-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GenericArgKind::as_{type,const,region}
#110545
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
cd2c1fb
to
3f15521
Compare
GenericArgKind::Const(ct) => Some(ct), | ||
_ => None, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should those methods be on GenericArgKind
, or directly on GenericArg
? Seems like we always unpack first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented them on the kind because it technically supports more use cases, but given that we always unpack first, I can move it to the GenericArg
...
@bors r+ |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#110240 (Add `indent_style = tab` for `Makefile`s to `.editorconfig`) - rust-lang#110545 (Add `GenericArgKind::as_{type,const,region}`) - rust-lang#110574 ( fix out-of-date comment about rpath in bootstrap) - rust-lang#110581 (Style fix for loongarch-linux.md) - rust-lang#110584 (Allow overwriting the sysroot compile flag in compile tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This allows to make code nicer in some cases