Rollup merge of #78388 - camelid:regression-tests, r=lcnr

Add some regression tests

Closes #75763.
Closes #76179.
This commit is contained in:
Yuki Okushi 2020-10-27 08:45:17 +09:00 committed by GitHub
commit 98e2a9564f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,15 @@
// build-pass
#![allow(incomplete_features)]
#![feature(const_generics)]
struct Bug<const S: &'static str>;
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])
}
}>;
}

View file

@ -0,0 +1,19 @@
// check-pass
#![feature(associated_type_defaults)]
use std::io::Read;
trait View {
type Deserializers: Deserializer<Item = Self::RequestParams>;
type RequestParams = DefaultRequestParams;
}
struct DefaultRequestParams;
trait Deserializer {
type Item;
fn deserialize(r: impl Read) -> Self::Item;
}
fn main() {}