rust/tests/ui/lint/unused/unused-associated-item.rs

22 lines
363 B
Rust

//@ check-pass
#![deny(unused_must_use)]
use std::future::Future;
use std::pin::Pin;
trait Factory {
type Output;
}
impl Factory for () {
type Output = Pin<Box<dyn Future<Output = ()> + 'static>>;
}
// Make sure we don't get an `unused_must_use` error on the *associated type bound*.
fn f() -> impl Factory<Output: Future> {}
fn main() {
f();
}