summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_late_init.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /src/tools/clippy/tests/ui/needless_late_init.rs
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/needless_late_init.rs')
-rw-r--r--src/tools/clippy/tests/ui/needless_late_init.rs36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/tools/clippy/tests/ui/needless_late_init.rs b/src/tools/clippy/tests/ui/needless_late_init.rs
index d84457a29..969afb38e 100644
--- a/src/tools/clippy/tests/ui/needless_late_init.rs
+++ b/src/tools/clippy/tests/ui/needless_late_init.rs
@@ -1,4 +1,5 @@
// run-rustfix
+// aux-build:proc_macros.rs
#![feature(let_chains)]
#![allow(unused)]
#![allow(
@@ -10,6 +11,8 @@
clippy::uninlined_format_args
)]
+extern crate proc_macros;
+
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::rc::Rc;
@@ -138,6 +141,7 @@ const fn in_const() -> &'static str {
a
}
+#[proc_macros::inline_macros]
fn does_not_lint() {
let z;
if false {
@@ -195,35 +199,27 @@ fn does_not_lint() {
}
y = 3;
- macro_rules! assign {
- ($i:ident) => {
- $i = 1;
- };
- }
let x;
- assign!(x);
+ inline!($x = 1;);
let x;
if true {
- assign!(x);
+ inline!($x = 1;);
} else {
x = 2;
}
- macro_rules! in_macro {
- () => {
- let x;
- x = 1;
+ inline!({
+ let x;
+ x = 1;
- let x;
- if true {
- x = 1;
- } else {
- x = 2;
- }
- };
- }
- in_macro!();
+ let x;
+ if true {
+ x = 1;
+ } else {
+ x = 2;
+ }
+ });
// ignore if-lets - https://github.com/rust-lang/rust-clippy/issues/8613
let x;