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.
Auto merge of rust-lang#134374 - matthiaskrgr:rollup-2tbbrxq, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#134314 (Make sure to use normalized ty for unevaluated const in default struct value) - rust-lang#134342 (crashes: more tests) - rust-lang#134357 (Fix `trimmed_def_paths` ICE in the function ptr comparison lint) - rust-lang#134369 (Update spelling of "referring") - rust-lang#134372 (Disable `tests/ui/associated-consts/issue-93775.rs` on windows msvc) Failed merges: - rust-lang#134365 (Rename `rustc_mir_build::build` to `builder`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
25 changed files
with
309 additions
and
65 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
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,23 @@ | ||
//@ known-bug: #130797 | ||
|
||
trait Transform { | ||
type Output<'a>; | ||
} | ||
trait Propagate<O> {} | ||
trait AddChild<C> { | ||
fn add_child(&self) {} | ||
} | ||
|
||
pub struct Node<T>(T); | ||
impl<T> AddChild<Box<dyn for<'b> Propagate<T::Output<'b>>>> for Node<T> where T: Transform {} | ||
|
||
fn make_graph_root() { | ||
Node(Dummy).add_child() | ||
} | ||
|
||
struct Dummy; | ||
impl Transform for Dummy { | ||
type Output<'a> = (); | ||
} | ||
|
||
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,21 @@ | ||
//@ known-bug: #132103 | ||
//@compile-flags: -Zvalidate-mir --edition=2018 -Zinline-mir=yes | ||
use core::future::{async_drop_in_place, Future}; | ||
use core::mem::{self}; | ||
use core::pin::pin; | ||
use core::task::{Context, Waker}; | ||
|
||
async fn test_async_drop<T>(x: T) { | ||
let mut x = mem::MaybeUninit::new(x); | ||
pin!(unsafe { async_drop_in_place(x.as_mut_ptr()) }); | ||
} | ||
|
||
fn main() { | ||
let waker = Waker::noop(); | ||
let mut cx = Context::from_waker(&waker); | ||
|
||
let fut = pin!(async { | ||
test_async_drop(test_async_drop(0)).await; | ||
}); | ||
fut.poll(&mut cx); | ||
} |
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,36 @@ | ||
//@ known-bug: #132960 | ||
|
||
#![feature(adt_const_params, const_ptr_read, generic_const_exprs)] | ||
|
||
const fn concat_strs<const A: &'static str, const B: &'static str>() -> &'static str | ||
where | ||
[(); A.len()]:, | ||
[(); B.len()]:, | ||
[(); A.len() + B.len()]:, | ||
{ | ||
#[repr(C)] | ||
#[repr(C)] | ||
|
||
const fn concat_arr<const M: usize, const N: usize>(a: [u8; M], b: [u8; N]) -> [u8; M + N] {} | ||
|
||
struct Inner<const A: &'static str, const B: &'static str>; | ||
impl<const A: &'static str, const B: &'static str> Inner<A, B> | ||
where | ||
[(); A.len()]:, | ||
[(); B.len()]:, | ||
[(); A.len() + B.len()]:, | ||
{ | ||
const ABSTR: &'static str = unsafe { | ||
std::str::from_utf8_unchecked(&concat_arr( | ||
A.as_ptr().cast().read(), | ||
B.as_ptr().cast().read(), | ||
)) | ||
}; | ||
} | ||
|
||
Inner::<A, B>::ABSTR | ||
} | ||
|
||
const FOO: &str = "foo"; | ||
const BAR: &str = "bar"; | ||
const FOOBAR: &str = concat_strs::<FOO, BAR>(); |
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,8 @@ | ||
//@ known-bug: #133117 | ||
|
||
fn main() { | ||
match () { | ||
(!|!) if true => {} | ||
(!|!) if 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,43 @@ | ||
//@ known-bug: #133252 | ||
//@ edition:2021 | ||
use std::future::Future; | ||
|
||
trait Owned: 'static {} | ||
fn ice() -> impl Future<Output = &'static dyn Owned> { | ||
async { | ||
let not_static = 0; | ||
force_send(async_load(¬_static)); | ||
loop {} | ||
} | ||
} | ||
|
||
fn force_send<T: Send>(_: T) {} | ||
|
||
fn async_load<'a, T: LoadQuery<'a>>(this: T) -> impl Future { | ||
async { | ||
this.get_future().await; | ||
} | ||
} | ||
|
||
trait LoadQuery<'a>: Sized { | ||
type LoadFuture: Future; | ||
|
||
fn get_future(self) -> Self::LoadFuture { | ||
loop {} | ||
} | ||
} | ||
|
||
impl<'a> LoadQuery<'a> for &'a u8 { | ||
type LoadFuture = SimpleFuture; | ||
} | ||
|
||
struct SimpleFuture; | ||
impl Future for SimpleFuture { | ||
type Output = (); | ||
fn poll( | ||
self: std::pin::Pin<&mut Self>, | ||
_: &mut std::task::Context<'_>, | ||
) -> std::task::Poll<Self::Output> { | ||
loop {} | ||
} | ||
} |
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: #133613 | ||
|
||
struct Wrapper<'a>(); | ||
|
||
trait IntFactory { | ||
fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send>>; | ||
} |
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,17 @@ | ||
//@ known-bug: #134175 | ||
//@compile-flags: -Zvalidate-mir -Zinline-mir=yes | ||
use std::vec::IntoIter; | ||
|
||
pub(crate) trait Foo: Iterator<Item = <Self as Foo>::Key> { | ||
type Key; | ||
} | ||
|
||
impl Foo for IntoIter<i16> {} | ||
|
||
fn sum_foo<F: Foo<Key = i32>>(f: F) -> i32 { | ||
f.fold(0, |a, b| a + b) | ||
} | ||
|
||
fn main() { | ||
let x = sum_foo(vec![11, 10, 1].into_iter()); | ||
} |
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 @@ | ||
//@ known-bug: #134334 | ||
//@ only-x86_64 | ||
|
||
#[repr(simd)] | ||
struct A(); | ||
|
||
fn main() { | ||
std::arch::asm!("{}", in(xmm_reg) A()); | ||
} |
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,12 @@ | ||
//@ known-bug: #134335 | ||
//@compile-flags: -Zunstable-options --edition=2024 --crate-type=lib | ||
pub async fn async_closure(x: &mut i32) { | ||
let c = async move || { | ||
*x += 1; | ||
}; | ||
call_once(c).await; | ||
} | ||
|
||
fn call_once<T>(f: impl FnOnce() -> T) -> T { | ||
f() | ||
} |
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.