Skip to content

Commit

Permalink
add known-bug test for unsound issue 100041
Browse files Browse the repository at this point in the history
  • Loading branch information
whtahy committed Apr 22, 2023
1 parent 3141262 commit cff6c0e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/ui/wf/wf-normalization-sized.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// check-pass
// known-bug: #100041

// Should fail. Normalization can bypass well-formedness checking.
// `[[[[[[u8]]]]]]` is not a well-formed type since size of type `[u8]` cannot
// be known at compile time (since `Sized` is not implemented for `[u8]`).

trait WellUnformed {
type RequestNormalize;
}

impl<T: ?Sized> WellUnformed for T {
type RequestNormalize = ();
}

const _: <[[[[[[u8]]]]]] as WellUnformed>::RequestNormalize = ();
const _: <Vec<str> as WellUnformed>::RequestNormalize = ();

fn main() {}

0 comments on commit cff6c0e

Please sign in to comment.