]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_interface/tests.rs
Rollup merge of #72533 - Diggsey:db-fix-arc-ub2, r=dtolnay
[rust.git] / src / librustc_interface / tests.rs
index 68b749e10844bc81776beb6cdc468b3750491bda..d573e11fc4b249ad00eb771d00d963f109ecce7d 100644 (file)
@@ -2,7 +2,6 @@
 
 use rustc_data_structures::fx::FxHashSet;
 use rustc_errors::{emitter::HumanReadableErrorType, registry, ColorConfig};
-use rustc_middle::middle::cstore;
 use rustc_session::config::Strip;
 use rustc_session::config::{build_configuration, build_session_options, to_crate_config};
 use rustc_session::config::{rustc_optgroups, ErrorOutputType, ExternLocation, Options, Passes};
 use rustc_session::getopts;
 use rustc_session::lint::Level;
 use rustc_session::search_paths::SearchPath;
+use rustc_session::utils::NativeLibKind;
 use rustc_session::{build_session, Session};
 use rustc_span::edition::{Edition, DEFAULT_EDITION};
 use rustc_span::symbol::sym;
 use rustc_span::SourceFileHashAlgorithm;
-use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy};
+use rustc_target::spec::{CodeModel, LinkerFlavor, MergeFunctions, PanicStrategy};
 use rustc_target::spec::{RelocModel, RelroLevel, TlsModel};
 use std::collections::{BTreeMap, BTreeSet};
 use std::iter::FromIterator;
@@ -300,30 +300,30 @@ fn test_native_libs_tracking_hash_different_values() {
 
     // Reference
     v1.libs = vec![
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("b"), None, Some(cstore::NativeFramework)),
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("b"), None, NativeLibKind::Framework),
+        (String::from("c"), None, NativeLibKind::Unspecified),
     ];
 
     // Change label
     v2.libs = vec![
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("X"), None, Some(cstore::NativeFramework)),
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("X"), None, NativeLibKind::Framework),
+        (String::from("c"), None, NativeLibKind::Unspecified),
     ];
 
     // Change kind
     v3.libs = vec![
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("b"), None, Some(cstore::NativeStatic)),
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("b"), None, NativeLibKind::StaticBundle),
+        (String::from("c"), None, NativeLibKind::Unspecified),
     ];
 
     // Change new-name
     v4.libs = vec![
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("b"), Some(String::from("X")), Some(cstore::NativeFramework)),
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("b"), Some(String::from("X")), NativeLibKind::Framework),
+        (String::from("c"), None, NativeLibKind::Unspecified),
     ];
 
     assert!(v1.dep_tracking_hash() != v2.dep_tracking_hash());
@@ -345,21 +345,21 @@ fn test_native_libs_tracking_hash_different_order() {
 
     // Reference
     v1.libs = vec![
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("b"), None, Some(cstore::NativeFramework)),
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("b"), None, NativeLibKind::Framework),
+        (String::from("c"), None, NativeLibKind::Unspecified),
     ];
 
     v2.libs = vec![
-        (String::from("b"), None, Some(cstore::NativeFramework)),
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
+        (String::from("b"), None, NativeLibKind::Framework),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("c"), None, NativeLibKind::Unspecified),
     ];
 
     v3.libs = vec![
-        (String::from("c"), None, Some(cstore::NativeUnknown)),
-        (String::from("a"), None, Some(cstore::NativeStatic)),
-        (String::from("b"), None, Some(cstore::NativeFramework)),
+        (String::from("c"), None, NativeLibKind::Unspecified),
+        (String::from("a"), None, NativeLibKind::StaticBundle),
+        (String::from("b"), None, NativeLibKind::Framework),
     ];
 
     assert!(v1.dep_tracking_hash() == v2.dep_tracking_hash());
@@ -411,7 +411,7 @@ macro_rules! tracked {
 
     // Make sure that changing a [TRACKED] option changes the hash.
     // This list is in alphabetical order.
-    tracked!(code_model, Some(String::from("code model")));
+    tracked!(code_model, Some(CodeModel::Large));
     tracked!(debug_assertions, Some(true));
     tracked!(debuginfo, 0xdeadbeef);
     tracked!(embed_bitcode, false);
@@ -511,6 +511,7 @@ macro_rules! untracked {
     untracked!(ui_testing, true);
     untracked!(unpretty, Some("expanded".to_string()));
     untracked!(unstable_options, true);
+    untracked!(validate_mir, true);
     untracked!(verbose, true);
 
     macro_rules! tracked {