Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/target_feature.rs')
-rw-r--r--crates/hir-ty/src/target_feature.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/crates/hir-ty/src/target_feature.rs b/crates/hir-ty/src/target_feature.rs
index fe9416c6cf..01e4160edb 100644
--- a/crates/hir-ty/src/target_feature.rs
+++ b/crates/hir-ty/src/target_feature.rs
@@ -4,7 +4,7 @@ use std::sync::LazyLock;
use hir_def::attr::Attrs;
use hir_def::tt;
-use intern::{sym, Symbol};
+use intern::{Symbol, sym};
use rustc_hash::{FxHashMap, FxHashSet};
#[derive(Debug, Default)]
@@ -38,15 +38,17 @@ impl TargetFeatures {
let enabled = attrs
.by_key(&sym::target_feature)
.tt_values()
- .filter_map(|tt| {
- match tt.token_trees().flat_tokens() {
- [
- tt::TokenTree::Leaf(tt::Leaf::Ident(enable_ident)),
- tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct { char: '=', .. })),
- tt::TokenTree::Leaf(tt::Leaf::Literal(tt::Literal { kind: tt::LitKind::Str, symbol: features, .. })),
- ] if enable_ident.sym == sym::enable => Some(features),
- _ => None,
- }
+ .filter_map(|tt| match tt.token_trees().flat_tokens() {
+ [
+ tt::TokenTree::Leaf(tt::Leaf::Ident(enable_ident)),
+ tt::TokenTree::Leaf(tt::Leaf::Punct(tt::Punct { char: '=', .. })),
+ tt::TokenTree::Leaf(tt::Leaf::Literal(tt::Literal {
+ kind: tt::LitKind::Str,
+ symbol: features,
+ ..
+ })),
+ ] if enable_ident.sym == sym::enable => Some(features),
+ _ => None,
})
.flat_map(|features| features.as_str().split(',').map(Symbol::intern))
.collect();