-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Constify trait aliases #144291
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
base: master
Are you sure you want to change the base?
Constify trait aliases #144291
Conversation
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt HIR ty lowering was modified cc @fmease Changes to the size of AST and/or HIR nodes. cc @nnethercote Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
static_assert_size!(Item, 144); | ||
static_assert_size!(ItemKind, 80); | ||
static_assert_size!(Item, 136); | ||
static_assert_size!(ItemKind, 72); |
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.
👍
Clippy changes are approved. |
src/tools/rustfmt/src/visitor.rs
Outdated
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.
Can we add a simple test case for #![feature(trait_alias, const_trait_impl)]
in src/tools/rustfmt/tests/target
. Would be nice to make sure rustfmt isn't formatting the code incorrectly.
☔ The latest upstream changes (presumably #143897) made this pull request unmergeable. Please resolve the merge conflicts. |
cb809b6
to
7508ac9
Compare
☔ The latest upstream changes (presumably #143843) made this pull request unmergeable. Please resolve the merge conflicts. |
7508ac9
to
5d3eb69
Compare
☔ The latest upstream changes (presumably #143884) made this pull request unmergeable. Please resolve the merge conflicts. |
Allow
const trait Foo = Bar + [const] Baz;
trait alias declarations. Their rules are the same as with super traits of const traits. So[const] Baz
orconst Baz
is only required for[const] Foo
orconst Foo
bounds respectively.tracking issue #41517 (part of the general trait alias feature gate, but I can split it out into a separate const trait alias feature gate. I just assumed that const traits would stabilize before trait aliases, and we'd want to stabilize trait aliases together with const trait aliases at the same time)
r? @compiler-errors @fee1-dead