2016-07-27 16:26:55 -05:00
|
|
|
// Check that the hash for a method call is sensitive to the traits in
|
|
|
|
// scope.
|
|
|
|
|
|
|
|
// revisions: rpass1 rpass2
|
2017-09-12 10:07:09 -05:00
|
|
|
// compile-flags: -Z query-dep-graph
|
2016-07-27 16:26:55 -05:00
|
|
|
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
fn test<T>() { }
|
|
|
|
|
|
|
|
trait Trait1 {
|
|
|
|
fn method(&self) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Trait1 for () { }
|
|
|
|
|
|
|
|
trait Trait2 {
|
|
|
|
fn method(&self) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Trait2 for () { }
|
|
|
|
|
|
|
|
mod mod3 {
|
2017-12-04 05:47:16 -06:00
|
|
|
#[cfg(rpass1)]
|
2016-07-27 16:26:55 -05:00
|
|
|
use Trait1;
|
2017-12-04 05:47:16 -06:00
|
|
|
#[cfg(rpass2)]
|
2016-07-27 16:26:55 -05:00
|
|
|
use Trait2;
|
|
|
|
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(except="typeck", cfg="rpass2")]
|
2016-07-27 16:26:55 -05:00
|
|
|
fn bar() {
|
|
|
|
().method();
|
|
|
|
}
|
|
|
|
|
2021-05-15 06:20:42 -05:00
|
|
|
#[rustc_clean(cfg="rpass2")]
|
2016-07-27 16:26:55 -05:00
|
|
|
fn baz() {
|
|
|
|
22; // no method call, traits in scope don't matter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|