forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#73783 - estebank:impl-dyn-trait-static-life…
…time, r=nikomatsakis Detect when `'static` obligation might come from an `impl` Partly address rust-lang#71341.
- Loading branch information
Showing
57 changed files
with
996 additions
and
439 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
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
651 changes: 454 additions & 197 deletions
651
src/librustc_infer/infer/error_reporting/nice_region_error/static_impl_trait.rs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
23 changes: 4 additions & 19 deletions
23
src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.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 |
---|---|---|
@@ -1,26 +1,11 @@ | ||
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements | ||
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement | ||
--> $DIR/project-fn-ret-contravariant.rs:38:8 | ||
| | ||
LL | bar(foo, x) | ||
| ^^^ | ||
| | ||
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 37:8... | ||
--> $DIR/project-fn-ret-contravariant.rs:37:8 | ||
| | ||
LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { | ||
| ^^ | ||
note: ...so that reference does not outlive borrowed content | ||
--> $DIR/project-fn-ret-contravariant.rs:38:13 | ||
| | ||
LL | bar(foo, x) | ||
| ^ | ||
= note: but, the lifetime must be valid for the static lifetime... | ||
note: ...so that reference does not outlive borrowed content | ||
--> $DIR/project-fn-ret-contravariant.rs:38:4 | ||
| | ||
| ------- this data with lifetime `'a`... | ||
LL | bar(foo, x) | ||
| ^^^^^^^^^^^ | ||
| ----^^^---- ...is captured and required to live as long as `'static` here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0495`. | ||
For more information about this error, try `rustc --explain E0759`. |
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
Oops, something went wrong.