forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#129208 - veluca93:adt_const_fix, r=BoxyUwU Fix order of normalization and recursion in const folding. Fixes rust-lang#126831. Without this patch, type normalization is not always idempotent, which leads to all sorts of bugs in places that assume that normalizing a normalized type does nothing. Tracking issue: rust-lang#95174 r? BoxyUwU
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//@ compile-flags: -Cdebuginfo=2 --crate-type=lib | ||
//@ build-pass | ||
#![feature(adt_const_params)] | ||
|
||
const N_ISLANDS: usize = 4; | ||
|
||
pub type Matrix = [[usize; N_ISLANDS]; N_ISLANDS]; | ||
|
||
const EMPTY_MATRIX: Matrix = [[0; N_ISLANDS]; N_ISLANDS]; | ||
|
||
const fn to_matrix() -> Matrix { | ||
EMPTY_MATRIX | ||
} | ||
|
||
const BRIDGE_MATRIX: [[usize; N_ISLANDS]; N_ISLANDS] = to_matrix(); | ||
|
||
pub struct Walk<const CURRENT: usize, const REMAINING: Matrix> { | ||
_p: (), | ||
} | ||
|
||
impl Walk<0, BRIDGE_MATRIX> { | ||
pub const fn new() -> Self { | ||
Self { _p: () } | ||
} | ||
} |