Skip to content

Commit c2c6986

Browse files
authored
Rollup merge of rust-lang#52220 - ljedrz:dyn_bootstrap, r=kennytm
Deny bare trait objects in `src/bootstrap` Enforce `#![deny(bare_trait_objects)]` in `src/bootstrap`.
2 parents 8fba84f + 72b908f commit c2c6986

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/bootstrap/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct Builder<'a> {
4444
pub top_stage: u32,
4545
pub kind: Kind,
4646
cache: Cache,
47-
stack: RefCell<Vec<Box<Any>>>,
47+
stack: RefCell<Vec<Box<dyn Any>>>,
4848
time_spent_on_dependencies: Cell<Duration>,
4949
pub paths: Vec<PathBuf>,
5050
graph_nodes: RefCell<HashMap<String, NodeIndex>>,

src/bootstrap/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ lazy_static! {
249249
pub struct Cache(
250250
RefCell<HashMap<
251251
TypeId,
252-
Box<Any>, // actually a HashMap<Step, Interned<Step::Output>>
252+
Box<dyn Any>, // actually a HashMap<Step, Interned<Step::Output>>
253253
>>
254254
);
255255

src/bootstrap/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ pub fn run_cargo(builder: &Builder, cargo: &mut Command, stamp: &Path, is_check:
11891189
pub fn stream_cargo(
11901190
builder: &Builder,
11911191
cargo: &mut Command,
1192-
cb: &mut FnMut(CargoMessage),
1192+
cb: &mut dyn FnMut(CargoMessage),
11931193
) -> bool {
11941194
if builder.config.dry_run {
11951195
return true;

src/bootstrap/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
//! More documentation can be found in each respective module below, and you can
114114
//! also check out the `src/bootstrap/README.md` file for more information.
115115
116+
#![deny(bare_trait_objects)]
116117
#![deny(warnings)]
117118
#![feature(core_intrinsics)]
118119
#![feature(drain_filter)]
@@ -1174,13 +1175,13 @@ impl Build {
11741175
/// Copies the `src` directory recursively to `dst`. Both are assumed to exist
11751176
/// when this function is called. Unwanted files or directories can be skipped
11761177
/// by returning `false` from the filter function.
1177-
pub fn cp_filtered(&self, src: &Path, dst: &Path, filter: &Fn(&Path) -> bool) {
1178+
pub fn cp_filtered(&self, src: &Path, dst: &Path, filter: &dyn Fn(&Path) -> bool) {
11781179
// Immediately recurse with an empty relative path
11791180
self.recurse_(src, dst, Path::new(""), filter)
11801181
}
11811182

11821183
// Inner function does the actual work
1183-
fn recurse_(&self, src: &Path, dst: &Path, relative: &Path, filter: &Fn(&Path) -> bool) {
1184+
fn recurse_(&self, src: &Path, dst: &Path, relative: &Path, filter: &dyn Fn(&Path) -> bool) {
11841185
for f in self.read_dir(src) {
11851186
let path = f.path();
11861187
let name = path.file_name().unwrap();

0 commit comments

Comments
 (0)