-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Rustc nightly points out a wrong part of line as an error #90101
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code (playground):
and rustc shows the following error:
Rustc says that
"world"at line 6 is causing the error, but actually it is not.I think Rustc should point out
Path::new("hello").to_path_buf().to_string_lossy()instead.Rustc version
# rustc --version --verbose rustc 1.58.0-nightly (1af55d19c 2021-10-19) binary: rustc commit-hash: 1af55d19c7a9189374d89472f97dc119659bb67e commit-date: 2021-10-19 host: x86_64-unknown-linux-gnu release: 1.58.0-nightly LLVM version: 13.0.0