mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 01:42:54 +03:00
Fixed suggestion in macro invocations
This commit is contained in:
@@ -49,12 +49,12 @@ fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) {
|
||||
return;
|
||||
}
|
||||
|
||||
let sugg = sugg::Sugg::hir(cx, &expr, "..");
|
||||
let sugg = sugg::Sugg::hir_with_macro_callsite(cx, &expr, "..");
|
||||
let suggestion = format!("{0};", sugg);
|
||||
span_lint_and_sugg(
|
||||
cx,
|
||||
SEMICOLON_IF_NOTHING_RETURNED,
|
||||
expr.span,
|
||||
expr.span.source_callsite(),
|
||||
"consider adding a `;` to the last statement for consistent formatting",
|
||||
"add a `;` here",
|
||||
suggestion,
|
||||
|
||||
@@ -2,10 +2,9 @@ error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:8:5
|
||||
|
|
||||
LL | println!("Hello")
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^ help: add a `;` here: `println!("Hello");`
|
||||
|
|
||||
= note: `-D clippy::semicolon-if-nothing-returned` implied by `-D warnings`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:12:5
|
||||
|
||||
Reference in New Issue
Block a user