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 {
20 #[rustc_if_this_changed]
21 impl Foo for char { type T = char; }
23 impl Foo for u32 { type T = u32; }
29 #[rustc_then_this_would_need(typeck)] //~ ERROR OK
30 pub fn use_char_assoc() {
31 // Careful here: in the representation, <char as Foo>::T gets
32 // normalized away, so at a certain point we had no edge to
33 // codegen. (But now codegen just depends on typeck.)
34 let x: <char as Foo>::T = 'a';
37 pub fn take_foo<T:Foo>(t: T) { }