-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
follow-up fix about 101866 to print the self type. #102670
Conversation
lyming2007
commented
Oct 4, 2022
modified: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs modified: src/test/ui/error-codes/E0283.stderr modified: src/test/ui/error-codes/E0790.stderr modified: src/test/ui/traits/static-method-generic-inference.stderr modified: src/test/ui/type/issue-101866.stderr
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @compiler-errors (or someone else) soon. Please see the contribution instructions for more information. |
I think this is fine, even if it may give incorrect suggestions in some cases. Also for future reference, @lyming2007 you don't need to put the list of modified files in the description. Instead, it's probably useful to write a few sentences of what this PR is for. @bors r+ rollup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticed the cause for another issue with the suggestion, feel free to either fix this in this PR or in another one 😁
@@ -9,8 +9,8 @@ LL | let _f: base::Foo = base::HasNew::new(); | |||
| | |||
help: use the fully-qualified path to the only available implementation | |||
| | |||
LL | let _f: base::Foo = base::<::base::Foo as HasNew>::new(); | |||
| +++++++++++++++ + | |||
LL | let _f: base::Foo = base::<Foo as HasNew>::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that error was already wrong 😅 i guess the issue is that we shouldn't use the trait_path_segment
but instead the whole path of the function except for the final segment ✨
@@ -2265,7 +2265,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { | |||
}; | |||
let mut suggestions = vec![( | |||
trait_path_segment.ident.span.shrink_to_lo(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be path.shrink_to_lo()
🤔 not completely sure whether that's correct.
…piler-errors follow-up fix about 101866 to print the self type. modified: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs modified: src/test/ui/error-codes/E0283.stderr modified: src/test/ui/error-codes/E0790.stderr modified: src/test/ui/traits/static-method-generic-inference.stderr modified: src/test/ui/type/issue-101866.stderr
Rollup of 5 pull requests Successful merges: - rust-lang#102574 (Make Hash{Set,Map}::with_hasher unstably const) - rust-lang#102650 (Slightly improve no return for returning function error) - rust-lang#102662 (rustdoc: remove no-op CSS `.code-header { display: block }`) - rust-lang#102670 (follow-up fix about 101866 to print the self type.) - rust-lang#102686 (Don't build the compiler before building rls) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…f-id, r=estebank Use impl's def id when calculating type to specify in UFCS Fixes rust-lang#104327 Fixes rust-lang#104328 Also addresses rust-lang#102670 (comment)
…f-id, r=estebank Use impl's def id when calculating type to specify in UFCS Fixes rust-lang#104327 Fixes rust-lang#104328 Also addresses rust-lang#102670 (comment)
…f-id, r=estebank Use impl's def id when calculating type to specify in UFCS Fixes rust-lang#104327 Fixes rust-lang#104328 Also addresses rust-lang#102670 (comment)
…f-id, r=estebank Use impl's def id when calculating type to specify in UFCS Fixes rust-lang#104327 Fixes rust-lang#104328 Also addresses rust-lang#102670 (comment)
…id, r=estebank Use impl's def id when calculating type to specify in UFCS Fixes rust-lang#104327 Fixes rust-lang#104328 Also addresses rust-lang#102670 (comment)
…ebank Use impl's def id when calculating type to specify in UFCS Fixes #104327 Fixes #104328 Also addresses rust-lang/rust#102670 (comment)