-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incorporate resolve results into hashing
We now incorporate the `def_map` and `trait_map` results into the SVH.
- Loading branch information
1 parent
953d711
commit c7f15aa
Showing
10 changed files
with
250 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// Check that the hash for a method call is sensitive to the traits in | ||
// scope. | ||
|
||
// revisions: rpass1 rpass2 | ||
|
||
#![feature(rustc_attrs)] | ||
|
||
fn test<T>() { } | ||
|
||
trait Trait1 { | ||
fn method(&self) { } | ||
} | ||
|
||
impl Trait1 for () { } | ||
|
||
trait Trait2 { | ||
fn method(&self) { } | ||
} | ||
|
||
impl Trait2 for () { } | ||
|
||
#[cfg(rpass1)] | ||
mod mod3 { | ||
use Trait1; | ||
|
||
fn bar() { | ||
().method(); | ||
} | ||
|
||
fn baz() { | ||
22; // no method call, traits in scope don't matter | ||
} | ||
} | ||
|
||
#[cfg(rpass2)] | ||
mod mod3 { | ||
use Trait2; | ||
|
||
#[rustc_dirty(label="Hir", cfg="rpass2")] | ||
fn bar() { | ||
().method(); | ||
} | ||
|
||
#[rustc_clean(label="Hir", cfg="rpass2")] | ||
fn baz() { | ||
22; // no method call, traits in scope don't matter | ||
} | ||
} | ||
|
||
fn main() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// Check that the hash for `mod3::bar` changes when we change the | ||
// `use` to something different. | ||
|
||
// revisions: rpass1 rpass2 rpass3 | ||
|
||
#![feature(rustc_attrs)] | ||
|
||
fn test<T>() { } | ||
|
||
mod mod1 { | ||
pub struct Foo(pub u32); | ||
} | ||
|
||
mod mod2 { | ||
pub struct Foo(pub i64); | ||
} | ||
|
||
#[cfg(rpass1)] | ||
mod mod3 { | ||
use test; | ||
use mod1::Foo; | ||
|
||
fn in_expr() { | ||
Foo(0); | ||
} | ||
|
||
fn in_type() { | ||
test::<Foo>(); | ||
} | ||
} | ||
|
||
#[cfg(rpass2)] | ||
mod mod3 { | ||
use mod1::Foo; // <-- Nothing changed, but reordered! | ||
use test; | ||
|
||
#[rustc_clean(label="Hir", cfg="rpass2")] | ||
fn in_expr() { | ||
Foo(0); | ||
} | ||
|
||
#[rustc_clean(label="Hir", cfg="rpass2")] | ||
fn in_type() { | ||
test::<Foo>(); | ||
} | ||
} | ||
|
||
#[cfg(rpass3)] | ||
mod mod3 { | ||
use test; | ||
use mod2::Foo; // <-- This changed! | ||
|
||
#[rustc_dirty(label="Hir", cfg="rpass3")] | ||
fn in_expr() { | ||
Foo(0); | ||
} | ||
|
||
#[rustc_dirty(label="Hir", cfg="rpass3")] | ||
fn in_type() { | ||
test::<Foo>(); | ||
} | ||
} | ||
|
||
fn main() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters