| //@compile-flags: -Z track-diagnostics | |
| // Normalize the emitted location so this doesn't need | |
| // updating everytime someone adds or removes a line. | |
| //@normalize-stderr-test: ".rs:\d+:\d+" -> ".rs:LL:CC" | |
| //@normalize-stderr-test: "src/tools/clippy/" -> "" | |
| #![warn(clippy::let_and_return, clippy::unnecessary_cast)] | |
| fn main() { | |
| // Check the provenance of a lint sent through `LintContext::span_lint()` | |
| let a = 3u32; | |
| let b = a; | |
| //~^ unnecessary_cast | |
| // Check the provenance of a lint sent through `TyCtxt::node_span_lint()` | |
| let c = { | |
| 42 | |
| //~^ let_and_return | |
| }; | |
| } |