1 // Test that when a trait impl changes, fns whose body uses that trait
2 // must also be recompiled.
5 // compile-flags: -Z query-dep-graph
7 #![feature(rustc_attrs)]
12 pub trait Foo: Sized {
19 #[rustc_if_this_changed]
28 #[rustc_then_this_would_need(typeck)] //~ ERROR OK
33 #[rustc_then_this_would_need(typeck)] //~ ERROR OK
34 pub fn take_foo_with_char() {
35 take_foo::<char>('a');
38 #[rustc_then_this_would_need(typeck)] //~ ERROR OK
43 #[rustc_then_this_would_need(typeck)] //~ ERROR OK
44 pub fn take_foo_with_u32() {
48 pub fn take_foo<T:Foo>(t: T) { }
54 // These are expected to yield errors, because changes to `x`
55 // affect the BODY of `y`, but not its signature.
56 #[rustc_then_this_would_need(typeck)] //~ ERROR no path