Skip to content

Commit b806d39

Browse files
committed
Auto merge of #155901 - jhpratt:rollup-R3JaeoO, r=jhpratt
Rollup of 3 pull requests Successful merges: - #155894 (triagebot: add myself to libs rotation) - #155897 (Add regression test for LLVM bug with huge stack frames) - #155900 (Refer to `FnDef` as "function item", not "function pointer")
2 parents b20956b + 6960391 commit b806d39

4 files changed

Lines changed: 33 additions & 9 deletions

File tree

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
533533
ty::FnDef(def_id, _) => {
534534
let name = self.infcx.tcx.item_name(*def_id);
535535
let identity_args = GenericArgs::identity_for_item(self.infcx.tcx, *def_id);
536-
let desc = format!("a function pointer to `{name}`");
536+
let desc = format!("the function item type defined by `{name}`");
537537
let note = format!(
538538
"the function `{name}` is invariant over the parameter `{}`",
539539
identity_args[param_index as usize]

tests/ui/codegen/huge-stacks.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ revisions: unoptimized optimized
2+
//@[optimized]compile-flags: -O
3+
//@ run-pass
4+
//@ only-64bit
5+
//@ min-llvm-version: 22
6+
7+
// Regression test for https://github.com/rust-lang/rust/issues/83060
8+
9+
fn func() {
10+
const CAP: usize = std::u32::MAX as usize;
11+
let mut x: [u8; CAP] = [0; CAP];
12+
x[2] = 123;
13+
assert_eq!(x[2], 123);
14+
}
15+
16+
fn main() {
17+
std::thread::Builder::new()
18+
.stack_size(5 * 1024 * 1024 * 1024)
19+
.spawn(func)
20+
.unwrap()
21+
.join()
22+
.unwrap();
23+
}

tests/ui/fn/fn_def_coercion.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | let mut x = foo::<&'a ()>;
99
| ^^^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
1010
|
1111
= help: consider adding the following bound: `'b: 'a`
12-
= note: requirement occurs because of a function pointer to `foo`
12+
= note: requirement occurs because of the function item type defined by `foo`
1313
= note: the function `foo` is invariant over the parameter `T`
1414
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
1515

@@ -25,7 +25,7 @@ LL | x = foo::<&'b ()>;
2525
| ^^^^^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
2626
|
2727
= help: consider adding the following bound: `'a: 'b`
28-
= note: requirement occurs because of a function pointer to `foo`
28+
= note: requirement occurs because of the function item type defined by `foo`
2929
= note: the function `foo` is invariant over the parameter `T`
3030
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
3131

@@ -56,7 +56,7 @@ LL | x = foo::<&'b ()>;
5656
| ^^^^^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
5757
|
5858
= help: consider adding the following bound: `'a: 'b`
59-
= note: requirement occurs because of a function pointer to `foo`
59+
= note: requirement occurs because of the function item type defined by `foo`
6060
= note: the function `foo` is invariant over the parameter `T`
6161
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
6262

@@ -72,7 +72,7 @@ LL | x = foo::<&'a ()>;
7272
| ^^^^^^^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
7373
|
7474
= help: consider adding the following bound: `'b: 'a`
75-
= note: requirement occurs because of a function pointer to `foo`
75+
= note: requirement occurs because of the function item type defined by `foo`
7676
= note: the function `foo` is invariant over the parameter `T`
7777
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
7878

@@ -92,7 +92,7 @@ LL | true => foo::<&'b ()>,
9292
| ^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
9393
|
9494
= help: consider adding the following bound: `'a: 'b`
95-
= note: requirement occurs because of a function pointer to `foo`
95+
= note: requirement occurs because of the function item type defined by `foo`
9696
= note: the function `foo` is invariant over the parameter `T`
9797
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
9898

@@ -108,7 +108,7 @@ LL | false => foo::<&'a ()>,
108108
| ^^^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
109109
|
110110
= help: consider adding the following bound: `'b: 'a`
111-
= note: requirement occurs because of a function pointer to `foo`
111+
= note: requirement occurs because of the function item type defined by `foo`
112112
= note: the function `foo` is invariant over the parameter `T`
113113
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
114114

@@ -128,7 +128,7 @@ LL | true => foo::<&'c ()>,
128128
| ^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'c`
129129
|
130130
= help: consider adding the following bound: `'a: 'c`
131-
= note: requirement occurs because of a function pointer to `foo`
131+
= note: requirement occurs because of the function item type defined by `foo`
132132
= note: the function `foo` is invariant over the parameter `T`
133133
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
134134

@@ -144,7 +144,7 @@ LL | false => foo::<&'a ()>,
144144
| ^^^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
145145
|
146146
= help: consider adding the following bound: `'b: 'a`
147-
= note: requirement occurs because of a function pointer to `foo`
147+
= note: requirement occurs because of the function item type defined by `foo`
148148
= note: the function `foo` is invariant over the parameter `T`
149149
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
150150

triagebot.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,7 @@ libs = [
14931493
"@tgross35",
14941494
"@thomcc",
14951495
"@joboet",
1496+
"@nia-e",
14961497
]
14971498
infra-ci = [
14981499
"@Mark-Simulacrum",

0 commit comments

Comments
 (0)