Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --With the latest nightly, the bytemuck crate fails to compile. This was compiling yesterday and the issue seems to be traits are not imported with super::*. Please see the issue in the bytemuck repository: <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: </p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Regression in searched nightlies: from nightly-2023-06-10 to nightly-2023-06-20 regressed nightly: nightly-2023-06-20 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.6</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: cc
<details<summaryi made a mistake making the example, see below </summaryThis should error in coherence, but instead errors with It looks like if there is a derive macro and trait with the same name, glob imports don't resolve the trait anymore. Note that works correctly </details
Maybe the reduced it incorrect? I found that it also throw an error for 1.70?
hm, maybe your change simply exposed an existing bug in more cases
I will check it later claim
ah no, I made a stupid mistake, i should have used :D, my example only got from the prelude which only contains the macro.
This is resolved, of course. Only tagging this with Nilstrieb's estimated priority for historical analysis later.
Now that this fix is merged, what time tonight should we expect a new nightly release?
0:00 according to a server somewhere. In practice, usually UTC 0:00. So it should be being cut sometime soon. Or 24 hours from now. Either one.

Discussion:
let res = binding.res(); self.check_reserved_macro_name(key.ident, res); self.set_binding_parent_module(binding, module); <del> let mut resolution = self.resolution(module, key).borrow_mut(); let old_binding = resolution.binding(); let mut t = Ok(()); if let Some(old_binding) = resolution.binding { if res == Res::Err && old_binding.res() != Res::Err { // Do not override real bindings with `Res::Err`s from error recovery. } else { </del> <ins> self.update_resolution(module, key, |this, resolution| { if let Some(old_binding) = resolution.binding { if res == Res::Err && old_binding.res() != Res::Err { // Do not override real bindings with `Res::Err`s from error recovery. return Ok(()); } </ins> match (old_binding.is_glob_import(), binding.is_glob_import()) { (true, true) => { if res != old_binding.res() { <del> resolution.binding = Some(self.ambiguity( </del> <ins> resolution.binding = Some(this.ambiguity( </ins> AmbiguityKind::GlobVsGlob, old_binding, binding, )); <del> } else if !old_binding.vis.is_at_least(binding.vis, self.tcx) { </del> <ins> } else if !old_binding.vis.is_at_least(binding.vis, this.tcx) { </ins> // We are glob-importing the same item but with greater visibility. resolution.binding = Some(binding); }

&& key.ns == MacroNS && nonglob_binding.expansion != LocalExpnId::ROOT { <del> resolution.binding = Some(self.ambiguity( </del> <ins> resolution.binding = Some(this.ambiguity( </ins> AmbiguityKind::GlobVsExpanded, nonglob_binding, glob_binding,

if let Some(old_binding) = resolution.shadowed_glob { assert!(old_binding.is_glob_import()); if glob_binding.res() != old_binding.res() { <del> resolution.shadowed_glob = Some(self.ambiguity( </del> <ins> resolution.shadowed_glob = Some(this.ambiguity( </ins> AmbiguityKind::GlobVsGlob, old_binding, glob_binding, )); <del> } else if !old_binding.vis.is_at_least(binding.vis, self.tcx) { </del> <ins> } else if !old_binding.vis.is_at_least(binding.vis, this.tcx) { </ins> resolution.shadowed_glob = Some(glob_binding); } } else {

} } (false, false) => { <del> t = Err(old_binding); </del> <ins> return Err(old_binding); </ins> } } <ins> } else { resolution.binding = Some(binding); </ins> } <del> } else { resolution.binding = Some(binding); }; </del> <ins> Ok(()) }) } fn ambiguity( &self, kind: AmbiguityKind, primary_binding: &'a NameBinding<'a>, secondary_binding: &'a NameBinding<'a>, ) -> &'a NameBinding<'a> { self.arenas.alloc_name_binding(NameBinding { ambiguity: Some((secondary_binding, kind)), ..primary_binding.clone() }) } // 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_resolution<T, F>(&mut self, module: Module<'a>, key: BindingKey, f: F) -> T where F: FnOnce(&mut Resolver<'a, 'tcx>, &mut NameResolution<'a>) -> T, { </ins> // 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. <del> let (binding, t) = match resolution.binding() { _ if old_binding.is_some() => return t, None => return t, Some(binding) => match old_binding { Some(old_binding) if ptr::eq(old_binding, binding) => return t, _ => (binding, t), }, </del> <ins> let (binding, t) = { let resolution = &mut *self.resolution(module, key).borrow_mut(); let old_binding = resolution.binding(); let t = f(self, resolution); match resolution.binding() { _ if old_binding.is_some() => return t, None => return t, Some(binding) => match old_binding { Some(old_binding) if ptr::eq(old_binding, binding) => return t, _ => (binding, t), }, } </ins> }; <del> drop(resolution); </del> // Define `binding` in `module`s glob importers. for import in module.glob_importers.borrow_mut().iter() { let mut ident = key.ident;

t } <del> fn ambiguity( &self, kind: AmbiguityKind, primary_binding: &'a NameBinding<'a>, secondary_binding: &'a NameBinding<'a>, ) -> &'a NameBinding<'a> { self.arenas.alloc_name_binding(NameBinding { ambiguity: Some((secondary_binding, kind)), ..primary_binding.clone() }) } </del> // Define a dummy resolution containing a `Res::Err` as a placeholder for a failed // or indeterminate resolution, also mark such failed imports as used to avoid duplicate diagnostics. fn import_dummy_binding(&mut self, import: &'a Import<'a>, is_indeterminate: bool) {

.emit(); } let key = BindingKey::new(target, ns); <del> let mut resolution = this.resolution(parent, key).borrow_mut(); resolution.single_imports.remove(&Interned::new_unchecked(import)); </del> <ins> this.update_resolution(parent, key, |_, resolution| { resolution.single_imports.remove(&Interned::new_unchecked(import)); }); </ins> } } }

<ins> // force-host // no-prefer-dynamic #![crate_type = "proc-macro"] extern crate proc_macro; struct Zeroable; #[proc_macro_derive(Zeroable)] pub fn derive_zeroable(_: proc_macro::TokenStream) -> proc_macro::TokenStream { proc_macro::TokenStream::default() } </ins>

<ins> // check-pass // aux-build:issue-112831-aux.rs mod zeroable { pub trait Zeroable {} } use zeroable::*; mod pod { use super::*; pub trait Pod: Zeroable {} } use pod::*; extern crate issue_112831_aux; use issue_112831_aux::Zeroable; fn main() {} </ins>