mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 12:33:57 +00:00
add a ui test for #101739
This commit is contained in:
parent
82510b90c6
commit
b8b30ae6ba
21
src/test/ui/transmutability/issues-101739.rs
Normal file
21
src/test/ui/transmutability/issues-101739.rs
Normal 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() {}
|
16
src/test/ui/transmutability/issues-101739.stderr
Normal file
16
src/test/ui/transmutability/issues-101739.stderr
Normal 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`.
|
Loading…
Reference in a new issue