rust/tests/ui/lint/dead-code/impl-trait.rs

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

19 lines
240 B
Rust
Raw Normal View History

2019-03-12 07:35:20 -05:00
#![deny(dead_code)]
trait Trait {
type Type;
}
impl Trait for () {
type Type = ();
}
type Used = ();
type Unused = (); //~ ERROR type alias `Unused` is never used
2019-03-12 07:35:20 -05:00
fn foo() -> impl Trait<Type = Used> {}
fn main() {
foo();
}