mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
Add note to the lint diagnostic
This commit is contained in:
parent
3e7514670d
commit
d65b9a19db
@ -859,6 +859,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
|
|||||||
|lint| {
|
|lint| {
|
||||||
let mut err = lint.build(&format!("moving {} bytes", layout.size.bytes()));
|
let mut err = lint.build(&format!("moving {} bytes", layout.size.bytes()));
|
||||||
err.span_label(source_info.span, "value moved from here");
|
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();
|
err.emit();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -15,24 +15,31 @@ note: the lint level is defined here
|
|||||||
|
|
|
|
||||||
LL | #![deny(large_assignments)]
|
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
|
error: moving 10024 bytes
|
||||||
--> $DIR/large_moves.rs:18:14
|
--> $DIR/large_moves.rs:18:14
|
||||||
|
|
|
|
||||||
LL | let z = (x, 42);
|
LL | let z = (x, 42);
|
||||||
| ^ value moved from here
|
| ^ 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
|
error: moving 10024 bytes
|
||||||
--> $DIR/large_moves.rs:18:13
|
--> $DIR/large_moves.rs:18:13
|
||||||
|
|
|
|
||||||
LL | let z = (x, 42);
|
LL | let z = (x, 42);
|
||||||
| ^^^^^^^ value moved from here
|
| ^^^^^^^ 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
|
error: moving 10024 bytes
|
||||||
--> $DIR/large_moves.rs:20:13
|
--> $DIR/large_moves.rs:20:13
|
||||||
|
|
|
|
||||||
LL | let a = z.0;
|
LL | let a = z.0;
|
||||||
| ^^^ value moved from here
|
| ^^^ 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
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
@ -15,24 +15,31 @@ note: the lint level is defined here
|
|||||||
|
|
|
|
||||||
LL | #![deny(large_assignments)]
|
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
|
error: moving 10024 bytes
|
||||||
--> $DIR/large_moves.rs:18:14
|
--> $DIR/large_moves.rs:18:14
|
||||||
|
|
|
|
||||||
LL | let z = (x, 42);
|
LL | let z = (x, 42);
|
||||||
| ^ value moved from here
|
| ^ 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
|
error: moving 10024 bytes
|
||||||
--> $DIR/large_moves.rs:18:13
|
--> $DIR/large_moves.rs:18:13
|
||||||
|
|
|
|
||||||
LL | let z = (x, 42);
|
LL | let z = (x, 42);
|
||||||
| ^^^^^^^ value moved from here
|
| ^^^^^^^ 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
|
error: moving 10024 bytes
|
||||||
--> $DIR/large_moves.rs:20:13
|
--> $DIR/large_moves.rs:20:13
|
||||||
|
|
|
|
||||||
LL | let a = z.0;
|
LL | let a = z.0;
|
||||||
| ^^^ value moved from here
|
| ^^^ 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
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user