Auto merge of #46556 - michaelwoerister:enable-query-caching, r=nmatsakis

incr.comp.: Enable query result caching for many more queries

Newly cached queries are:
* const_is_rvalue_promotable_to_static
* trans_fulfill_obligation
* optimized_mir
* unsafety_check_result
* borrowck
* mir_borrowck
* mir_const_qualif
* contains_extern_indicator
* def_symbol_name
* symbol_name

This also includes the stricter `Span` hashing first mentioned in #46490, which will lead to more false positives in release builds but overall is more correct -- and necessary for caching MIR. Hopefully we will soon be able to reduce the rate of false positives again by factoring `Span` out of MIR.

r? @nikomatsakis
This commit is contained in:
bors 2017-12-08 11:34:23 +00:00
commit 88fc3bc271
55 changed files with 260 additions and 995 deletions

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -10,7 +10,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -28,155 +28,134 @@
// Indexing expression ---------------------------------------------------------
#[cfg(cfail1)]
pub fn indexing(slice: &[u8]) -> u8 {
slice[100]
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn indexing(slice: &[u8]) -> u8 {
slice[100]
#[cfg(cfail1)]
{
slice[100]
}
#[cfg(not(cfail1))]
{
slice[100]
}
}
// Arithmetic overflow plus ----------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_plus(val: i32) -> i32 {
val + 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_plus(val: i32) -> i32 {
val + 1
#[cfg(cfail1)]
{
val + 1
}
#[cfg(not(cfail1))]
{
val + 1
}
}
// Arithmetic overflow minus ----------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_minus(val: i32) -> i32 {
val - 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_minus(val: i32) -> i32 {
val - 1
#[cfg(cfail1)]
{
val - 1
}
#[cfg(not(cfail1))]
{
val - 1
}
}
// Arithmetic overflow mult ----------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_mult(val: i32) -> i32 {
val * 2
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_mult(val: i32) -> i32 {
val * 2
#[cfg(cfail1)]
{
val * 2
}
#[cfg(not(cfail1))]
{
val * 2
}
}
// Arithmetic overflow negation ------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_negation(val: i32) -> i32 {
-val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_negation(val: i32) -> i32 {
-val
#[cfg(cfail1)]
{
-val
}
#[cfg(not(cfail1))]
{
-val
}
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub fn division_by_zero(val: i32) -> i32 {
2 / val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn division_by_zero(val: i32) -> i32 {
2 / val
#[cfg(cfail1)]
{
2 / val
}
#[cfg(not(cfail1))]
{
2 / val
}
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub fn mod_by_zero(val: i32) -> i32 {
2 % val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn mod_by_zero(val: i32) -> i32 {
2 % val
#[cfg(cfail1)]
{
2 % val
}
#[cfg(not(cfail1))]
{
2 % val
}
}
// shift left ------------------------------------------------------------------
#[cfg(cfail1)]
pub fn shift_left(val: i32, shift: usize) -> i32 {
val << shift
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn shift_left(val: i32, shift: usize) -> i32 {
val << shift
#[cfg(cfail1)]
{
val << shift
}
#[cfg(not(cfail1))]
{
val << shift
}
}
// shift right ------------------------------------------------------------------
#[cfg(cfail1)]
pub fn shift_right(val: i32, shift: usize) -> i32 {
val >> shift
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn shift_right(val: i32, shift: usize) -> i32 {
val >> shift
}
// THE FOLLOWING ITEMS SHOULD NOT BE INFLUENCED BY THEIR SOURCE LOCATION
// bitwise ---------------------------------------------------------------------
#[cfg(cfail1)]
pub fn bitwise(val: i32) -> i32 {
!val & 0x101010101 | 0x45689 ^ 0x2372382
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise(val: i32) -> i32 {
!val & 0x101010101 | 0x45689 ^ 0x2372382
}
// logical ---------------------------------------------------------------------
#[cfg(cfail1)]
pub fn logical(val1: bool, val2: bool, val3: bool) -> bool {
val1 && val2 || val3
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn logical(val1: bool, val2: bool, val3: bool) -> bool {
val1 && val2 || val3
#[cfg(cfail1)]
{
val >> shift
}
#[cfg(not(cfail1))]
{
val >> shift
}
}

View file

@ -1,225 +0,0 @@
// Copyright 2016 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.
// This test case tests the incremental compilation hash (ICH) implementation
// for exprs that can panic at runtime (e.g. because of bounds checking). For
// these expressions an error message containing their source location is
// generated, so their hash must always depend on their location in the source
// code, not just when debuginfo is enabled.
// As opposed to the panic_exprs.rs test case, this test case checks that things
// behave as expected when overflow checks are off:
//
// - Addition, subtraction, and multiplication do not change the ICH, unless
// the function containing them is marked with rustc_inherit_overflow_checks.
// - Division by zero and bounds checks always influence the ICH
// The general pattern followed here is: Change one thing between rev1 and rev2
// and make sure that the hash has changed, then change nothing between rev2 and
// rev3 and make sure that the hash has not changed.
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Z force-overflow-checks=off
#![allow(warnings)]
#![feature(rustc_attrs)]
#![crate_type="rlib"]
// Indexing expression ---------------------------------------------------------
#[cfg(cfail1)]
pub fn indexing(slice: &[u8]) -> u8 {
slice[100]
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn indexing(slice: &[u8]) -> u8 {
slice[100]
}
// Arithmetic overflow plus ----------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_plus_inherit(val: i32) -> i32 {
val + 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_plus_inherit(val: i32) -> i32 {
val + 1
}
// Arithmetic overflow minus ----------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_minus_inherit(val: i32) -> i32 {
val - 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_minus_inherit(val: i32) -> i32 {
val - 1
}
// Arithmetic overflow mult ----------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_mult_inherit(val: i32) -> i32 {
val * 2
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_mult_inherit(val: i32) -> i32 {
val * 2
}
// Arithmetic overflow negation ------------------------------------------------
#[cfg(cfail1)]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_negation_inherit(val: i32) -> i32 {
-val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
#[rustc_inherit_overflow_checks]
pub fn arithmetic_overflow_negation_inherit(val: i32) -> i32 {
-val
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub fn division_by_zero(val: i32) -> i32 {
2 / val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn division_by_zero(val: i32) -> i32 {
2 / val
}
// Division by zero ------------------------------------------------------------
#[cfg(cfail1)]
pub fn mod_by_zero(val: i32) -> i32 {
2 % val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn mod_by_zero(val: i32) -> i32 {
2 % val
}
// THE FOLLOWING ITEMS SHOULD NOT BE INFLUENCED BY THEIR SOURCE LOCATION
// bitwise ---------------------------------------------------------------------
#[cfg(cfail1)]
pub fn bitwise(val: i32) -> i32 {
!val & 0x101010101 | 0x45689 ^ 0x2372382 << 1 >> 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn bitwise(val: i32) -> i32 {
!val & 0x101010101 | 0x45689 ^ 0x2372382 << 1 >> 1
}
// logical ---------------------------------------------------------------------
#[cfg(cfail1)]
pub fn logical(val1: bool, val2: bool, val3: bool) -> bool {
val1 && val2 || val3
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn logical(val1: bool, val2: bool, val3: bool) -> bool {
val1 && val2 || val3
}
// Arithmetic overflow plus ----------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_plus(val: i32) -> i32 {
val + 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_plus(val: i32) -> i32 {
val + 1
}
// Arithmetic overflow minus ----------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_minus(val: i32) -> i32 {
val - 1
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_minus(val: i32) -> i32 {
val - 1
}
// Arithmetic overflow mult ----------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_mult(val: i32) -> i32 {
val * 2
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_mult(val: i32) -> i32 {
val * 2
}
// Arithmetic overflow negation ------------------------------------------------
#[cfg(cfail1)]
pub fn arithmetic_overflow_negation(val: i32) -> i32 {
-val
}
#[cfg(not(cfail1))]
#[rustc_clean(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
pub fn arithmetic_overflow_negation(val: i32) -> i32 {
-val
}

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]

View file

@ -23,7 +23,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph -Z force-overflow-checks=off
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -18,7 +18,7 @@
// must-compile-successfully
// revisions: cfail1 cfail2 cfail3
// compile-flags: -Z query-dep-graph
// compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
#![allow(warnings)]
#![feature(rustc_attrs)]

View file

@ -30,21 +30,10 @@ trait Trait2 {
impl Trait2 for () { }
#[cfg(rpass1)]
mod mod3 {
#[cfg(rpass1)]
use Trait1;
fn bar() {
().method();
}
fn baz() {
22; // no method call, traits in scope don't matter
}
}
#[cfg(rpass2)]
mod mod3 {
#[cfg(rpass2)]
use Trait2;
#[rustc_clean(label="Hir", cfg="rpass2")]

View file

@ -17,23 +17,18 @@
#![crate_type = "rlib"]
#![feature(rustc_attrs)]
#[cfg(cfail1)]
pub fn foo() {
pub fn bar() { }
pub fn baz() { }
}
#[cfg(cfail2)]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
pub fn foo() {
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail2")]
#[cfg(cfail1)]
pub fn baz() { } // order is different...
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail2")]
pub fn bar() { } // but that doesn't matter.
#[cfg(cfail2)]
pub fn baz() { } // order is different...
pub fn bap() { } // neither does adding a new item
}

View file

@ -25,49 +25,29 @@ mod mod2 {
pub struct Foo(pub i64);
}
#[cfg(rpass1)]
mod mod3 {
#[cfg(rpass1)]
use mod1::Foo;
use test;
// In rpass2 we move the use declaration.
#[cfg(rpass2)]
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;
// In rpass3 we let the declaration point to something else.
#[cfg(rpass3)]
use mod2::Foo;
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
fn in_expr() {
Foo(0);
}
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
fn in_type() {
test::<Foo>();
}
}
#[cfg(rpass3)]
mod mod3 {
use test;
use mod2::Foo; // <-- This changed!
#[rustc_clean(label="Hir", cfg="rpass3")]
#[rustc_dirty(label="HirBody", cfg="rpass3")]
fn in_expr() {
Foo(0);
}
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
#[rustc_clean(label="Hir", cfg="rpass3")]
#[rustc_dirty(label="HirBody", cfg="rpass3")]
fn in_type() {

View file

@ -35,28 +35,30 @@ fn file_same() {
let _ = file!();
}
#[cfg(rpass1)]
fn line_different() {
let _ = line!();
}
#[cfg(rpass2)]
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_dirty(label="HirBody", cfg="rpass2")]
fn line_different() {
let _ = line!();
#[cfg(rpass1)]
{
let _ = line!();
}
#[cfg(rpass2)]
{
let _ = line!();
}
}
#[cfg(rpass1)]
fn col_different() {
let _ = column!();
}
#[cfg(rpass2)]
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_dirty(label="HirBody", cfg="rpass2")]
fn col_different() {
let _ = column!();
#[cfg(rpass1)]
{
let _ = column!();
}
#[cfg(rpass2)]
{
let _ = column!();
}
}
fn main() {

View file

@ -1,26 +0,0 @@
// Copyright 2016 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.
// This test makes sure that just changing a definition's location in the
// source file does *not* change its incr. comp. hash, if debuginfo is disabled.
// revisions:rpass1 rpass2
// compile-flags: -Z query-dep-graph
#![feature(rustc_attrs)]
#[cfg(rpass1)]
pub fn main() {}
#[cfg(rpass2)]
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_clean(label="HirBody", cfg="rpass2")]
pub fn main() {}

View file

@ -23,8 +23,7 @@ pub fn main() {
}
#[cfg(rpass2)]
#[rustc_clean(label="Hir", cfg="rpass2")]
#[rustc_dirty(label="HirBody", cfg="rpass2")]
#[rustc_dirty(label="MirOptimized", cfg="rpass2")]
pub fn main() {
let _ = 0u8 + 1;
}

View file

@ -1,36 +0,0 @@
// 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.
//! The `svh-a-*.rs` files are all deviations from the base file
//! svh-a-base.rs with some difference (usually in `fn foo`) that
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![crate_name = "a"]
macro_rules! three {
() => { 3 }
}
pub trait U {}
pub trait V {}
impl U for () {}
impl V for () {}
static A_CONSTANT : isize = 2;
pub fn foo<T:U>(_: isize) -> isize {
// a comment does not affect the svh
3
}
pub fn an_unused_name() -> isize {
4
}

View file

@ -1,38 +0,0 @@
// 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.
//! The `svh-a-*.rs` files are all deviations from the base file
//! svh-a-base.rs with some difference (usually in `fn foo`) that
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![crate_name = "a"]
macro_rules! three {
() => { 3 }
}
pub trait U {}
pub trait V {}
impl U for () {}
impl V for () {}
static A_CONSTANT : isize = 2;
// Adding some documentation does not affect the svh.
/// foo always returns three.
pub fn foo<T:U>(_: isize) -> isize {
3
}
pub fn an_unused_name() -> isize {
4
}

View file

@ -1,37 +0,0 @@
// 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.
//! The `svh-a-*.rs` files are all deviations from the base file
//! svh-a-base.rs with some difference (usually in `fn foo`) that
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![crate_name = "a"]
macro_rules! three {
() => { 3 }
}
pub trait U {}
pub trait V {}
impl U for () {}
impl V for () {}
static A_CONSTANT : isize = 2;
pub fn foo<T:U>(_: isize) -> isize {
// a macro invocation in a function body does not affect the svh,
// as long as it yields the same code.
three!()
}
pub fn an_unused_name() -> isize {
4
}

View file

@ -1,35 +0,0 @@
// 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.
//! The `svh-a-*.rs` files are all deviations from the base file
//! svh-a-base.rs with some difference (usually in `fn foo`) that
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![crate_name = "a"]
macro_rules! three {
() => { 3 }
}
pub trait U {}
pub trait V {}
impl U for () {}
impl V for () {}
static A_CONSTANT : isize = 2;
pub fn foo<T:U>(_: isize) -> isize {
3
}
pub fn an_unused_name() -> isize {
4
}

View file

@ -1,37 +0,0 @@
// 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.
//! The `svh-a-*.rs` files are all deviations from the base file
//! svh-a-base.rs with some difference (usually in `fn foo`) that
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![crate_name = "a"]
macro_rules! three {
() => { 3 }
}
pub trait U {}
pub trait V {}
impl U for () {}
impl V for () {}
static A_CONSTANT : isize = 2;
// cfg attribute does not affect the svh, as long as it yields the same code.
#[cfg(not(an_unused_name))]
pub fn foo<T:U>(_: isize) -> isize {
3
}
pub fn an_unused_name() -> isize {
4
}

View file

@ -1,37 +0,0 @@
// 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.
//! The `svh-a-*.rs` files are all deviations from the base file
//! svh-a-base.rs with some difference (usually in `fn foo`) that
//! should not affect the strict version hash (SVH) computation
//! (#14132).
#![crate_name = "a"]
macro_rules! three {
() => { 3 }
}
pub trait U {}
pub trait V {}
impl U for () {}
impl V for () {}
static A_CONSTANT : isize = 2;
pub fn foo<T:U>(_: isize) -> isize {
3
}
pub fn an_unused_name() -> isize {
4
}

View file

@ -1,23 +0,0 @@
// 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.
// note that these aux-build directives must be in this order
// aux-build:svh-a-base.rs
// aux-build:svh-b.rs
// aux-build:svh-a-comment.rs
// pretty-expanded FIXME #23616
extern crate a;
extern crate b;
fn main() {
b::foo()
}

View file

@ -1,23 +0,0 @@
// 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.
// note that these aux-build directives must be in this order
// aux-build:svh-a-base.rs
// aux-build:svh-b.rs
// aux-build:svh-a-doc.rs
// pretty-expanded FIXME #23616
extern crate a;
extern crate b;
fn main() {
b::foo()
}

View file

@ -1,23 +0,0 @@
// 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.
// note that these aux-build directives must be in this order
// aux-build:svh-a-base.rs
// aux-build:svh-b.rs
// aux-build:svh-a-macro.rs
// pretty-expanded FIXME #23616
extern crate a;
extern crate b;
fn main() {
b::foo()
}

View file

@ -11,7 +11,7 @@
// note that these aux-build directives must be in this order
// aux-build:svh-a-base.rs
// aux-build:svh-b.rs
// aux-build:svh-a-no-change.rs
// aux-build:svh-a-base.rs
// pretty-expanded FIXME #23616

View file

@ -1,23 +0,0 @@
// 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.
// note that these aux-build directives must be in this order
// aux-build:svh-a-base.rs
// aux-build:svh-b.rs
// aux-build:svh-a-redundant-cfg.rs
// pretty-expanded FIXME #23616
extern crate a;
extern crate b;
fn main() {
b::foo()
}

View file

@ -1,23 +0,0 @@
// 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.
// note that these aux-build directives must be in this order
// aux-build:svh-a-base.rs
// aux-build:svh-b.rs
// aux-build:svh-a-whitespace.rs
// pretty-expanded FIXME #23616
extern crate a;
extern crate b;
fn main() {
b::foo()
}