rust/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs

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

22 lines
248 B
Rust
Raw Normal View History

2023-01-09 17:51:01 -06:00
#![feature(do_not_recommend)]
pub trait Foo {
}
impl Foo for i32 {
}
pub trait Bar {
}
#[do_not_recommend]
impl<T: Foo> Bar for T {
}
fn stuff<T: Bar>(_: T) {}
fn main() {
stuff(1u8);
//~^ the trait bound `u8: Foo` is not satisfied
}