-
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
Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tys
#103409
Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tys
#103409
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
= note: expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` | ||
found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` |
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 error kinda sucks, but it's not really RPITIT's fault.
This needs blessing after #103414 lands |
…jgillot Pretty print lifetimes captured by RPIT This specifically makes the output in rust-lang#103409 change from: ```diff error: `impl` item signature doesn't match `trait` item signature --> $DIR/signature-mismatch.rs:15:5 | LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>; | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` ... LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2` | = note: expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` - found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>>` + found `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + '2` = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output error: aborting due to previous error ``` Along with the UI tests in this PR, which I think are all improvements! r? `@oli-obk` though feel free to re-roll
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.
nit, then r=me
4530a06
to
fa5cf90
Compare
@bors r=lcnr rollup |
…ismatch, r=lcnr Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys` When a lifetime is late-bound in a trait signature, but early-bound in an impl signature, we already emit an error -- however, we also ICE in `collect_trait_impl_trait_tys`, so just delay a bug here. Fixes rust-lang#103407
Rollup of 11 pull requests Successful merges: - rust-lang#103333 (Fix assertion failed for break_last_token and trailing token) - rust-lang#103350 (Change terminology for assoc method suggestions when they are not called) - rust-lang#103382 (Don't ICE when reporting borrowck errors involving regions from `anonymous_lifetime_in_impl_trait`) - rust-lang#103409 (Delay span bug when we can't map lifetimes back in `collect_trait_impl_trait_tys`) - rust-lang#103410 (-Z docs: Add link to unstable book) - rust-lang#103462 (rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }`) - rust-lang#103465 (E0210 explanation: remove redundant sentence) - rust-lang#103486 (Use functions in highlight-colors rustdoc GUI test) - rust-lang#103493 (rustdoc: remove unused `.sidebar-logo` DOM on source pages) - rust-lang#103494 (rustdoc: remove redundant CSS `a.test-arrow:hover`) - rust-lang#103495 (rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When a lifetime is late-bound in a trait signature, but early-bound in an impl signature, we already emit an error -- however, we also ICE in
collect_trait_impl_trait_tys
, so just delay a bug here.Fixes #103407