Skip to content

Commit

Permalink
add a ui test for rust-lang#101739
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Oct 3, 2022
1 parent 82510b9 commit b8b30ae
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/transmutability/issues-101739.rs
Original file line number Diff line number Diff line change
@@ -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() {}
16 changes: 16 additions & 0 deletions src/test/ui/transmutability/issues-101739.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit b8b30ae

Please sign in to comment.