add a ui test for #101739

This commit is contained in:
Takayuki Maeda 2022-10-03 15:02:38 +09:00
parent 82510b90c6
commit b8b30ae6ba
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#![feature(transmutability)]
mod assert {
use std::mem::BikeshedIntrinsicFrom;
pub fn is_transmutable<Src, Context, const ASSUME_ALIGNMENT: bool>()
where
Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope
//~^ ERROR mismatched types
{
}
}
fn via_const() {
struct Context;
struct Src;
assert::is_transmutable::<Src, Context, false>();
}
fn main() {}

View file

@ -0,0 +1,16 @@
error[E0412]: cannot find type `Dst` in this scope
--> $DIR/issues-101739.rs:8:9
|
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
| ^^^ not found in this scope
error[E0308]: mismatched types
--> $DIR/issues-101739.rs:8:50
|
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
| ^^^^^^^^^^^^^^^^ expected struct `Assume`, found `bool`
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0308, E0412.
For more information about an error, try `rustc --explain E0308`.