diff options
author | bors <bors@rust-lang.org> | 2024-07-04 14:24:43 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2024-07-04 14:24:43 +0000 |
commit | 9f877c9cd2c3f8f2f64df1e0c1804ad0682416d0 (patch) | |
tree | e8b31767a803d73be9a928158744228858b8467c /compiler | |
parent | e2cf31a6148725bde4ea48acf1e4fe72675257a2 (diff) | |
parent | 449581d89bd8361d6eaa2d0e91c2197831658b1a (diff) |
Auto merge of #127170 - bjorn3:no_specialize_index_borrowck, r=michaelwoerister
Stop using specialization in rustc_index and rustc_borrowck
For rustc_borrowck the version with specialization isn't much more readable anyway IMO. For rustc_index it probably doesn't affect perf in any noticeable way anyway.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/rustc_borrowck/src/facts.rs | 28 | ||||
-rw-r--r-- | compiler/rustc_borrowck/src/lib.rs | 1 | ||||
-rw-r--r-- | compiler/rustc_index/src/lib.rs | 5 | ||||
-rw-r--r-- | compiler/rustc_index_macros/src/lib.rs | 5 | ||||
-rw-r--r-- | compiler/rustc_index_macros/src/newtype.rs | 4 | ||||
-rw-r--r-- | compiler/rustc_type_ir/src/lib.rs | 2 |
6 files changed, 29 insertions, 16 deletions
diff --git a/compiler/rustc_borrowck/src/facts.rs b/compiler/rustc_borrowck/src/facts.rs index 51ea59e2092..af96f115385 100644 --- a/compiler/rustc_borrowck/src/facts.rs +++ b/compiler/rustc_borrowck/src/facts.rs @@ -213,8 +213,32 @@ trait FactCell { fn to_string(&self, location_table: &LocationTable) -> String; } -impl<A: Debug> FactCell for A { - default fn to_string(&self, _location_table: &LocationTable) -> String { +impl FactCell for BorrowIndex { + fn to_string(&self, _location_table: &LocationTable) -> String { + format!("{self:?}") + } +} + +impl FactCell for Local { + fn to_string(&self, _location_table: &LocationTable) -> String { + format!("{self:?}") + } +} + +impl FactCell for MovePathIndex { + fn to_string(&self, _location_table: &LocationTable) -> String { + format!("{self:?}") + } +} + +impl FactCell for PoloniusRegionVid { + fn to_string(&self, _location_table: &LocationTable) -> String { + format!("{self:?}") + } +} + +impl FactCell for RegionVid { + fn to_string(&self, _location_table: &LocationTable) -> String { format!("{self:?}") } } diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index e6f8ffd428d..36ba1d81be6 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -7,7 +7,6 @@ #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(let_chains)] -#![feature(min_specialization)] #![feature(never_type)] #![feature(rustc_attrs)] #![feature(rustdoc_internals)] diff --git a/compiler/rustc_index/src/lib.rs b/compiler/rustc_index/src/lib.rs index db6b250467e..b775ae1f5e9 100644 --- a/compiler/rustc_index/src/lib.rs +++ b/compiler/rustc_index/src/lib.rs @@ -1,10 +1,7 @@ // tidy-alphabetical-start #![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))] -#![cfg_attr( - feature = "nightly", - feature(extend_one, min_specialization, new_uninit, step_trait, test) -)] #![cfg_attr(feature = "nightly", allow(internal_features))] +#![cfg_attr(feature = "nightly", feature(extend_one, new_uninit, step_trait, test))] // tidy-alphabetical-end pub mod bit_set; diff --git a/compiler/rustc_index_macros/src/lib.rs b/compiler/rustc_index_macros/src/lib.rs index 3e55dd82a6e..2b444932f85 100644 --- a/compiler/rustc_index_macros/src/lib.rs +++ b/compiler/rustc_index_macros/src/lib.rs @@ -34,10 +34,7 @@ mod newtype; /// optimizations. The default max value is 0xFFFF_FF00. /// - `#[gate_rustc_only]`: makes parts of the generated code nightly-only. #[proc_macro] -#[cfg_attr( - feature = "nightly", - allow_internal_unstable(step_trait, rustc_attrs, trusted_step, min_specialization) -)] +#[cfg_attr(feature = "nightly", allow_internal_unstable(step_trait, rustc_attrs, trusted_step))] pub fn newtype_index(input: TokenStream) -> TokenStream { newtype::newtype(input) } diff --git a/compiler/rustc_index_macros/src/newtype.rs b/compiler/rustc_index_macros/src/newtype.rs index 41863f7b15f..1ac2c44e9dc 100644 --- a/compiler/rustc_index_macros/src/newtype.rs +++ b/compiler/rustc_index_macros/src/newtype.rs @@ -139,10 +139,6 @@ impl Parse for Newtype { Self::index(start).checked_sub(u).map(Self::from_usize) } } - - // Safety: The implementation of `Step` upholds all invariants. - #gate_rustc_only - unsafe impl ::std::iter::TrustedStep for #name {} } } else { quote! {} diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs index 1b5529cd8db..fedc8959cf7 100644 --- a/compiler/rustc_type_ir/src/lib.rs +++ b/compiler/rustc_type_ir/src/lib.rs @@ -2,7 +2,7 @@ #![allow(rustc::usage_of_ty_tykind)] #![cfg_attr( feature = "nightly", - feature(associated_type_defaults, min_specialization, never_type, rustc_attrs, negative_impls) + feature(associated_type_defaults, never_type, rustc_attrs, negative_impls) )] #![cfg_attr(feature = "nightly", allow(internal_features))] // tidy-alphabetical-end |