diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-02-15 19:13:36 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-03-04 16:43:13 -0500 |
| commit | e912d9d7ecd9d326affd18f7b133dafb72ee8896 (patch) | |
| tree | 5cf187b41928fe0fa8be4d7731746288bc4540e7 | |
| parent | f63b88c761f935d9b2c220a1b4e3abf0c0681c69 (diff) | |
| download | rust-e912d9d7ecd9d326affd18f7b133dafb72ee8896.tar.gz rust-e912d9d7ecd9d326affd18f7b133dafb72ee8896.zip | |
Test #[allow(unused)] on `if` expression
| -rw-r--r-- | src/test/ui/parser/if-attrs/builtin-if-attr.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/parser/if-attrs/builtin-if-attr.rs b/src/test/ui/parser/if-attrs/builtin-if-attr.rs new file mode 100644 index 00000000000..7e290661501 --- /dev/null +++ b/src/test/ui/parser/if-attrs/builtin-if-attr.rs @@ -0,0 +1,12 @@ +// check-pass + +fn main() { + #[allow(unused_variables)] + if true { + let a = 1; + } else if false { + let b = 1; + } else { + let c = 1; + } +} |
