-
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.
- Loading branch information
Showing
11 changed files
with
61 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
pub mod a { | ||
use std::cell::RefCell; | ||
|
||
pub struct Arena<T> { | ||
chunks: RefCell<ChunkList<T>>, | ||
} | ||
|
||
struct ChunkList<T> { | ||
current: Vec<T>, | ||
rest: Vec<Vec<T>>, | ||
} | ||
|
||
impl<T> Arena<T> { | ||
pub fn new() -> Arena<T> { | ||
Arena { | ||
chunks: RefCell::new(ChunkList { | ||
current: Vec::with_capacity(12), | ||
rest: Vec::new(), | ||
}), | ||
} | ||
} | ||
} | ||
} |
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,3 @@ | ||
pub mod b { | ||
pub struct Unused {} | ||
} |
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
File renamed without changes.
File renamed without changes.
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
24 changes: 24 additions & 0 deletions
24
tests/ui/type_id/issue-35144-typeid-output-same-ignore-cfgs.rs
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,24 @@ | ||
// #35144: output should be the same with or without enabling the feature | ||
// | ||
// edition:2021 | ||
// aux-build:a.rs | ||
// aux-build:b.rs | ||
// run-pass | ||
// compile-flags: --extern a --extern b --cfg feature="afirst" -A unused_imports -A dead_code | ||
#![feature(core_intrinsics, rustc_private)] | ||
|
||
#[cfg(afirst)] | ||
use a; | ||
use b; | ||
#[cfg(not(afirst))] | ||
use a; | ||
|
||
use std::intrinsics::type_id; | ||
|
||
fn main() { | ||
println!( | ||
"{:?} {:?}", | ||
type_id::<a::a::Arena<()>>(), | ||
type_id::<dyn Iterator<Item = a::a::Arena<()>>>() | ||
); | ||
} |
File renamed without changes.
File renamed without changes.