rustc::ty: Rename struct_variant to non_enum_variant#47258
rustc::ty: Rename struct_variant to non_enum_variant#47258bors merged 1 commit intorust-lang:masterfrom
Conversation
src/librustc/ty/mod.rs
Outdated
There was a problem hiding this comment.
Things could change, but IIRC it was called on unions and it was supposed to be called on unions, because unions are represented as an ADT with a single "variant".
There was a problem hiding this comment.
In that case the name is misleading and the doc comment is wrong. I'm now auditing all callers to see whether they might be using this on unions. Depending on results I might change the doc comment and possibly the name.
There was a problem hiding this comment.
Alternatively, introduce another method that does the same thing for unions (if union code wants the helper method but there's no code that needs to work on structs and unions).
There was a problem hiding this comment.
I'd expect most code using this is common for structs and unions.
There was a problem hiding this comment.
Yeah there's a bunch. non_enum_variant it is.
b296578 to
38d55e6
Compare
src/librustc_typeck/check/wfcheck.rs
Outdated
There was a problem hiding this comment.
Note: this is technically a separate function that was caught up in the mass rename, but the rename fits here as well IMO.
It is also intended for use with unions.
|
r=me with build fixed |
38d55e6 to
cf3fefe
Compare
|
@bors r=eddyb |
|
📌 Commit cf3fefe has been approved by |
rustc::ty: Rename struct_variant to non_enum_variant r? @eddyb
r? @eddyb