Skip to content

Side-step ICE on RePlaceholder in eval_verify_bound #89890

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

estebank
Copy link
Contributor

Address #76168.

I don't think this is the correct way of handling this, but it does get rid of a stable-to-stable regression ICE.

The previous output (before the regression) was:

error[E0310]: the parameter type `F` may not live long enough
  --> src/lib.rs:9:1
   |
9  | / {
10 | | }
   | |_^
   |
   = help: consider adding an explicit lifetime bound `F: 'static`...

while the output with this PR is

error: `<F as FnOnce<(&'a mut i32,)>>::Output` does not live long enough
  --> $DIR/issue-76168.rs:8:1
   |
LL | / {
LL | |     let mut i = 41;
LL | |     f(&mut i).await;
LL | | }
   | |_^

@rust-highfive
Copy link
Contributor

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 14, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r? @rust-lang/borrowck

@rust-log-analyzer

This comment has been minimized.

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 21, 2021
@matthewjasper
Copy link
Contributor

I had a look at this, and I think that the correct fix is to replace the placeholder regions in the type here

GenericArgKind::Type(t1) => {
// we don't actually use this for anything, but
// the `TypeOutlives` code needs an origin.
let origin = infer::RelateParamBound(DUMMY_SP, t1, None);
TypeOutlives::new(
&mut *self,
tcx,
region_bound_pairs,
implicit_region_bound,
param_env,
)
.type_must_outlive(origin, t1, r2);
}

Do you want to update this PR to do that, or should I open a new PR with that change?

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2021
@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2021
@estebank
Copy link
Contributor Author

@matthewjasper would you have the time to open a PR doing the change you propose? I'm a bit swamped at the moment. You can close this PR if you do so. I'll keep this one open for now just as a note to self, to remind me to look at this if there's no movement in the medium term.

@matthewjasper
Copy link
Contributor

Opened #91321

@crlf0710
Copy link
Member

Triage: Since #91321 has landed and #76168.is now closed, i'm closing this PR.

@crlf0710 crlf0710 closed this Dec 17, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

9 participants