Skip to content
Prev Previous commit
Next Next commit
macro_expanded_macro_exports_accessed_by_absolute_paths -> error
  • Loading branch information
Centril committed Aug 3, 2019
commit 6ebc330a3e414967bfeb0b31f7cac040df905a5a
12 changes: 0 additions & 12 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,6 @@ declare_lint! {
via the module system"
}

declare_lint! {
pub MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
Deny,
"macro-expanded `macro_export` macros from the current crate \
cannot be referred to by absolute paths"
}

declare_lint! {
pub EXPLICIT_OUTLIVES_REQUIREMENTS,
Allow,
Expand Down Expand Up @@ -402,7 +395,6 @@ declare_lint_pass! {
WHERE_CLAUSES_OBJECT_SAFETY,
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
MACRO_USE_EXTERN_CRATE,
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
parser::ILL_FORMED_ATTRIBUTE_INPUT,
parser::META_VARIABLE_MISUSE,
DEPRECATED_IN_FUTURE,
Expand All @@ -421,7 +413,6 @@ pub enum BuiltinLintDiagnostics {
BareTraitObject(Span, /* is_global */ bool),
AbsPathWithModule(Span),
ProcMacroDeriveResolutionFallback(Span),
MacroExpandedMacroExportsAccessedByAbsolutePaths(Span),
ElidedLifetimesInPaths(usize, Span, bool, Span, String),
UnknownCrateTypes(Span, String, String),
UnusedImports(String, Vec<(Span, String)>),
Expand Down Expand Up @@ -506,9 +497,6 @@ impl BuiltinLintDiagnostics {
db.span_label(span, "names from parent modules are not \
accessible without an explicit import");
}
BuiltinLintDiagnostics::MacroExpandedMacroExportsAccessedByAbsolutePaths(span_def) => {
db.span_note(span_def, "the macro is defined here");
}
BuiltinLintDiagnostics::ElidedLifetimesInPaths(
n, path_span, incl_angl_brckt, insertion_span, anon_lts
) => {
Expand Down
7 changes: 2 additions & 5 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,6 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
reference: "issue #50504 <https://github.com/rust-lang/rust/issues/50504>",
edition: None,
},
FutureIncompatibleInfo {
id: LintId::of(MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS),
reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>",
edition: None,
},
FutureIncompatibleInfo {
id: LintId::of(ILL_FORMED_ATTRIBUTE_INPUT),
reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
Expand Down Expand Up @@ -467,6 +462,8 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
"converted into hard error, see https://github.com/rust-lang/rust/issues/42238");
store.register_removed("duplicate_macro_exports",
"converted into hard error, see https://github.com/rust-lang/rust/issues/35896");
store.register_removed("macro_expanded_macro_exports_accessed_by_absolute_paths",
"converted into hard error, see https://github.com/rust-lang/rust/issues/52234");
}

pub fn register_internals(store: &mut lint::LintStore, sess: Option<&Session>) {
Expand Down
15 changes: 7 additions & 8 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4746,14 +4746,13 @@ impl<'a> Resolver<'a> {
self.report_with_use_injections(krate);

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

for ambiguity_error in &self.ambiguity_errors {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/imports/local-modularized-tricky-fail-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ define_exported!();
mod m {
use exported;
//~^ ERROR macro-expanded `macro_export` macros from the current crate cannot
//~| WARN this was previously accepted
}

fn main() {
::exported!();
//~^ ERROR macro-expanded `macro_export` macros from the current crate cannot
//~| WARN this was previously accepted
}
7 changes: 1 addition & 6 deletions src/test/ui/imports/local-modularized-tricky-fail-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ error: macro-expanded `macro_export` macros from the current crate cannot be ref
LL | use exported;
| ^^^^^^^^
|
= note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
--> $DIR/local-modularized-tricky-fail-3.rs:5:5
|
Expand All @@ -19,13 +16,11 @@ LL | define_exported!();
| ------------------- in this macro invocation

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