about summary refs log tree commit diff
diff options
context:
space:
mode:
authorInfRandomness <infrandomness@gmail.com>2022-03-30 17:53:29 +0200
committerInfRandomness <infrandomness@gmail.com>2022-03-30 20:00:03 +0200
commitd65b9a19db62d18895f329a1ab6d5c0ff96fa960 (patch)
treee088991c0e375536d82f9dde9fe546ab8ee0df31
parent3e7514670db841a7f0d7656f3b13b1c8b2c11599 (diff)
downloadrust-d65b9a19db62d18895f329a1ab6d5c0ff96fa960.tar.gz
rust-d65b9a19db62d18895f329a1ab6d5c0ff96fa960.zip
Add note to the lint diagnostic
-rw-r--r--compiler/rustc_monomorphize/src/collector.rs1
-rw-r--r--src/test/ui/async-await/large_moves.attribute.stderr7
-rw-r--r--src/test/ui/async-await/large_moves.option.stderr7
3 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs
index 1477bc28cff..3f6c24a769e 100644
--- a/compiler/rustc_monomorphize/src/collector.rs
+++ b/compiler/rustc_monomorphize/src/collector.rs
@@ -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();
                     },
                 );
diff --git a/src/test/ui/async-await/large_moves.attribute.stderr b/src/test/ui/async-await/large_moves.attribute.stderr
index 39b7e7cb345..8d3f0b77f43 100644
--- a/src/test/ui/async-await/large_moves.attribute.stderr
+++ b/src/test/ui/async-await/large_moves.attribute.stderr
@@ -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
 
diff --git a/src/test/ui/async-await/large_moves.option.stderr b/src/test/ui/async-await/large_moves.option.stderr
index 39b7e7cb345..8d3f0b77f43 100644
--- a/src/test/ui/async-await/large_moves.option.stderr
+++ b/src/test/ui/async-await/large_moves.option.stderr
@@ -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