1 // Test that when a trait impl changes, fns whose body uses that trait
2 // must also be recompiled.
4 // compile-flags: -Z query-dep-graph
6 #![feature(rustc_attrs)]
11 pub trait Foo: Sized {
19 #[rustc_if_this_changed]
20 impl Foo for char { type T = char; }
22 impl Foo for u32 { type T = u32; }
28 #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
29 pub fn use_char_assoc() {
30 // Careful here: in the representation, <char as Foo>::T gets
31 // normalized away, so at a certain point we had no edge to
32 // codegen. (But now codegen just depends on typeck.)
33 let x: <char as Foo>::T = 'a';
36 pub fn take_foo<T:Foo>(t: T) { }