Add note to the lint diagnostic

This commit is contained in:
InfRandomness 2022-03-30 17:53:29 +02:00
parent 3e7514670d
commit d65b9a19db
3 changed files with 15 additions and 0 deletions

View file

@ -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();
},
);