Adding #[derive()]
changes blob import semantics
#115377
Labels
C-bug
Category: This is a bug.
P-medium
Medium priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: the assertion passing, since
{ use self::*; B::ASSOC }
should have a consistent value/meaning withinmain
'sfn body
where no other items are defined.Instead, this happened: the assertion fails!
Meta
This regressed in
1.52.0
Extra comments
The key element playing a role here, beyond the blob imports, is the
#[derive()]
slapped ontoB
. This seems to allow for the blob-importedmodule::B
to somehow gain priority over the clearly-definedcrate::B
type withinfn main
's blob import.I did not expect the "moving of
{ use self::*; B::ASSOC }
block" to alter this quirk (I was initially writing the MRE asassert_eq!(B::ASSSOC, { use … })
when I ran into this extra bug).Could resolve: Remove artificial import ambiguity errors #112086 be relevant? cc @petrochenkovInitially discovered on Discord by user
@kyuuhachi
@rustbot modify labels: +regression-from-stable-to-stable
The text was updated successfully, but these errors were encountered: