-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=ni…
…komatsakis incr.comp.: Don't include span information in the ICH of type definitions This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088). r? @nikomatsakis
- Loading branch information
Showing
5 changed files
with
101 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// 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. | ||
|
||
// Test that moving a type definition within a source file does not affect | ||
// re-compilation. | ||
|
||
// revisions:rpass1 rpass2 | ||
// compile-flags: -Z query-dep-graph -g | ||
|
||
#![rustc_partition_reused(module="spans_in_type_debuginfo", cfg="rpass2")] | ||
#![rustc_partition_reused(module="spans_in_type_debuginfo-structs", cfg="rpass2")] | ||
#![rustc_partition_reused(module="spans_in_type_debuginfo-enums", cfg="rpass2")] | ||
|
||
#![feature(rustc_attrs)] | ||
|
||
mod structs { | ||
#[cfg(rpass1)] | ||
pub struct X { | ||
pub x: u32, | ||
} | ||
|
||
#[cfg(rpass2)] | ||
pub struct X { | ||
pub x: u32, | ||
} | ||
|
||
pub fn foo(x: X) -> u32 { | ||
x.x | ||
} | ||
} | ||
|
||
mod enums { | ||
#[cfg(rpass1)] | ||
pub enum X { | ||
A { x: u32 }, | ||
B(u32), | ||
} | ||
|
||
#[cfg(rpass2)] | ||
pub enum X { | ||
A { x: u32 }, | ||
B(u32), | ||
} | ||
|
||
pub fn foo(x: X) -> u32 { | ||
match x { | ||
X::A { x } => x, | ||
X::B(x) => x, | ||
} | ||
} | ||
} | ||
|
||
pub fn main() { | ||
let _ = structs::foo(structs::X { x: 1 }); | ||
let _ = enums::foo(enums::X::A { x: 2 }); | ||
} |