Skip to content

Commit 06608c7

Browse files
authored
Rollup merge of #116036 - Enselic:split-large_moves, r=oli-obk
tests/ui: Split large_moves.rs and move to lint/large_assignments To make failing tests easier to debug with `--emit=mir`, etc. Don't bother with `revisions: attribute option` for both tests though. Seems sufficient to just have that on one of the tests. `git show -M --find-renames=40%` makes the diff easier to review. Or note that before this change we had one test with 4 errors, now we have 2 tests with 2 errors each. r? `@oli-obk` Part of #83518
2 parents d5e7df3 + d016e9a commit 06608c7

7 files changed

+96
-94
lines changed

tests/ui/async-await/large_moves.attribute.stderr

-39
This file was deleted.

tests/ui/async-await/large_moves.option.stderr

-39
This file was deleted.

tests/ui/async-await/large_moves.rs renamed to tests/ui/lint/large_assignments/box_rc_arc_allowed.rs

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
11
#![deny(large_assignments)]
22
#![feature(large_assignments)]
3-
#![cfg_attr(attribute, move_size_limit = "1000")]
3+
#![move_size_limit = "1000"]
44
// build-fail
55
// only-x86_64
6-
// revisions: attribute option
7-
// [option]compile-flags: -Zmove-size-limit=1000
86

97
// edition:2018
108
// compile-flags: -Zmir-opt-level=0
119

1210
use std::{sync::Arc, rc::Rc};
1311

1412
fn main() {
15-
let x = async {
16-
let y = [0; 9999];
17-
dbg!(y);
18-
thing(&y).await;
19-
dbg!(y);
20-
};
21-
let z = (x, 42); //~ ERROR large_assignments
22-
let a = z.0; //~ ERROR large_assignments
23-
let b = z.1;
2413
let _ = Arc::new([0; 9999]); // OK!
2514
let _ = Box::new([0; 9999]); // OK!
2615
let _ = Rc::new([0; 9999]); // OK!
2716
let _ = NotBox::new([0; 9999]); //~ ERROR large_assignments
2817
}
2918

30-
async fn thing(y: &[u8]) {
31-
dbg!(y);
32-
}
33-
3419
struct NotBox {
3520
data: [u8; 9999],
3621
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: moving 9999 bytes
2+
--> $DIR/box_rc_arc_allowed.rs:16:13
3+
|
4+
LL | let _ = NotBox::new([0; 9999]);
5+
| ^^^^^^^^^^^^^^^^^^^^^^ value moved from here
6+
|
7+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
8+
note: the lint level is defined here
9+
--> $DIR/box_rc_arc_allowed.rs:1:9
10+
|
11+
LL | #![deny(large_assignments)]
12+
| ^^^^^^^^^^^^^^^^^
13+
14+
error: moving 9999 bytes
15+
--> $DIR/box_rc_arc_allowed.rs:26:13
16+
|
17+
LL | data,
18+
| ^^^^ value moved from here
19+
|
20+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
21+
22+
error: aborting due to 2 previous errors
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: moving 10024 bytes
2+
--> $DIR/large_future.rs:19:14
3+
|
4+
LL | let z = (x, 42);
5+
| ^ value moved from here
6+
|
7+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
8+
note: the lint level is defined here
9+
--> $DIR/large_future.rs:1:9
10+
|
11+
LL | #![deny(large_assignments)]
12+
| ^^^^^^^^^^^^^^^^^
13+
14+
error: moving 10024 bytes
15+
--> $DIR/large_future.rs:20:13
16+
|
17+
LL | let a = z.0;
18+
| ^^^ value moved from here
19+
|
20+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
21+
22+
error: aborting due to 2 previous errors
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error: moving 10024 bytes
2+
--> $DIR/large_future.rs:19:14
3+
|
4+
LL | let z = (x, 42);
5+
| ^ value moved from here
6+
|
7+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
8+
note: the lint level is defined here
9+
--> $DIR/large_future.rs:1:9
10+
|
11+
LL | #![deny(large_assignments)]
12+
| ^^^^^^^^^^^^^^^^^
13+
14+
error: moving 10024 bytes
15+
--> $DIR/large_future.rs:20:13
16+
|
17+
LL | let a = z.0;
18+
| ^^^ value moved from here
19+
|
20+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
21+
22+
error: aborting due to 2 previous errors
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#![deny(large_assignments)]
2+
#![cfg_attr(attribute, feature(large_assignments))]
3+
#![cfg_attr(attribute, move_size_limit = "1000")]
4+
// build-fail
5+
// only-x86_64
6+
// revisions: attribute option
7+
// [option]compile-flags: -Zmove-size-limit=1000
8+
9+
// edition:2018
10+
// compile-flags: -Zmir-opt-level=0
11+
12+
fn main() {
13+
let x = async {
14+
let y = [0; 9999];
15+
dbg!(y);
16+
thing(&y).await;
17+
dbg!(y);
18+
};
19+
let z = (x, 42); //~ ERROR large_assignments
20+
let a = z.0; //~ ERROR large_assignments
21+
let b = z.1;
22+
}
23+
24+
async fn thing(y: &[u8]) {
25+
dbg!(y);
26+
}

0 commit comments

Comments
 (0)