Skip to content

Commit 4388ac5

Browse files
authored
Rollup merge of #95478 - InfRandomness:infrandomness/lint_largemove_note, r=compiler-errors
Add note to the move size diagnostic context: #83518
2 parents c6764c9 + d65b9a1 commit 4388ac5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Diff for: compiler/rustc_monomorphize/src/collector.rs

+1
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
859859
|lint| {
860860
let mut err = lint.build(&format!("moving {} bytes", layout.size.bytes()));
861861
err.span_label(source_info.span, "value moved from here");
862+
err.note(&format!(r#"The current maximum size is {}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`"#, limit.bytes()));
862863
err.emit();
863864
},
864865
);

Diff for: src/test/ui/async-await/large_moves.attribute.stderr

+7
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,31 @@ note: the lint level is defined here
1515
|
1616
LL | #![deny(large_assignments)]
1717
| ^^^^^^^^^^^^^^^^^
18+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
1819

1920
error: moving 10024 bytes
2021
--> $DIR/large_moves.rs:18:14
2122
|
2223
LL | let z = (x, 42);
2324
| ^ value moved from here
25+
|
26+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
2427

2528
error: moving 10024 bytes
2629
--> $DIR/large_moves.rs:18:13
2730
|
2831
LL | let z = (x, 42);
2932
| ^^^^^^^ value moved from here
33+
|
34+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
3035

3136
error: moving 10024 bytes
3237
--> $DIR/large_moves.rs:20:13
3338
|
3439
LL | let a = z.0;
3540
| ^^^ value moved from here
41+
|
42+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
3643

3744
error: aborting due to 4 previous errors
3845

Diff for: src/test/ui/async-await/large_moves.option.stderr

+7
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,31 @@ note: the lint level is defined here
1515
|
1616
LL | #![deny(large_assignments)]
1717
| ^^^^^^^^^^^^^^^^^
18+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
1819

1920
error: moving 10024 bytes
2021
--> $DIR/large_moves.rs:18:14
2122
|
2223
LL | let z = (x, 42);
2324
| ^ value moved from here
25+
|
26+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
2427

2528
error: moving 10024 bytes
2629
--> $DIR/large_moves.rs:18:13
2730
|
2831
LL | let z = (x, 42);
2932
| ^^^^^^^ value moved from here
33+
|
34+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
3035

3136
error: moving 10024 bytes
3237
--> $DIR/large_moves.rs:20:13
3338
|
3439
LL | let a = z.0;
3540
| ^^^ value moved from here
41+
|
42+
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
3643

3744
error: aborting due to 4 previous errors
3845

0 commit comments

Comments
 (0)