forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#129242 - jieyouxu:rollup-1yhzl81, r=jieyouxu
Rollup of 4 pull requests Successful merges: - rust-lang#128084 (Suggest adding Result return type for associated method in E0277.) - rust-lang#129187 (bootstrap: fix clean's remove_dir_all implementation) - rust-lang#129208 (Fix order of normalization and recursion in const folding.) - rust-lang#129228 (crashes: more tests) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
14 changed files
with
252 additions
and
89 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
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
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
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,7 @@ | ||
//@ known-bug: rust-lang/rust#129150 | ||
//@ only-x86_64 | ||
use std::arch::x86_64::_mm_blend_ps; | ||
|
||
pub fn main() { | ||
_mm_blend_ps(1, 2, &const {} ); | ||
} |
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,7 @@ | ||
//@ known-bug: rust-lang/rust#129166 | ||
|
||
fn main() { | ||
#[cfg_eval] | ||
#[cfg] | ||
0 | ||
} |
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,5 @@ | ||
//@ known-bug: rust-lang/rust#129205 | ||
|
||
fn x<T: Copy>() { | ||
T::try_from(); | ||
} |
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,11 @@ | ||
//@ known-bug: rust-lang/rust#129209 | ||
|
||
impl< | ||
const N: usize = { | ||
static || { | ||
Foo([0; X]); | ||
} | ||
}, | ||
> PartialEq for True | ||
{ | ||
} |
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,30 @@ | ||
//@ known-bug: rust-lang/rust#129214 | ||
//@ compile-flags: -Zvalidate-mir -Copt-level=3 --crate-type=lib | ||
|
||
trait to_str {} | ||
|
||
trait map<T> { | ||
fn map<U, F>(&self, f: F) -> Vec<U> | ||
where | ||
F: FnMut(&Box<usize>) -> U; | ||
} | ||
impl<T> map<T> for Vec<T> { | ||
fn map<U, F>(&self, mut f: F) -> Vec<U> | ||
where | ||
F: FnMut(&T) -> U, | ||
{ | ||
let mut r = Vec::new(); | ||
for i in self { | ||
r.push(f(i)); | ||
} | ||
r | ||
} | ||
} | ||
|
||
fn foo<U, T: map<U>>(x: T) -> Vec<String> { | ||
x.map(|_e| "hi".to_string()) | ||
} | ||
|
||
pub fn main() { | ||
assert_eq!(foo(vec![1]), ["hi".to_string()]); | ||
} |
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,11 @@ | ||
//@ known-bug: rust-lang/rust#129216 | ||
|
||
trait Mirror { | ||
type Assoc; | ||
} | ||
|
||
struct Foo; | ||
|
||
fn main() { | ||
<Foo as Mirror>::Assoc::new(); | ||
} |
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,26 @@ | ||
//@ known-bug: rust-lang/rust#129219 | ||
//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir --edition=2018 | ||
|
||
use core::marker::Unsize; | ||
|
||
pub trait CastTo<T: ?Sized>: Unsize<T> {} | ||
|
||
impl<T: ?Sized, U: ?Sized> CastTo<T> for U {} | ||
|
||
impl<T: ?Sized> Cast for T {} | ||
pub trait Cast { | ||
fn cast<T: ?Sized>(&self) -> &T | ||
where | ||
Self: CastTo<T>, | ||
{ | ||
self | ||
} | ||
} | ||
|
||
pub trait Foo {} | ||
impl Foo for [i32; 0] {} | ||
|
||
fn main() { | ||
let x: &dyn Foo = &[]; | ||
let x = x.cast::<[i32]>(); | ||
} |
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,25 @@ | ||
//@ compile-flags: -Cdebuginfo=2 --crate-type=lib | ||
//@ build-pass | ||
#![feature(adt_const_params)] | ||
|
||
const N_ISLANDS: usize = 4; | ||
|
||
pub type Matrix = [[usize; N_ISLANDS]; N_ISLANDS]; | ||
|
||
const EMPTY_MATRIX: Matrix = [[0; N_ISLANDS]; N_ISLANDS]; | ||
|
||
const fn to_matrix() -> Matrix { | ||
EMPTY_MATRIX | ||
} | ||
|
||
const BRIDGE_MATRIX: [[usize; N_ISLANDS]; N_ISLANDS] = to_matrix(); | ||
|
||
pub struct Walk<const CURRENT: usize, const REMAINING: Matrix> { | ||
_p: (), | ||
} | ||
|
||
impl Walk<0, BRIDGE_MATRIX> { | ||
pub const fn new() -> Self { | ||
Self { _p: () } | ||
} | ||
} |
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
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
Oops, something went wrong.