about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-31 13:09:53 +0200
committerGitHub <noreply@github.com>2022-03-31 13:09:53 +0200
commit4388ac58a2a1fc5d223563ea0c1fbf484d8f939f (patch)
treee5629a30df7ba5ecf35addabaa309aba703ec409 /compiler
parentc6764c982d71dd63ad43f9e70c5b7d5bdca7617c (diff)
parentd65b9a19db62d18895f329a1ab6d5c0ff96fa960 (diff)
downloadrust-4388ac58a2a1fc5d223563ea0c1fbf484d8f939f.tar.gz
rust-4388ac58a2a1fc5d223563ea0c1fbf484d8f939f.zip
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
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_monomorphize/src/collector.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs
index 66941e49a9a..2a659a97db5 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();
                     },
                 );