Fix dead code warning when inline const is used in pattern#88036
Fix dead code warning when inline const is used in pattern#88036bors merged 2 commits intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
I'd never guess that |
|
📌 Commit 17d18e3822d5e5876fbf9d2ddd6d2b4a6783e117 has been approved by |
|
Actually this approach doesn't catch |
|
Added a test case for using inline const in range pattern |
It's surprising to me as well, but I guess that's probably the easiest way to implement it since it'll need to have a |
Yeah, it's a better approach, it should also fix cases like const fn one() -> i32 {
1
}
struct S<const C: i32>;
fn main() {
match S::<1> {
S::<{one()}> => {}
}
}Could you actually add this case too? @bors r- |
|
Added and merged |
|
Thanks! |
|
📌 Commit e62ecdc has been approved by |
Fix dead code warning when inline const is used in pattern Fixes rust-lang#78171
…laumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#87818 (Fix anchors display in rustdoc) - rust-lang#87983 (Use more accurate spans when proposing adding lifetime to item) - rust-lang#88012 (Change WASI's `RawFd` from `u32` to `c_int` (`i32`).) - rust-lang#88031 (Make `BuildHasher` object safe) - rust-lang#88036 (Fix dead code warning when inline const is used in pattern) - rust-lang#88082 (Take into account jobs number for rustdoc GUI tests) - rust-lang#88109 (Fix environment variable getter docs) - rust-lang#88111 (Add background-color on clickable definitions in source code) - rust-lang#88129 (Fix dataflow graphviz bug, make dataflow graphviz modules public) - rust-lang#88136 (Move private_unused.rs test to impl-trait) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #78171