rust/tests/ui/dyn-keyword/suggest-dyn-on-bare-trait-in-pat.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
268 B
Rust
Raw Normal View History

//@ edition: 2021
trait Trait {}
impl dyn Trait {
const CONST: () = ();
}
fn main() {
match () {
Trait::CONST => {}
//~^ ERROR expected a type, found a trait
//~| HELP you can add the `dyn` keyword if you want a trait object
}
}