diff options
| author | Centri3 <114838443+Centri3@users.noreply.github.com> | 2023-05-15 15:22:59 -0500 |
|---|---|---|
| committer | Centri3 <114838443+Centri3@users.noreply.github.com> | 2023-06-07 18:34:34 -0500 |
| commit | 378d77584acdd4864bf495ce67c932c0f422e6f4 (patch) | |
| tree | b99e6be81e673d28d29523b17fe104c76b8787d8 | |
| parent | 493a23e957f9d639c13bddb19937bd19cbc6cfe2 (diff) | |
| download | rust-378d77584acdd4864bf495ce67c932c0f422e6f4.tar.gz rust-378d77584acdd4864bf495ce67c932c0f422e6f4.zip | |
work with lint attributes
| -rw-r--r-- | clippy_lints/src/excessive_nesting.rs | 54 | ||||
| -rw-r--r-- | clippy_lints/src/lib.rs | 1 | ||||
| -rw-r--r-- | tests/ui-toml/excessive_nesting/below/clippy.toml (renamed from tests/ui-toml/excessive_nesting/clippy.toml) | 0 | ||||
| -rw-r--r-- | tests/ui-toml/excessive_nesting/default/clippy.toml | 1 | ||||
| -rw-r--r-- | tests/ui-toml/excessive_nesting/excessive_nesting.below.stderr | 369 | ||||
| -rw-r--r-- | tests/ui-toml/excessive_nesting/excessive_nesting.default.stderr | 43 | ||||
| -rw-r--r-- | tests/ui-toml/excessive_nesting/excessive_nesting.rs | 6 | ||||
| -rw-r--r-- | tests/ui-toml/excessive_nesting/excessive_nesting.stderr | 70 |
8 files changed, 492 insertions, 52 deletions
diff --git a/clippy_lints/src/excessive_nesting.rs b/clippy_lints/src/excessive_nesting.rs index 5ade713f816..f1aafa3cbc3 100644 --- a/clippy_lints/src/excessive_nesting.rs +++ b/clippy_lints/src/excessive_nesting.rs @@ -1,7 +1,8 @@ use clippy_utils::diagnostics::span_lint_and_help; use rustc_ast::{ + node_id::NodeSet, visit::{walk_block, walk_item, Visitor}, - Block, Crate, Inline, Item, ItemKind, ModKind, + Block, Crate, Inline, Item, ItemKind, ModKind, NodeId, }; use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; use rustc_middle::lint::in_external_macro; @@ -52,6 +53,10 @@ declare_clippy_lint! { /// } /// } /// ``` + /// lib.rs: + /// ```rust,ignore + /// pub mod a; + /// ``` #[clippy::version = "1.70.0"] pub EXCESSIVE_NESTING, restriction, @@ -59,16 +64,31 @@ declare_clippy_lint! { } impl_lint_pass!(ExcessiveNesting => [EXCESSIVE_NESTING]); -#[derive(Clone, Copy)] +#[derive(Clone)] pub struct ExcessiveNesting { pub excessive_nesting_threshold: u64, + pub nodes: NodeSet, +} + +impl ExcessiveNesting { + pub fn check_node_id(&self, cx: &EarlyContext<'_>, span: Span, node_id: NodeId) { + if self.nodes.contains(&node_id) { + span_lint_and_help( + cx, + EXCESSIVE_NESTING, + span, + "this block is too nested", + None, + "try refactoring your code to minimize nesting", + ); + } + } } impl EarlyLintPass for ExcessiveNesting { fn check_crate(&mut self, cx: &EarlyContext<'_>, krate: &Crate) { - let conf = self; let mut visitor = NestingVisitor { - conf, + conf: self, cx, nest_level: 0, }; @@ -77,25 +97,26 @@ impl EarlyLintPass for ExcessiveNesting { visitor.visit_item(item); } } + + fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { + self.check_node_id(cx, block.span, block.id); + } + + fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { + self.check_node_id(cx, item.span, item.id); + } } struct NestingVisitor<'conf, 'cx> { - conf: &'conf ExcessiveNesting, + conf: &'conf mut ExcessiveNesting, cx: &'cx EarlyContext<'cx>, nest_level: u64, } impl NestingVisitor<'_, '_> { - fn check_indent(&self, span: Span) -> bool { + fn check_indent(&mut self, span: Span, id: NodeId) -> bool { if self.nest_level > self.conf.excessive_nesting_threshold && !in_external_macro(self.cx.sess(), span) { - span_lint_and_help( - self.cx, - EXCESSIVE_NESTING, - span, - "this block is too nested", - None, - "try refactoring your code to minimize nesting", - ); + self.conf.nodes.insert(id); return true; } @@ -106,14 +127,13 @@ impl NestingVisitor<'_, '_> { impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> { fn visit_block(&mut self, block: &Block) { - // TODO: Probably not necessary, since any block would already be ignored by the check in visit_item if block.span.from_expansion() { return; } self.nest_level += 1; - if !self.check_indent(block.span) { + if !self.check_indent(block.span, block.id) { walk_block(self, block); } @@ -129,7 +149,7 @@ impl<'conf, 'cx> Visitor<'_> for NestingVisitor<'conf, 'cx> { ItemKind::Trait(_) | ItemKind::Impl(_) | ItemKind::Mod(.., ModKind::Loaded(_, Inline::Yes, _)) => { self.nest_level += 1; - if !self.check_indent(item.span) { + if !self.check_indent(item.span, item.id) { walk_item(self, item); } diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 202b4709ad4..189096d7ba9 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1012,6 +1012,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: store.register_early_pass(move || { Box::new(excessive_nesting::ExcessiveNesting { excessive_nesting_threshold, + nodes: rustc_ast::node_id::NodeSet::new(), }) }); store.register_late_pass(|_| Box::new(items_after_test_module::ItemsAfterTestModule)); diff --git a/tests/ui-toml/excessive_nesting/clippy.toml b/tests/ui-toml/excessive_nesting/below/clippy.toml index 10be2751a86..10be2751a86 100644 --- a/tests/ui-toml/excessive_nesting/clippy.toml +++ b/tests/ui-toml/excessive_nesting/below/clippy.toml diff --git a/tests/ui-toml/excessive_nesting/default/clippy.toml b/tests/ui-toml/excessive_nesting/default/clippy.toml new file mode 100644 index 00000000000..b01e482e485 --- /dev/null +++ b/tests/ui-toml/excessive_nesting/default/clippy.toml @@ -0,0 +1 @@ +excessive-nesting-threshold = 10 diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.below.stderr b/tests/ui-toml/excessive_nesting/excessive_nesting.below.stderr new file mode 100644 index 00000000000..1f069437dfe --- /dev/null +++ b/tests/ui-toml/excessive_nesting/excessive_nesting.below.stderr @@ -0,0 +1,369 @@ +error: this block is too nested + --> $DIR/auxiliary/mod.rs:6:13 + | +LL | / mod d { +LL | | mod e {} +LL | | } + | |_____________^ + | + = help: try refactoring your code to minimize nesting + = note: `-D clippy::excessive-nesting` implied by `-D warnings` + +error: this block is too nested + --> $DIR/auxiliary/mod.rs:15:7 + | +LL | {{{}}} + | ^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:24:21 + | +LL | let z = { + | _____________________^ +LL | | let w = { 3 }; +LL | | w +LL | | }; + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:68:24 + | +LL | pub fn b() { + | ________________________^ +LL | | struct C; +LL | | +LL | | impl C { +LL | | pub fn c() {} +LL | | } +LL | | } + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:84:21 + | +LL | fn cc() { + | _____________________^ +LL | | let x = { 1 }; // not a warning, but cc is +LL | | } + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:88:21 + | +LL | let x = { 1 }; // warning + | ^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:101:13 + | +LL | / pub mod d { +LL | | pub mod e { +LL | | pub mod f {} +LL | | } // not here +LL | | } // only warning should be here + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:115:17 + | +LL | a_but_not({{{{{{{{0}}}}}}}}); + | ^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:116:11 + | +LL | a.a({{{{{{{{{0}}}}}}}}}); + | ^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:117:11 + | +LL | (0, {{{{{{{1}}}}}}}); + | ^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:121:21 + | +LL | if true { + | _____________________^ +LL | | if true { +LL | | if true { +LL | | +LL | | } +LL | | } +LL | | } + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:133:25 + | +LL | let y = (|| { + | _________________________^ +LL | | let z = (|| { +LL | | let w = { 3 }; +LL | | w +LL | | })(); +LL | | z +LL | | })(); + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:148:36 + | +LL | !{boo as u32 + !{boo as u32 + !{boo as u32}}}; + | ^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:152:12 + | +LL | y += {{{{{5}}}}}; + | ^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:153:19 + | +LL | let z = y + {{{{{{{{{5}}}}}}}}}; + | ^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:154:11 + | +LL | [0, {{{{{{{{{{0}}}}}}}}}}]; + | ^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:155:24 + | +LL | let mut xx = [0; {{{{{{{{100}}}}}}}}]; + | ^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:156:10 + | +LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:157:12 + | +LL | &mut {{{{{{{{{{y}}}}}}}}}}; + | ^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:159:16 + | +LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} + | ^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:159:27 + | +LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} + | ^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:161:27 + | +LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} + | ^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:161:47 + | +LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} + | ^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:163:13 + | +LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} + | ^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:163:34 + | +LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} + | ^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:165:22 + | +LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:167:7 + | +LL | {{{{1;}}}}..{{{{{{3}}}}}}; + | ^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:167:19 + | +LL | {{{{1;}}}}..{{{{{{3}}}}}}; + | ^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:168:7 + | +LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; + | ^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:168:20 + | +LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:169:9 + | +LL | ..{{{{{{{5}}}}}}}; + | ^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:170:10 + | +LL | ..={{{{{3}}}}}; + | ^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:171:7 + | +LL | {{{{{1;}}}}}..; + | ^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:173:19 + | +LL | loop { break {{{{1}}}} }; + | ^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:174:12 + | +LL | loop {{{{{{}}}}}} + | ^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:176:13 + | +LL | match {{{{{{true}}}}}} { + | ^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:177:19 + | +LL | true => {{{{}}}}, + | ^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:178:20 + | +LL | false => {{{{}}}}, + | ^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:183:13 + | +LL | / { +LL | | { +LL | | println!("warning! :)"); +LL | | } +LL | | } + | |_____________^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:193:27 + | +LL | async fn c() -> u32 {{{{{{{0}}}}}}} + | ^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:199:7 + | +LL | {{{{b().await}}}}; + | ^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: aborting due to 41 previous errors + diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.default.stderr b/tests/ui-toml/excessive_nesting/excessive_nesting.default.stderr new file mode 100644 index 00000000000..02fa2cdcf9f --- /dev/null +++ b/tests/ui-toml/excessive_nesting/excessive_nesting.default.stderr @@ -0,0 +1,43 @@ +error: this block is too nested + --> $DIR/excessive_nesting.rs:154:18 + | +LL | [0, {{{{{{{{{{0}}}}}}}}}}]; + | ^^^ + | + = help: try refactoring your code to minimize nesting + = note: `-D clippy::excessive-nesting` implied by `-D warnings` + +error: this block is too nested + --> $DIR/excessive_nesting.rs:156:17 + | +LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:157:19 + | +LL | &mut {{{{{{{{{{y}}}}}}}}}}; + | ^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:165:29 + | +LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: this block is too nested + --> $DIR/excessive_nesting.rs:168:27 + | +LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try refactoring your code to minimize nesting + +error: aborting due to 5 previous errors + diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.rs b/tests/ui-toml/excessive_nesting/excessive_nesting.rs index 3e3ac7c923a..745031db1eb 100644 --- a/tests/ui-toml/excessive_nesting/excessive_nesting.rs +++ b/tests/ui-toml/excessive_nesting/excessive_nesting.rs @@ -1,4 +1,7 @@ //@aux-build:macro_rules.rs +//@revisions: below default +//@[below] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/excessive_nesting/below +//@[default] rustc-env:CLIPPY_CONF_DIR=tests/ui-toml/excessive_nesting/default #![rustfmt::skip] #![feature(custom_inner_attributes)] #![allow(unused)] @@ -87,6 +90,9 @@ trait Lol { } } +#[allow(clippy::excessive_nesting)] +fn l() {{{{{{{{{}}}}}}}}} + use a::{b::{c::{d::{e::{f::{}}}}}}; // should not lint pub mod a { diff --git a/tests/ui-toml/excessive_nesting/excessive_nesting.stderr b/tests/ui-toml/excessive_nesting/excessive_nesting.stderr index 524282d11f7..f1db396fe48 100644 --- a/tests/ui-toml/excessive_nesting/excessive_nesting.stderr +++ b/tests/ui-toml/excessive_nesting/excessive_nesting.stderr @@ -64,7 +64,7 @@ LL | let x = { 1 }; // warning = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:95:13 + --> $DIR/excessive_nesting.rs:98:13 | LL | / pub mod d { LL | | pub mod e { @@ -76,7 +76,7 @@ LL | | } // only warning should be here = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:109:17 + --> $DIR/excessive_nesting.rs:112:17 | LL | a_but_not({{{{{{{{0}}}}}}}}); | ^^^^^^^^^^^^^ @@ -84,7 +84,7 @@ LL | a_but_not({{{{{{{{0}}}}}}}}); = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:110:11 + --> $DIR/excessive_nesting.rs:113:11 | LL | a.a({{{{{{{{{0}}}}}}}}}); | ^^^^^^^^^^^^^^^ @@ -92,7 +92,7 @@ LL | a.a({{{{{{{{{0}}}}}}}}}); = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:111:11 + --> $DIR/excessive_nesting.rs:114:11 | LL | (0, {{{{{{{1}}}}}}}); | ^^^^^^^^^^^ @@ -100,7 +100,7 @@ LL | (0, {{{{{{{1}}}}}}}); = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:115:21 + --> $DIR/excessive_nesting.rs:118:21 | LL | if true { | _____________________^ @@ -115,7 +115,7 @@ LL | | } = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:127:25 + --> $DIR/excessive_nesting.rs:130:25 | LL | let y = (|| { | _________________________^ @@ -130,7 +130,7 @@ LL | | })(); = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:142:36 + --> $DIR/excessive_nesting.rs:145:36 | LL | !{boo as u32 + !{boo as u32 + !{boo as u32}}}; | ^^^^^^^^^^^^ @@ -138,7 +138,7 @@ LL | !{boo as u32 + !{boo as u32 + !{boo as u32}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:146:12 + --> $DIR/excessive_nesting.rs:149:12 | LL | y += {{{{{5}}}}}; | ^^^^^^^ @@ -146,7 +146,7 @@ LL | y += {{{{{5}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:147:19 + --> $DIR/excessive_nesting.rs:150:19 | LL | let z = y + {{{{{{{{{5}}}}}}}}}; | ^^^^^^^^^^^^^^^ @@ -154,7 +154,7 @@ LL | let z = y + {{{{{{{{{5}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:148:11 + --> $DIR/excessive_nesting.rs:151:11 | LL | [0, {{{{{{{{{{0}}}}}}}}}}]; | ^^^^^^^^^^^^^^^^^ @@ -162,7 +162,7 @@ LL | [0, {{{{{{{{{{0}}}}}}}}}}]; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:149:24 + --> $DIR/excessive_nesting.rs:152:24 | LL | let mut xx = [0; {{{{{{{{100}}}}}}}}]; | ^^^^^^^^^^^^^^^ @@ -170,7 +170,7 @@ LL | let mut xx = [0; {{{{{{{{100}}}}}}}}]; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:150:10 + --> $DIR/excessive_nesting.rs:153:10 | LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -178,7 +178,7 @@ LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}]; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:151:12 + --> $DIR/excessive_nesting.rs:154:12 | LL | &mut {{{{{{{{{{y}}}}}}}}}}; | ^^^^^^^^^^^^^^^^^ @@ -186,7 +186,7 @@ LL | &mut {{{{{{{{{{y}}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:153:16 + --> $DIR/excessive_nesting.rs:156:16 | LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} | ^^^^^^ @@ -194,7 +194,7 @@ LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:153:27 + --> $DIR/excessive_nesting.rs:156:27 | LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} | ^^^^^^^^^^^^ @@ -202,7 +202,7 @@ LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:155:27 + --> $DIR/excessive_nesting.rs:158:27 | LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} | ^^^^^^^^^^^^^^^ @@ -210,7 +210,7 @@ LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:155:47 + --> $DIR/excessive_nesting.rs:158:47 | LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} | ^^^^^^^^^^ @@ -218,7 +218,7 @@ LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:157:13 + --> $DIR/excessive_nesting.rs:160:13 | LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} | ^^^^^^^^^^^^^^^^ @@ -226,7 +226,7 @@ LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:157:34 + --> $DIR/excessive_nesting.rs:160:34 | LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} | ^^^^^^^^^^^^^^ @@ -234,7 +234,7 @@ LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:159:22 + --> $DIR/excessive_nesting.rs:162:22 | LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -242,7 +242,7 @@ LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} }; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:161:7 + --> $DIR/excessive_nesting.rs:164:7 | LL | {{{{1;}}}}..{{{{{{3}}}}}}; | ^^^^^^ @@ -250,7 +250,7 @@ LL | {{{{1;}}}}..{{{{{{3}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:161:19 + --> $DIR/excessive_nesting.rs:164:19 | LL | {{{{1;}}}}..{{{{{{3}}}}}}; | ^^^^^^^^^ @@ -258,7 +258,7 @@ LL | {{{{1;}}}}..{{{{{{3}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:162:7 + --> $DIR/excessive_nesting.rs:165:7 | LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; | ^^^^^^ @@ -266,7 +266,7 @@ LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:162:20 + --> $DIR/excessive_nesting.rs:165:20 | LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -274,7 +274,7 @@ LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:163:9 + --> $DIR/excessive_nesting.rs:166:9 | LL | ..{{{{{{{5}}}}}}}; | ^^^^^^^^^^^ @@ -282,7 +282,7 @@ LL | ..{{{{{{{5}}}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:164:10 + --> $DIR/excessive_nesting.rs:167:10 | LL | ..={{{{{3}}}}}; | ^^^^^^^ @@ -290,7 +290,7 @@ LL | ..={{{{{3}}}}}; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:165:7 + --> $DIR/excessive_nesting.rs:168:7 | LL | {{{{{1;}}}}}..; | ^^^^^^^^ @@ -298,7 +298,7 @@ LL | {{{{{1;}}}}}..; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:167:19 + --> $DIR/excessive_nesting.rs:170:19 | LL | loop { break {{{{1}}}} }; | ^^^^^^^ @@ -306,7 +306,7 @@ LL | loop { break {{{{1}}}} }; = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:168:12 + --> $DIR/excessive_nesting.rs:171:12 | LL | loop {{{{{{}}}}}} | ^^^^^^^^ @@ -314,7 +314,7 @@ LL | loop {{{{{{}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:170:13 + --> $DIR/excessive_nesting.rs:173:13 | LL | match {{{{{{true}}}}}} { | ^^^^^^^^^^^^ @@ -322,7 +322,7 @@ LL | match {{{{{{true}}}}}} { = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:171:19 + --> $DIR/excessive_nesting.rs:174:19 | LL | true => {{{{}}}}, | ^^^^ @@ -330,7 +330,7 @@ LL | true => {{{{}}}}, = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:172:20 + --> $DIR/excessive_nesting.rs:175:20 | LL | false => {{{{}}}}, | ^^^^ @@ -338,7 +338,7 @@ LL | false => {{{{}}}}, = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:177:13 + --> $DIR/excessive_nesting.rs:180:13 | LL | / { LL | | { @@ -350,7 +350,7 @@ LL | | } = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:187:27 + --> $DIR/excessive_nesting.rs:190:27 | LL | async fn c() -> u32 {{{{{{{0}}}}}}} | ^^^^^^^^^^^ @@ -358,7 +358,7 @@ LL | async fn c() -> u32 {{{{{{{0}}}}}}} = help: try refactoring your code to minimize nesting error: this block is too nested - --> $DIR/excessive_nesting.rs:193:7 + --> $DIR/excessive_nesting.rs:196:7 | LL | {{{{b().await}}}}; | ^^^^^^^^^^^^^ |
