@@ -331,6 +331,13 @@ declare_lint! {
331
331
via the module system"
332
332
}
333
333
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
+
334
341
/// Some lints that are buffered from `libsyntax`. See `syntax::early_buffered_lints`.
335
342
pub mod parser {
336
343
declare_lint ! {
@@ -398,6 +405,7 @@ impl LintPass for HardwiredLints {
398
405
WHERE_CLAUSES_OBJECT_SAFETY ,
399
406
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK ,
400
407
MACRO_USE_EXTERN_CRATE ,
408
+ MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS ,
401
409
parser:: QUESTION_MARK_MACRO_SEP ,
402
410
)
403
411
}
@@ -412,6 +420,7 @@ pub enum BuiltinLintDiagnostics {
412
420
AbsPathWithModule ( Span ) ,
413
421
DuplicatedMacroExports ( ast:: Ident , Span , Span ) ,
414
422
ProcMacroDeriveResolutionFallback ( Span ) ,
423
+ MacroExpandedMacroExportsAccessedByAbsolutePaths ( Span ) ,
415
424
ElidedLifetimesInPaths ( usize , Span , bool , Span , String ) ,
416
425
}
417
426
@@ -453,6 +462,9 @@ impl BuiltinLintDiagnostics {
453
462
db. span_label ( span, "names from parent modules are not \
454
463
accessible without an explicit import") ;
455
464
}
465
+ BuiltinLintDiagnostics :: MacroExpandedMacroExportsAccessedByAbsolutePaths ( span_def) => {
466
+ db. span_note ( span_def, "the macro is defined here" ) ;
467
+ }
456
468
BuiltinLintDiagnostics :: ElidedLifetimesInPaths (
457
469
n, path_span, incl_angl_brckt, insertion_span, anon_lts
458
470
) => {
0 commit comments