-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Adding #[derive()] changes blob import semantics #115377
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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 bodywhere no other items are defined.Instead, this happened: the assertion fails!
Meta
This regressed in
1.52.0Extra 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::Bto somehow gain priority over the clearly-definedcrate::Btype 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