]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_lint/late.rs
Auto merge of #67940 - JohnTitor:rustc-guide, r=JohnTitor
[rust.git] / src / librustc_lint / late.rs
index e3ab604d39881e6a4e44baeec0bafd00839be986..30a3788377508b106ff02a8f817ab6d7dc2d56c5 100644 (file)
@@ -14,8 +14,8 @@
 //! upon. As the ast is traversed, this keeps track of the current lint level
 //! for all lint attributes.
 
+use crate::{passes::LateLintPassObject, LateContext, LateLintPass, LintStore};
 use rustc::hir::map::Map;
-use rustc::lint::{LateContext, LateLintPass, LateLintPassObject, LintStore};
 use rustc::ty::{self, TyCtxt};
 use rustc_data_structures::sync::{join, par_iter, ParallelIterator};
 use rustc_hir as hir;
 use syntax::walk_list;
 
 use log::debug;
+use std::any::Any;
 use std::slice;
 
 /// Extract the `LintStore` from the query context.
 /// This function exists because we've erased `LintStore` as `dyn Any` in the context.
 crate fn unerased_lint_store<'tcx>(tcx: TyCtxt<'tcx>) -> &'tcx LintStore {
-    tcx.lint_store.downcast_ref().unwrap()
+    let store: &dyn Any = &*tcx.lint_store;
+    store.downcast_ref().unwrap()
 }
 
 macro_rules! lint_callback { ($cx:expr, $f:ident, $($args:expr),*) => ({
@@ -347,7 +349,7 @@ impl<'a, $hir> LateLintPass<'a, $hir> for LateLintPassObjects<'_> {
     )
 }
 
-late_lint_methods!(late_lint_pass_impl, [], ['tcx]);
+crate::late_lint_methods!(late_lint_pass_impl, [], ['tcx]);
 
 fn late_lint_mod_pass<'tcx, T: for<'a> LateLintPass<'a, 'tcx>>(
     tcx: TyCtxt<'tcx>,