-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't FCW assoc consts in patterns #140467
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
Conversation
r? oli-obk |
); | ||
if !self.features().generic_const_exprs() | ||
&& ct.args.has_non_region_param() | ||
&& self.def_kind(instance.def_id()) == DefKind::AnonConst |
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 think there should be a comment explaining why we check the def_kind here.
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.
doh.... yeah, why would I put it only in the test 😆
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.
updated. let me know if the comment doesn't make sense to you and it needs elaborating somewhere :)
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 barely know what this entire function does, let alone what the FCW is for, so I'm afraid I am mostly lost here, but this way at least there are some breadcrumbs to follow for someone who stumbles upon this curious extra check in the future. :)
8e1d885
to
40fb600
Compare
This comment has been minimized.
This comment has been minimized.
r? lcnr r=me after CI |
40fb600
to
be90613
Compare
@bors r=lcnr rollup |
Don't FCW assoc consts in patterns Fixes rust-lang#140447 See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
Rollup of 14 pull requests Successful merges: - rust-lang#140380 (transmutability: uninit transition matches unit byte only) - rust-lang#140385 (Subtree update of `rust-analyzer`) - rust-lang#140395 (organize and extend forbidden target feature tests) - rust-lang#140430 (Improve test coverage of HIR pretty printing.) - rust-lang#140458 (Fix for async drop ice with partly dropped tuple) - rust-lang#140460 (Fix handling of LoongArch target features not supported by LLVM 19) - rust-lang#140465 (chore: edit and move tests) - rust-lang#140467 (Don't FCW assoc consts in patterns) - rust-lang#140468 (Minor tweaks to make some normalization (adjacent) code less confusing) - rust-lang#140470 (CI: rfl: move job forward to Linux v6.15-rc4) - rust-lang#140476 (chore: delete unused ui/auxiliary crates) - rust-lang#140481 (Require sanitizers be enabled for asan_odr_windows.rs) - rust-lang#140486 (rustfmt: Also allow bool literals as first item of let chain) - rust-lang#140494 (Parser: Document restrictions) r? `@ghost` `@rustbot` modify labels: rollup
Don't FCW assoc consts in patterns Fixes rust-lang#140447 See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
Rollup of 13 pull requests Successful merges: - rust-lang#140380 (transmutability: uninit transition matches unit byte only) - rust-lang#140385 (Subtree update of `rust-analyzer`) - rust-lang#140395 (organize and extend forbidden target feature tests) - rust-lang#140458 (Fix for async drop ice with partly dropped tuple) - rust-lang#140460 (Fix handling of LoongArch target features not supported by LLVM 19) - rust-lang#140465 (chore: edit and move tests) - rust-lang#140467 (Don't FCW assoc consts in patterns) - rust-lang#140468 (Minor tweaks to make some normalization (adjacent) code less confusing) - rust-lang#140470 (CI: rfl: move job forward to Linux v6.15-rc4) - rust-lang#140476 (chore: delete unused ui/auxiliary crates) - rust-lang#140481 (Require sanitizers be enabled for asan_odr_windows.rs) - rust-lang#140486 (rustfmt: Also allow bool literals as first item of let chain) - rust-lang#140494 (Parser: Document restrictions) r? `@ghost` `@rustbot` modify labels: rollup
Don't FCW assoc consts in patterns Fixes rust-lang#140447 See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#140380 (transmutability: uninit transition matches unit byte only) - rust-lang#140385 (Subtree update of `rust-analyzer`) - rust-lang#140458 (Fix for async drop ice with partly dropped tuple) - rust-lang#140465 (chore: edit and move tests) - rust-lang#140467 (Don't FCW assoc consts in patterns) - rust-lang#140468 (Minor tweaks to make some normalization (adjacent) code less confusing) - rust-lang#140470 (CI: rfl: move job forward to Linux v6.15-rc4) - rust-lang#140476 (chore: delete unused ui/auxiliary crates) - rust-lang#140481 (Require sanitizers be enabled for asan_odr_windows.rs) - rust-lang#140486 (rustfmt: Also allow bool literals as first item of let chain) - rust-lang#140494 (Parser: Document restrictions) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#140385 (Subtree update of `rust-analyzer`) - rust-lang#140458 (Fix for async drop ice with partly dropped tuple) - rust-lang#140465 (chore: edit and move tests) - rust-lang#140467 (Don't FCW assoc consts in patterns) - rust-lang#140468 (Minor tweaks to make some normalization (adjacent) code less confusing) - rust-lang#140470 (CI: rfl: move job forward to Linux v6.15-rc4) - rust-lang#140476 (chore: delete unused ui/auxiliary crates) - rust-lang#140481 (Require sanitizers be enabled for asan_odr_windows.rs) - rust-lang#140486 (rustfmt: Also allow bool literals as first item of let chain) - rust-lang#140494 (Parser: Document restrictions) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#140467 - BoxyUwU:no_fcw_assoc_consts, r=lcnr Don't FCW assoc consts in patterns Fixes rust-lang#140447 See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
Fixes #140447
See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which should get FCWs) and const patterns (which cant be anon consts afaik).