diff --git a/compiler/rustc_codegen_gcc/build_system/src/test.rs b/compiler/rustc_codegen_gcc/build_system/src/test.rs index ca2a2a7dc2de0..f1c10681d147c 100644 --- a/compiler/rustc_codegen_gcc/build_system/src/test.rs +++ b/compiler/rustc_codegen_gcc/build_system/src/test.rs @@ -826,8 +826,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 99cce0c44b86d..08330ea13af52 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4438,7 +4438,7 @@ declare_lint! { /// /// ### Example /// - /// ```rust,compile_fail + /// ```rust,ignore (needs extern crate) /// #![deny(ambiguous_glob_imports)] /// pub fn foo() -> u32 { /// use sub::*; @@ -4454,8 +4454,6 @@ declare_lint! { /// } /// ``` /// - /// {{produces}} - /// /// ### Explanation /// /// Previous versions of Rust compile it successfully because it diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index b9c945a440f88..9ce72987b5f35 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); } } @@ -82,13 +82,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { vis: Visibility, span: Span, expansion: LocalExpnId, - ambiguity: Option<(NameBinding<'ra>, AmbiguityKind)>, + ambiguity: Option<(NameBinding<'ra>, AmbiguityKind, bool)>, ) { let binding = self.arenas.alloc_name_binding(NameBindingData { kind: NameBindingKind::Res(res), ambiguity, - // External ambiguities always report the `AMBIGUOUS_GLOB_IMPORTS` lint at the moment. - warn_ambiguity: true, vis, span, expansion, @@ -288,7 +286,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { AmbigModChildKind::GlobVsGlob => AmbiguityKind::GlobVsGlob, AmbigModChildKind::GlobVsExpanded => AmbiguityKind::GlobVsExpanded, }; - (self.arenas.new_res_binding(res, vis, span, expansion), ambig_kind) + // External ambiguities always report the `AMBIGUOUS_GLOB_IMPORTS` lint at the moment. + (self.arenas.new_res_binding(res, vis, span, expansion), ambig_kind, true) }); // Record primary definitions. diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 3eccbd4682daf..1a5efc1f7a6c6 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1995,6 +1995,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { } } + pub(crate) fn remove_same_import( + b1: NameBinding<'ra>, + b2: NameBinding<'ra>, + ) -> (NameBinding<'ra>, NameBinding<'ra>) { + if let NameBindingKind::Import { import: import1, binding: b1_next } = b1.kind + && let NameBindingKind::Import { import: import2, binding: b2_next } = b2.kind + && import1 == import2 + && b1.ambiguity == b2.ambiguity + { + assert!(b1.ambiguity.is_none()); + assert_eq!(b1.expansion, b2.expansion); + assert_eq!(b1.span, b2.span); + assert_eq!(b1.vis, b2.vis); + Self::remove_same_import(b1_next, b2_next) + } else { + (b1, b2) + } + } + fn ambiguity_diagnostic(&self, ambiguity_error: &AmbiguityError<'ra>) -> errors::Ambiguity { let AmbiguityError { kind, ident, b1, b2, misc1, misc2, .. } = *ambiguity_error; let extern_prelude_ambiguity = || { @@ -2003,6 +2022,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { && entry.flag_binding.as_ref().and_then(|pb| pb.get().0.binding()) == Some(b2) }) }; + let (b1, b2) = Self::remove_same_import(b1, b2); let (b1, b2, misc1, misc2, swapped) = if b2.span.is_dummy() && !b1.span.is_dummy() { // We have to print the span-less alternative first, otherwise formatting looks bad. (b2, b1, misc2, misc1, true) diff --git a/compiler/rustc_resolve/src/effective_visibilities.rs b/compiler/rustc_resolve/src/effective_visibilities.rs index fe6e5b8e6eb6a..ab8ea60207b06 100644 --- a/compiler/rustc_resolve/src/effective_visibilities.rs +++ b/compiler/rustc_resolve/src/effective_visibilities.rs @@ -125,27 +125,13 @@ 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; 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) { - // 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.) - break; - } - parent_id = ParentId::Import(binding); binding = nested_binding; - warn_ambiguity |= nested_binding.warn_ambiguity; } - if !is_ambiguity(binding, warn_ambiguity) - && let Some(def_id) = binding.res().opt_def_id().and_then(|id| id.as_local()) - { + if 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/imports.rs b/compiler/rustc_resolve/src/imports.rs index 4e0f3db59821f..2897c56043fdb 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -325,7 +325,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, @@ -339,7 +338,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); @@ -351,7 +349,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. @@ -360,30 +358,35 @@ 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. + assert_ne!(glob_binding, old_glob_binding); + + // There's a specific situation that is currently processed here instead of + // using determinacy elsewhere. + // Same glob import first fetches a glob binding from its target module, + // and then fetches a more expanded non-glob binding from the same module. + // In that case the non-glob binding should overwrite ("shadow") the glob + // binding without any errors. + let (deep_binding, old_deep_binding) = + Self::remove_same_import(glob_binding, old_glob_binding); + if deep_binding != binding && !deep_binding.is_glob_import() { + assert_ne!(old_deep_binding, old_binding); + assert_ne!(old_deep_binding, deep_binding); + assert!(old_deep_binding.is_glob_import()); + assert!(old_deep_binding.ambiguity.is_none()); + assert!(deep_binding.ambiguity.is_none()); resolution.glob_binding = Some(glob_binding); } else if res != old_glob_binding.res() { resolution.glob_binding = Some(this.new_ambiguity_binding( AmbiguityKind::GlobVsGlob, old_glob_binding, glob_binding, - warn_ambiguity, + false, )); - } 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) => { @@ -412,7 +415,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { 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 { @@ -440,33 +446,22 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ambiguity_kind: AmbiguityKind, primary_binding: NameBinding<'ra>, secondary_binding: NameBinding<'ra>, - warn_ambiguity: bool, + warning: bool, ) -> NameBinding<'ra> { - let ambiguity = Some((secondary_binding, ambiguity_kind)); - let data = NameBindingData { ambiguity, warn_ambiguity, ..*primary_binding }; + let ambiguity = Some((secondary_binding, ambiguity_kind, warning)); + 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(); @@ -475,7 +470,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; } @@ -500,7 +495,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { ident.0, key.ns, imported_binding, - warn_ambiguity, ); } } @@ -521,11 +515,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); }) } @@ -658,7 +652,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { let Some(binding) = resolution.best_binding() else { continue }; if let NameBindingKind::Import { import, .. } = binding.kind - && let Some((amb_binding, _)) = binding.ambiguity + && let Some((amb_binding, ..)) = binding.ambiguity && binding.res() != Res::Err && exported_ambiguities.contains(&binding) { @@ -917,7 +911,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { this.get_mut_unchecked().update_local_resolution( parent, key, - false, |_, resolution| { resolution.single_imports.swap_remove(&import); }, @@ -1523,16 +1516,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, ); } } diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index b3141406e467e..8bb9fb5740a21 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -793,10 +793,7 @@ impl<'ra> fmt::Debug for Module<'ra> { #[derive(Clone, Copy, Debug)] 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, + ambiguity: Option<(NameBinding<'ra>, AmbiguityKind, bool /*warning*/)>, expansion: LocalExpnId, span: Span, vis: Visibility, @@ -933,7 +930,7 @@ impl<'ra> NameBindingData<'ra> { self: NameBinding<'ra>, ) -> Option<(NameBinding<'ra>, NameBinding<'ra>, AmbiguityKind)> { match self.ambiguity { - Some((ambig_binding, ambig_kind)) => Some((self, ambig_binding, ambig_kind)), + Some((ambig_binding, ambig_kind, _)) => Some((self, ambig_binding, ambig_kind)), None => match self.kind { NameBindingKind::Import { binding, .. } => binding.descent_to_ambiguity(), _ => None, @@ -949,14 +946,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(), @@ -1342,7 +1331,6 @@ impl<'ra> ResolverArenas<'ra> { self.alloc_name_binding(NameBindingData { kind: NameBindingKind::Res(res), ambiguity: None, - warn_ambiguity: false, vis, span, expansion, @@ -2047,17 +2035,7 @@ 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 { + if let Some((b2, kind, warning)) = used_binding.ambiguity { let ambiguity_error = AmbiguityError { kind, ident, @@ -2065,7 +2043,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { b2, misc1: AmbiguityErrorMisc::None, misc2: AmbiguityErrorMisc::None, - warning: warn_ambiguity, + warning, }; if !self.matches_previous_ambiguity_error(&ambiguity_error) { // avoid duplicated span information to be emit out @@ -2114,12 +2092,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/rustdoc-json/reexport/glob_collision.rs b/tests/rustdoc-json/reexport/glob_collision.rs index 48de1b5e77213..d58099ed367d3 100644 --- a/tests/rustdoc-json/reexport/glob_collision.rs +++ b/tests/rustdoc-json/reexport/glob_collision.rs @@ -1,7 +1,7 @@ // Regression test for https://github.com/rust-lang/rust/issues/100973 //@ set m1 = "$.index[?(@.name == 'm1' && @.inner.module)].id" -//@ is "$.index[?(@.name == 'm1')].inner.module.items" [] +//@ is "$.index[?(@.name == 'm1')].inner.module.items" [0] //@ is "$.index[?(@.name == 'm1')].inner.module.is_stripped" true mod m1 { pub fn f() {} diff --git a/tests/rustdoc/glob-shadowing.rs b/tests/rustdoc/glob-shadowing.rs index d9e9ead3f9a90..c1eeb7e663e7b 100644 --- a/tests/rustdoc/glob-shadowing.rs +++ b/tests/rustdoc/glob-shadowing.rs @@ -1,9 +1,9 @@ //@ has 'glob_shadowing/index.html' -//@ count - '//dt' 6 -//@ !has - '//dd' 'sub1::describe' +//@ count - '//dt' 7 +//@ !has - '//dd' 'sub1::describe1' //@ has - '//dd' 'sub2::describe' -//@ !has - '//dd' 'sub1::describe2' +//@ has - '//dd' 'sub1::describe2' //@ !has - '//dd' 'sub1::prelude' //@ has - '//dd' 'mod::prelude' @@ -18,7 +18,7 @@ mod sub1 { // this should be shadowed by sub2::describe - /// sub1::describe + /// sub1::describe1 pub fn describe() -> &'static str { "sub1::describe" } @@ -33,7 +33,9 @@ mod sub1 { pub struct Foo; // this should be shadowed, - // because both sub1::describe2 and sub3::describe2 are from glob reexport + // because both sub1::describe2 and sub3::describe2 are from glob reexport, + // but it is still usable from other crates under the `ambiguous_glob_imports` lint, + // so it is reachable and documented /// sub1::describe2 pub fn describe2() -> &'static str { "sub1::describe2" 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 ba2d7dc4e0166..b7203a2cb6fb4 100644 --- a/tests/ui/imports/ambiguous-14.rs +++ b/tests/ui/imports/ambiguous-14.rs @@ -22,5 +22,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 4efa31c61e328..327dd075945a4 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:23: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:13: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:23: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:13: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:14: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 3a51c156d34ca..5ba51ce714b75 100644 --- a/tests/ui/imports/ambiguous-17.rs +++ b/tests/ui/imports/ambiguous-17.rs @@ -25,5 +25,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 1849b83d76a35..b46a9430d2a7c 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:4: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: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-17.rs:4: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: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 +warning: ambiguous glob re-exports --> $DIR/ambiguous-17.rs:4: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:5: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 65c971c00b9ac..0000000000000 --- a/tests/ui/imports/ambiguous-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ aux-build: ../ambiguous-1.rs -// https://github.com/rust-lang/rust/pull/113099#issuecomment-1633574396 - -extern crate ambiguous_1; - -fn main() { - ambiguous_1::id(); //~ ERROR `id` is ambiguous - //~| WARN this was previously accepted -} diff --git a/tests/ui/imports/ambiguous-2.stderr b/tests/ui/imports/ambiguous-2.stderr deleted file mode 100644 index d428e58a78fd7..0000000000000 --- a/tests/ui/imports/ambiguous-2.stderr +++ /dev/null @@ -1,45 +0,0 @@ -error: `id` is ambiguous - --> $DIR/ambiguous-2.rs:7:18 - | -LL | ambiguous_1::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 defined here - --> $DIR/auxiliary/../ambiguous-1.rs:13:13 - | -LL | pub use self::evp::*; - | ^^^^^^^^^ -note: `id` could also refer to the function defined here - --> $DIR/auxiliary/../ambiguous-1.rs:15:13 - | -LL | pub use self::handwritten::*; - | ^^^^^^^^^^^^^^^^^ - = 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: `id` is ambiguous - --> $DIR/ambiguous-2.rs:7:18 - | -LL | ambiguous_1::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 defined here - --> $DIR/auxiliary/../ambiguous-1.rs:13:13 - | -LL | pub use self::evp::*; - | ^^^^^^^^^ -note: `id` could also refer to the function defined here - --> $DIR/auxiliary/../ambiguous-1.rs:15:13 - | -LL | pub use self::handwritten::*; - | ^^^^^^^^^^^^^^^^^ - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - 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 125612dea03e5..a062b38df617e 100644 --- a/tests/ui/imports/ambiguous-4-extern.rs +++ b/tests/ui/imports/ambiguous-4-extern.rs @@ -1,9 +1,6 @@ //@ edition:2015 -//@ check-pass // https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883 -#![warn(ambiguous_glob_imports)] - macro_rules! m { () => { pub fn id() {} @@ -24,6 +21,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 87492dee67fb4..dae8432118f45 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:13: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:26:5 +error[E0659]: `id` is ambiguous + --> $DIR/ambiguous-4-extern.rs:23: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:13:9 + --> $DIR/ambiguous-4-extern.rs:10: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:14:9 + --> $DIR/ambiguous-4-extern.rs:11: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:5: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: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-4-extern.rs:13:9 +warning: ambiguous glob re-exports + --> $DIR/ambiguous-4-extern.rs:10: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:14: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:5: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 e66d231f93cc3..0000000000000 --- a/tests/ui/imports/ambiguous-4.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ edition:2015 -//@ aux-build: ../ambiguous-4-extern.rs - -extern crate ambiguous_4_extern; - -fn main() { - ambiguous_4_extern::id(); //~ ERROR `id` is ambiguous - //~| WARN this was previously accepted -} diff --git a/tests/ui/imports/ambiguous-4.stderr b/tests/ui/imports/ambiguous-4.stderr deleted file mode 100644 index cf4127cbbb1cc..0000000000000 --- a/tests/ui/imports/ambiguous-4.stderr +++ /dev/null @@ -1,45 +0,0 @@ -error: `id` is ambiguous - --> $DIR/ambiguous-4.rs:7:25 - | -LL | ambiguous_4_extern::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 defined here - --> $DIR/auxiliary/../ambiguous-4-extern.rs:13:9 - | -LL | pub use evp::*; - | ^^^ -note: `id` could also refer to the function defined here - --> $DIR/auxiliary/../ambiguous-4-extern.rs:14:9 - | -LL | pub use handwritten::*; - | ^^^^^^^^^^^ - = 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: `id` is ambiguous - --> $DIR/ambiguous-4.rs:7:25 - | -LL | ambiguous_4_extern::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 defined here - --> $DIR/auxiliary/../ambiguous-4-extern.rs:13:9 - | -LL | pub use evp::*; - | ^^^ -note: `id` could also refer to the function defined here - --> $DIR/auxiliary/../ambiguous-4-extern.rs:14:9 - | -LL | pub use handwritten::*; - | ^^^^^^^^^^^ - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - 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/glob-conflict-cross-crate-3.rs b/tests/ui/imports/glob-conflict-cross-crate-3.rs index 31c234b9250fc..74415cfd9bb36 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-3.rs +++ b/tests/ui/imports/glob-conflict-cross-crate-3.rs @@ -14,5 +14,4 @@ fn main() { //~^ ERROR `C` is ambiguous //~| ERROR `C` is ambiguous //~| WARN this was previously accepted - //~| WARN this was previously accepted } diff --git a/tests/ui/imports/glob-conflict-cross-crate-3.stderr b/tests/ui/imports/glob-conflict-cross-crate-3.stderr index 213eafda20b72..36382fd5f206b 100644 --- a/tests/ui/imports/glob-conflict-cross-crate-3.stderr +++ b/tests/ui/imports/glob-conflict-cross-crate-3.stderr @@ -1,32 +1,9 @@ -error: `C` is ambiguous - --> $DIR/glob-conflict-cross-crate-3.rs:13:13 - | -LL | let _a: C = 1; - | ^ 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 type alias defined here - --> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:9:9 - | -LL | pub use a::*; - | ^ -note: `C` could also refer to the type alias defined here - --> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:10:9 - | -LL | pub use b::*; - | ^ - = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default - -error: `C` is ambiguous +error[E0659]: `C` is ambiguous --> $DIR/glob-conflict-cross-crate-3.rs:13:13 | LL | let _a: C = 1; | ^ 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 type alias imported here --> $DIR/glob-conflict-cross-crate-3.rs:9:5 @@ -41,9 +18,6 @@ LL | use a::*; | ^^^^ = help: consider adding an explicit import of `C` to disambiguate -error: aborting due to 2 previous errors - -Future incompatibility report: Future breakage diagnostic: error: `C` is ambiguous --> $DIR/glob-conflict-cross-crate-3.rs:13:13 | @@ -65,7 +39,10 @@ LL | pub use b::*; | ^ = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default -Future breakage diagnostic: +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0659`. +Future incompatibility report: Future breakage diagnostic: error: `C` is ambiguous --> $DIR/glob-conflict-cross-crate-3.rs:13:13 | @@ -75,17 +52,15 @@ LL | let _a: C = 1; = 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 type alias imported here - --> $DIR/glob-conflict-cross-crate-3.rs:9:5 +note: `C` could refer to the type alias defined here + --> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:9:9 | -LL | use glob_conflict_cross_crate_2_extern::*; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: consider adding an explicit import of `C` to disambiguate -note: `C` could also refer to the type alias imported here - --> $DIR/glob-conflict-cross-crate-3.rs:10:5 +LL | pub use a::*; + | ^ +note: `C` could also refer to the type alias defined here + --> $DIR/auxiliary/glob-conflict-cross-crate-2-extern.rs:10:9 | -LL | use a::*; - | ^^^^ - = help: consider adding an explicit import of `C` to disambiguate +LL | pub use b::*; + | ^ = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default 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`.