about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-07-12 20:25:27 +0800
committerGitHub <noreply@github.com>2018-07-12 20:25:27 +0800
commitc2c6986733ff26f17beb1b5ea7d413b6ad30a240 (patch)
treecf6f6f6f53fc44784c71d7eba7221f493afae2c4
parent8fba84fe0ab499de894c023612c6af5327bba956 (diff)
parent72b908ffbe42d97dfbad848e0fc53e7e9eecfed9 (diff)
downloadrust-c2c6986733ff26f17beb1b5ea7d413b6ad30a240.tar.gz
rust-c2c6986733ff26f17beb1b5ea7d413b6ad30a240.zip
Rollup merge of #52220 - ljedrz:dyn_bootstrap, r=kennytm
Deny bare trait objects in `src/bootstrap`

Enforce `#![deny(bare_trait_objects)]` in `src/bootstrap`.
-rw-r--r--src/bootstrap/builder.rs2
-rw-r--r--src/bootstrap/cache.rs2
-rw-r--r--src/bootstrap/compile.rs2
-rw-r--r--src/bootstrap/lib.rs5
4 files changed, 6 insertions, 5 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 6c3a476d084..eb534cb685e 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -44,7 +44,7 @@ pub struct Builder<'a> {
     pub top_stage: u32,
     pub kind: Kind,
     cache: Cache,
-    stack: RefCell<Vec<Box<Any>>>,
+    stack: RefCell<Vec<Box<dyn Any>>>,
     time_spent_on_dependencies: Cell<Duration>,
     pub paths: Vec<PathBuf>,
     graph_nodes: RefCell<HashMap<String, NodeIndex>>,
diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
index d81c6bc28e5..bca5ff85ba2 100644
--- a/src/bootstrap/cache.rs
+++ b/src/bootstrap/cache.rs
@@ -249,7 +249,7 @@ lazy_static! {
 pub struct Cache(
     RefCell<HashMap<
         TypeId,
-        Box<Any>, // actually a HashMap<Step, Interned<Step::Output>>
+        Box<dyn Any>, // actually a HashMap<Step, Interned<Step::Output>>
     >>
 );
 
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 298bd58c6cd..7d94bac66f7 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -1189,7 +1189,7 @@ pub fn run_cargo(builder: &Builder, cargo: &mut Command, stamp: &Path, is_check:
 pub fn stream_cargo(
     builder: &Builder,
     cargo: &mut Command,
-    cb: &mut FnMut(CargoMessage),
+    cb: &mut dyn FnMut(CargoMessage),
 ) -> bool {
     if builder.config.dry_run {
         return true;
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 5f66d0b102e..cd9a639e82e 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -113,6 +113,7 @@
 //! 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.
 
+#![deny(bare_trait_objects)]
 #![deny(warnings)]
 #![feature(core_intrinsics)]
 #![feature(drain_filter)]
@@ -1174,13 +1175,13 @@ impl Build {
     /// Copies the `src` directory recursively to `dst`. Both are assumed to exist
     /// when this function is called. Unwanted files or directories can be skipped
     /// 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
         self.recurse_(src, dst, Path::new(""), filter)
     }
 
     // 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) {
             let path = f.path();
             let name = path.file_name().unwrap();