diff options
Diffstat (limited to 'compiler/rustc_metadata/src')
| -rw-r--r-- | compiler/rustc_metadata/src/native_libs.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs | 19 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/encoder.rs | 16 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/parameterized.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/table.rs | 63 |
6 files changed, 6 insertions, 103 deletions
diff --git a/compiler/rustc_metadata/src/native_libs.rs b/compiler/rustc_metadata/src/native_libs.rs index 8855766ca98..958e314efab 100644 --- a/compiler/rustc_metadata/src/native_libs.rs +++ b/compiler/rustc_metadata/src/native_libs.rs @@ -83,7 +83,7 @@ pub fn walk_native_lib_search_dirs<R>( // Mac Catalyst uses the macOS SDK, but to link to iOS-specific frameworks // we must have the support library stubs in the library search path (#121430). if let Some(sdk_root) = apple_sdk_root - && sess.target.llvm_target.contains("macabi") + && sess.target.env == "macabi" { f(&sdk_root.join("System/iOSSupport/usr/lib"), false)?; f(&sdk_root.join("System/iOSSupport/System/Library/Frameworks"), true)?; diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 00c97a2f738..548c56a97bc 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -1530,7 +1530,7 @@ impl<'a> CrateMetadataRef<'a> { let macro_rules = self.root.tables.is_macro_rules.get(self, id); let body = self.root.tables.macro_definition.get(self, id).unwrap().decode((self, sess)); - ast::MacroDef { macro_rules, body: ast::ptr::P(body) } + ast::MacroDef { macro_rules, body: Box::new(body) } } _ => bug!(), } diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 0f3896fd9be..11fef3be5d0 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -75,24 +75,6 @@ impl<'a, 'tcx, T: Copy + Decodable<DecodeContext<'a, 'tcx>>> ProcessQueryValue<' } impl<'a, 'tcx, T: Copy + Decodable<DecodeContext<'a, 'tcx>>> - ProcessQueryValue<'tcx, ty::EarlyBinder<'tcx, &'tcx [T]>> - for Option<DecodeIterator<'a, 'tcx, T>> -{ - #[inline(always)] - fn process_decoded( - self, - tcx: TyCtxt<'tcx>, - err: impl Fn() -> !, - ) -> ty::EarlyBinder<'tcx, &'tcx [T]> { - ty::EarlyBinder::bind(if let Some(iter) = self { - tcx.arena.alloc_from_iter(iter) - } else { - err() - }) - } -} - -impl<'a, 'tcx, T: Copy + Decodable<DecodeContext<'a, 'tcx>>> ProcessQueryValue<'tcx, Option<&'tcx [T]>> for Option<DecodeIterator<'a, 'tcx, T>> { #[inline(always)] @@ -413,6 +395,7 @@ provide! { tcx, def_id, other, cdata, crate_extern_paths => { cdata.source().paths().cloned().collect() } expn_that_defined => { cdata.get_expn_that_defined(def_id.index, tcx.sess) } + default_field => { cdata.get_default_field(def_id.index) } is_doc_hidden => { cdata.get_attr_flags(def_id.index).contains(AttrFlags::IS_DOC_HIDDEN) } doc_link_resolutions => { tcx.arena.alloc(cdata.get_doc_link_resolutions(def_id.index)) } doc_link_traits_in_scope => { diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index ff9f77be945..d42c8b947a4 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -19,13 +19,12 @@ use rustc_hir::find_attr; use rustc_hir_pretty::id_to_string; use rustc_middle::dep_graph::WorkProductId; use rustc_middle::middle::dependency_format::Linkage; -use rustc_middle::middle::exported_symbols::metadata_symbol_name; use rustc_middle::mir::interpret; use rustc_middle::query::Providers; use rustc_middle::traits::specialization_graph; +use rustc_middle::ty::AssocItemContainer; use rustc_middle::ty::codec::TyEncoder; use rustc_middle::ty::fast_reject::{self, TreatParams}; -use rustc_middle::ty::{AssocItemContainer, SymbolName}; use rustc_middle::{bug, span_bug}; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder, opaque}; use rustc_session::config::{CrateType, OptLevel, TargetModifier}; @@ -2207,19 +2206,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { exported_symbols: &[(ExportedSymbol<'tcx>, SymbolExportInfo)], ) -> LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)> { empty_proc_macro!(self); - // The metadata symbol name is special. It should not show up in - // downstream crates. - let metadata_symbol_name = SymbolName::new(self.tcx, &metadata_symbol_name(self.tcx)); - self.lazy_array( - exported_symbols - .iter() - .filter(|&(exported_symbol, _)| match *exported_symbol { - ExportedSymbol::NoDefId(symbol_name) => symbol_name != metadata_symbol_name, - _ => true, - }) - .cloned(), - ) + self.lazy_array(exported_symbols.iter().cloned()) } fn encode_dylib_dependency_formats(&mut self) -> LazyArray<Option<LinkagePreference>> { diff --git a/compiler/rustc_metadata/src/rmeta/parameterized.rs b/compiler/rustc_metadata/src/rmeta/parameterized.rs index d632e65104a..34180001f80 100644 --- a/compiler/rustc_metadata/src/rmeta/parameterized.rs +++ b/compiler/rustc_metadata/src/rmeta/parameterized.rs @@ -6,7 +6,7 @@ use rustc_index::{Idx, IndexVec}; use rustc_middle::ty::{Binder, EarlyBinder}; use rustc_span::Symbol; -use crate::rmeta::{LazyArray, LazyTable, LazyValue}; +use crate::rmeta::{LazyArray, LazyValue}; pub(crate) trait ParameterizedOverTcx: 'static { type Value<'tcx>; @@ -48,10 +48,6 @@ impl<T: ParameterizedOverTcx> ParameterizedOverTcx for LazyArray<T> { type Value<'tcx> = LazyArray<T::Value<'tcx>>; } -impl<I: 'static, T: ParameterizedOverTcx> ParameterizedOverTcx for LazyTable<I, T> { - type Value<'tcx> = LazyTable<I, T::Value<'tcx>>; -} - macro_rules! trivially_parameterized_over_tcx { ($($ty:ty),+ $(,)?) => { $( @@ -154,7 +150,6 @@ parameterized_over_tcx! { rustc_middle::mir::CoroutineLayout, rustc_middle::mir::interpret::ConstAllocation, rustc_middle::ty::Clause, - rustc_middle::ty::ClauseKind, rustc_middle::ty::Const, rustc_middle::ty::ConstConditions, rustc_middle::ty::FnSig, diff --git a/compiler/rustc_metadata/src/rmeta/table.rs b/compiler/rustc_metadata/src/rmeta/table.rs index 28f406fbc96..0671aa20399 100644 --- a/compiler/rustc_metadata/src/rmeta/table.rs +++ b/compiler/rustc_metadata/src/rmeta/table.rs @@ -66,22 +66,6 @@ pub(super) trait FixedSizeEncoding: IsDefault { fn write_to_bytes(self, b: &mut Self::ByteArray); } -/// This implementation is not used generically, but for reading/writing -/// concrete `u32` fields in `Lazy*` structures, which may be zero. -impl FixedSizeEncoding for u32 { - type ByteArray = [u8; 4]; - - #[inline] - fn from_bytes(b: &[u8; 4]) -> Self { - Self::from_le_bytes(*b) - } - - #[inline] - fn write_to_bytes(self, b: &mut [u8; 4]) { - *b = self.to_le_bytes(); - } -} - impl FixedSizeEncoding for u64 { type ByteArray = [u8; 8]; @@ -175,14 +159,6 @@ fixed_size_enum! { } fixed_size_enum! { - ty::ImplPolarity { - ( Positive ) - ( Negative ) - ( Reservation ) - } -} - -fixed_size_enum! { hir::Constness { ( NotConst ) ( Const ) @@ -306,45 +282,6 @@ impl FixedSizeEncoding for bool { } } -impl FixedSizeEncoding for Option<bool> { - type ByteArray = [u8; 1]; - - #[inline] - fn from_bytes(b: &[u8; 1]) -> Self { - match b[0] { - 0 => Some(false), - 1 => Some(true), - 2 => None, - _ => unreachable!(), - } - } - - #[inline] - fn write_to_bytes(self, b: &mut [u8; 1]) { - debug_assert!(!self.is_default()); - b[0] = match self { - Some(false) => 0, - Some(true) => 1, - None => 2, - }; - } -} - -impl FixedSizeEncoding for UnusedGenericParams { - type ByteArray = [u8; 4]; - - #[inline] - fn from_bytes(b: &[u8; 4]) -> Self { - let x: u32 = u32::from_bytes(b); - UnusedGenericParams::from_bits(x) - } - - #[inline] - fn write_to_bytes(self, b: &mut [u8; 4]) { - self.bits().write_to_bytes(b); - } -} - // NOTE(eddyb) there could be an impl for `usize`, which would enable a more // generic `LazyValue<T>` impl, but in the general case we might not need / want // to fit every `usize` in `u32`. |
