about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-21 19:35:12 +0200
committerGitHub <noreply@github.com>2024-08-21 19:35:12 +0200
commitffdbd9d6c848123ebe0b74f9dfb1ef7028f8c8ca (patch)
tree3834e12f1679a3003616710354c3420018089282 /compiler/rustc_interface/src
parent47af700fe6dac24d2b3b4635290c561639b63e6c (diff)
parentf5bae722be1f81f70d92e30cec1930f7cefc6313 (diff)
downloadrust-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_interface/src')
0 files changed, 0 insertions, 0 deletions