Skip to content
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

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

lyming2007
Copy link

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

	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
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 4, 2022
@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2022
@lyming2007
Copy link
Author

@lcnr this is the follow-up for #102421

@compiler-errors
Copy link
Member

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

@bors
Copy link
Contributor

bors commented Oct 4, 2022

📌 Commit 4f3b6ac has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2022
Copy link
Contributor

@lcnr lcnr left a 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();
Copy link
Contributor

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(),
Copy link
Contributor

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.

notriddle added a commit to notriddle/rust that referenced this pull request Oct 5, 2022
…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
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2022
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
@bors bors merged commit 8dea87d into rust-lang:master Oct 5, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 5, 2022
@lyming2007 lyming2007 deleted the issue-101866-fix branch October 5, 2022 14:45
@jruderman
Copy link
Contributor

I traced a pair of ICEs to this change: #104327 and #104328. They're similar to each other so maybe only one fix will be needed.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2022
…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)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 14, 2022
…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)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 15, 2022
…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)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 15, 2022
…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)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 16, 2022
…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)
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Dec 16, 2022
…ebank

Use impl's def id when calculating type to specify in UFCS

Fixes #104327
Fixes #104328

Also addresses rust-lang/rust#102670 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants