]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #52287 - ljedrz:dyn_librustc_resolve, r=petrochenkov
authorkennytm <kennytm@gmail.com>
Thu, 12 Jul 2018 12:25:30 +0000 (20:25 +0800)
committerGitHub <noreply@github.com>
Thu, 12 Jul 2018 12:25:30 +0000 (20:25 +0800)
Deny bare trait objects in src/librustc_resolve

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_resolve`.

src/librustc_resolve/lib.rs

index 8a47b8ea6485a341ab8de71453186ccd5b562260..aed70861e33837d1d8cd462e8f2694f08dcc98b8 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![deny(bare_trait_objects)]
+
 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/nightly/")]
@@ -1292,7 +1294,7 @@ fn intern(&mut self, string: &str, primitive_type: PrimTy) {
 /// This is the visitor that walks the whole crate.
 pub struct Resolver<'a> {
     session: &'a Session,
-    cstore: &'a CrateStore,
+    cstore: &'a dyn CrateStore,
 
     pub definitions: Definitions,
 
@@ -1388,7 +1390,7 @@ pub struct Resolver<'a> {
     /// true if `#![feature(use_extern_macros)]`
     use_extern_macros: bool,
 
-    crate_loader: &'a mut CrateLoader,
+    crate_loader: &'a mut dyn CrateLoader,
     macro_names: FxHashSet<Ident>,
     global_macros: FxHashMap<Name, &'a NameBinding<'a>>,
     pub all_macros: FxHashMap<Name, Def>,
@@ -1604,11 +1606,11 @@ fn resolve_hir_path_cb<F>(&mut self, path: &mut hir::Path, is_value: bool, error
 
 impl<'a> Resolver<'a> {
     pub fn new(session: &'a Session,
-               cstore: &'a CrateStore,
+               cstore: &'a dyn CrateStore,
                krate: &Crate,
                crate_name: &str,
                make_glob_map: MakeGlobMap,
-               crate_loader: &'a mut CrateLoader,
+               crate_loader: &'a mut dyn CrateLoader,
                arenas: &'a ResolverArenas<'a>)
                -> Resolver<'a> {
         let root_def_id = DefId::local(CRATE_DEF_INDEX);