@@ -331,6 +331,13 @@ declare_lint! {
331331 via the module system"
332332}
333333
334+ declare_lint ! {
335+ pub MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS ,
336+ Deny ,
337+ "macro-expanded `macro_export` macros from the current crate \
338+ cannot be referred to by absolute paths"
339+ }
340+
334341/// Some lints that are buffered from `libsyntax`. See `syntax::early_buffered_lints`.
335342pub mod parser {
336343 declare_lint ! {
@@ -398,6 +405,7 @@ impl LintPass for HardwiredLints {
398405 WHERE_CLAUSES_OBJECT_SAFETY ,
399406 PROC_MACRO_DERIVE_RESOLUTION_FALLBACK ,
400407 MACRO_USE_EXTERN_CRATE ,
408+ MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS ,
401409 parser:: QUESTION_MARK_MACRO_SEP ,
402410 )
403411 }
@@ -412,6 +420,7 @@ pub enum BuiltinLintDiagnostics {
412420 AbsPathWithModule ( Span ) ,
413421 DuplicatedMacroExports ( ast:: Ident , Span , Span ) ,
414422 ProcMacroDeriveResolutionFallback ( Span ) ,
423+ MacroExpandedMacroExportsAccessedByAbsolutePaths ( Span ) ,
415424 ElidedLifetimesInPaths ( usize , Span , bool , Span , String ) ,
416425}
417426
@@ -453,6 +462,9 @@ impl BuiltinLintDiagnostics {
453462 db. span_label ( span, "names from parent modules are not \
454463 accessible without an explicit import") ;
455464 }
465+ BuiltinLintDiagnostics :: MacroExpandedMacroExportsAccessedByAbsolutePaths ( span_def) => {
466+ db. span_note ( span_def, "the macro is defined here" ) ;
467+ }
456468 BuiltinLintDiagnostics :: ElidedLifetimesInPaths (
457469 n, path_span, incl_angl_brckt, insertion_span, anon_lts
458470 ) => {
0 commit comments