Rollup merge of #95478 - InfRandomness:infrandomness/lint_largemove_note, r=compiler-errors
Add note to the move size diagnostic context: https://github.com/rust-lang/rust/issues/83518
This commit is contained in:
commit
4388ac58a2
3 changed files with 15 additions and 0 deletions
|
@ -859,6 +859,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
|
|||
|lint| {
|
||||
let mut err = lint.build(&format!("moving {} bytes", layout.size.bytes()));
|
||||
err.span_label(source_info.span, "value moved from here");
|
||||
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()));
|
||||
err.emit();
|
||||
},
|
||||
);
|
||||
|
|
|
@ -15,24 +15,31 @@ note: the lint level is defined here
|
|||
|
|
||||
LL | #![deny(large_assignments)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: moving 10024 bytes
|
||||
--> $DIR/large_moves.rs:18:14
|
||||
|
|
||||
LL | let z = (x, 42);
|
||||
| ^ value moved from here
|
||||
|
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: moving 10024 bytes
|
||||
--> $DIR/large_moves.rs:18:13
|
||||
|
|
||||
LL | let z = (x, 42);
|
||||
| ^^^^^^^ value moved from here
|
||||
|
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: moving 10024 bytes
|
||||
--> $DIR/large_moves.rs:20:13
|
||||
|
|
||||
LL | let a = z.0;
|
||||
| ^^^ value moved from here
|
||||
|
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
@ -15,24 +15,31 @@ note: the lint level is defined here
|
|||
|
|
||||
LL | #![deny(large_assignments)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: moving 10024 bytes
|
||||
--> $DIR/large_moves.rs:18:14
|
||||
|
|
||||
LL | let z = (x, 42);
|
||||
| ^ value moved from here
|
||||
|
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: moving 10024 bytes
|
||||
--> $DIR/large_moves.rs:18:13
|
||||
|
|
||||
LL | let z = (x, 42);
|
||||
| ^^^^^^^ value moved from here
|
||||
|
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: moving 10024 bytes
|
||||
--> $DIR/large_moves.rs:20:13
|
||||
|
|
||||
LL | let a = z.0;
|
||||
| ^^^ value moved from here
|
||||
|
|
||||
= note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue