forked from rust-lang/glacier
-
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
1 parent
5ca315a
commit c117519
Showing
4 changed files
with
62 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,24 @@ | ||
#!/bin/bash | ||
|
||
rustc -Zsave-analysis - <<'EOF' | ||
#![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>, | ||
{} | ||
} | ||
fn via_const() { | ||
struct Context; | ||
struct Src; | ||
assert::is_transmutable::<Src, Context, false>(); | ||
} | ||
EOF | ||
|
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,10 @@ | ||
pub fn ice( | ||
x: impl AsRef<str>, | ||
) -> impl IntoIterator<Item = ()> { | ||
vec![].append(&mut ice(x.as_ref())); | ||
|
||
Vec::new() | ||
} | ||
|
||
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,19 @@ | ||
pub trait Trait { | ||
type Fut<'a> where Self: 'a; | ||
fn fun<'a, 'b>(&'a self, x: &'_ mut &'b ()) -> Self::Fut<'a> | ||
where | ||
'b: 'a; | ||
} | ||
impl Trait for () { | ||
type Fut<'a> = impl ::std::future::Future + 'a | ||
where | ||
Self: 'a; | ||
fn fun<'a, 'b>(&'a self, x: &'_ mut &'b ()) -> Self::Fut<'a> | ||
where | ||
'b: 'a, | ||
{ | ||
async { } | ||
} | ||
} | ||
|
||
pub 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,9 @@ | ||
#![feature(core_intrinsics)] | ||
|
||
pub fn wrapping<T: Copy>(a: T, b: T) { | ||
let _z = core::intrinsics::wrapping_mul(a, b); | ||
} | ||
|
||
pub fn main() { | ||
wrapping(1,2); | ||
} |