about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-16 21:29:49 +0000
committerbors <bors@rust-lang.org>2023-11-16 21:29:49 +0000
commitee48a3f24121d42ba32b69856d6d6e22ae01d8c7 (patch)
tree384c503a882266654d78521607ead1296aa50706 /compiler/rustc_interface/src
parent3d65927fae3bf2c90ced4955a2ec6a24bb04d865 (diff)
parenta5a039be35f7cfb8230819d214da04f97d71f735 (diff)
downloadrust-ee48a3f24121d42ba32b69856d6d6e22ae01d8c7.tar.gz
rust-ee48a3f24121d42ba32b69856d6d6e22ae01d8c7.zip
Auto merge of #3171 - saethlin:rustup, r=saethlin
Rustup

For https://github.com/rust-lang/miri/pull/3103
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/interface.rs24
-rw-r--r--compiler/rustc_interface/src/util.rs4
2 files changed, 21 insertions, 7 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index c4962707f69..89125c54a6a 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -178,7 +178,9 @@ pub(crate) fn parse_check_cfg(handler: &EarlyErrorHandler, specs: Vec<String>) -
 
             check_cfg.exhaustive_names = true;
             for arg in args {
-                if arg.is_word() && let Some(ident) = arg.ident() {
+                if arg.is_word()
+                    && let Some(ident) = arg.ident()
+                {
                     check_cfg.expecteds.entry(ident.name).or_insert(ExpectedValues::Any);
                 } else {
                     error!("`names()` arguments must be simple identifiers");
@@ -188,7 +190,9 @@ pub(crate) fn parse_check_cfg(handler: &EarlyErrorHandler, specs: Vec<String>) -
             set_old_syntax();
 
             if let Some((name, values)) = args.split_first() {
-                if name.is_word() && let Some(ident) = name.ident() {
+                if name.is_word()
+                    && let Some(ident) = name.ident()
+                {
                     let expected_values = check_cfg
                         .expecteds
                         .entry(ident.name)
@@ -236,12 +240,16 @@ pub(crate) fn parse_check_cfg(handler: &EarlyErrorHandler, specs: Vec<String>) -
             let mut values_any_specified = false;
 
             for arg in args {
-                if arg.is_word() && let Some(ident) = arg.ident() {
+                if arg.is_word()
+                    && let Some(ident) = arg.ident()
+                {
                     if values_specified {
                         error!("`cfg()` names cannot be after values");
                     }
                     names.push(ident);
-                } else if arg.has_name(sym::any) && let Some(args) = arg.meta_item_list() {
+                } else if arg.has_name(sym::any)
+                    && let Some(args) = arg.meta_item_list()
+                {
                     if any_specified {
                         error!("`any()` cannot be specified multiple times");
                     }
@@ -249,7 +257,9 @@ pub(crate) fn parse_check_cfg(handler: &EarlyErrorHandler, specs: Vec<String>) -
                     if !args.is_empty() {
                         error!("`any()` must be empty");
                     }
-                } else if arg.has_name(sym::values) && let Some(args) = arg.meta_item_list() {
+                } else if arg.has_name(sym::values)
+                    && let Some(args) = arg.meta_item_list()
+                {
                     if names.is_empty() {
                         error!("`values()` cannot be specified before the names");
                     } else if values_specified {
@@ -260,7 +270,9 @@ pub(crate) fn parse_check_cfg(handler: &EarlyErrorHandler, specs: Vec<String>) -
                     for arg in args {
                         if let Some(LitKind::Str(s, _)) = arg.lit().map(|lit| &lit.kind) {
                             values.insert(Some(*s));
-                        } else if arg.has_name(sym::any) && let Some(args) = arg.meta_item_list() {
+                        } else if arg.has_name(sym::any)
+                            && let Some(args) = arg.meta_item_list()
+                        {
                             if values_any_specified {
                                 error!("`any()` in `values()` cannot be specified multiple times");
                             }
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs
index 22d12793464..8df3648a065 100644
--- a/compiler/rustc_interface/src/util.rs
+++ b/compiler/rustc_interface/src/util.rs
@@ -415,7 +415,9 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec<C
     let mut base = session.opts.crate_types.clone();
     if base.is_empty() {
         let attr_types = attrs.iter().filter_map(|a| {
-            if a.has_name(sym::crate_type) && let Some(s) = a.value_str() {
+            if a.has_name(sym::crate_type)
+                && let Some(s) = a.value_str()
+            {
                 categorize_crate_type(s)
             } else {
                 None