rust/tests/ui/lint/unused/trait-alias-supertrait.rs

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

16 lines
299 B
Rust
Raw Normal View History

2023-01-31 21:22:11 +00:00
//@ check-pass
// Make sure that we only consider *Self* supertrait predicates
// in the `unused_must_use` lint.
#![feature(trait_alias)]
#![deny(unused_must_use)]
trait Foo<T> = Sized where T: Iterator;
fn test<T: Iterator>() -> impl Foo<T> {}
fn main() {
test::<std::iter::Once<()>>();
}