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 1
1
use clippy_utils:: diagnostics:: span_lint_and_sugg;
2
+ use clippy_utils:: is_from_proc_macro;
2
3
use rustc_errors:: Applicability ;
3
4
use rustc_hir:: def:: Res ;
4
5
use rustc_hir:: def_id:: DefId ;
5
6
use 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;
7
9
use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
8
10
use rustc_span:: symbol:: kw;
9
11
use rustc_span:: { sym, Span } ;
@@ -99,6 +101,8 @@ impl<'tcx> LateLintPass<'tcx> for StdReexports {
99
101
if let Res :: Def ( _, def_id) = path. res
100
102
&& let Some ( first_segment) = get_first_segment ( path)
101
103
&& is_stable ( cx, def_id)
104
+ && !in_external_macro ( cx. sess ( ) , path. span )
105
+ && !is_from_proc_macro ( cx, & first_segment. ident )
102
106
{
103
107
let ( lint, used_mod, replace_with) = match first_segment. ident . name {
104
108
sym:: std => match cx. tcx . crate_name ( def_id. krate ) {
You can’t perform that action at this time.
0 commit comments