diff options
| author | Léo Lanteri Thauvin <leseulartichaut@gmail.com> | 2021-08-16 17:29:49 +0200 |
|---|---|---|
| committer | Léo Lanteri Thauvin <leseulartichaut@gmail.com> | 2021-08-25 20:24:35 +0200 |
| commit | fde1b76b4b1d0d84f5691f4785906b31bb91f38d (patch) | |
| tree | 966691ff24d8ec26354d737e549bbfccaa658f3d /compiler/rustc_ast/src | |
| parent | a992a11913b39a258158646bb1e03528c5aa5060 (diff) | |
| download | rust-fde1b76b4b1d0d84f5691f4785906b31bb91f38d.tar.gz rust-fde1b76b4b1d0d84f5691f4785906b31bb91f38d.zip | |
Use if-let guards in the codebase
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/attr/mod.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/lib.rs | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 41121d095f3..81195f7fb5c 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -564,11 +564,11 @@ impl NestedMetaItem { I: Iterator<Item = TokenTree>, { match tokens.peek() { - Some(TokenTree::Token(token)) => { - if let Ok(lit) = Lit::from_token(token) { - tokens.next(); - return Some(NestedMetaItem::Literal(lit)); - } + Some(TokenTree::Token(token)) + if let Ok(lit) = Lit::from_token(token) => + { + tokens.next(); + return Some(NestedMetaItem::Literal(lit)); } Some(TokenTree::Delimited(_, token::NoDelim, inner_tokens)) => { let inner_tokens = inner_tokens.clone(); diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 502bd69e6a9..ef3f6035085 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -11,10 +11,12 @@ #![feature(box_patterns)] #![cfg_attr(bootstrap, feature(const_fn_transmute))] #![feature(crate_visibility_modifier)] +#![feature(if_let_guard)] #![feature(iter_zip)] #![feature(label_break_value)] #![feature(nll)] #![feature(min_specialization)] +#![cfg_attr(bootstrap, allow(incomplete_features))] // if_let_guard #![recursion_limit = "256"] #[macro_use] |
