Auto merge of #42576 - nikomatsakis:incr-comp-less-tasks, r=michaelwoerister
prune some tasks and depnode variants Pick some low-hanging fruit towards the goal of removing the older tasks. r? @michaelwoerister
This commit is contained in:
commit
9b5b514c8d
16 changed files with 61 additions and 217 deletions
|
|
@ -36,7 +36,6 @@ mod y {
|
|||
use Foo;
|
||||
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK
|
||||
pub fn use_char_assoc() {
|
||||
// Careful here: in the representation, <char as Foo>::T gets
|
||||
// normalized away, so at a certain point we had no edge to
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ mod y {
|
|||
|
||||
// These dependencies SHOULD exist:
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK
|
||||
pub fn y() {
|
||||
x::x();
|
||||
}
|
||||
|
|
@ -40,7 +39,6 @@ mod z {
|
|||
// These are expected to yield errors, because changes to `x`
|
||||
// affect the BODY of `y`, but not its signature.
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR no path
|
||||
pub fn z() {
|
||||
y::y();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,25 +35,21 @@ mod y {
|
|||
use Foo;
|
||||
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK
|
||||
pub fn with_char() {
|
||||
char::method('a');
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK
|
||||
pub fn take_foo_with_char() {
|
||||
take_foo::<char>('a');
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK
|
||||
pub fn with_u32() {
|
||||
u32::method(22);
|
||||
}
|
||||
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR OK
|
||||
pub fn take_foo_with_u32() {
|
||||
take_foo::<u32>(22);
|
||||
}
|
||||
|
|
@ -67,7 +63,6 @@ mod z {
|
|||
// These are expected to yield errors, because changes to `x`
|
||||
// affect the BODY of `y`, but not its signature.
|
||||
#[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR no path
|
||||
pub fn z() {
|
||||
y::with_char();
|
||||
y::with_u32();
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright 2012-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.
|
||||
|
||||
// Test that two unrelated functions have no trans dependency.
|
||||
|
||||
// compile-flags: -Z query-dep-graph
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[rustc_if_this_changed]
|
||||
fn main() { }
|
||||
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //~ ERROR no path from `main`
|
||||
fn bar() { }
|
||||
|
|
@ -36,19 +36,15 @@ mod y {
|
|||
use x;
|
||||
|
||||
#[rustc_clean(label="TypeckTables", cfg="cfail2")]
|
||||
#[rustc_clean(label="TransCrateItem", cfg="cfail2")]
|
||||
pub fn y() {
|
||||
//[cfail2]~^ ERROR `TypeckTables(y::y)` not found in dep graph, but should be clean
|
||||
//[cfail2]~| ERROR `TransCrateItem(y::y)` not found in dep graph, but should be clean
|
||||
x::x();
|
||||
}
|
||||
}
|
||||
|
||||
mod z {
|
||||
#[rustc_dirty(label="TypeckTables", cfg="cfail2")]
|
||||
#[rustc_dirty(label="TransCrateItem", cfg="cfail2")]
|
||||
pub fn z() {
|
||||
//[cfail2]~^ ERROR `TypeckTables(z::z)` found in dep graph, but should be dirty
|
||||
//[cfail2]~| ERROR `TransCrateItem(z::z)` found in dep graph, but should be dirty
|
||||
}
|
||||
}
|
||||
|
|
|
|||
45
src/test/incremental/issue-42602.rs
Normal file
45
src/test/incremental/issue-42602.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// 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.
|
||||
|
||||
// Regression test for #42602. It used to be that we had
|
||||
// a dep-graph like
|
||||
//
|
||||
// typeck(foo) -> FnOnce -> typeck(bar)
|
||||
//
|
||||
// This was fixed by improving the resolution of the `FnOnce` trait
|
||||
// selection node.
|
||||
|
||||
// revisions:cfail1
|
||||
// compile-flags:-Zquery-dep-graph
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
fn main() {
|
||||
a::foo();
|
||||
b::bar();
|
||||
}
|
||||
|
||||
mod a {
|
||||
#[rustc_if_this_changed(HirBody)]
|
||||
pub fn foo() {
|
||||
let x = vec![1, 2, 3];
|
||||
let v = || ::std::mem::drop(x);
|
||||
v();
|
||||
}
|
||||
}
|
||||
|
||||
mod b {
|
||||
#[rustc_then_this_would_need(TypeckTables)] //[cfail1]~ ERROR no path
|
||||
pub fn bar() {
|
||||
let x = vec![1, 2, 3];
|
||||
let v = || ::std::mem::drop(x);
|
||||
v();
|
||||
}
|
||||
}
|
||||
|
|
@ -9,20 +9,22 @@
|
|||
// except according to those terms.
|
||||
|
||||
// Regr. test that using HIR inlined from another krate does *not* add
|
||||
// a dependency from the local Krate node.
|
||||
// a dependency from the local Krate node. We can't easily test that
|
||||
// directly anymore, so now we test that we get reuse.
|
||||
|
||||
// revisions: cfail1
|
||||
// revisions: rpass1 rpass2
|
||||
// compile-flags: -Z query-dep-graph
|
||||
|
||||
#![allow(warnings)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![rustc_partition_reused(module="krate_inlined-x", cfg="rpass2")]
|
||||
|
||||
#![rustc_if_this_changed(Krate)]
|
||||
|
||||
fn main() { }
|
||||
fn main() {
|
||||
#[cfg(rpass2)]
|
||||
()
|
||||
}
|
||||
|
||||
mod x {
|
||||
#[rustc_then_this_would_need(TransCrateItem)] //[cfail1]~ ERROR no path
|
||||
fn method() {
|
||||
// use some methods that require inlining HIR from another crate:
|
||||
let mut v = vec![];
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
extern crate extern_crate;
|
||||
|
||||
#[rustc_clean(label="TransCrateItem", cfg="rpass2")]
|
||||
#[rustc_clean(label="TransCrateItem", cfg="rpass3")]
|
||||
fn main() {
|
||||
some_mod::some_fn();
|
||||
}
|
||||
|
|
@ -34,8 +32,6 @@ fn main() {
|
|||
mod some_mod {
|
||||
use extern_crate;
|
||||
|
||||
#[rustc_clean(label="TransCrateItem", cfg="rpass2")]
|
||||
#[rustc_dirty(label="TransCrateItem", cfg="rpass3")]
|
||||
pub fn some_fn() {
|
||||
extern_crate::inline_fn();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ mod x {
|
|||
|
||||
#[cfg(rpass2)]
|
||||
#[rustc_dirty(label="TypeckTables", cfg="rpass2")]
|
||||
#[rustc_dirty(label="TransCrateItem", cfg="rpass2")]
|
||||
pub fn x() {
|
||||
println!("{}", "2");
|
||||
}
|
||||
|
|
@ -38,7 +37,6 @@ mod y {
|
|||
use x;
|
||||
|
||||
#[rustc_clean(label="TypeckTables", cfg="rpass2")]
|
||||
#[rustc_clean(label="TransCrateItem", cfg="rpass2")]
|
||||
pub fn y() {
|
||||
x::x();
|
||||
}
|
||||
|
|
@ -48,7 +46,6 @@ mod z {
|
|||
use y;
|
||||
|
||||
#[rustc_clean(label="TypeckTables", cfg="rpass2")]
|
||||
#[rustc_clean(label="TransCrateItem", cfg="rpass2")]
|
||||
pub fn z() {
|
||||
y::y();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue