Deny bare trait objects in src/bootstrap
.
This commit is contained in:
parent
77117e3836
commit
d1e3567250
4 changed files with 6 additions and 6 deletions
|
@ -44,7 +44,7 @@ pub struct Builder<'a> {
|
||||||
pub top_stage: u32,
|
pub top_stage: u32,
|
||||||
pub kind: Kind,
|
pub kind: Kind,
|
||||||
cache: Cache,
|
cache: Cache,
|
||||||
stack: RefCell<Vec<Box<Any>>>,
|
stack: RefCell<Vec<Box<dyn Any>>>,
|
||||||
time_spent_on_dependencies: Cell<Duration>,
|
time_spent_on_dependencies: Cell<Duration>,
|
||||||
pub paths: Vec<PathBuf>,
|
pub paths: Vec<PathBuf>,
|
||||||
graph_nodes: RefCell<HashMap<String, NodeIndex>>,
|
graph_nodes: RefCell<HashMap<String, NodeIndex>>,
|
||||||
|
|
|
@ -249,7 +249,7 @@ lazy_static! {
|
||||||
pub struct Cache(
|
pub struct Cache(
|
||||||
RefCell<HashMap<
|
RefCell<HashMap<
|
||||||
TypeId,
|
TypeId,
|
||||||
Box<Any>, // actually a HashMap<Step, Interned<Step::Output>>
|
Box<dyn Any>, // actually a HashMap<Step, Interned<Step::Output>>
|
||||||
>>
|
>>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1189,7 +1189,7 @@ pub fn run_cargo(builder: &Builder, cargo: &mut Command, stamp: &Path, is_check:
|
||||||
pub fn stream_cargo(
|
pub fn stream_cargo(
|
||||||
builder: &Builder,
|
builder: &Builder,
|
||||||
cargo: &mut Command,
|
cargo: &mut Command,
|
||||||
cb: &mut FnMut(CargoMessage),
|
cb: &mut dyn FnMut(CargoMessage),
|
||||||
) -> bool {
|
) -> bool {
|
||||||
if builder.config.dry_run {
|
if builder.config.dry_run {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
//! More documentation can be found in each respective module below, and you can
|
//! More documentation can be found in each respective module below, and you can
|
||||||
//! also check out the `src/bootstrap/README.md` file for more information.
|
//! also check out the `src/bootstrap/README.md` file for more information.
|
||||||
|
|
||||||
#![deny(warnings)]
|
#![deny(bare_trait_objects)]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
#![feature(drain_filter)]
|
#![feature(drain_filter)]
|
||||||
|
|
||||||
|
@ -1174,13 +1174,13 @@ impl Build {
|
||||||
/// Copies the `src` directory recursively to `dst`. Both are assumed to exist
|
/// Copies the `src` directory recursively to `dst`. Both are assumed to exist
|
||||||
/// when this function is called. Unwanted files or directories can be skipped
|
/// when this function is called. Unwanted files or directories can be skipped
|
||||||
/// by returning `false` from the filter function.
|
/// by returning `false` from the filter function.
|
||||||
pub fn cp_filtered(&self, src: &Path, dst: &Path, filter: &Fn(&Path) -> bool) {
|
pub fn cp_filtered(&self, src: &Path, dst: &Path, filter: &dyn Fn(&Path) -> bool) {
|
||||||
// Immediately recurse with an empty relative path
|
// Immediately recurse with an empty relative path
|
||||||
self.recurse_(src, dst, Path::new(""), filter)
|
self.recurse_(src, dst, Path::new(""), filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inner function does the actual work
|
// Inner function does the actual work
|
||||||
fn recurse_(&self, src: &Path, dst: &Path, relative: &Path, filter: &Fn(&Path) -> bool) {
|
fn recurse_(&self, src: &Path, dst: &Path, relative: &Path, filter: &dyn Fn(&Path) -> bool) {
|
||||||
for f in self.read_dir(src) {
|
for f in self.read_dir(src) {
|
||||||
let path = f.path();
|
let path = f.path();
|
||||||
let name = path.file_name().unwrap();
|
let name = path.file_name().unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue