Skip to content

Commit 2574810

Browse files
committed
Auto merge of #158524 - JonathanBrouwer:rollup-75ZlceV, r=JonathanBrouwer
Rollup of 4 pull requests Successful merges: - #158486 (std: treat ENFILE as transient in the pidfd support probe) - #158454 (regression test for `Trait<A><B>` in "consider further restricting this bound" suggestion) - #158518 (Fix mixed use of "a" / "an" article in E0277) - #158519 (add crashtests [2/N])
2 parents b4486ca + 412fd6b commit 2574810

88 files changed

Lines changed: 330 additions & 128 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

library/core/src/ops/function.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use crate::marker::Tuple;
6767
// SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
6868
label = "call the function in a closure: `|| unsafe {{ /* code */ }}`"
6969
),
70-
message = "expected a `{This:resolved}` closure, found `{Self}`",
70+
message = "expected an `{This:resolved}` closure, found `{Self}`",
7171
label = "expected an `{This:resolved}` closure, found `{Self}`"
7272
)]
7373
#[fundamental] // so that regex can rely that `&str: !FnMut`
@@ -154,7 +154,7 @@ pub const trait Fn<Args: Tuple>: [const] FnMut<Args> {
154154
// SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
155155
label = "call the function in a closure: `|| unsafe {{ /* code */ }}`"
156156
),
157-
message = "expected a `{This:resolved}` closure, found `{Self}`",
157+
message = "expected an `{This:resolved}` closure, found `{Self}`",
158158
label = "expected an `{This:resolved}` closure, found `{Self}`"
159159
)]
160160
#[fundamental] // so that regex can rely that `&str: !FnMut`
@@ -233,7 +233,7 @@ pub const trait FnMut<Args: Tuple>: FnOnce<Args> {
233233
// SAFETY: tidy is not smart enough to tell that the below unsafe block is a string
234234
label = "call the function in a closure: `|| unsafe {{ /* code */ }}`"
235235
),
236-
message = "expected a `{This:resolved}` closure, found `{Self}`",
236+
message = "expected an `{This:resolved}` closure, found `{Self}`",
237237
label = "expected an `{This:resolved}` closure, found `{Self}`"
238238
)]
239239
#[fundamental] // so that regex can rely that `&str: !FnMut`

library/std/src/sys/process/unix/unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ impl Command {
510510
support = SPAWN;
511511
}
512512
}
513-
Err(e) if e.raw_os_error() == Some(libc::EMFILE) => {
514-
// We're temporarily(?) out of file descriptors. In this case pidfd_spawnp would also fail
513+
Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE | libc::ENOMEM)) => {
514+
// We're temporarily(?) out of file descriptors or memory. In this case pidfd_spawnp would also fail
515515
// Don't update the support flag so we can probe again later.
516516
return Err(e)
517517
}

tests/crashes/149748.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #149748
2+
//@ edition: 2024
3+
//@ compile-flags: -Zmir-enable-passes=+Inline -Zmir-enable-passes=+ReferencePropagation -Zlint-mir
4+
5+
#![feature(gen_blocks)]
6+
gen fn foo(z: i32) -> i32 {
7+
yield z;
8+
z;
9+
}
10+
pub fn main() {
11+
let mut iter = foo(3);
12+
assert_eq!(iter.next(), Some(3))
13+
}

tests/crashes/150040.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #150040
2+
3+
fn main() {
4+
let [(ref a, b), x];
5+
a = "";
6+
b = 5;
7+
}

tests/crashes/150049.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: #150049
2+
#![feature(min_generic_const_args)]
3+
#![feature(inherent_associated_types)]
4+
struct Foo<'a> {
5+
x: &'a (),
6+
}
7+
8+
impl<'a> Foo<'a> {
9+
fn foo(_: [u8; Foo::X]) { std::mem::transmute([4]) }
10+
}
11+
12+
fn main() {}

tests/crashes/150128.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ known-bug: #150128
2+
fn main() {
3+
match 0 {
4+
_ => || (),
5+
_ => || (),
6+
_ => (|| ()) as unsafe fn,
7+
};
8+
}

tests/crashes/150296.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #150296
2+
#[derive(PartialEq)]
3+
pub struct Thing<const N: usize>;
4+
5+
impl<const N: usize> Thing<N> {
6+
const A: Self = Thing;
7+
}
8+
9+
fn broken<const N: usize>(x: Thing<N>) {
10+
match x {
11+
<Thing<N>>::A => {}
12+
_ => {}
13+
}
14+
}

tests/crashes/150387.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #150387
2+
#![feature(min_specialization)]
3+
#![allow(dead_code)]
4+
5+
struct Thing<T>(T) where [T]: Sized;
6+
7+
impl<T> Drop for Thing<T> where [T]: Sized {
8+
default fn drop(&mut self) {}
9+
}
10+
impl<T> Drop for Thing<T> where [T]: Sized {
11+
fn drop(&mut self) {}
12+
}
13+
fn main() {}

tests/crashes/150403.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ known-bug: #150403
2+
#![feature(non_lifetime_binders)]
3+
4+
trait A {
5+
type GAT<T>: A;
6+
fn foo<T>(self, t: T) -> Self::GAT<T>
7+
where
8+
Self: Sized;
9+
}
10+
11+
trait B: A where
12+
for<T> Self::GAT<T>: B,
13+
{
14+
fn bar<T>(self) -> Self::GAT<T>
15+
where
16+
Self: Sized;
17+
18+
fn baz<T>(self, t: T) -> Self::GAT<T>
19+
where
20+
Self: Sized,
21+
{
22+
self.foo(t).bar()
23+
}
24+
}
25+
26+
fn main() {}

tests/crashes/150517.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: #150517
2+
trait Stream {
3+
type Item;
4+
fn next(self) -> ();
5+
}
6+
impl Stream for &'a () {}
7+
impl<'a, A> Stream for <&A as Stream>::Item {}
8+
trait StreamExt {
9+
fn f(self) -> ()
10+
where
11+
for<'b> &'b A: Stream,
12+
{
13+
self.next()
14+
}
15+
}

0 commit comments

Comments
 (0)