Confusing diagnostic for stray lifetime in type · Issue #133413 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
Code
struct Bar; pub struct Foo<'a>('a, Bar);
Current output
error: lifetime in trait object type must be followed by +
--> src/lib.rs:2:20
|
2 | pub struct Foo<'a>('a, Bar);
| ^^
error[E0224]: at least one trait is required for an object type --> src/lib.rs:2:20 | 2 | pub struct Foo<'a>('a, Bar); | ^^
Rationale and extra context
Rust Version
Tested on playground so latest stable and nightly at the time of writing (1.82.0 stable)