forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#134627 - estebank:issue-133252, r=jackh726
Avoid ICE in borrowck Provide a fallback in `best_blame_constraint` when `find_constraint_paths_between_regions` doesn't have a result. This code is due a rework to avoid the letf-over `unwrap()`, but avoids the ICE caused by the repro. Fix rust-lang#133252.
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
error: implementation of `LoadQuery` is not general enough | ||
--> $DIR/implementation-not-general-enough-ice-133252.rs:9:9 | ||
| | ||
LL | force_send(async_load(¬_static)); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `LoadQuery` is not general enough | ||
| | ||
= note: `LoadQuery<'0>` would have to be implemented for the type `&u8`, for any lifetime `'0`... | ||
= note: ...but `LoadQuery<'1>` is actually implemented for the type `&'1 u8`, for some specific lifetime `'1` | ||
|
||
error[E0597]: `not_static` does not live long enough | ||
--> $DIR/implementation-not-general-enough-ice-133252.rs:9:31 | ||
| | ||
LL | async { | ||
| - return type of async block is &(dyn Owned + '1) | ||
LL | let not_static = 0; | ||
| ---------- binding `not_static` declared here | ||
LL | force_send(async_load(¬_static)); | ||
| -----------^^^^^^^^^^^- | ||
| | | | ||
| | borrowed value does not live long enough | ||
| argument requires that `not_static` is borrowed for `'1` | ||
... | ||
LL | } | ||
| - `not_static` dropped here while still borrowed | ||
| | ||
note: due to current limitations in the borrow checker, this implies a `'static` lifetime | ||
--> $DIR/implementation-not-general-enough-ice-133252.rs:16:18 | ||
| | ||
LL | fn force_send<T: Send>(_: T) {} | ||
| ^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0597`. |