]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_session/options.rs
Auto merge of #66899 - msizanoen1:riscv-std, r=alexcrichton
[rust.git] / src / librustc_session / options.rs
index 2f2d03fc596e48e6fadc6ebf647b64d876925bb8..656c1b019b2e2ead069151c9589be1316b61a693 100644 (file)
@@ -1,33 +1,35 @@
 use crate::config::*;
 
-use crate::lint;
-use crate::utils::NativeLibraryKind;
 use crate::early_error;
+use crate::lint;
 use crate::search_paths::SearchPath;
+use crate::utils::NativeLibraryKind;
 
-use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
 use rustc_target::spec::TargetTriple;
+use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
 
-use syntax_pos::edition::Edition;
 use rustc_feature::UnstableFeatures;
+use rustc_span::edition::Edition;
 
 use getopts;
 
 use std::collections::BTreeMap;
 
-use std::str;
-use std::hash::Hasher;
 use std::collections::hash_map::DefaultHasher;
+use std::hash::Hasher;
 use std::path::PathBuf;
+use std::str;
 
 macro_rules! hash_option {
-    ($opt_name:ident, $opt_expr:expr, $sub_hashes:expr, [UNTRACKED]) => ({});
-    ($opt_name:ident, $opt_expr:expr, $sub_hashes:expr, [TRACKED]) => ({
-        if $sub_hashes.insert(stringify!($opt_name),
-                              $opt_expr as &dyn dep_tracking::DepTrackingHash).is_some() {
+    ($opt_name:ident, $opt_expr:expr, $sub_hashes:expr, [UNTRACKED]) => {{}};
+    ($opt_name:ident, $opt_expr:expr, $sub_hashes:expr, [TRACKED]) => {{
+        if $sub_hashes
+            .insert(stringify!($opt_name), $opt_expr as &dyn dep_tracking::DepTrackingHash)
+            .is_some()
+        {
             panic!("duplicate key in CLI DepTrackingHash: {}", stringify!($opt_name))
         }
-    });
+    }};
 }
 
 macro_rules! top_level_options {
@@ -870,8 +872,6 @@ fn parse_symbol_mangling_version(
         "choose which RELRO level to use"),
     nll_facts: bool = (false, parse_bool, [UNTRACKED],
                        "dump facts from NLL analysis into side files"),
-    nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
-        "in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
     dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
         "emit diagnostics rather than buffering (breaks NLL error downgrading, sorting)."),
     polonius: bool = (false, parse_bool, [UNTRACKED],
@@ -904,7 +904,7 @@ fn parse_symbol_mangling_version(
         `mir` (the MIR), or `mir-cfg` (graphviz formatted MIR)"),
     run_dsymutil: Option<bool> = (None, parse_opt_bool, [TRACKED],
         "run `dsymutil` and delete intermediate object files"),
-    ui_testing: bool = (false, parse_bool, [UNTRACKED],
+    ui_testing: Option<bool> = (None, parse_opt_bool, [UNTRACKED],
         "format compiler diagnostics in a way that's better suitable for UI testing"),
     embed_bitcode: bool = (false, parse_bool, [TRACKED],
         "embed LLVM bitcode in object files"),
@@ -946,4 +946,6 @@ fn parse_symbol_mangling_version(
     insert_sideeffect: bool = (false, parse_bool, [TRACKED],
         "fix undefined behavior when a thread doesn't eventually make progress \
          (such as entering an empty infinite loop) by inserting llvm.sideeffect"),
+    deduplicate_diagnostics: Option<bool> = (None, parse_opt_bool, [UNTRACKED],
+        "deduplicate identical diagnostics"),
 }