File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11use clippy_utils:: diagnostics:: span_lint_and_sugg;
2+ use clippy_utils:: is_from_proc_macro;
23use rustc_errors:: Applicability ;
34use rustc_hir:: def:: Res ;
45use rustc_hir:: def_id:: DefId ;
56use rustc_hir:: { HirId , Path , PathSegment } ;
6- use rustc_lint:: { LateContext , LateLintPass } ;
7+ use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
8+ use rustc_middle:: lint:: in_external_macro;
79use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
810use rustc_span:: symbol:: kw;
911use rustc_span:: { sym, Span } ;
@@ -99,6 +101,8 @@ impl<'tcx> LateLintPass<'tcx> for StdReexports {
99101 if let Res :: Def ( _, def_id) = path. res
100102 && let Some ( first_segment) = get_first_segment ( path)
101103 && is_stable ( cx, def_id)
104+ && !in_external_macro ( cx. sess ( ) , path. span )
105+ && !is_from_proc_macro ( cx, & first_segment. ident )
102106 {
103107 let ( lint, used_mod, replace_with) = match first_segment. ident . name {
104108 sym:: std => match cx. tcx . crate_name ( def_id. krate ) {
You can’t perform that action at this time.
0 commit comments