From 94ed9455e831e820041291165576a4f78e6e722a Mon Sep 17 00:00:00 2001 From: Camelid Date: Sun, 25 Oct 2020 22:01:37 -0700 Subject: [PATCH 1/2] Add some regression tests --- src/test/ui/issues/issue-75763.rs | 14 ++++++++++++++ src/test/ui/issues/issue-76179.rs | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/test/ui/issues/issue-75763.rs create mode 100644 src/test/ui/issues/issue-76179.rs diff --git a/src/test/ui/issues/issue-75763.rs b/src/test/ui/issues/issue-75763.rs new file mode 100644 index 0000000000000..2ecc16be7f6de --- /dev/null +++ b/src/test/ui/issues/issue-75763.rs @@ -0,0 +1,14 @@ +// build-pass + +#![allow(incomplete_features)] +#![feature(const_generics)] + +struct Bug; + +fn main() { + let b: Bug::<{ + unsafe { + std::mem::transmute::<&[u8], &str>(&[0xC0, 0xC1, 0xF5]) + } + }>; +} diff --git a/src/test/ui/issues/issue-76179.rs b/src/test/ui/issues/issue-76179.rs new file mode 100644 index 0000000000000..0e086968b9056 --- /dev/null +++ b/src/test/ui/issues/issue-76179.rs @@ -0,0 +1,19 @@ +// check-pass + +#![feature(associated_type_defaults)] + +use std::io::Read; + +trait View { + type Deserializers: Deserializer; + type RequestParams = DefaultRequestParams; +} + +struct DefaultRequestParams; + +trait Deserializer { + type Item; + fn deserialize(r: impl Read) -> Self::Item; +} + +fn main() {} From 4641d2e6aa990d3fb6730a3208e9fd857f52eb33 Mon Sep 17 00:00:00 2001 From: Camelid Date: Mon, 26 Oct 2020 13:56:31 -0700 Subject: [PATCH 2/2] Add FIXME note to const generics test Co-authored-by: lcnr --- src/test/ui/issues/issue-75763.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/ui/issues/issue-75763.rs b/src/test/ui/issues/issue-75763.rs index 2ecc16be7f6de..2fd9f9a60de9f 100644 --- a/src/test/ui/issues/issue-75763.rs +++ b/src/test/ui/issues/issue-75763.rs @@ -8,6 +8,7 @@ struct Bug; fn main() { let b: Bug::<{ unsafe { + // FIXME(const_generics): Decide on how to deal with invalid values as const params. std::mem::transmute::<&[u8], &str>(&[0xC0, 0xC1, 0xF5]) } }>;