Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upresolve: Fix variant namespacing #30882
Conversation
rust-highfive
assigned
Aatch
Jan 13, 2016
This comment has been minimized.
This comment has been minimized.
|
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
cc me (this might fix a bug I've encountered) |
petrochenkov
referenced this pull request
Jan 14, 2016
Merged
Preserve struct/variant kinds in metadata #30896
This comment has been minimized.
This comment has been minimized.
|
r? @nrc |
rust-highfive
assigned
nrc
and unassigned
Aatch
Jan 14, 2016
This comment has been minimized.
This comment has been minimized.
|
I wonder if it is worth leaving struct variants in the value namespace? I don't suppose we'll ever need it, but it is future-proofing (e.g., if we someday get named arguments for functions, then we could make struct variants generate functions like other variants). |
nrc
added
the
S-waiting-on-crater
label
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
|
Should probably decide on the behaviour before we give it a crater run, but it will need one before landing |
This comment has been minimized.
This comment has been minimized.
|
Adding struct variants into the value namespace (including cross-crate) will give us the "maximum breakage mode", best suited for evaluation with crater. I'll add a second commit doing this. |
This comment has been minimized.
This comment has been minimized.
|
Regarding keeping struct variants in the value namespace in the long term, I'm mildly against it. The pattern
is not especially idiomatic, but it exists and disallowing it would (presumably) break too much code. |
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
|
Updated with all variants in both namespaces. |
bors
added a commit
that referenced
this pull request
Jan 16, 2016
bors
added a commit
that referenced
this pull request
Jan 16, 2016
This comment has been minimized.
This comment has been minimized.
|
@brson could you crater this please? |
This comment has been minimized.
This comment has been minimized.
|
@petrochenkov we often have this issue - do we want to be consistent between structs and struct variants or struct variants and other variants? I don't have an opinion in this case, but if we can get away with leaving our options open, I would like that. |
This comment has been minimized.
This comment has been minimized.
|
|
petrochenkov
force-pushed the
petrochenkov:varnamesp
branch
from
a21f099
to
8058dbb
Jan 16, 2016
This comment has been minimized.
This comment has been minimized.
|
Rebased. |
This comment has been minimized.
This comment has been minimized.
|
Starting a crater run now |
This comment has been minimized.
This comment has been minimized.
|
Looks like there are three regressions (legitimate ones I believe) |
alexcrichton
removed
the
S-waiting-on-crater
label
Jan 17, 2016
This comment has been minimized.
This comment has been minimized.
|
Zero regressions due to future-proofing of struct-variants suggested by @nrc |
This comment has been minimized.
This comment has been minimized.
|
Hi, feel free to ping me about the @petrochenkov, you are correct, |
This comment has been minimized.
This comment has been minimized.
|
I'd be happy to take this and submit PRs to the breaking crates above. What do the rest of the team think? |
This comment has been minimized.
This comment has been minimized.
|
note: I do think of this as qualifying as a bug fix |
This comment has been minimized.
This comment has been minimized.
|
I'm on board with future-proofing here. |
petrochenkov
referenced this pull request
Jan 18, 2016
Closed
Regression resolving enum variant with name of struct when both are imported #30989
This comment has been minimized.
This comment has been minimized.
tailhook
commented
Jan 18, 2016
|
Thanks to @brson, the bug in rotor-http is fixed now. This case looks more like an oversight rather than a valid use case. And I'm happy that compiler catches it now. |
brson
added
the
relnotes
label
Jan 20, 2016
This comment has been minimized.
This comment has been minimized.
|
|
petrochenkov
force-pushed the
petrochenkov:varnamesp
branch
from
8058dbb
to
ff6b0aa
Jan 21, 2016
This comment has been minimized.
This comment has been minimized.
|
Rebased. |
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ (discussed at lang team meeting today) |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added a commit
that referenced
this pull request
Jan 21, 2016
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
merged commit ff6b0aa
into
rust-lang:master
Jan 22, 2016
bors
referenced this pull request
Jan 22, 2016
Merged
rustc_resolve: Refactor away NameBindings and ImportResolutionPerNamespace #30843
petrochenkov
referenced this pull request
Feb 11, 2016
Closed
Items shadow glob-imported reexports #31337
petrochenkov
referenced this pull request
Feb 22, 2016
Merged
Clarify the relationships between various kinds of structs and variants #1506
This comment has been minimized.
This comment has been minimized.
|
Just ran a crate report against nightly, and I wanted to confirm, but the regression of the |
This comment has been minimized.
This comment has been minimized.
|
Yes, this is an expected regression. |
This comment has been minimized.
This comment has been minimized.
|
Ok, thanks @petrochenkov! |
This comment has been minimized.
This comment has been minimized.
mattyhall
commented
Mar 31, 2016
|
I've pushed the new version. |
petrochenkov commentedJan 13, 2016
Tuple and unit variants from other crates weren't put into type namespace.
Now variant namespacing is aligned with struct namespacing and is not affected by the variant's crate of origin (struct -> type, tuple/unit -> type/value).
Additionally, struct variants from other crates are put into value namespace (struct variants from local crate were already in it). This is not a necessity, but a future proofing measure.
This fix can result in some new shadowing errors in cross-crate scenarios, crater reports three regressions.
[breaking-change]