Skip to content

Commit d1e3567

Browse files
committed
Deny bare trait objects in src/bootstrap.
1 parent 77117e3 commit d1e3567

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/bootstrap/builder.rs

+1-1
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

+1-1
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

+1-1
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,7 +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(warnings)]
116+
#![deny(bare_trait_objects)]
117117
#![feature(core_intrinsics)]
118118
#![feature(drain_filter)]
119119

@@ -1174,13 +1174,13 @@ impl Build {
11741174
/// Copies the `src` directory recursively to `dst`. Both are assumed to exist
11751175
/// when this function is called. Unwanted files or directories can be skipped
11761176
/// by returning `false` from the filter function.
1177-
pub fn cp_filtered(&self, src: &Path, dst: &Path, filter: &Fn(&Path) -> bool) {
1177+
pub fn cp_filtered(&self, src: &Path, dst: &Path, filter: &dyn Fn(&Path) -> bool) {
11781178
// Immediately recurse with an empty relative path
11791179
self.recurse_(src, dst, Path::new(""), filter)
11801180
}
11811181

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

0 commit comments

Comments
 (0)