blob: 3c96c760dfb21dcde3ec919f15142e95e8c724bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ reference: attributes.diagnostic.do_not_recommend.intro
trait Root {}
trait DontRecommend {}
trait Other {}
trait Child {}
#[diagnostic::do_not_recommend]
impl<T> Root for T where T: DontRecommend {}
impl<T> DontRecommend for T where T: Other {}
#[diagnostic::do_not_recommend]
impl<T> Other for T where T: Child {}
fn needs_root<T: Root>() {}
fn main() {
needs_root::<()>();
//~^ ERROR the trait bound `(): Root` is not satisfied
}
|