-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
trait permitting extra members #54665
Copy link
Copy link
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemP-highHigh priorityHigh 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.
Milestone
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemP-highHigh priorityHigh 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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I've been tinkering locally with a crate called salsa. Along the way, I noticed that my impl permits me to add extra members. e.g., I have this trait:
But in my cargo example I can use this impl:
What the heck is going on here? I couldn't easily reproduce this in a smaller example, so I saved the commit. It did reproduce cleanly after
rm -rf targetandcargo clean, so I guess it's (probably?) not an incremental bug.To reproduce:
36e2b9cdcc01228560f9fb7ffdfadf466d21e60d.cargo build --example storage_varietiesMarking as T-compiler and P-high. P-high because this could be a very dangerous bug in terms of backwards compat risk! But I'm hoping it's something more bizarre (e.g., not rebuilding when I think it is). I did validate though that adding other weird stuff (e.g., invalid tokens) causes compilation to fail. Assigning to myself to investigate on Monday.