-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Loop over all opaque types instead of looking at just the first one with the same DefId #87107
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,18 @@ note: hidden type `&'<empty> str` captures lifetime smaller than the function bo | |
LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a; | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: concrete type differs from previous defining opaque type use | ||
--> $DIR/issue-85113.rs:14:1 | ||
| | ||
LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'<empty> str`, got `&'a str` | ||
| | ||
note: previous use here | ||
--> $DIR/issue-85113.rs:14:1 | ||
| | ||
LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR is great to me, we've discussed this with Oli already. I'm not strong enough to approve in particular this part of the PR. cc @nikomatsakis There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The span here is kind of confusing. I suppose we want to be pointing to the binding? |
||
error[E0477]: the type `&'<empty> str` does not fulfill the required lifetime | ||
--> $DIR/issue-85113.rs:5:29 | ||
| | ||
|
@@ -42,7 +54,7 @@ LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a; | |
= note: expected `Output<'a>` | ||
found `Output<'_>` | ||
|
||
error: aborting due to 3 previous errors | ||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0477, E0495, E0700. | ||
For more information about an error, try `rustc --explain E0477`. |
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 test is kind of weird. Does it pass if the
let out: ...
is removed?I expect it to pass, because we stabilized member constraints in #84701, but it seems like the
let out: ...
is probably caused it not to work.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.
yes, it does. Note that this test has
impl_trait_in_bindings
enabled, so it's not really relevant for min_tait. The problem is that the let binding gives uswhich is probably due to the odd way that
impl_trait_in_bindings
works and that should hopefully all go away once we do not treat them special anymore and just put them into the inference list just like we do with the return type.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 test is really weird, we were talking about it with @lqd some minutes ago.
Note the following https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3c4de7d1bfdfee59d8e2f3f5c0d39453
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.
I think I'd merge this as is, in my remove let binding PR this test is going away anyway so ...