-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure to use normalized ty for unevaluated const for default stru…
…ct value
- Loading branch information
1 parent
ad30cae
commit f870761
Showing
2 changed files
with
28 additions
and
5 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
17 changes: 17 additions & 0 deletions
17
tests/ui/structs/default-field-values/use-normalized-ty-for-default-struct-value.rs
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,17 @@ | ||
//@ check-pass | ||
|
||
#![feature(default_field_values)] | ||
|
||
struct Value<const VALUE: u8>; | ||
|
||
impl<const VALUE: u8> Value<VALUE> { | ||
pub const VALUE: Self = Self; | ||
} | ||
|
||
pub struct WithUse { | ||
_use: Value<{ 0 + 0 }> = Value::VALUE | ||
} | ||
|
||
const _: WithUse = WithUse { .. }; | ||
|
||
fn main() {} |