2016-07-27 21:26:55 +00:00
|
|
|
// Check that the hash for a method call is sensitive to the traits in
|
|
|
|
// scope.
|
|
|
|
|
|
|
|
//@ revisions: rpass1 rpass2
|
2017-09-12 15:07:09 +00:00
|
|
|
//@ compile-flags: -Z query-dep-graph
|
2016-07-27 21:26:55 +00: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 11:47:16 +00:00
|
|
|
#[cfg(rpass1)]
|
2016-07-27 21:26:55 +00:00
|
|
|
use Trait1;
|
2017-12-04 11:47:16 +00:00
|
|
|
#[cfg(rpass2)]
|
2016-07-27 21:26:55 +00:00
|
|
|
use Trait2;
|
|
|
|
|
2021-05-15 11:20:42 +00:00
|
|
|
#[rustc_clean(except="typeck", cfg="rpass2")]
|
2016-07-27 21:26:55 +00:00
|
|
|
fn bar() {
|
|
|
|
().method();
|
|
|
|
}
|
|
|
|
|
2021-05-15 11:20:42 +00:00
|
|
|
#[rustc_clean(cfg="rpass2")]
|
2016-07-27 21:26:55 +00:00
|
|
|
fn baz() {
|
|
|
|
22; // no method call, traits in scope don't matter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|