Confusing diagnostic for stray lifetime in type · Issue #133413 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@Dylan-DPC

Description

@Dylan-DPC

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

Playground link

Rust Version

Tested on playground so latest stable and nightly at the time of writing (1.82.0 stable)