rust/tests/ui/diagnostic_namespace/do_not_recommend/simple.rs
Georg Semmler 2cff3e90bc
Move #[do_not_recommend] to the #[diagnostic] namespace
This commit moves the `#[do_not_recommend]` attribute to the
`#[diagnostic]` namespace. It still requires
`#![feature(do_not_recommend)]` to work.
2024-05-21 13:14:41 +02:00

21 lines
526 B
Rust

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
#![feature(do_not_recommend)]
trait Foo {}
#[diagnostic::do_not_recommend]
impl<T> Foo for T where T: Send {}
fn needs_foo<T: Foo>() {}
//~^ NOTE required by a bound in `needs_foo`
//~| NOTE required by this bound in `needs_foo`
fn main() {
needs_foo::<*mut ()>();
//~^ ERROR the trait bound `*mut (): Foo` is not satisfied
//~| NOTE the trait `Foo` is not implemented for `*mut ()`
}