Skip to content

Commit 6ebc330

Browse files
committed
macro_expanded_macro_exports_accessed_by_absolute_paths -> error
1 parent 261f8a3 commit 6ebc330

File tree

5 files changed

+10
-33
lines changed

5 files changed

+10
-33
lines changed

src/librustc/lint/builtin.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,6 @@ declare_lint! {
292292
via the module system"
293293
}
294294

295-
declare_lint! {
296-
pub MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
297-
Deny,
298-
"macro-expanded `macro_export` macros from the current crate \
299-
cannot be referred to by absolute paths"
300-
}
301-
302295
declare_lint! {
303296
pub EXPLICIT_OUTLIVES_REQUIREMENTS,
304297
Allow,
@@ -402,7 +395,6 @@ declare_lint_pass! {
402395
WHERE_CLAUSES_OBJECT_SAFETY,
403396
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
404397
MACRO_USE_EXTERN_CRATE,
405-
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
406398
parser::ILL_FORMED_ATTRIBUTE_INPUT,
407399
parser::META_VARIABLE_MISUSE,
408400
DEPRECATED_IN_FUTURE,
@@ -421,7 +413,6 @@ pub enum BuiltinLintDiagnostics {
421413
BareTraitObject(Span, /* is_global */ bool),
422414
AbsPathWithModule(Span),
423415
ProcMacroDeriveResolutionFallback(Span),
424-
MacroExpandedMacroExportsAccessedByAbsolutePaths(Span),
425416
ElidedLifetimesInPaths(usize, Span, bool, Span, String),
426417
UnknownCrateTypes(Span, String, String),
427418
UnusedImports(String, Vec<(Span, String)>),
@@ -506,9 +497,6 @@ impl BuiltinLintDiagnostics {
506497
db.span_label(span, "names from parent modules are not \
507498
accessible without an explicit import");
508499
}
509-
BuiltinLintDiagnostics::MacroExpandedMacroExportsAccessedByAbsolutePaths(span_def) => {
510-
db.span_note(span_def, "the macro is defined here");
511-
}
512500
BuiltinLintDiagnostics::ElidedLifetimesInPaths(
513501
n, path_span, incl_angl_brckt, insertion_span, anon_lts
514502
) => {

src/librustc_lint/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
368368
reference: "issue #50504 <https://github.com/rust-lang/rust/issues/50504>",
369369
edition: None,
370370
},
371-
FutureIncompatibleInfo {
372-
id: LintId::of(MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS),
373-
reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>",
374-
edition: None,
375-
},
376371
FutureIncompatibleInfo {
377372
id: LintId::of(ILL_FORMED_ATTRIBUTE_INPUT),
378373
reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
@@ -467,6 +462,8 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
467462
"converted into hard error, see https://github.com/rust-lang/rust/issues/42238");
468463
store.register_removed("duplicate_macro_exports",
469464
"converted into hard error, see https://github.com/rust-lang/rust/issues/35896");
465+
store.register_removed("macro_expanded_macro_exports_accessed_by_absolute_paths",
466+
"converted into hard error, see https://github.com/rust-lang/rust/issues/52234");
470467
}
471468

472469
pub fn register_internals(store: &mut lint::LintStore, sess: Option<&Session>) {

src/librustc_resolve/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4746,14 +4746,13 @@ impl<'a> Resolver<'a> {
47464746
self.report_with_use_injections(krate);
47474747

47484748
for &(span_use, span_def) in &self.macro_expanded_macro_export_errors {
4749-
let msg = "macro-expanded `macro_export` macros from the current crate \
4750-
cannot be referred to by absolute paths";
4751-
self.session.buffer_lint_with_diagnostic(
4752-
lint::builtin::MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
4753-
CRATE_NODE_ID, span_use, msg,
4754-
lint::builtin::BuiltinLintDiagnostics::
4755-
MacroExpandedMacroExportsAccessedByAbsolutePaths(span_def),
4756-
);
4749+
self.session.struct_span_err(
4750+
span_use,
4751+
"macro-expanded `macro_export` macros from the current crate \
4752+
cannot be referred to by absolute paths",
4753+
)
4754+
.span_note(span_def, "the macro is defined here")
4755+
.emit();
47574756
}
47584757

47594758
for ambiguity_error in &self.ambiguity_errors {

src/test/ui/imports/local-modularized-tricky-fail-3.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ define_exported!();
1212
mod m {
1313
use exported;
1414
//~^ ERROR macro-expanded `macro_export` macros from the current crate cannot
15-
//~| WARN this was previously accepted
1615
}
1716

1817
fn main() {
1918
::exported!();
2019
//~^ ERROR macro-expanded `macro_export` macros from the current crate cannot
21-
//~| WARN this was previously accepted
2220
}

src/test/ui/imports/local-modularized-tricky-fail-3.stderr

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ error: macro-expanded `macro_export` macros from the current crate cannot be ref
44
LL | use exported;
55
| ^^^^^^^^
66
|
7-
= note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
8-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9-
= note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
107
note: the macro is defined here
118
--> $DIR/local-modularized-tricky-fail-3.rs:5:5
129
|
@@ -19,13 +16,11 @@ LL | define_exported!();
1916
| ------------------- in this macro invocation
2017

2118
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
22-
--> $DIR/local-modularized-tricky-fail-3.rs:19:5
19+
--> $DIR/local-modularized-tricky-fail-3.rs:18:5
2320
|
2421
LL | ::exported!();
2522
| ^^^^^^^^^^
2623
|
27-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
28-
= note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
2924
note: the macro is defined here
3025
--> $DIR/local-modularized-tricky-fail-3.rs:5:5
3126
|

0 commit comments

Comments
 (0)