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

22 lines
460 B
Rust

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
#![feature(do_not_recommend)]
trait Root {}
trait DontRecommend {}
trait Other {}
#[diagnostic::do_not_recommend]
impl<T> Root for T where T: DontRecommend {}
impl<T> DontRecommend for T where T: Other {}
fn needs_root<T: Root>() {}
fn main() {
needs_root::<()>();
//~^ ERROR the trait bound `(): Root` is not satisfied
}