forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |