diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-08-21 19:35:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-21 19:35:12 +0200 |
| commit | ffdbd9d6c848123ebe0b74f9dfb1ef7028f8c8ca (patch) | |
| tree | 3834e12f1679a3003616710354c3420018089282 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp | |
| parent | 47af700fe6dac24d2b3b4635290c561639b63e6c (diff) | |
| parent | f5bae722be1f81f70d92e30cec1930f7cefc6313 (diff) | |
| download | rust-ffdbd9d6c848123ebe0b74f9dfb1ef7028f8c8ca.tar.gz rust-ffdbd9d6c848123ebe0b74f9dfb1ef7028f8c8ca.zip | |
Rollup merge of #129070 - estebank:static-trait, r=davidtwco
Point at explicit `'static` obligations on a trait
Given `trait Any: 'static` and a `struct` with a `Box<dyn Any + 'a>` field, point at the `'static` bound in `Any` to explain why `'a: 'static`.
```
error[E0478]: lifetime bound not satisfied
--> f202.rs:2:12
|
2 | value: Box<dyn std::any::Any + 'a>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime `'a` as defined here
--> f202.rs:1:14
|
1 | struct Hello<'a> {
| ^^
note: but lifetime parameter must outlive the static lifetime
--> /home/gh-estebank/rust/library/core/src/any.rs:113:16
|
113 | pub trait Any: 'static {
| ^^^^^^^
```
Partially address #33652.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
