Skip to content

Commit cff6c0e

Browse files
committed
add known-bug test for unsound issue 100041
1 parent 3141262 commit cff6c0e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/ui/wf/wf-normalization-sized.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// check-pass
2+
// known-bug: #100041
3+
4+
// Should fail. Normalization can bypass well-formedness checking.
5+
// `[[[[[[u8]]]]]]` is not a well-formed type since size of type `[u8]` cannot
6+
// be known at compile time (since `Sized` is not implemented for `[u8]`).
7+
8+
trait WellUnformed {
9+
type RequestNormalize;
10+
}
11+
12+
impl<T: ?Sized> WellUnformed for T {
13+
type RequestNormalize = ();
14+
}
15+
16+
const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
17+
const _: <Vec<str> as WellUnformed>::RequestNormalize = ();
18+
19+
fn main() {}

0 commit comments

Comments
 (0)