diff --git a/compiler/rustc_codegen_gcc/build_system/src/test.rs b/compiler/rustc_codegen_gcc/build_system/src/test.rs index dbdaf2a63ef29..8288f0f36e53e 100644 --- a/compiler/rustc_codegen_gcc/build_system/src/test.rs +++ b/compiler/rustc_codegen_gcc/build_system/src/test.rs @@ -840,8 +840,6 @@ fn valid_ui_error_pattern_test(file: &str) -> bool { "type-alias-impl-trait/auxiliary/cross_crate_ice.rs", "type-alias-impl-trait/auxiliary/cross_crate_ice2.rs", "macros/rfc-2011-nicer-assert-messages/auxiliary/common.rs", - "imports/ambiguous-1.rs", - "imports/ambiguous-4-extern.rs", "entry-point/auxiliary/bad_main_functions.rs", ] .iter() diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 899632b9d4b75..dc0e2b6d0ae2f 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -19,7 +19,6 @@ declare_lint_pass! { AARCH64_SOFTFLOAT_NEON, ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, AMBIGUOUS_ASSOCIATED_ITEMS, - AMBIGUOUS_GLOB_IMPORTS, AMBIGUOUS_GLOB_REEXPORTS, ARITHMETIC_OVERFLOW, ASM_SUB_REGISTER, @@ -4445,48 +4444,6 @@ declare_lint! { Warn, "detects diagnostic attribute with malformed diagnostic format literals", } -declare_lint! { - /// The `ambiguous_glob_imports` lint detects glob imports that should report ambiguity - /// errors, but previously didn't do that due to rustc bugs. - /// - /// ### Example - /// - /// ```rust,compile_fail - /// #![deny(ambiguous_glob_imports)] - /// pub fn foo() -> u32 { - /// use sub::*; - /// C - /// } - /// - /// mod sub { - /// mod mod1 { pub const C: u32 = 1; } - /// mod mod2 { pub const C: u32 = 2; } - /// - /// pub use mod1::*; - /// pub use mod2::*; - /// } - /// ``` - /// - /// {{produces}} - /// - /// ### Explanation - /// - /// Previous versions of Rust compile it successfully because it - /// had lost the ambiguity error when resolve `use sub::mod2::*`. - /// - /// This is a [future-incompatible] lint to transition this to a - /// hard error in the future. - /// - /// [future-incompatible]: ../index.md#future-incompatible-lints - pub AMBIGUOUS_GLOB_IMPORTS, - Deny, - "detects certain glob imports that require reporting an ambiguity error", - @future_incompatible = FutureIncompatibleInfo { - reason: FutureIncompatibilityReason::FutureReleaseError, - reference: "issue #114095 ", - report_in_deps: true, - }; -} declare_lint! { /// The `refining_impl_trait_reachable` lint detects `impl Trait` return diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index cd12d5ad10cf7..c943f119a7d06 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -53,7 +53,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ns: Namespace, binding: NameBinding<'ra>, ) { - if let Err(old_binding) = self.try_define_local(parent, ident, ns, binding, false) { + if let Err(old_binding) = self.try_define_local(parent, ident, ns, binding) { self.report_conflict(parent, ident, ns, old_binding, binding); } } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 2f4a18f9cfa6b..0f27650bb41bf 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -21,8 +21,7 @@ use rustc_middle::bug; use rustc_middle::ty::TyCtxt; use rustc_session::Session; use rustc_session::lint::builtin::{ - ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, AMBIGUOUS_GLOB_IMPORTS, - MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS, + ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS, }; use rustc_session::lint::{AmbiguityErrorDiag, BuiltinLintDiag}; use rustc_session::utils::was_invoked_from_cargo; @@ -144,21 +143,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { for ambiguity_error in &self.ambiguity_errors { let diag = self.ambiguity_diagnostics(ambiguity_error); - if ambiguity_error.warning { - let NameBindingKind::Import { import, .. } = ambiguity_error.b1.0.kind else { - unreachable!() - }; - self.lint_buffer.buffer_lint( - AMBIGUOUS_GLOB_IMPORTS, - import.root_id, - ambiguity_error.ident.span, - BuiltinLintDiag::AmbiguousGlobImports { diag }, - ); - } else { - let mut err = struct_span_code_err!(self.dcx(), diag.span, E0659, "{}", diag.msg); - report_ambiguity_error(&mut err, diag); - err.emit(); - } + let mut err = struct_span_code_err!(self.dcx(), diag.span, E0659, "{}", diag.msg); + report_ambiguity_error(&mut err, diag); + err.emit(); } let mut reported_spans = FxHashSet::default(); diff --git a/compiler/rustc_resolve/src/effective_visibilities.rs b/compiler/rustc_resolve/src/effective_visibilities.rs index fe6e5b8e6eb6a..eff7e72ac4b6b 100644 --- a/compiler/rustc_resolve/src/effective_visibilities.rs +++ b/compiler/rustc_resolve/src/effective_visibilities.rs @@ -124,15 +124,12 @@ impl<'a, 'ra, 'tcx> EffectiveVisibilitiesVisitor<'a, 'ra, 'tcx> { // // If the binding is ambiguous, put the root ambiguity binding and all reexports // leading to it into the table. They are used by the `ambiguous_glob_reexports` - // lint. For all bindings added to the table this way `is_ambiguity` returns true. - let is_ambiguity = - |binding: NameBinding<'ra>, warn: bool| binding.ambiguity.is_some() && !warn; + // lint. let mut parent_id = ParentId::Def(module_id); - let mut warn_ambiguity = binding.warn_ambiguity; while let NameBindingKind::Import { binding: nested_binding, .. } = binding.kind { self.update_import(binding, parent_id); - if is_ambiguity(binding, warn_ambiguity) { + if binding.ambiguity.is_some() { // Stop at the root ambiguity, further bindings in the chain should not // be reexported because the root ambiguity blocks any access to them. // (Those further bindings are most likely not ambiguities themselves.) @@ -141,9 +138,8 @@ impl<'a, 'ra, 'tcx> EffectiveVisibilitiesVisitor<'a, 'ra, 'tcx> { parent_id = ParentId::Import(binding); binding = nested_binding; - warn_ambiguity |= nested_binding.warn_ambiguity; } - if !is_ambiguity(binding, warn_ambiguity) + if binding.ambiguity.is_none() && let Some(def_id) = binding.res().opt_def_id().and_then(|id| id.as_local()) { self.update_def(def_id, binding.vis.expect_local(), parent_id); diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 8ecae07dea67d..f9102c47fdb12 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -728,7 +728,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ident: orig_ident, b1: innermost_binding, b2: binding, - warning: false, misc1: misc(innermost_flags), misc2: misc(flags), }); @@ -1072,7 +1071,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ident, b1: binding, b2: shadowed_glob, - warning: false, misc1: AmbiguityErrorMisc::None, misc2: AmbiguityErrorMisc::None, }); diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index f98aaecea18ce..60f5efdb2fe27 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -326,7 +326,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { self.arenas.alloc_name_binding(NameBindingData { kind: NameBindingKind::Import { binding, import }, ambiguity: None, - warn_ambiguity: false, span: import.span, vis, expansion: import.parent_scope.expansion, @@ -340,7 +339,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ident: Ident, ns: Namespace, binding: NameBinding<'ra>, - warn_ambiguity: bool, ) -> Result<(), NameBinding<'ra>> { let res = binding.res(); self.check_reserved_macro_name(ident, res); @@ -352,7 +350,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { module.underscore_disambiguator.update_unchecked(|d| d + 1); module.underscore_disambiguator.get() }); - self.update_local_resolution(module, key, warn_ambiguity, |this, resolution| { + self.update_local_resolution(module, key, |this, resolution| { if let Some(old_binding) = resolution.best_binding() { if res == Res::Err && old_binding.res() != Res::Err { // Do not override real bindings with `Res::Err`s from error recovery. @@ -361,30 +359,17 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { match (old_binding.is_glob_import(), binding.is_glob_import()) { (true, true) => { let (glob_binding, old_glob_binding) = (binding, old_binding); - // FIXME: remove `!binding.is_ambiguity_recursive()` after delete the warning ambiguity. - if !binding.is_ambiguity_recursive() - && let NameBindingKind::Import { import: old_import, .. } = - old_glob_binding.kind - && let NameBindingKind::Import { import, .. } = glob_binding.kind - && old_import == import - { - // When imported from the same glob-import statement, we should replace - // `old_glob_binding` with `glob_binding`, regardless of whether - // they have the same resolution or not. - resolution.glob_binding = Some(glob_binding); - } else if res != old_glob_binding.res() { + if res != old_glob_binding.res() { resolution.glob_binding = Some(this.new_ambiguity_binding( AmbiguityKind::GlobVsGlob, old_glob_binding, glob_binding, - warn_ambiguity, )); - } else if !old_binding.vis.is_at_least(binding.vis, this.tcx) { + } else if !old_glob_binding.vis.is_at_least(glob_binding.vis, this.tcx) + || glob_binding.is_ambiguity_recursive() + { // We are glob-importing the same item but with greater visibility. resolution.glob_binding = Some(glob_binding); - } else if binding.is_ambiguity_recursive() { - resolution.glob_binding = - Some(this.new_warn_ambiguity_binding(glob_binding)); } } (old_glob @ true, false) | (old_glob @ false, true) => { @@ -398,7 +383,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { AmbiguityKind::GlobVsExpanded, non_glob_binding, glob_binding, - false, )); } else { resolution.non_glob_binding = Some(non_glob_binding); @@ -411,9 +395,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { AmbiguityKind::GlobVsGlob, old_glob_binding, glob_binding, - false, )); - } else if !old_glob_binding.vis.is_at_least(binding.vis, this.tcx) { + } else if !old_glob_binding.vis.is_at_least(glob_binding.vis, this.tcx) + || glob_binding.is_ambiguity_recursive() + { + // We are glob-importing the same item but with greater visibility. resolution.glob_binding = Some(glob_binding); } } else { @@ -441,33 +427,21 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ambiguity_kind: AmbiguityKind, primary_binding: NameBinding<'ra>, secondary_binding: NameBinding<'ra>, - warn_ambiguity: bool, ) -> NameBinding<'ra> { let ambiguity = Some((secondary_binding, ambiguity_kind)); - let data = NameBindingData { ambiguity, warn_ambiguity, ..*primary_binding }; + let data = NameBindingData { ambiguity, ..*primary_binding }; self.arenas.alloc_name_binding(data) } - fn new_warn_ambiguity_binding(&self, binding: NameBinding<'ra>) -> NameBinding<'ra> { - assert!(binding.is_ambiguity_recursive()); - self.arenas.alloc_name_binding(NameBindingData { warn_ambiguity: true, ..*binding }) - } - // Use `f` to mutate the resolution of the name in the module. // If the resolution becomes a success, define it in the module's glob importers. - fn update_local_resolution( - &mut self, - module: Module<'ra>, - key: BindingKey, - warn_ambiguity: bool, - f: F, - ) -> T + fn update_local_resolution(&mut self, module: Module<'ra>, key: BindingKey, f: F) -> T where F: FnOnce(&Resolver<'ra, 'tcx>, &mut NameResolution<'ra>) -> T, { // Ensure that `resolution` isn't borrowed when defining in the module's glob importers, // during which the resolution might end up getting re-defined via a glob cycle. - let (binding, t, warn_ambiguity) = { + let (binding, t) = { let resolution = &mut *self.resolution_or_default(module, key).borrow_mut_unchecked(); let old_binding = resolution.binding(); @@ -476,7 +450,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { if let Some(binding) = resolution.binding() && old_binding != Some(binding) { - (binding, t, warn_ambiguity || old_binding.is_some()) + (binding, t) } else { return t; } @@ -501,7 +475,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ident.0, key.ns, imported_binding, - warn_ambiguity, ); } } @@ -522,11 +495,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { let dummy_binding = self.import(dummy_binding, import); self.per_ns(|this, ns| { let module = import.parent_scope.module; - let _ = this.try_define_local(module, target, ns, dummy_binding, false); + let _ = this.try_define_local(module, target, ns, dummy_binding); // Don't remove underscores from `single_imports`, they were never added. if target.name != kw::Underscore { let key = BindingKey::new(target, ns); - this.update_local_resolution(module, key, false, |_, resolution| { + this.update_local_resolution(module, key, |_, resolution| { resolution.single_imports.swap_remove(&import); }) } @@ -916,7 +889,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { this.get_mut_unchecked().update_local_resolution( parent, key, - false, |_, resolution| { resolution.single_imports.swap_remove(&import); }, @@ -945,8 +917,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ImportKind::Single { bindings, .. } => bindings[TypeNS].get().binding(), _ => None, }; - let ambiguity_errors_len = - |errors: &Vec>| errors.iter().filter(|error| !error.warning).count(); + let ambiguity_errors_len = |errors: &Vec>| errors.iter().count(); let prev_ambiguity_errors_len = ambiguity_errors_len(&self.ambiguity_errors); let finalize = Finalize::with_root_span(import.root_id, import.span, import.root_span); @@ -1160,9 +1131,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { initial_binding.res() }); let res = binding.res(); - let has_ambiguity_error = - this.ambiguity_errors.iter().any(|error| !error.warning); - if res == Res::Err || has_ambiguity_error { + if res == Res::Err || !this.ambiguity_errors.is_empty() { this.dcx() .span_delayed_bug(import.span, "some error happened for an import"); return; @@ -1520,16 +1489,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { }; if self.is_accessible_from(binding.vis, scope) { let imported_binding = self.import(binding, import); - let warn_ambiguity = self - .resolution(import.parent_scope.module, key) - .and_then(|r| r.binding()) - .is_some_and(|binding| binding.warn_ambiguity_recursive()); let _ = self.try_define_local( import.parent_scope.module, key.ident.0, key.ns, imported_binding, - warn_ambiguity, ); } } @@ -1554,8 +1518,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { module.for_each_child(self, |this, ident, _, binding| { let res = binding.res().expect_non_local(); - let error_ambiguity = binding.is_ambiguity_recursive() && !binding.warn_ambiguity; - if res != def::Res::Err && !error_ambiguity { + if res != def::Res::Err && !binding.is_ambiguity_recursive() { let mut reexport_chain = SmallVec::new(); let mut next_binding = binding; while let NameBindingKind::Import { binding, import, .. } = next_binding.kind { diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 7ce70ee9af8d4..2e617c6f68e39 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -797,9 +797,6 @@ impl<'ra> fmt::Debug for Module<'ra> { struct NameBindingData<'ra> { kind: NameBindingKind<'ra>, ambiguity: Option<(NameBinding<'ra>, AmbiguityKind)>, - /// Produce a warning instead of an error when reporting ambiguities inside this binding. - /// May apply to indirect ambiguities under imports, so `ambiguity.is_some()` is not required. - warn_ambiguity: bool, expansion: LocalExpnId, span: Span, vis: Visibility, @@ -914,7 +911,6 @@ struct AmbiguityError<'ra> { b2: NameBinding<'ra>, misc1: AmbiguityErrorMisc, misc2: AmbiguityErrorMisc, - warning: bool, } impl<'ra> NameBindingData<'ra> { @@ -940,14 +936,6 @@ impl<'ra> NameBindingData<'ra> { } } - fn warn_ambiguity_recursive(&self) -> bool { - self.warn_ambiguity - || match self.kind { - NameBindingKind::Import { binding, .. } => binding.warn_ambiguity_recursive(), - _ => false, - } - } - fn is_possibly_imported_variant(&self) -> bool { match self.kind { NameBindingKind::Import { binding, .. } => binding.is_possibly_imported_variant(), @@ -1321,7 +1309,6 @@ impl<'ra> ResolverArenas<'ra> { self.alloc_name_binding(NameBindingData { kind: NameBindingKind::Res(res), ambiguity: None, - warn_ambiguity: false, vis, span, expansion, @@ -2024,16 +2011,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } fn record_use(&mut self, ident: Ident, used_binding: NameBinding<'ra>, used: Used) { - self.record_use_inner(ident, used_binding, used, used_binding.warn_ambiguity); - } - - fn record_use_inner( - &mut self, - ident: Ident, - used_binding: NameBinding<'ra>, - used: Used, - warn_ambiguity: bool, - ) { if let Some((b2, kind)) = used_binding.ambiguity { let ambiguity_error = AmbiguityError { kind, @@ -2042,7 +2019,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { b2, misc1: AmbiguityErrorMisc::None, misc2: AmbiguityErrorMisc::None, - warning: warn_ambiguity, }; if !self.matches_previous_ambiguity_error(&ambiguity_error) { // avoid duplicated span information to be emit out @@ -2091,12 +2067,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { self.used_imports.insert(id); } self.add_to_glob_map(import, ident); - self.record_use_inner( - ident, - binding, - Used::Other, - warn_ambiguity || binding.warn_ambiguity, - ); + self.record_use(ident, binding, Used::Other); } } diff --git a/tests/ui/imports/ambiguous-1.rs b/tests/ui/imports/ambiguous-1.rs index 31f39eee62b9a..6c8e7da74f967 100644 --- a/tests/ui/imports/ambiguous-1.rs +++ b/tests/ui/imports/ambiguous-1.rs @@ -1,8 +1,5 @@ -//@ check-pass // https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883 -#![warn(ambiguous_glob_imports)] - macro_rules! m { () => { pub fn id() {} @@ -27,6 +24,5 @@ pub use openssl::*; fn main() { id(); - //~^ WARNING `id` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + //~^ ERROR `id` is ambiguous } diff --git a/tests/ui/imports/ambiguous-1.stderr b/tests/ui/imports/ambiguous-1.stderr index 04ff3a36c7467..b891baafe5710 100644 --- a/tests/ui/imports/ambiguous-1.stderr +++ b/tests/ui/imports/ambiguous-1.stderr @@ -1,68 +1,34 @@ -warning: ambiguous glob re-exports - --> $DIR/ambiguous-1.rs:13:13 - | -LL | pub use self::evp::*; - | ^^^^^^^^^^^^ the name `id` in the value namespace is first re-exported here -LL | -LL | pub use self::handwritten::*; - | -------------------- but the name `id` in the value namespace is also re-exported here - | - = note: `#[warn(ambiguous_glob_reexports)]` on by default - -warning: `id` is ambiguous - --> $DIR/ambiguous-1.rs:29:5 +error[E0659]: `id` is ambiguous + --> $DIR/ambiguous-1.rs:26:5 | LL | id(); | ^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here - --> $DIR/ambiguous-1.rs:13:13 + --> $DIR/ambiguous-1.rs:10:13 | LL | pub use self::evp::*; | ^^^^^^^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: `id` could also refer to the function imported here - --> $DIR/ambiguous-1.rs:15:13 + --> $DIR/ambiguous-1.rs:12:13 | LL | pub use self::handwritten::*; | ^^^^^^^^^^^^^^^^^^^^ = help: consider adding an explicit import of `id` to disambiguate -note: the lint level is defined here - --> $DIR/ambiguous-1.rs:4:9 - | -LL | #![warn(ambiguous_glob_imports)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: 2 warnings emitted -Future incompatibility report: Future breakage diagnostic: -warning: `id` is ambiguous - --> $DIR/ambiguous-1.rs:29:5 - | -LL | id(); - | ^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `id` could refer to the function imported here - --> $DIR/ambiguous-1.rs:13:13 +warning: ambiguous glob re-exports + --> $DIR/ambiguous-1.rs:10:13 | LL | pub use self::evp::*; - | ^^^^^^^^^^^^ - = help: consider adding an explicit import of `id` to disambiguate -note: `id` could also refer to the function imported here - --> $DIR/ambiguous-1.rs:15:13 - | + | ^^^^^^^^^^^^ the name `id` in the value namespace is first re-exported here +LL | LL | pub use self::handwritten::*; - | ^^^^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `id` to disambiguate -note: the lint level is defined here - --> $DIR/ambiguous-1.rs:4:9 + | -------------------- but the name `id` in the value namespace is also re-exported here | -LL | #![warn(ambiguous_glob_imports)] - | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(ambiguous_glob_reexports)]` on by default + +error: aborting due to 1 previous error; 1 warning emitted +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-10.rs b/tests/ui/imports/ambiguous-10.rs index 166b01ede12d3..cbc8ce3a13c62 100644 --- a/tests/ui/imports/ambiguous-10.rs +++ b/tests/ui/imports/ambiguous-10.rs @@ -14,5 +14,5 @@ use crate::a::*; use crate::b::*; fn c(_: Token) {} //~^ ERROR `Token` is ambiguous -//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + fn main() { } diff --git a/tests/ui/imports/ambiguous-10.stderr b/tests/ui/imports/ambiguous-10.stderr index f175d27c99e98..e3f126d338c49 100644 --- a/tests/ui/imports/ambiguous-10.stderr +++ b/tests/ui/imports/ambiguous-10.stderr @@ -1,11 +1,9 @@ -error: `Token` is ambiguous +error[E0659]: `Token` is ambiguous --> $DIR/ambiguous-10.rs:15:9 | LL | fn c(_: Token) {} | ^^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `Token` could refer to the enum imported here --> $DIR/ambiguous-10.rs:13:5 @@ -19,31 +17,7 @@ note: `Token` could also refer to the enum imported here LL | use crate::b::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `Token` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `Token` is ambiguous - --> $DIR/ambiguous-10.rs:15:9 - | -LL | fn c(_: Token) {} - | ^^^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `Token` could refer to the enum imported here - --> $DIR/ambiguous-10.rs:13:5 - | -LL | use crate::a::*; - | ^^^^^^^^^^^ - = help: consider adding an explicit import of `Token` to disambiguate -note: `Token` could also refer to the enum imported here - --> $DIR/ambiguous-10.rs:14:5 - | -LL | use crate::b::*; - | ^^^^^^^^^^^ - = help: consider adding an explicit import of `Token` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-12.rs b/tests/ui/imports/ambiguous-12.rs index 543396b8dfe5c..54bdf26e88cce 100644 --- a/tests/ui/imports/ambiguous-12.rs +++ b/tests/ui/imports/ambiguous-12.rs @@ -20,5 +20,4 @@ use crate::public::*; fn main() { b(); //~^ ERROR `b` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } diff --git a/tests/ui/imports/ambiguous-12.stderr b/tests/ui/imports/ambiguous-12.stderr index 5f92eae0dbcb1..099abd66e8a3c 100644 --- a/tests/ui/imports/ambiguous-12.stderr +++ b/tests/ui/imports/ambiguous-12.stderr @@ -1,11 +1,9 @@ -error: `b` is ambiguous +error[E0659]: `b` is ambiguous --> $DIR/ambiguous-12.rs:21:5 | LL | b(); | ^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `b` could refer to the function imported here --> $DIR/ambiguous-12.rs:17:5 @@ -19,31 +17,7 @@ note: `b` could also refer to the function imported here LL | use crate::public::*; | ^^^^^^^^^^^^^^^^ = help: consider adding an explicit import of `b` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `b` is ambiguous - --> $DIR/ambiguous-12.rs:21:5 - | -LL | b(); - | ^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `b` could refer to the function imported here - --> $DIR/ambiguous-12.rs:17:5 - | -LL | use crate::ciphertext::*; - | ^^^^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `b` to disambiguate -note: `b` could also refer to the function imported here - --> $DIR/ambiguous-12.rs:18:5 - | -LL | use crate::public::*; - | ^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `b` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-13.rs b/tests/ui/imports/ambiguous-13.rs index 3569dd5d9adc2..dc58bbbc63d57 100644 --- a/tests/ui/imports/ambiguous-13.rs +++ b/tests/ui/imports/ambiguous-13.rs @@ -17,5 +17,5 @@ use crate::content::*; fn a(_: Rect) {} //~^ ERROR `Rect` is ambiguous -//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + fn main() { } diff --git a/tests/ui/imports/ambiguous-13.stderr b/tests/ui/imports/ambiguous-13.stderr index 279b4e8f1420a..1d105eec0e36f 100644 --- a/tests/ui/imports/ambiguous-13.stderr +++ b/tests/ui/imports/ambiguous-13.stderr @@ -1,11 +1,9 @@ -error: `Rect` is ambiguous +error[E0659]: `Rect` is ambiguous --> $DIR/ambiguous-13.rs:18:9 | LL | fn a(_: Rect) {} | ^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `Rect` could refer to the struct imported here --> $DIR/ambiguous-13.rs:15:5 @@ -19,31 +17,7 @@ note: `Rect` could also refer to the struct imported here LL | use crate::content::*; | ^^^^^^^^^^^^^^^^^ = help: consider adding an explicit import of `Rect` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `Rect` is ambiguous - --> $DIR/ambiguous-13.rs:18:9 - | -LL | fn a(_: Rect) {} - | ^^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `Rect` could refer to the struct imported here - --> $DIR/ambiguous-13.rs:15:5 - | -LL | use crate::object::*; - | ^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `Rect` to disambiguate -note: `Rect` could also refer to the struct imported here - --> $DIR/ambiguous-13.rs:16:5 - | -LL | use crate::content::*; - | ^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `Rect` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-14.rs b/tests/ui/imports/ambiguous-14.rs index f752387aa7e1b..4a4c8ef4ea93e 100644 --- a/tests/ui/imports/ambiguous-14.rs +++ b/tests/ui/imports/ambiguous-14.rs @@ -21,5 +21,4 @@ mod g { fn main() { g::foo(); //~^ ERROR `foo` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } diff --git a/tests/ui/imports/ambiguous-14.stderr b/tests/ui/imports/ambiguous-14.stderr index ef7e2669bae4c..7c07ec419a407 100644 --- a/tests/ui/imports/ambiguous-14.stderr +++ b/tests/ui/imports/ambiguous-14.stderr @@ -1,11 +1,9 @@ -error: `foo` is ambiguous +error[E0659]: `foo` is ambiguous --> $DIR/ambiguous-14.rs:22:8 | LL | g::foo(); | ^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `foo` could refer to the function imported here --> $DIR/ambiguous-14.rs:12:13 @@ -19,31 +17,7 @@ note: `foo` could also refer to the function imported here LL | pub use b::*; | ^^^^ = help: consider adding an explicit import of `foo` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `foo` is ambiguous - --> $DIR/ambiguous-14.rs:22:8 - | -LL | g::foo(); - | ^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `foo` could refer to the function imported here - --> $DIR/ambiguous-14.rs:12:13 - | -LL | pub use a::*; - | ^^^^ - = help: consider adding an explicit import of `foo` to disambiguate -note: `foo` could also refer to the function imported here - --> $DIR/ambiguous-14.rs:13:13 - | -LL | pub use b::*; - | ^^^^ - = help: consider adding an explicit import of `foo` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-15.rs b/tests/ui/imports/ambiguous-15.rs index 07d8893b2dead..72c2940573c6b 100644 --- a/tests/ui/imports/ambiguous-15.rs +++ b/tests/ui/imports/ambiguous-15.rs @@ -21,6 +21,5 @@ mod t3 { use self::t3::*; fn a(_: E) {} //~^ ERROR `Error` is ambiguous -//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! fn main() {} diff --git a/tests/ui/imports/ambiguous-15.stderr b/tests/ui/imports/ambiguous-15.stderr index 15f83546532ec..fb3551d76274c 100644 --- a/tests/ui/imports/ambiguous-15.stderr +++ b/tests/ui/imports/ambiguous-15.stderr @@ -1,11 +1,9 @@ -error: `Error` is ambiguous +error[E0659]: `Error` is ambiguous --> $DIR/ambiguous-15.rs:22:9 | LL | fn a(_: E) {} | ^^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `Error` could refer to the trait imported here --> $DIR/ambiguous-15.rs:21:5 @@ -19,31 +17,7 @@ note: `Error` could also refer to the enum imported here LL | pub use t2::*; | ^^^^^ = help: consider adding an explicit import of `Error` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `Error` is ambiguous - --> $DIR/ambiguous-15.rs:22:9 - | -LL | fn a(_: E) {} - | ^^^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `Error` could refer to the trait imported here - --> $DIR/ambiguous-15.rs:21:5 - | -LL | use self::t3::*; - | ^^^^^^^^^^^ - = help: consider adding an explicit import of `Error` to disambiguate -note: `Error` could also refer to the enum imported here - --> $DIR/ambiguous-15.rs:15:9 - | -LL | pub use t2::*; - | ^^^^^ - = help: consider adding an explicit import of `Error` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-16.rs b/tests/ui/imports/ambiguous-16.rs index f31c78d18a380..a20c0e340d601 100644 --- a/tests/ui/imports/ambiguous-16.rs +++ b/tests/ui/imports/ambiguous-16.rs @@ -21,6 +21,5 @@ mod framing { use crate::framing::ConfirmedTranscriptHashInput; //~^ ERROR `ConfirmedTranscriptHashInput` is ambiguous -//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! fn main() { } diff --git a/tests/ui/imports/ambiguous-16.stderr b/tests/ui/imports/ambiguous-16.stderr index 7c80dee17f040..c18242d4a3cfc 100644 --- a/tests/ui/imports/ambiguous-16.stderr +++ b/tests/ui/imports/ambiguous-16.stderr @@ -1,11 +1,9 @@ -error: `ConfirmedTranscriptHashInput` is ambiguous +error[E0659]: `ConfirmedTranscriptHashInput` is ambiguous --> $DIR/ambiguous-16.rs:22:21 | LL | use crate::framing::ConfirmedTranscriptHashInput; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `ConfirmedTranscriptHashInput` could refer to the struct imported here --> $DIR/ambiguous-16.rs:18:13 @@ -19,31 +17,7 @@ note: `ConfirmedTranscriptHashInput` could also refer to the struct imported her LL | pub use self::public_message_in::*; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `ConfirmedTranscriptHashInput` is ambiguous - --> $DIR/ambiguous-16.rs:22:21 - | -LL | use crate::framing::ConfirmedTranscriptHashInput; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `ConfirmedTranscriptHashInput` could refer to the struct imported here - --> $DIR/ambiguous-16.rs:18:13 - | -LL | pub use self::public_message::*; - | ^^^^^^^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate -note: `ConfirmedTranscriptHashInput` could also refer to the struct imported here - --> $DIR/ambiguous-16.rs:19:13 - | -LL | pub use self::public_message_in::*; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-17.rs b/tests/ui/imports/ambiguous-17.rs index 520ac70c6f10b..25ed4e349b53a 100644 --- a/tests/ui/imports/ambiguous-17.rs +++ b/tests/ui/imports/ambiguous-17.rs @@ -24,5 +24,4 @@ mod handwritten { fn main() { id(); //~^ ERROR `id` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } diff --git a/tests/ui/imports/ambiguous-17.stderr b/tests/ui/imports/ambiguous-17.stderr index 38491ce10628d..1afda0b258335 100644 --- a/tests/ui/imports/ambiguous-17.stderr +++ b/tests/ui/imports/ambiguous-17.stderr @@ -1,21 +1,9 @@ -warning: ambiguous glob re-exports - --> $DIR/ambiguous-17.rs:3:9 - | -LL | pub use evp::*; - | ^^^^^^ the name `id` in the value namespace is first re-exported here -LL | pub use handwritten::*; - | -------------- but the name `id` in the value namespace is also re-exported here - | - = note: `#[warn(ambiguous_glob_reexports)]` on by default - -error: `id` is ambiguous +error[E0659]: `id` is ambiguous --> $DIR/ambiguous-17.rs:25:5 | LL | id(); | ^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here --> $DIR/ambiguous-17.rs:3:9 @@ -29,31 +17,17 @@ note: `id` could also refer to the function imported here LL | pub use handwritten::*; | ^^^^^^^^^^^^^^ = help: consider adding an explicit import of `id` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - -error: aborting due to 1 previous error; 1 warning emitted -Future incompatibility report: Future breakage diagnostic: -error: `id` is ambiguous - --> $DIR/ambiguous-17.rs:25:5 - | -LL | id(); - | ^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `id` could refer to the function imported here +warning: ambiguous glob re-exports --> $DIR/ambiguous-17.rs:3:9 | LL | pub use evp::*; - | ^^^^^^ - = help: consider adding an explicit import of `id` to disambiguate -note: `id` could also refer to the function imported here - --> $DIR/ambiguous-17.rs:4:9 - | + | ^^^^^^ the name `id` in the value namespace is first re-exported here LL | pub use handwritten::*; - | ^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `id` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default + | -------------- but the name `id` in the value namespace is also re-exported here + | + = note: `#[warn(ambiguous_glob_reexports)]` on by default + +error: aborting due to 1 previous error; 1 warning emitted +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-2.rs b/tests/ui/imports/ambiguous-2.rs deleted file mode 100644 index 087431485ad62..0000000000000 --- a/tests/ui/imports/ambiguous-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ check-pass -//@ aux-build: ../ambiguous-1.rs -// https://github.com/rust-lang/rust/pull/113099#issuecomment-1633574396 - -extern crate ambiguous_1; - -fn main() { - ambiguous_1::id(); - //^ FIXME: `id` should be identified as an ambiguous item. -} diff --git a/tests/ui/imports/ambiguous-3.rs b/tests/ui/imports/ambiguous-3.rs index ff0dcc221ec05..4919d9fbac63d 100644 --- a/tests/ui/imports/ambiguous-3.rs +++ b/tests/ui/imports/ambiguous-3.rs @@ -4,7 +4,6 @@ fn main() { use a::*; x(); //~^ ERROR `x` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } mod a { diff --git a/tests/ui/imports/ambiguous-3.stderr b/tests/ui/imports/ambiguous-3.stderr index 27fa05a195b94..6c3031a9807aa 100644 --- a/tests/ui/imports/ambiguous-3.stderr +++ b/tests/ui/imports/ambiguous-3.stderr @@ -1,49 +1,23 @@ -error: `x` is ambiguous +error[E0659]: `x` is ambiguous --> $DIR/ambiguous-3.rs:5:5 | LL | x(); | ^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `x` could refer to the function imported here - --> $DIR/ambiguous-3.rs:18:13 + --> $DIR/ambiguous-3.rs:17:13 | LL | pub use self::b::*; | ^^^^^^^^^^ = help: consider adding an explicit import of `x` to disambiguate note: `x` could also refer to the function imported here - --> $DIR/ambiguous-3.rs:19:13 + --> $DIR/ambiguous-3.rs:18:13 | LL | pub use self::c::*; | ^^^^^^^^^^ = help: consider adding an explicit import of `x` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `x` is ambiguous - --> $DIR/ambiguous-3.rs:5:5 - | -LL | x(); - | ^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `x` could refer to the function imported here - --> $DIR/ambiguous-3.rs:18:13 - | -LL | pub use self::b::*; - | ^^^^^^^^^^ - = help: consider adding an explicit import of `x` to disambiguate -note: `x` could also refer to the function imported here - --> $DIR/ambiguous-3.rs:19:13 - | -LL | pub use self::c::*; - | ^^^^^^^^^^ - = help: consider adding an explicit import of `x` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-4-extern.rs b/tests/ui/imports/ambiguous-4-extern.rs index bc856af852d61..e7a4924f0178b 100644 --- a/tests/ui/imports/ambiguous-4-extern.rs +++ b/tests/ui/imports/ambiguous-4-extern.rs @@ -1,8 +1,5 @@ -//@ check-pass // https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883 -#![warn(ambiguous_glob_imports)] - macro_rules! m { () => { pub fn id() {} @@ -23,6 +20,5 @@ mod handwritten { fn main() { id(); - //~^ WARNING `id` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + //~^ ERROR `id` is ambiguous } diff --git a/tests/ui/imports/ambiguous-4-extern.stderr b/tests/ui/imports/ambiguous-4-extern.stderr index a9427ac03504b..ee12343762e98 100644 --- a/tests/ui/imports/ambiguous-4-extern.stderr +++ b/tests/ui/imports/ambiguous-4-extern.stderr @@ -1,67 +1,33 @@ -warning: ambiguous glob re-exports - --> $DIR/ambiguous-4-extern.rs:12:9 - | -LL | pub use evp::*; - | ^^^^^^ the name `id` in the value namespace is first re-exported here -LL | pub use handwritten::*; - | -------------- but the name `id` in the value namespace is also re-exported here - | - = note: `#[warn(ambiguous_glob_reexports)]` on by default - -warning: `id` is ambiguous - --> $DIR/ambiguous-4-extern.rs:25:5 +error[E0659]: `id` is ambiguous + --> $DIR/ambiguous-4-extern.rs:22:5 | LL | id(); | ^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `id` could refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:12:9 + --> $DIR/ambiguous-4-extern.rs:9:9 | LL | pub use evp::*; | ^^^^^^ = help: consider adding an explicit import of `id` to disambiguate note: `id` could also refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:13:9 + --> $DIR/ambiguous-4-extern.rs:10:9 | LL | pub use handwritten::*; | ^^^^^^^^^^^^^^ = help: consider adding an explicit import of `id` to disambiguate -note: the lint level is defined here - --> $DIR/ambiguous-4-extern.rs:4:9 - | -LL | #![warn(ambiguous_glob_imports)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: 2 warnings emitted -Future incompatibility report: Future breakage diagnostic: -warning: `id` is ambiguous - --> $DIR/ambiguous-4-extern.rs:25:5 - | -LL | id(); - | ^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `id` could refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:12:9 +warning: ambiguous glob re-exports + --> $DIR/ambiguous-4-extern.rs:9:9 | LL | pub use evp::*; - | ^^^^^^ - = help: consider adding an explicit import of `id` to disambiguate -note: `id` could also refer to the function imported here - --> $DIR/ambiguous-4-extern.rs:13:9 - | + | ^^^^^^ the name `id` in the value namespace is first re-exported here LL | pub use handwritten::*; - | ^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `id` to disambiguate -note: the lint level is defined here - --> $DIR/ambiguous-4-extern.rs:4:9 + | -------------- but the name `id` in the value namespace is also re-exported here | -LL | #![warn(ambiguous_glob_imports)] - | ^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(ambiguous_glob_reexports)]` on by default + +error: aborting due to 1 previous error; 1 warning emitted +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-4.rs b/tests/ui/imports/ambiguous-4.rs deleted file mode 100644 index 3a9a14bfb524e..0000000000000 --- a/tests/ui/imports/ambiguous-4.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ check-pass -//@ aux-build: ../ambiguous-4-extern.rs - -extern crate ambiguous_4_extern; - -fn main() { - ambiguous_4_extern::id(); - //^ FIXME: `id` should be identified as an ambiguous item. -} diff --git a/tests/ui/imports/ambiguous-5.rs b/tests/ui/imports/ambiguous-5.rs index 8f89c966d4a5d..a88dbf46ddab9 100644 --- a/tests/ui/imports/ambiguous-5.rs +++ b/tests/ui/imports/ambiguous-5.rs @@ -11,7 +11,6 @@ mod gpos { use super::*; struct MarkRecord(Class); //~^ ERROR`Class` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } mod gsubgpos { diff --git a/tests/ui/imports/ambiguous-5.stderr b/tests/ui/imports/ambiguous-5.stderr index 1fc5f4543f358..e2dfe4d2dea85 100644 --- a/tests/ui/imports/ambiguous-5.stderr +++ b/tests/ui/imports/ambiguous-5.stderr @@ -1,11 +1,9 @@ -error: `Class` is ambiguous +error[E0659]: `Class` is ambiguous --> $DIR/ambiguous-5.rs:12:23 | LL | struct MarkRecord(Class); | ^^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `Class` could refer to the struct imported here --> $DIR/ambiguous-5.rs:11:9 @@ -19,31 +17,7 @@ note: `Class` could also refer to the struct imported here LL | use super::gsubgpos::*; | ^^^^^^^^^^^^^^^^^^ = help: consider adding an explicit import of `Class` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `Class` is ambiguous - --> $DIR/ambiguous-5.rs:12:23 - | -LL | struct MarkRecord(Class); - | ^^^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `Class` could refer to the struct imported here - --> $DIR/ambiguous-5.rs:11:9 - | -LL | use super::*; - | ^^^^^^^^ - = help: consider adding an explicit import of `Class` to disambiguate -note: `Class` could also refer to the struct imported here - --> $DIR/ambiguous-5.rs:10:9 - | -LL | use super::gsubgpos::*; - | ^^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `Class` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-6.rs b/tests/ui/imports/ambiguous-6.rs index 1c6e34377165a..71667a8f3bb80 100644 --- a/tests/ui/imports/ambiguous-6.rs +++ b/tests/ui/imports/ambiguous-6.rs @@ -5,7 +5,6 @@ pub fn foo() -> u32 { use sub::*; C //~^ ERROR `C` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } mod sub { diff --git a/tests/ui/imports/ambiguous-6.stderr b/tests/ui/imports/ambiguous-6.stderr index 681bc40931f52..f1a4fb694c9a0 100644 --- a/tests/ui/imports/ambiguous-6.stderr +++ b/tests/ui/imports/ambiguous-6.stderr @@ -1,49 +1,23 @@ -error: `C` is ambiguous +error[E0659]: `C` is ambiguous --> $DIR/ambiguous-6.rs:6:5 | LL | C | ^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `C` could refer to the constant imported here - --> $DIR/ambiguous-6.rs:15:13 + --> $DIR/ambiguous-6.rs:14:13 | LL | pub use mod1::*; | ^^^^^^^ = help: consider adding an explicit import of `C` to disambiguate note: `C` could also refer to the constant imported here - --> $DIR/ambiguous-6.rs:16:13 + --> $DIR/ambiguous-6.rs:15:13 | LL | pub use mod2::*; | ^^^^^^^ = help: consider adding an explicit import of `C` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default error: aborting due to 1 previous error -Future incompatibility report: Future breakage diagnostic: -error: `C` is ambiguous - --> $DIR/ambiguous-6.rs:6:5 - | -LL | C - | ^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `C` could refer to the constant imported here - --> $DIR/ambiguous-6.rs:15:13 - | -LL | pub use mod1::*; - | ^^^^^^^ - = help: consider adding an explicit import of `C` to disambiguate -note: `C` could also refer to the constant imported here - --> $DIR/ambiguous-6.rs:16:13 - | -LL | pub use mod2::*; - | ^^^^^^^ - = help: consider adding an explicit import of `C` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/ambiguous-9.rs b/tests/ui/imports/ambiguous-9.rs index c10b1268060ce..58796031bf18f 100644 --- a/tests/ui/imports/ambiguous-9.rs +++ b/tests/ui/imports/ambiguous-9.rs @@ -22,7 +22,5 @@ use prelude::*; fn main() { date_range(); //~^ ERROR `date_range` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //~| ERROR `date_range` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } diff --git a/tests/ui/imports/ambiguous-9.stderr b/tests/ui/imports/ambiguous-9.stderr index 800a2e10c9d78..b6e4c30a8d410 100644 --- a/tests/ui/imports/ambiguous-9.stderr +++ b/tests/ui/imports/ambiguous-9.stderr @@ -1,52 +1,9 @@ -warning: ambiguous glob re-exports - --> $DIR/ambiguous-9.rs:7:13 - | -LL | pub use self::range::*; - | ^^^^^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here -LL | use super::prelude::*; - | ----------------- but the name `date_range` in the value namespace is also re-exported here - | - = note: `#[warn(ambiguous_glob_reexports)]` on by default - -error: `date_range` is ambiguous - --> $DIR/ambiguous-9.rs:23:5 - | -LL | date_range(); - | ^^^^^^^^^^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `date_range` could refer to the function imported here - --> $DIR/ambiguous-9.rs:7:13 - | -LL | pub use self::range::*; - | ^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `date_range` to disambiguate -note: `date_range` could also refer to the function imported here - --> $DIR/ambiguous-9.rs:8:9 - | -LL | use super::prelude::*; - | ^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `date_range` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - -warning: ambiguous glob re-exports - --> $DIR/ambiguous-9.rs:15:13 - | -LL | pub use self::t::*; - | ^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here -LL | pub use super::dsl::*; - | ------------- but the name `date_range` in the value namespace is also re-exported here - -error: `date_range` is ambiguous +error[E0659]: `date_range` is ambiguous --> $DIR/ambiguous-9.rs:23:5 | LL | date_range(); | ^^^^^^^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `date_range` could refer to the function imported here --> $DIR/ambiguous-9.rs:19:5 @@ -61,17 +18,12 @@ LL | use prelude::*; | ^^^^^^^^^^ = help: consider adding an explicit import of `date_range` to disambiguate -error: aborting due to 2 previous errors; 2 warnings emitted - -Future incompatibility report: Future breakage diagnostic: -error: `date_range` is ambiguous +error[E0659]: `date_range` is ambiguous --> $DIR/ambiguous-9.rs:23:5 | LL | date_range(); | ^^^^^^^^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `date_range` could refer to the function imported here --> $DIR/ambiguous-9.rs:7:13 @@ -85,29 +37,25 @@ note: `date_range` could also refer to the function imported here LL | use super::prelude::*; | ^^^^^^^^^^^^^^^^^ = help: consider adding an explicit import of `date_range` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default -Future breakage diagnostic: -error: `date_range` is ambiguous - --> $DIR/ambiguous-9.rs:23:5 - | -LL | date_range(); - | ^^^^^^^^^^ ambiguous name +warning: ambiguous glob re-exports + --> $DIR/ambiguous-9.rs:7:13 | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `date_range` could refer to the function imported here - --> $DIR/ambiguous-9.rs:19:5 +LL | pub use self::range::*; + | ^^^^^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here +LL | use super::prelude::*; + | ----------------- but the name `date_range` in the value namespace is also re-exported here | -LL | use dsl::*; - | ^^^^^^ - = help: consider adding an explicit import of `date_range` to disambiguate -note: `date_range` could also refer to the function imported here - --> $DIR/ambiguous-9.rs:20:5 + = note: `#[warn(ambiguous_glob_reexports)]` on by default + +warning: ambiguous glob re-exports + --> $DIR/ambiguous-9.rs:15:13 | -LL | use prelude::*; - | ^^^^^^^^^^ - = help: consider adding an explicit import of `date_range` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default +LL | pub use self::t::*; + | ^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here +LL | pub use super::dsl::*; + | ------------- but the name `date_range` in the value namespace is also re-exported here + +error: aborting due to 2 previous errors; 2 warnings emitted +For more information about this error, try `rustc --explain E0659`. diff --git a/tests/ui/imports/duplicate.rs b/tests/ui/imports/duplicate.rs index 0a652889ca8ad..be089dbf5a4af 100644 --- a/tests/ui/imports/duplicate.rs +++ b/tests/ui/imports/duplicate.rs @@ -35,7 +35,6 @@ fn main() { f::foo(); //~ ERROR `foo` is ambiguous g::foo(); //~^ ERROR `foo` is ambiguous - //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! } mod ambiguous_module_errors { diff --git a/tests/ui/imports/duplicate.stderr b/tests/ui/imports/duplicate.stderr index 5cd3b0c2c8a55..7bff44109e40b 100644 --- a/tests/ui/imports/duplicate.stderr +++ b/tests/ui/imports/duplicate.stderr @@ -9,20 +9,20 @@ LL | use crate::a::foo; = note: `foo` must be defined only once in the value namespace of this module error[E0659]: `foo` is ambiguous - --> $DIR/duplicate.rs:48:15 + --> $DIR/duplicate.rs:47:15 | LL | use self::foo::bar; | ^^^ ambiguous name | = note: ambiguous because of multiple glob imports of a name in the same module note: `foo` could refer to the module imported here - --> $DIR/duplicate.rs:45:9 + --> $DIR/duplicate.rs:44:9 | LL | use self::m1::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `foo` to disambiguate note: `foo` could also refer to the module imported here - --> $DIR/duplicate.rs:46:9 + --> $DIR/duplicate.rs:45:9 | LL | use self::m2::*; | ^^^^^^^^^^^ @@ -49,33 +49,11 @@ LL | pub use crate::b::*; = help: consider adding an explicit import of `foo` to disambiguate error[E0659]: `foo` is ambiguous - --> $DIR/duplicate.rs:51:9 - | -LL | foo::bar(); - | ^^^ ambiguous name - | - = note: ambiguous because of multiple glob imports of a name in the same module -note: `foo` could refer to the module imported here - --> $DIR/duplicate.rs:45:9 - | -LL | use self::m1::*; - | ^^^^^^^^^^^ - = help: consider adding an explicit import of `foo` to disambiguate -note: `foo` could also refer to the module imported here - --> $DIR/duplicate.rs:46:9 - | -LL | use self::m2::*; - | ^^^^^^^^^^^ - = help: consider adding an explicit import of `foo` to disambiguate - -error: `foo` is ambiguous --> $DIR/duplicate.rs:36:8 | LL | g::foo(); | ^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `foo` could refer to the function imported here --> $DIR/duplicate.rs:24:13 @@ -89,33 +67,28 @@ note: `foo` could also refer to the function imported here LL | pub use crate::b::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `foo` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - -error: aborting due to 5 previous errors -Some errors have detailed explanations: E0252, E0659. -For more information about an error, try `rustc --explain E0252`. -Future incompatibility report: Future breakage diagnostic: -error: `foo` is ambiguous - --> $DIR/duplicate.rs:36:8 +error[E0659]: `foo` is ambiguous + --> $DIR/duplicate.rs:50:9 | -LL | g::foo(); - | ^^^ ambiguous name +LL | foo::bar(); + | ^^^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module -note: `foo` could refer to the function imported here - --> $DIR/duplicate.rs:24:13 +note: `foo` could refer to the module imported here + --> $DIR/duplicate.rs:44:9 | -LL | pub use crate::a::*; - | ^^^^^^^^^^^ +LL | use self::m1::*; + | ^^^^^^^^^^^ = help: consider adding an explicit import of `foo` to disambiguate -note: `foo` could also refer to the function imported here - --> $DIR/duplicate.rs:25:13 +note: `foo` could also refer to the module imported here + --> $DIR/duplicate.rs:45:9 | -LL | pub use crate::b::*; - | ^^^^^^^^^^^ +LL | use self::m2::*; + | ^^^^^^^^^^^ = help: consider adding an explicit import of `foo` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0252, E0659. +For more information about an error, try `rustc --explain E0252`. diff --git a/tests/ui/imports/import-after-macro-expand-10.rs b/tests/ui/imports/import-after-macro-expand-10.rs index eb04936a5feb7..3dd55bc20d2aa 100644 --- a/tests/ui/imports/import-after-macro-expand-10.rs +++ b/tests/ui/imports/import-after-macro-expand-10.rs @@ -1,5 +1,3 @@ -//@ check-pass - mod b { pub mod http { pub struct HeaderMap; @@ -14,4 +12,6 @@ use crate::b::*; fn main() { let h: crate::b::HeaderMap = HeaderMap; + //~^ ERROR `HeaderMap` is ambiguous + //~| ERROR mismatched types } diff --git a/tests/ui/imports/import-after-macro-expand-10.stderr b/tests/ui/imports/import-after-macro-expand-10.stderr new file mode 100644 index 0000000000000..34009d8a2c2f8 --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-10.stderr @@ -0,0 +1,44 @@ +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-10.rs:14:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the unit struct imported here + --> $DIR/import-after-macro-expand-10.rs:11:5 + | +LL | use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the unit struct imported here + --> $DIR/import-after-macro-expand-10.rs:11:5 + | +LL | use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-10.rs:14:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ------------------- ^^^^^^^^^ expected `b::HeaderMap`, found `http::HeaderMap` + | | + | expected due to this + | + = note: `http::HeaderMap` and `b::HeaderMap` have similar names, but are actually distinct types +note: `http::HeaderMap` is defined in module `crate::b::http` of the current crate + --> $DIR/import-after-macro-expand-10.rs:3:9 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ +note: `b::HeaderMap` is defined in module `crate::b` of the current crate + --> $DIR/import-after-macro-expand-10.rs:8:5 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/import-after-macro-expand-11.rs b/tests/ui/imports/import-after-macro-expand-11.rs index 897c3001cc928..05b451a09065d 100644 --- a/tests/ui/imports/import-after-macro-expand-11.rs +++ b/tests/ui/imports/import-after-macro-expand-11.rs @@ -1,5 +1,3 @@ -//@ check-pass - #[derive(Debug)] struct H; @@ -14,6 +12,8 @@ mod p { fn f() { let h: crate::p::H = H; + //~^ ERROR `H` is ambiguous + //~| ERROR mismatched types } } } diff --git a/tests/ui/imports/import-after-macro-expand-11.stderr b/tests/ui/imports/import-after-macro-expand-11.stderr new file mode 100644 index 0000000000000..53c37f1915daa --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-11.stderr @@ -0,0 +1,44 @@ +error[E0659]: `H` is ambiguous + --> $DIR/import-after-macro-expand-11.rs:14:33 + | +LL | let h: crate::p::H = H; + | ^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `H` could refer to the unit struct imported here + --> $DIR/import-after-macro-expand-11.rs:11:13 + | +LL | use super::*; + | ^^^^^^^^ + = help: consider adding an explicit import of `H` to disambiguate +note: `H` could also refer to the unit struct imported here + --> $DIR/import-after-macro-expand-11.rs:11:13 + | +LL | use super::*; + | ^^^^^^^^ + = help: consider adding an explicit import of `H` to disambiguate + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-11.rs:14:33 + | +LL | let h: crate::p::H = H; + | ----------- ^ expected `p::H`, found `H` + | | + | expected due to this + | + = note: `H` and `p::H` have similar names, but are actually distinct types +note: `H` is defined in module `crate` of the current crate + --> $DIR/import-after-macro-expand-11.rs:2:1 + | +LL | struct H; + | ^^^^^^^^ +note: `p::H` is defined in module `crate::p` of the current crate + --> $DIR/import-after-macro-expand-11.rs:8:5 + | +LL | struct H; + | ^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/import-after-macro-expand-12.rs b/tests/ui/imports/import-after-macro-expand-12.rs index 894423815287c..fd3ee1ca5660e 100644 --- a/tests/ui/imports/import-after-macro-expand-12.rs +++ b/tests/ui/imports/import-after-macro-expand-12.rs @@ -1,4 +1,3 @@ -//@ check-pass // https://github.com/rust-lang/rust/issues/115377 use module::*; @@ -26,6 +25,8 @@ fn main() { let a: u16 = { use self::*; B::ASSOC + //~^ ERROR `B` is ambiguous + //~| ERROR mismatched types }; let b: u16 = m!({ use self::*; diff --git a/tests/ui/imports/import-after-macro-expand-12.stderr b/tests/ui/imports/import-after-macro-expand-12.stderr new file mode 100644 index 0000000000000..5e4488cef7828 --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-12.stderr @@ -0,0 +1,35 @@ +error[E0659]: `B` is ambiguous + --> $DIR/import-after-macro-expand-12.rs:27:9 + | +LL | B::ASSOC + | ^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `B` could refer to the enum imported here + --> $DIR/import-after-macro-expand-12.rs:26:13 + | +LL | use self::*; + | ^^^^^^^ + = help: consider adding an explicit import of `B` to disambiguate +note: `B` could also refer to the enum imported here + --> $DIR/import-after-macro-expand-12.rs:26:13 + | +LL | use self::*; + | ^^^^^^^ + = help: consider adding an explicit import of `B` to disambiguate + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-12.rs:27:9 + | +LL | B::ASSOC + | ^^^^^^^^ expected `u16`, found `u8` + | +help: you can convert a `u8` to a `u16` + | +LL | B::ASSOC.into() + | +++++++ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/import-after-macro-expand-13.rs b/tests/ui/imports/import-after-macro-expand-13.rs index 016d897732d9f..55cd599070eff 100644 --- a/tests/ui/imports/import-after-macro-expand-13.rs +++ b/tests/ui/imports/import-after-macro-expand-13.rs @@ -1,7 +1,7 @@ -//@ check-pass // similar as `import-after-macro-expand-6.rs` use crate::a::HeaderMap; +//~^ ERROR `HeaderMap` is ambiguous mod b { pub mod http { @@ -19,4 +19,6 @@ mod a { fn main() { let h: crate::b::HeaderMap = HeaderMap; + //~^ ERROR `HeaderMap` is ambiguous + //~| ERROR mismatched types } diff --git a/tests/ui/imports/import-after-macro-expand-13.stderr b/tests/ui/imports/import-after-macro-expand-13.stderr new file mode 100644 index 0000000000000..6ea8dad219286 --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-13.stderr @@ -0,0 +1,64 @@ +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-13.rs:3:15 + | +LL | use crate::a::HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the struct imported here + --> $DIR/import-after-macro-expand-13.rs:17:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the struct imported here + --> $DIR/import-after-macro-expand-13.rs:17:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-13.rs:21:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the unit struct imported here + --> $DIR/import-after-macro-expand-13.rs:17:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the unit struct imported here + --> $DIR/import-after-macro-expand-13.rs:17:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-13.rs:21:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ------------------- ^^^^^^^^^ expected `b::HeaderMap`, found `http::HeaderMap` + | | + | expected due to this + | + = note: `http::HeaderMap` and `b::HeaderMap` have similar names, but are actually distinct types +note: `http::HeaderMap` is defined in module `crate::b::http` of the current crate + --> $DIR/import-after-macro-expand-13.rs:8:9 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ +note: `b::HeaderMap` is defined in module `crate::b` of the current crate + --> $DIR/import-after-macro-expand-13.rs:13:5 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/import-after-macro-expand-14.rs b/tests/ui/imports/import-after-macro-expand-14.rs index 0af312f375efa..bd347d0a201ca 100644 --- a/tests/ui/imports/import-after-macro-expand-14.rs +++ b/tests/ui/imports/import-after-macro-expand-14.rs @@ -1,6 +1,5 @@ -//@ check-pass - use crate::a::HeaderMap; +//~^ ERROR `HeaderMap` is ambiguous mod b { pub mod http { @@ -19,4 +18,6 @@ mod a { fn main() { let h: crate::b::HeaderMap = HeaderMap; + //~^ ERROR `HeaderMap` is ambiguous + //~| ERROR mismatched types } diff --git a/tests/ui/imports/import-after-macro-expand-14.stderr b/tests/ui/imports/import-after-macro-expand-14.stderr new file mode 100644 index 0000000000000..dff62d8a97209 --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-14.stderr @@ -0,0 +1,64 @@ +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-14.rs:1:15 + | +LL | use crate::a::HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the struct imported here + --> $DIR/import-after-macro-expand-14.rs:16:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the struct imported here + --> $DIR/import-after-macro-expand-14.rs:16:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-14.rs:20:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the unit struct imported here + --> $DIR/import-after-macro-expand-14.rs:16:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the unit struct imported here + --> $DIR/import-after-macro-expand-14.rs:16:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-14.rs:20:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ------------------- ^^^^^^^^^ expected `b::HeaderMap`, found `http::HeaderMap` + | | + | expected due to this + | + = note: `http::HeaderMap` and `b::HeaderMap` have similar names, but are actually distinct types +note: `http::HeaderMap` is defined in module `crate::b::http` of the current crate + --> $DIR/import-after-macro-expand-14.rs:7:9 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ +note: `b::HeaderMap` is defined in module `crate::b` of the current crate + --> $DIR/import-after-macro-expand-14.rs:12:5 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/import-after-macro-expand-2.rs b/tests/ui/imports/import-after-macro-expand-2.rs index f0b5fbf02d90d..6a4ccb5d57b30 100644 --- a/tests/ui/imports/import-after-macro-expand-2.rs +++ b/tests/ui/imports/import-after-macro-expand-2.rs @@ -1,4 +1,3 @@ -//@ check-pass // https://github.com/rust-lang/rust/issues/56593#issuecomment-1133174514 use thing::*; @@ -13,6 +12,8 @@ mod tests { fn test_thing() { let thing: crate::Thing = Thing::Foo; + //~^ ERROR `Thing` is ambiguous + //~| ERROR no variant or associated item named `Foo` found for enum `thing::Thing` } } diff --git a/tests/ui/imports/import-after-macro-expand-2.stderr b/tests/ui/imports/import-after-macro-expand-2.stderr new file mode 100644 index 0000000000000..ecd07007501f3 --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-2.stderr @@ -0,0 +1,33 @@ +error[E0659]: `Thing` is ambiguous + --> $DIR/import-after-macro-expand-2.rs:14:35 + | +LL | let thing: crate::Thing = Thing::Foo; + | ^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `Thing` could refer to the enum imported here + --> $DIR/import-after-macro-expand-2.rs:11:9 + | +LL | use super::*; + | ^^^^^^^^ + = help: consider adding an explicit import of `Thing` to disambiguate +note: `Thing` could also refer to the enum imported here + --> $DIR/import-after-macro-expand-2.rs:11:9 + | +LL | use super::*; + | ^^^^^^^^ + = help: consider adding an explicit import of `Thing` to disambiguate + +error[E0599]: no variant or associated item named `Foo` found for enum `thing::Thing` in the current scope + --> $DIR/import-after-macro-expand-2.rs:14:42 + | +LL | let thing: crate::Thing = Thing::Foo; + | ^^^ variant or associated item not found in `thing::Thing` +... +LL | pub enum Thing { + | -------------- variant or associated item `Foo` not found for this enum + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0599, E0659. +For more information about an error, try `rustc --explain E0599`. diff --git a/tests/ui/imports/import-after-macro-expand-4.rs b/tests/ui/imports/import-after-macro-expand-4.rs index 4181c414dd890..d6ff1fe4f6859 100644 --- a/tests/ui/imports/import-after-macro-expand-4.rs +++ b/tests/ui/imports/import-after-macro-expand-4.rs @@ -1,4 +1,3 @@ -//@ check-pass // https://github.com/rust-lang/rust/pull/113242#issuecomment-1616034904 // similar with `import-after-macro-expand-2.rs` @@ -11,6 +10,14 @@ pub use a::*; mod c { use crate::*; pub struct S(Vec

); + //~^ ERROR `P` is ambiguous + //~| ERROR the size for values of type `(dyn a::P + 'static)` cannot be known at compilation time + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + //~| WARN this is accepted in the current edition + //~| WARN this is accepted in the current edition } #[derive(Clone)] diff --git a/tests/ui/imports/import-after-macro-expand-4.stderr b/tests/ui/imports/import-after-macro-expand-4.stderr new file mode 100644 index 0000000000000..dad3c88267c5e --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-4.stderr @@ -0,0 +1,76 @@ +error[E0659]: `P` is ambiguous + --> $DIR/import-after-macro-expand-4.rs:12:22 + | +LL | pub struct S(Vec

); + | ^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `P` could refer to the trait imported here + --> $DIR/import-after-macro-expand-4.rs:11:9 + | +LL | use crate::*; + | ^^^^^^^^ + = help: consider adding an explicit import of `P` to disambiguate +note: `P` could also refer to the enum imported here + --> $DIR/import-after-macro-expand-4.rs:11:9 + | +LL | use crate::*; + | ^^^^^^^^ + = help: consider adding an explicit import of `P` to disambiguate + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/import-after-macro-expand-4.rs:12:22 + | +LL | pub struct S(Vec

); + | ^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see + = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default +help: if this is a dyn-compatible trait, use `dyn` + | +LL | pub struct S(Vec); + | +++ + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/import-after-macro-expand-4.rs:12:22 + | +LL | pub struct S(Vec

); + | ^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: if this is a dyn-compatible trait, use `dyn` + | +LL | pub struct S(Vec); + | +++ + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/import-after-macro-expand-4.rs:12:22 + | +LL | pub struct S(Vec

); + | ^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: if this is a dyn-compatible trait, use `dyn` + | +LL | pub struct S(Vec); + | +++ + +error[E0277]: the size for values of type `(dyn a::P + 'static)` cannot be known at compilation time + --> $DIR/import-after-macro-expand-4.rs:12:18 + | +LL | pub struct S(Vec

); + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn a::P + 'static)` +note: required by an implicit `Sized` bound in `Vec` + --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL + +error: aborting due to 2 previous errors; 3 warnings emitted + +Some errors have detailed explanations: E0277, E0659. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/imports/import-after-macro-expand-6.rs b/tests/ui/imports/import-after-macro-expand-6.rs index 73dce5985a841..9aaf4f5cef7f1 100644 --- a/tests/ui/imports/import-after-macro-expand-6.rs +++ b/tests/ui/imports/import-after-macro-expand-6.rs @@ -1,8 +1,9 @@ -//@ check-pass // https://github.com/rust-lang/rust/pull/113099#issuecomment-1633574396 pub mod a { pub use crate::b::*; + //~^ WARN ambiguous glob re-exports + //~| WARN ambiguous glob re-exports } mod b { @@ -16,7 +17,10 @@ mod b { } use crate::a::HeaderMap; +//~^ ERROR `HeaderMap` is ambiguous fn main() { let h: crate::b::HeaderMap = HeaderMap; + //~^ ERROR `HeaderMap` is ambiguous + //~| ERROR mismatched types } diff --git a/tests/ui/imports/import-after-macro-expand-6.stderr b/tests/ui/imports/import-after-macro-expand-6.stderr new file mode 100644 index 0000000000000..8a0a34f1514ca --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-6.stderr @@ -0,0 +1,84 @@ +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-6.rs:19:15 + | +LL | use crate::a::HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the struct imported here + --> $DIR/import-after-macro-expand-6.rs:4:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the struct imported here + --> $DIR/import-after-macro-expand-6.rs:4:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-6.rs:23:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the unit struct imported here + --> $DIR/import-after-macro-expand-6.rs:4:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the unit struct imported here + --> $DIR/import-after-macro-expand-6.rs:4:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +warning: ambiguous glob re-exports + --> $DIR/import-after-macro-expand-6.rs:4:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + | | + | the name `HeaderMap` in the type namespace is first re-exported here + | but the name `HeaderMap` in the type namespace is also re-exported here + | + = note: `#[warn(ambiguous_glob_reexports)]` on by default + +warning: ambiguous glob re-exports + --> $DIR/import-after-macro-expand-6.rs:4:13 + | +LL | pub use crate::b::*; + | ^^^^^^^^^^^ + | | + | the name `HeaderMap` in the value namespace is first re-exported here + | but the name `HeaderMap` in the value namespace is also re-exported here + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-6.rs:23:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ------------------- ^^^^^^^^^ expected `b::HeaderMap`, found `http::HeaderMap` + | | + | expected due to this + | + = note: `http::HeaderMap` and `b::HeaderMap` have similar names, but are actually distinct types +note: `http::HeaderMap` is defined in module `crate::b::http` of the current crate + --> $DIR/import-after-macro-expand-6.rs:11:9 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ +note: `b::HeaderMap` is defined in module `crate::b` of the current crate + --> $DIR/import-after-macro-expand-6.rs:16:5 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors; 2 warnings emitted + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/import-after-macro-expand-9.rs b/tests/ui/imports/import-after-macro-expand-9.rs index 5caac06e7b984..230f43413114b 100644 --- a/tests/ui/imports/import-after-macro-expand-9.rs +++ b/tests/ui/imports/import-after-macro-expand-9.rs @@ -1,5 +1,3 @@ -//@ check-pass - use crate::b::*; mod b { @@ -14,4 +12,6 @@ mod b { fn main() { let h: crate::b::HeaderMap = HeaderMap; + //~^ ERROR `HeaderMap` is ambiguous + //~| ERROR mismatched types } diff --git a/tests/ui/imports/import-after-macro-expand-9.stderr b/tests/ui/imports/import-after-macro-expand-9.stderr new file mode 100644 index 0000000000000..e033faf050ced --- /dev/null +++ b/tests/ui/imports/import-after-macro-expand-9.stderr @@ -0,0 +1,44 @@ +error[E0659]: `HeaderMap` is ambiguous + --> $DIR/import-after-macro-expand-9.rs:14:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ^^^^^^^^^ ambiguous name + | + = note: ambiguous because of multiple glob imports of a name in the same module +note: `HeaderMap` could refer to the unit struct imported here + --> $DIR/import-after-macro-expand-9.rs:1:5 + | +LL | use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate +note: `HeaderMap` could also refer to the unit struct imported here + --> $DIR/import-after-macro-expand-9.rs:1:5 + | +LL | use crate::b::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `HeaderMap` to disambiguate + +error[E0308]: mismatched types + --> $DIR/import-after-macro-expand-9.rs:14:34 + | +LL | let h: crate::b::HeaderMap = HeaderMap; + | ------------------- ^^^^^^^^^ expected `b::HeaderMap`, found `http::HeaderMap` + | | + | expected due to this + | + = note: `http::HeaderMap` and `b::HeaderMap` have similar names, but are actually distinct types +note: `http::HeaderMap` is defined in module `crate::b::http` of the current crate + --> $DIR/import-after-macro-expand-9.rs:5:9 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ +note: `b::HeaderMap` is defined in module `crate::b` of the current crate + --> $DIR/import-after-macro-expand-9.rs:10:5 + | +LL | pub struct HeaderMap; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0659. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/imports/unresolved-seg-after-ambiguous.rs b/tests/ui/imports/unresolved-seg-after-ambiguous.rs index 67366deabaafb..00a3c5b0145c2 100644 --- a/tests/ui/imports/unresolved-seg-after-ambiguous.rs +++ b/tests/ui/imports/unresolved-seg-after-ambiguous.rs @@ -17,8 +17,6 @@ mod a { } use self::a::E::in_exist; -//~^ ERROR: unresolved import `self::a::E` -//~| ERROR: `E` is ambiguous -//~| WARNING: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! +//~^ ERROR: `E` is ambiguous fn main() {} diff --git a/tests/ui/imports/unresolved-seg-after-ambiguous.stderr b/tests/ui/imports/unresolved-seg-after-ambiguous.stderr index 67316462a27e9..e712d80f69460 100644 --- a/tests/ui/imports/unresolved-seg-after-ambiguous.stderr +++ b/tests/ui/imports/unresolved-seg-after-ambiguous.stderr @@ -1,17 +1,9 @@ -error[E0432]: unresolved import `self::a::E` - --> $DIR/unresolved-seg-after-ambiguous.rs:19:14 - | -LL | use self::a::E::in_exist; - | ^ `E` is a struct, not a module - -error: `E` is ambiguous +error[E0659]: `E` is ambiguous --> $DIR/unresolved-seg-after-ambiguous.rs:19:14 | LL | use self::a::E::in_exist; | ^ ambiguous name | - = 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 #114095 = note: ambiguous because of multiple glob imports of a name in the same module note: `E` could refer to the struct imported here --> $DIR/unresolved-seg-after-ambiguous.rs:13:17 @@ -25,32 +17,7 @@ note: `E` could also refer to the struct imported here LL | pub use self::d::*; | ^^^^^^^^^^ = help: consider adding an explicit import of `E` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - -error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0432`. -Future incompatibility report: Future breakage diagnostic: -error: `E` is ambiguous - --> $DIR/unresolved-seg-after-ambiguous.rs:19:14 - | -LL | use self::a::E::in_exist; - | ^ ambiguous name - | - = 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 #114095 - = note: ambiguous because of multiple glob imports of a name in the same module -note: `E` could refer to the struct imported here - --> $DIR/unresolved-seg-after-ambiguous.rs:13:17 - | -LL | pub use self::c::*; - | ^^^^^^^^^^ - = help: consider adding an explicit import of `E` to disambiguate -note: `E` could also refer to the struct imported here - --> $DIR/unresolved-seg-after-ambiguous.rs:12:17 - | -LL | pub use self::d::*; - | ^^^^^^^^^^ - = help: consider adding an explicit import of `E` to disambiguate - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default +error: aborting due to 1 previous error +For more information about this error, try `rustc --explain E0659`.