diff --git a/compiler/rustc_codegen_cranelift/example/mini_core.rs b/compiler/rustc_codegen_cranelift/example/mini_core.rs index 5293b458d8c4f..a82c7d3878dff 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core.rs @@ -18,11 +18,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "destruct"] pub trait Destruct {} @@ -52,14 +52,14 @@ impl<'a, T: PointeeSized + Unsize, U: PointeeSized> DispatchFromDyn<&'a mut U impl, U: PointeeSized> DispatchFromDyn<*const U> for *const T {} // *mut T -> *mut U impl, U: PointeeSized> DispatchFromDyn<*mut U> for *mut T {} -impl, U: MetaSized> DispatchFromDyn> for Box {} +impl, U: SizeOfVal> DispatchFromDyn> for Box {} #[lang = "legacy_receiver"] pub trait LegacyReceiver {} impl LegacyReceiver for &T {} impl LegacyReceiver for &mut T {} -impl LegacyReceiver for Box {} +impl LegacyReceiver for Box {} #[lang = "copy"] pub trait Copy {} diff --git a/compiler/rustc_codegen_gcc/example/mini_core.rs b/compiler/rustc_codegen_gcc/example/mini_core.rs index 2e165cc3c129d..02f49d0c3449e 100644 --- a/compiler/rustc_codegen_gcc/example/mini_core.rs +++ b/compiler/rustc_codegen_gcc/example/mini_core.rs @@ -22,11 +22,11 @@ unsafe extern "C" fn _Unwind_Resume() { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "destruct"] pub trait Destruct {} @@ -56,14 +56,14 @@ impl<'a, T: PointeeSized + Unsize, U: PointeeSized> DispatchFromDyn<&'a mut U impl, U: PointeeSized> DispatchFromDyn<*const U> for *const T {} // *mut T -> *mut U impl, U: PointeeSized> DispatchFromDyn<*mut U> for *mut T {} -impl, U: MetaSized> DispatchFromDyn> for Box {} +impl, U: SizeOfVal> DispatchFromDyn> for Box {} #[lang = "legacy_receiver"] pub trait LegacyReceiver {} impl LegacyReceiver for &T {} impl LegacyReceiver for &mut T {} -impl LegacyReceiver for Box {} +impl LegacyReceiver for Box {} #[lang = "receiver"] trait Receiver {} diff --git a/compiler/rustc_codegen_gcc/tests/run/simd-ffi.rs b/compiler/rustc_codegen_gcc/tests/run/simd-ffi.rs index 67cc2e5b96e3f..21feaf7fb2700 100644 --- a/compiler/rustc_codegen_gcc/tests/run/simd-ffi.rs +++ b/compiler/rustc_codegen_gcc/tests/run/simd-ffi.rs @@ -62,11 +62,11 @@ pub fn bar(a: i32x4, b: i32x4) -> i32x4 { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs index 80f0af9d663cb..fb8846eaf3135 100644 --- a/compiler/rustc_hir/src/lang_items.rs +++ b/compiler/rustc_hir/src/lang_items.rs @@ -153,7 +153,7 @@ impl HashStable for LangItem { language_item_table! { // Variant name, Name, Getter method name, Target Generic requirements; Sized, sym::sized, sized_trait, Target::Trait, GenericRequirement::Exact(0); - MetaSized, sym::meta_sized, meta_sized_trait, Target::Trait, GenericRequirement::Exact(0); + SizeOfVal, sym::size_of_val, size_of_val_trait, Target::Trait, GenericRequirement::Exact(0); PointeeSized, sym::pointee_sized, pointee_sized_trait, Target::Trait, GenericRequirement::Exact(0); Unsize, sym::unsize, unsize_trait, Target::Trait, GenericRequirement::Minimum(1); AlignOf, sym::mem_align_const, align_const, Target::AssocConst, GenericRequirement::Exact(0); diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs index 458bb6ddd2117..45336b4f8fb8e 100644 --- a/compiler/rustc_hir_analysis/src/check/mod.rs +++ b/compiler/rustc_hir_analysis/src/check/mod.rs @@ -376,7 +376,7 @@ fn bounds_from_generic_predicates<'tcx>( projections_str.push(format!("{} = {}", name, p.term)); } } - let bound_def_path = if tcx.is_lang_item(bound, LangItem::MetaSized) { + let bound_def_path = if tcx.is_lang_item(bound, LangItem::SizeOfVal) { String::from("?Sized") } else { tcx.def_path_str(bound) diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index ca399964fdd93..0cb811fc134a4 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -44,17 +44,17 @@ impl CollectedBound { struct CollectedSizednessBounds { // Collected `Sized` bounds sized: CollectedBound, - // Collected `MetaSized` bounds - meta_sized: CollectedBound, + // Collected `SizeOfVal` bounds + size_of_val: CollectedBound, // Collected `PointeeSized` bounds pointee_sized: CollectedBound, } impl CollectedSizednessBounds { /// Returns `true` if any of `Trait`, `?Trait` or `!Trait` were encountered for `Sized`, - /// `MetaSized` or `PointeeSized`. + /// `SizeOfVal` or `PointeeSized`. fn any(&self) -> bool { - self.sized.any() || self.meta_sized.any() || self.pointee_sized.any() + self.sized.any() || self.size_of_val.any() || self.pointee_sized.any() } } @@ -127,13 +127,13 @@ fn collect_sizedness_bounds<'tcx>( let sized_did = tcx.require_lang_item(hir::LangItem::Sized, span); let sized = collect_bounds(hir_bounds, context, sized_did); - let meta_sized_did = tcx.require_lang_item(hir::LangItem::MetaSized, span); - let meta_sized = collect_bounds(hir_bounds, context, meta_sized_did); + let size_of_val_did = tcx.require_lang_item(hir::LangItem::SizeOfVal, span); + let size_of_val = collect_bounds(hir_bounds, context, size_of_val_did); let pointee_sized_did = tcx.require_lang_item(hir::LangItem::PointeeSized, span); let pointee_sized = collect_bounds(hir_bounds, context, pointee_sized_did); - CollectedSizednessBounds { sized, meta_sized, pointee_sized } + CollectedSizednessBounds { sized, size_of_val, pointee_sized } } /// Add a trait bound for `did`. @@ -155,9 +155,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { /// /// - On parameters, opaque type and associated types, add default `Sized` bound if no explicit /// sizedness bounds are present. - /// - On traits and trait aliases, add default `MetaSized` supertrait if no explicit sizedness + /// - On traits and trait aliases, add default `SizeOfVal` supertrait if no explicit sizedness /// bounds are present. - /// - On parameters, opaque type, associated types and trait aliases, add a `MetaSized` bound if + /// - On parameters, opaque type, associated types and trait aliases, add a `SizeOfVal` bound if /// a `?Sized` bound is present. pub(crate) fn add_implicit_sizedness_bounds( &self, @@ -174,7 +174,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { return; } - let meta_sized_did = tcx.require_lang_item(hir::LangItem::MetaSized, span); + let size_of_val_did = tcx.require_lang_item(hir::LangItem::SizeOfVal, span); let pointee_sized_did = tcx.require_lang_item(hir::LangItem::PointeeSized, span); // If adding sizedness bounds to a trait, then there are some relevant early exits @@ -210,18 +210,18 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { let collected = collect_sizedness_bounds(tcx, hir_bounds, context, span); if (collected.sized.maybe || collected.sized.negative) && !collected.sized.positive - && !collected.meta_sized.any() + && !collected.size_of_val.any() && !collected.pointee_sized.any() { - // `?Sized` is equivalent to `MetaSized` (but only add the bound if there aren't any + // `?Sized` is equivalent to `SizeOfVal` (but only add the bound if there aren't any // other explicit ones) - this can happen for trait aliases as well as bounds. - add_trait_bound(tcx, bounds, self_ty, meta_sized_did, span); + add_trait_bound(tcx, bounds, self_ty, size_of_val_did, span); } else if !collected.any() { match context { ImpliedBoundsContext::TraitDef(..) => { // If there are no explicit sizedness bounds on a trait then add a default - // `MetaSized` supertrait. - add_trait_bound(tcx, bounds, self_ty, meta_sized_did, span); + // `SizeOfVal` supertrait. + add_trait_bound(tcx, bounds, self_ty, size_of_val_did, span); } ImpliedBoundsContext::TyParam(..) | ImpliedBoundsContext::AssociatedTypeOrImplTrait => { diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs index a498e97403881..328fd2f452c4c 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs @@ -92,14 +92,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // FIXME(sized-hierarchy): https://github.com/rust-lang/rust/pull/142712#issuecomment-3013231794 debug!(?user_written_bounds, ?elaborated_trait_bounds); - let meta_sized_did = tcx.require_lang_item(LangItem::MetaSized, span); - // Don't strip out `MetaSized` when the user wrote it explicitly, only when it was + let size_of_val_did = tcx.require_lang_item(LangItem::SizeOfVal, span); + // Don't strip out `SizeOfVal` when the user wrote it explicitly, only when it was // elaborated - if user_written_bounds - .iter() - .all(|(clause, _)| clause.as_trait_clause().map(|p| p.def_id()) != Some(meta_sized_did)) - { - elaborated_trait_bounds.retain(|(pred, _)| pred.def_id() != meta_sized_did); + if user_written_bounds.iter().all(|(clause, _)| { + clause.as_trait_clause().map(|p| p.def_id()) != Some(size_of_val_did) + }) { + elaborated_trait_bounds.retain(|(pred, _)| pred.def_id() != size_of_val_did); } debug!(?user_written_bounds, ?elaborated_trait_bounds); diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 91660fc655377..9f9f28b64a23b 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -62,7 +62,7 @@ use crate::{NoVariantNamed, check_c_variadic_abi}; #[derive(Clone, Copy)] pub(crate) enum ImpliedBoundsContext<'tcx> { /// An implied bound is added to a trait definition (i.e. a new supertrait), used when adding - /// a default `MetaSized` supertrait + /// a default `SizeOfVal` supertrait TraitDef(LocalDefId), /// An implied bound is added to a type parameter TyParam(LocalDefId, &'tcx [hir::WherePredicate<'tcx>]), diff --git a/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs b/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs index 93f067d09833a..1f13f496d9ff6 100644 --- a/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs +++ b/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs @@ -47,7 +47,7 @@ impl<'tcx> LateLintPass<'tcx> for MultipleSupertraitUpcastable { .explicit_super_predicates_of(def_id) .iter_identity_copied() .filter_map(|(pred, _)| pred.as_trait_clause()) - .filter(|pred| !cx.tcx.is_lang_item(pred.def_id(), hir::LangItem::MetaSized)) + .filter(|pred| !cx.tcx.is_lang_item(pred.def_id(), hir::LangItem::SizeOfVal)) .filter(|pred| !cx.tcx.is_default_trait(pred.def_id())); if direct_super_traits_iter.count() > 1 { cx.emit_span_lint( diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 58a2edca8ecef..5bfc96a0b82ae 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -990,7 +990,7 @@ impl<'tcx> TyCtxt<'tcx> { } pub fn is_sizedness_trait(self, def_id: DefId) -> bool { - matches!(self.as_lang_item(def_id), Some(LangItem::Sized | LangItem::MetaSized)) + matches!(self.as_lang_item(def_id), Some(LangItem::Sized | LangItem::SizeOfVal)) } /// Returns a range of the start/end indices specified with the diff --git a/compiler/rustc_middle/src/ty/context/impl_interner.rs b/compiler/rustc_middle/src/ty/context/impl_interner.rs index 7bbfb11698fe1..e3d8122c94054 100644 --- a/compiler/rustc_middle/src/ty/context/impl_interner.rs +++ b/compiler/rustc_middle/src/ty/context/impl_interner.rs @@ -799,9 +799,9 @@ bidirectional_lang_item_map! { FusedIterator, Future, Iterator, - MetaSized, PointeeSized, PointeeTrait, + SizeOfVal, Sized, TransmuteTrait, TrivialClone, diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 2c14c37609d41..fac591fd3bc1d 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1078,7 +1078,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { let mut has_sized_bound = false; let mut has_negative_sized_bound = false; - let mut has_meta_sized_bound = false; + let mut has_size_of_val_bound = false; for (predicate, _) in bounds.iter_instantiated_copied(tcx, args) { let bound_predicate = predicate.kind(); @@ -1086,7 +1086,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { match bound_predicate.skip_binder() { ty::ClauseKind::Trait(pred) => { // With `feature(sized_hierarchy)`, don't print `?Sized` as an alias for - // `MetaSized`, and skip sizedness bounds to be added at the end. + // `SizeOfVal`, and skip sizedness bounds to be added at the end. match tcx.as_lang_item(pred.def_id()) { Some(LangItem::Sized) => match pred.polarity { ty::PredicatePolarity::Positive => { @@ -1095,8 +1095,8 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { } ty::PredicatePolarity::Negative => has_negative_sized_bound = true, }, - Some(LangItem::MetaSized) => { - has_meta_sized_bound = true; + Some(LangItem::SizeOfVal) => { + has_size_of_val_bound = true; continue; } Some(LangItem::PointeeSized) => { @@ -1248,10 +1248,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { let using_sized_hierarchy = self.tcx().features().sized_hierarchy(); let add_sized = has_sized_bound && (first || has_negative_sized_bound); let add_maybe_sized = - has_meta_sized_bound && !has_negative_sized_bound && !using_sized_hierarchy; - // Set `has_pointee_sized_bound` if there were no `Sized` or `MetaSized` bounds. + has_size_of_val_bound && !has_negative_sized_bound && !using_sized_hierarchy; + // Set `has_pointee_sized_bound` if there were no `Sized` or `SizeOfVal` bounds. let has_pointee_sized_bound = - !has_sized_bound && !has_meta_sized_bound && !has_negative_sized_bound; + !has_sized_bound && !has_size_of_val_bound && !has_negative_sized_bound; if add_sized || add_maybe_sized { if !first { write!(self, " + ")?; @@ -1260,11 +1260,11 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { write!(self, "?")?; } write!(self, "Sized")?; - } else if has_meta_sized_bound && using_sized_hierarchy { + } else if has_size_of_val_bound && using_sized_hierarchy { if !first { write!(self, " + ")?; } - write!(self, "MetaSized")?; + write!(self, "SizeOfVal")?; } else if has_pointee_sized_bound && using_sized_hierarchy { if !first { write!(self, " + ")?; diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 0d047b348d9e1..2dfb47e00dc0d 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1890,7 +1890,7 @@ impl<'tcx> Ty<'tcx> { } } - /// Fast path helper for testing if a type is `Sized` or `MetaSized`. + /// Fast path helper for testing if a type is `Sized` or `SizeOfVal`. /// /// Returning true means the type is known to implement the sizedness trait. Returning `false` /// means nothing -- could be sized, might not be. @@ -1924,11 +1924,11 @@ impl<'tcx> Ty<'tcx> { ty::Str | ty::Slice(_) | ty::Dynamic(_, _) => match sizedness { SizedTraitKind::Sized => false, - SizedTraitKind::MetaSized => true, + SizedTraitKind::SizeOfVal => true, }, ty::Foreign(..) => match sizedness { - SizedTraitKind::Sized | SizedTraitKind::MetaSized => false, + SizedTraitKind::Sized | SizedTraitKind::SizeOfVal => false, }, ty::Tuple(tys) => tys.last().is_none_or(|ty| ty.has_trivial_sizedness(tcx, sizedness)), diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs index 32b1e93bf98be..06a9f14d86ece 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs @@ -218,8 +218,8 @@ where goal: Goal, ) -> Result, NoSolution>; - /// A type is `Sized` if its tail component is `Sized` and a type is `MetaSized` if its tail - /// component is `MetaSized`. + /// A type is `Sized` if its tail component is `Sized` and a type is `SizeOfVal` if its tail + /// component is `SizeOfVal`. /// /// These components are given by built-in rules from /// [`structural_traits::instantiate_constituent_tys_for_sizedness_trait`]. @@ -551,8 +551,8 @@ where Some(SolverTraitLangItem::Sized) => { G::consider_builtin_sizedness_candidates(self, goal, SizedTraitKind::Sized) } - Some(SolverTraitLangItem::MetaSized) => { - G::consider_builtin_sizedness_candidates(self, goal, SizedTraitKind::MetaSized) + Some(SolverTraitLangItem::SizeOfVal) => { + G::consider_builtin_sizedness_candidates(self, goal, SizedTraitKind::SizeOfVal) } Some(SolverTraitLangItem::PointeeSized) => { unreachable!("`PointeeSized` is removed during lowering"); @@ -802,7 +802,7 @@ where ) { let cx = self.cx(); if cx.is_sizedness_trait(goal.predicate.trait_def_id(cx)) { - // `dyn MetaSized` is valid, but should get its `MetaSized` impl from + // `dyn SizeOfVal` is valid, but should get its `SizeOfVal` impl from // being `dyn` (SizedCandidate), not from the object candidate. return; } diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs index 433cad188bb6c..22b3539ce517a 100644 --- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs @@ -140,7 +140,7 @@ where // impl {Meta,}Sized for str, [T], dyn Trait ty::Str | ty::Slice(_) | ty::Dynamic(..) => match sizedness { SizedTraitKind::Sized => Err(NoSolution), - SizedTraitKind::MetaSized => Ok(ty::Binder::dummy(vec![])), + SizedTraitKind::SizeOfVal => Ok(ty::Binder::dummy(vec![])), }, // impl {} for extern type diff --git a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs index 4b1e4b2de571d..16397dea385a1 100644 --- a/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs @@ -233,7 +233,7 @@ where _goal: Goal, _sizedness: SizedTraitKind, ) -> Result, NoSolution> { - unreachable!("Sized/MetaSized is never const") + unreachable!("Sized/SizeOfVal is never const") } fn consider_builtin_copy_clone_candidate( diff --git a/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs b/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs index 13f2ad8f82eba..c238992bfe08d 100644 --- a/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs +++ b/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs @@ -422,7 +422,7 @@ where goal: Goal, _sizedness: SizedTraitKind, ) -> Result, NoSolution> { - panic!("`Sized`/`MetaSized` does not have an associated type: {:?}", goal); + panic!("`Sized`/`SizeOfVal` does not have an associated type: {:?}", goal); } fn consider_builtin_copy_clone_candidate( diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 6589a12c4cc2d..fd7617399baf4 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -140,12 +140,12 @@ where ) -> bool { clause_def_id == goal_def_id // PERF(sized-hierarchy): Sizedness supertraits aren't elaborated to improve perf, so - // check for a `MetaSized` supertrait being matched against a `Sized` assumption. + // check for a `SizeOfVal` supertrait being matched against a `Sized` assumption. // // `PointeeSized` bounds are syntactic sugar for a lack of bounds so don't need this. || (polarity == PredicatePolarity::Positive && cx.is_trait_lang_item(clause_def_id, SolverTraitLangItem::Sized) - && cx.is_trait_lang_item(goal_def_id, SolverTraitLangItem::MetaSized)) + && cx.is_trait_lang_item(goal_def_id, SolverTraitLangItem::SizeOfVal)) } if let Some(trait_clause) = assumption.as_trait_clause() @@ -176,16 +176,16 @@ where let trait_clause = assumption.as_trait_clause().unwrap(); // PERF(sized-hierarchy): Sizedness supertraits aren't elaborated to improve perf, so - // check for a `Sized` subtrait when looking for `MetaSized`. `PointeeSized` bounds + // check for a `Sized` subtrait when looking for `SizeOfVal`. `PointeeSized` bounds // are syntactic sugar for a lack of bounds so don't need this. // We don't need to check polarity, `fast_reject_assumption` already rejected non-`Positive` - // polarity `Sized` assumptions as matching non-`Positive` `MetaSized` goals. - if ecx.cx().is_trait_lang_item(goal.predicate.def_id(), SolverTraitLangItem::MetaSized) + // polarity `Sized` assumptions as matching non-`Positive` `SizeOfVal` goals. + if ecx.cx().is_trait_lang_item(goal.predicate.def_id(), SolverTraitLangItem::SizeOfVal) && ecx.cx().is_trait_lang_item(trait_clause.def_id(), SolverTraitLangItem::Sized) { - let meta_sized_clause = + let size_of_val_clause = trait_predicate_with_def_id(ecx.cx(), trait_clause, goal.predicate.def_id()); - return Self::match_assumption(ecx, goal, meta_sized_clause, then); + return Self::match_assumption(ecx, goal, size_of_val_clause, then); } let assumption_trait_pred = ecx.instantiate_binder_with_infer(trait_clause); @@ -897,7 +897,7 @@ where /// Small helper function to change the `def_id` of a trait predicate - this is not normally /// something that you want to do, as different traits will require different args and so making /// it easy to change the trait is something of a footgun, but it is useful in the narrow -/// circumstance of changing from `MetaSized` to `Sized`, which happens as part of the lazy +/// circumstance of changing from `SizeOfVal` to `Sized`, which happens as part of the lazy /// elaboration of sizedness candidates. #[inline(always)] fn trait_predicate_with_def_id( diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 738c9b975fd00..4a6c116a703f2 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1238,7 +1238,6 @@ symbols! { memtag, message, meta, - meta_sized, metadata_type, mgca_type_const_syntax, min_const_fn, diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs index 7f5ed9ecb6d11..c52918b2f2530 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs @@ -209,7 +209,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { // begin with in those cases. if matches!( self.tcx.as_lang_item(trait_pred.def_id()), - Some(LangItem::Sized | LangItem::MetaSized) + Some(LangItem::Sized | LangItem::SizeOfVal) ) { return match self.tainted_by_errors() { None => self diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs index bda0c4fa2c6f6..5f7e1da8670fe 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs @@ -154,7 +154,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { }) .collect(); - // Ensure `T: Sized`, `T: MetaSized`, `T: PointeeSized` and `T: WF` obligations come last, + // Ensure `T: Sized`, `T: SizeOfVal`, `T: PointeeSized` and `T: WF` obligations come last, // and `Subtype` obligations from `FormatLiteral` desugarings come first. // This lets us display diagnostics with more relevant type information and hide redundant // E0282 errors. @@ -163,7 +163,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { SubtypeFormat(usize, usize), OtherKind, SizedTrait, - MetaSizedTrait, + SizeOfValTrait, PointeeSizedTrait, Coerce, WellFormed, @@ -189,8 +189,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { _ if maybe_sizedness_did == self.tcx.lang_items().sized_trait() => { ErrorSortKey::SizedTrait } - _ if maybe_sizedness_did == self.tcx.lang_items().meta_sized_trait() => { - ErrorSortKey::MetaSizedTrait + _ if maybe_sizedness_did == self.tcx.lang_items().size_of_val_trait() => { + ErrorSortKey::SizeOfValTrait } _ if maybe_sizedness_did == self.tcx.lang_items().pointee_sized_trait() => { ErrorSortKey::PointeeSizedTrait @@ -458,7 +458,7 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti #[derive(Debug, Default)] struct SizednessFound { sized: bool, - meta_sized: bool, + size_of_val: bool, } let mut types_with_sizedness_bounds = FxIndexMap::<_, SizednessFound>::default(); @@ -490,7 +490,7 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti let mut pretty_predicates = Vec::with_capacity(predicates.len()); let sized_trait = tcx.lang_items().sized_trait(); - let meta_sized_trait = tcx.lang_items().meta_sized_trait(); + let size_of_val_trait = tcx.lang_items().size_of_val_trait(); for (p, _) in predicates { // Accumulate the sizedness bounds for each self ty. @@ -500,8 +500,8 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti if Some(trait_clause.def_id()) == sized_trait { sizedness_of.sized = true; continue; - } else if Some(trait_clause.def_id()) == meta_sized_trait { - sizedness_of.meta_sized = true; + } else if Some(trait_clause.def_id()) == size_of_val_trait { + sizedness_of.size_of_val = true; continue; } } @@ -520,8 +520,8 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti if sizedness.sized { // Maybe a default bound, don't write anything. pretty_predicates.push(format!("{ty}: Sized")); - } else if sizedness.meta_sized { - pretty_predicates.push(format!("{ty}: MetaSized")); + } else if sizedness.size_of_val { + pretty_predicates.push(format!("{ty}: SizeOfVal")); } else { pretty_predicates.push(format!("{ty}: PointeeSized")); } diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs index 62572694de326..910efa6bc37ee 100644 --- a/compiler/rustc_trait_selection/src/solve/delegate.rs +++ b/compiler/rustc_trait_selection/src/solve/delegate.rs @@ -76,7 +76,7 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< if trait_pred.polarity() == ty::PredicatePolarity::Positive { match self.0.tcx.as_lang_item(trait_pred.def_id()) { - Some(LangItem::Sized) | Some(LangItem::MetaSized) => { + Some(LangItem::Sized) | Some(LangItem::SizeOfVal) => { let predicate = self.resolve_vars_if_possible(goal.predicate); if sizedness_fast_path(self.tcx, predicate, goal.param_env) { return Some(Certainty::Yes); diff --git a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs index f1ab59abc6aef..a8555048a9e9e 100644 --- a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs +++ b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs @@ -606,11 +606,11 @@ fn receiver_for_self_ty<'tcx>( /// In practice, we cannot use `dyn Trait` explicitly in the obligation because it would result in /// a new check that `Trait` is dyn-compatible, creating a cycle. /// Instead, we emulate a placeholder by introducing a new type parameter `U` such that -/// `Self: Unsize` and `U: Trait + MetaSized`, and use `U` in place of `dyn Trait`. +/// `Self: Unsize` and `U: Trait + SizeOfVal`, and use `U` in place of `dyn Trait`. /// /// Written as a chalk-style query: /// ```ignore (not-rust) -/// forall (U: Trait + MetaSized) { +/// forall (U: Trait + SizeOfVal) { /// if (Self: Unsize) { /// Receiver: DispatchFromDyn U]> /// } @@ -647,7 +647,7 @@ fn receiver_is_dispatchable<'tcx>( receiver_for_self_ty(tcx, receiver_ty, unsized_self_ty, method.def_id); // create a modified param env, with `Self: Unsize` and `U: Trait` (and all of - // its supertraits) added to caller bounds. `U: MetaSized` is already implied here. + // its supertraits) added to caller bounds. `U: SizeOfVal` is already implied here. let param_env = { // N.B. We generally want to emulate the construction of the `unnormalized_param_env` // in the param-env query here. The fact that we don't just start with the clauses @@ -676,11 +676,11 @@ fn receiver_is_dispatchable<'tcx>( let trait_predicate = ty::TraitRef::new_from_args(tcx, trait_def_id, args); predicates.push(trait_predicate.upcast(tcx)); - let meta_sized_predicate = { - let meta_sized_did = tcx.require_lang_item(LangItem::MetaSized, DUMMY_SP); - ty::TraitRef::new(tcx, meta_sized_did, [unsized_self_ty]).upcast(tcx) + let size_of_val_predicate = { + let size_of_val_did = tcx.require_lang_item(LangItem::SizeOfVal, DUMMY_SP); + ty::TraitRef::new(tcx, size_of_val_did, [unsized_self_ty]).upcast(tcx) }; - predicates.push(meta_sized_predicate); + predicates.push(size_of_val_predicate); normalize_param_env_or_error( tcx, diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index b0af60d2aecfc..5b3507ed83907 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -99,11 +99,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { SizedTraitKind::Sized, ); } - Some(LangItem::MetaSized) => { + Some(LangItem::SizeOfVal) => { self.assemble_builtin_sized_candidate( obligation.predicate.self_ty().skip_binder(), &mut candidates, - SizedTraitKind::MetaSized, + SizedTraitKind::SizeOfVal, ); } Some(LangItem::PointeeSized) => { @@ -912,7 +912,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ); if self.tcx().is_sizedness_trait(obligation.predicate.def_id()) { - // `dyn MetaSized` is valid, but should get its `MetaSized` impl from + // `dyn SizeOfVal` is valid, but should get its `SizeOfVal` impl from // being `dyn` (SizedCandidate), not from the object candidate. return; } @@ -1232,7 +1232,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } } - /// Assembles the `Sized` and `MetaSized` traits which are built-in to the language itself. + /// Assembles the `Sized` and `SizeOfVal` traits which are built-in to the language itself. #[instrument(level = "debug", skip(self, candidates))] fn assemble_builtin_sized_candidate( &mut self, @@ -1277,15 +1277,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { candidates.vec.push(SizedCandidate); } - // `MetaSized` but not `Sized`. + // `SizeOfVal` but not `Sized`. ty::Str | ty::Slice(_) | ty::Dynamic(..) => match sizedness { SizedTraitKind::Sized => {} - SizedTraitKind::MetaSized => { + SizedTraitKind::SizeOfVal => { candidates.vec.push(SizedCandidate); } }, - // Not `MetaSized` or `Sized`. + // Not `SizeOfVal` or `Sized`. ty::Foreign(..) => {} ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => {} diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index e948994b8689c..78769f31f95d5 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -238,8 +238,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ); let types = match tcx.as_lang_item(trait_def) { Some(LangItem::Sized) => self.sizedness_conditions(self_ty, SizedTraitKind::Sized), - Some(LangItem::MetaSized) => { - self.sizedness_conditions(self_ty, SizedTraitKind::MetaSized) + Some(LangItem::SizeOfVal) => { + self.sizedness_conditions(self_ty, SizedTraitKind::SizeOfVal) } Some(LangItem::PointeeSized) => { bug!("`PointeeSized` is removing during lowering"); diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 0008ce4b4984a..f085b0597d466 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -2164,7 +2164,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> { ty::Str | ty::Slice(_) | ty::Dynamic(..) => match sizedness { SizedTraitKind::Sized => unreachable!("tried to assemble `Sized` for unsized type"), - SizedTraitKind::MetaSized => ty::Binder::dummy(vec![]), + SizedTraitKind::SizeOfVal => ty::Binder::dummy(vec![]), }, ty::Foreign(..) => unreachable!("tried to assemble `Sized` for unsized type"), diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index c3f46aa51c737..4fe18248ebd42 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -370,7 +370,7 @@ pub fn sizedness_fast_path<'tcx>( predicate: ty::Predicate<'tcx>, param_env: ty::ParamEnv<'tcx>, ) -> bool { - // Proving `Sized`/`MetaSized`, very often on "obviously sized" types like + // Proving `Sized`/`SizeOfVal`, very often on "obviously sized" types like // `&T`, accounts for about 60% percentage of the predicates we have to prove. No need to // canonicalize and all that for such cases. if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred)) = @@ -379,7 +379,7 @@ pub fn sizedness_fast_path<'tcx>( { let sizedness = match tcx.as_lang_item(trait_pred.def_id()) { Some(LangItem::Sized) => SizedTraitKind::Sized, - Some(LangItem::MetaSized) => SizedTraitKind::MetaSized, + Some(LangItem::SizeOfVal) => SizedTraitKind::SizeOfVal, _ => return false, }; @@ -394,7 +394,7 @@ pub fn sizedness_fast_path<'tcx>( && clause_pred.polarity == ty::PredicatePolarity::Positive && clause_pred.self_ty() == trait_pred.self_ty() && (clause_pred.def_id() == trait_pred.def_id() - || (sizedness == SizedTraitKind::MetaSized + || (sizedness == SizedTraitKind::SizeOfVal && tcx.is_lang_item(clause_pred.def_id(), LangItem::Sized))) { return true; @@ -407,14 +407,14 @@ pub fn sizedness_fast_path<'tcx>( } /// To improve performance, sizedness traits are not elaborated and so special-casing is required -/// in the trait solver to find a `Sized` candidate for a `MetaSized` obligation. Returns the +/// in the trait solver to find a `Sized` candidate for a `SizeOfVal` obligation. Returns the /// predicate to used in the candidate for such a `obligation`, given a `candidate`. pub(crate) fn lazily_elaborate_sizedness_candidate<'tcx>( infcx: &InferCtxt<'tcx>, obligation: &PolyTraitObligation<'tcx>, candidate: PolyTraitPredicate<'tcx>, ) -> PolyTraitPredicate<'tcx> { - if !infcx.tcx.is_lang_item(obligation.predicate.def_id(), LangItem::MetaSized) + if !infcx.tcx.is_lang_item(obligation.predicate.def_id(), LangItem::SizeOfVal) || !infcx.tcx.is_lang_item(candidate.def_id(), LangItem::Sized) { return candidate; diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index b8f5336115e12..13d7b949bc332 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -568,9 +568,9 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> { def_id: DefId, args: GenericArgsRef<'tcx>, ) -> PredicateObligations<'tcx> { - // PERF: `Sized`'s predicates include `MetaSized`, but both are compiler implemented marker - // traits, so `MetaSized` will always be WF if `Sized` is WF and vice-versa. Determining - // the nominal obligations of `Sized` would in-effect just elaborate `MetaSized` and make + // PERF: `Sized`'s predicates include `SizeOfVal`, but both are compiler implemented marker + // traits, so `SizeOfVal` will always be WF if `Sized` is WF and vice-versa. Determining + // the nominal obligations of `Sized` would in-effect just elaborate `SizeOfVal` and make // the compiler do a bunch of work needlessly. if self.tcx().is_lang_item(def_id, LangItem::Sized) { return Default::default(); diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 7a84a87a789ac..c7225f3ab876c 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -23,7 +23,7 @@ fn sizedness_constraint_for_ty<'tcx>( ty: Ty<'tcx>, ) -> Option> { match ty.kind() { - // Always `Sized` or `MetaSized` + // Always `Sized` or `SizeOfVal` ty::Bool | ty::Char | ty::Int(..) @@ -43,11 +43,11 @@ fn sizedness_constraint_for_ty<'tcx>( ty::Str | ty::Slice(..) | ty::Dynamic(_, _) => match sizedness { // Never `Sized` SizedTraitKind::Sized => Some(ty), - // Always `MetaSized` - SizedTraitKind::MetaSized => None, + // Always `SizeOfVal` + SizedTraitKind::SizeOfVal => None, }, - // Maybe `Sized` or `MetaSized` + // Maybe `Sized` or `SizeOfVal` ty::Param(..) | ty::Alias(..) | ty::Error(_) => Some(ty), // We cannot instantiate the binder, so just return the *original* type back, @@ -57,7 +57,7 @@ fn sizedness_constraint_for_ty<'tcx>( sizedness_constraint_for_ty(tcx, sizedness, inner_ty.skip_binder()).map(|_| ty) } - // Never `MetaSized` or `Sized` + // Never `SizeOfVal` or `Sized` ty::Foreign(..) => Some(ty), // Recursive cases @@ -108,7 +108,7 @@ fn defaultness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Defaultness { /// - an pointee-sized type (extern types) /// - a type parameter or projection whose sizedness can't be known /// -/// For `MetaSized`, there are only a few options for the types in the constraint: +/// For `SizeOfVal`, there are only a few options for the types in the constraint: /// - an pointee-sized type (extern types) /// - a type parameter or projection whose sizedness can't be known #[instrument(level = "debug", skip(tcx), ret)] diff --git a/compiler/rustc_type_ir/src/elaborate.rs b/compiler/rustc_type_ir/src/elaborate.rs index 2f7c78d497a4f..a8509278d009f 100644 --- a/compiler/rustc_type_ir/src/elaborate.rs +++ b/compiler/rustc_type_ir/src/elaborate.rs @@ -135,8 +135,8 @@ impl> Elaborator { // PERF(sized-hierarchy): To avoid iterating over sizedness supertraits in // parameter environments, as an optimisation, sizedness supertraits aren't // elaborated, so check if a `Sized` obligation is being elaborated to a - // `MetaSized` obligation and emit it. Candidate assembly and confirmation - // are modified to check for the `Sized` subtrait when a `MetaSized` obligation + // `SizeOfVal` obligation and emit it. Candidate assembly and confirmation + // are modified to check for the `Sized` subtrait when a `SizeOfVal` obligation // is present. if self.elaborate_sized == ElaborateSized::No && let Some(did) = clause.as_trait_clause().map(|c| c.def_id()) diff --git a/compiler/rustc_type_ir/src/lang_items.rs b/compiler/rustc_type_ir/src/lang_items.rs index f1c45a4d98b5e..48181a05ded97 100644 --- a/compiler/rustc_type_ir/src/lang_items.rs +++ b/compiler/rustc_type_ir/src/lang_items.rs @@ -46,9 +46,9 @@ pub enum SolverTraitLangItem { FusedIterator, Future, Iterator, - MetaSized, PointeeSized, PointeeTrait, + SizeOfVal, Sized, TransmuteTrait, TrivialClone, diff --git a/compiler/rustc_type_ir/src/solve/mod.rs b/compiler/rustc_type_ir/src/solve/mod.rs index 72b7df22b30d5..a901b4d307700 100644 --- a/compiler/rustc_type_ir/src/solve/mod.rs +++ b/compiler/rustc_type_ir/src/solve/mod.rs @@ -461,15 +461,15 @@ pub enum AdtDestructorKind { Const, } -/// Which sizedness trait - `Sized`, `MetaSized`? `PointeeSized` is omitted as it is removed during +/// Which sizedness trait - `Sized`, `SizeOfVal`? `PointeeSized` is omitted as it is removed during /// lowering. #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] #[cfg_attr(feature = "nightly", derive(HashStable_NoContext))] pub enum SizedTraitKind { /// `Sized` trait Sized, - /// `MetaSized` trait - MetaSized, + /// `SizeOfVal` trait + SizeOfVal, } impl SizedTraitKind { @@ -477,7 +477,7 @@ impl SizedTraitKind { pub fn require_lang_item(self, cx: I) -> I::TraitId { cx.require_trait_lang_item(match self { SizedTraitKind::Sized => SolverTraitLangItem::Sized, - SizedTraitKind::MetaSized => SolverTraitLangItem::MetaSized, + SizedTraitKind::SizeOfVal => SolverTraitLangItem::SizeOfVal, }) } } diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index c79e8fc4060c1..f3594d5f2373b 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -155,13 +155,13 @@ unsafe impl Send for &T {} // and we know that the supertraits are always implemented if the subtrait is just by looking at // the builtin impls. #[rustc_coinductive] -pub trait Sized: MetaSized { +pub trait Sized: SizeOfVal { // Empty. } /// Types with a size that can be determined from pointer metadata. #[unstable(feature = "sized_hierarchy", issue = "144404")] -#[lang = "meta_sized"] +#[lang = "size_of_val"] #[diagnostic::on_unimplemented( message = "the size for values of type `{Self}` cannot be known", label = "doesn't have a known size" @@ -169,10 +169,10 @@ pub trait Sized: MetaSized { #[fundamental] #[rustc_specialization_trait] #[rustc_deny_explicit_impl] -// `MetaSized` being coinductive, despite having supertraits, is okay for the same reasons as +// `SizeOfVal` being coinductive, despite having supertraits, is okay for the same reasons as // `Sized` above. #[rustc_coinductive] -pub trait MetaSized: PointeeSized { +pub trait SizeOfVal: PointeeSized { // Empty } diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs index b106314f14d12..a309adc7fcb0a 100644 --- a/library/core/src/ptr/alignment.rs +++ b/library/core/src/ptr/alignment.rs @@ -1,6 +1,6 @@ #![allow(clippy::enum_clike_unportable_variant)] -use crate::marker::MetaSized; +use crate::marker::SizeOfVal; use crate::num::NonZero; use crate::ub_checks::assert_unsafe_precondition; use crate::{cmp, fmt, hash, mem, num}; @@ -72,7 +72,7 @@ impl Alignment { #[inline] #[must_use] #[unstable(feature = "ptr_alignment_type", issue = "102070")] - pub const fn of_val(val: &T) -> Self { + pub const fn of_val(val: &T) -> Self { let align = mem::align_of_val(val); // SAFETY: `align_of_val` returns valid alignment unsafe { Alignment::new_unchecked(align) } @@ -120,7 +120,7 @@ impl Alignment { #[must_use] #[unstable(feature = "ptr_alignment_type", issue = "102070")] // #[unstable(feature = "layout_for_ptr", issue = "69835")] - pub const unsafe fn of_val_raw(val: *const T) -> Self { + pub const unsafe fn of_val_raw(val: *const T) -> Self { // SAFETY: precondition propagated to the caller let align = unsafe { mem::align_of_val_raw(val) }; // SAFETY: `align_of_val_raw` returns valid alignment diff --git a/library/rtstartup/rsbegin.rs b/library/rtstartup/rsbegin.rs index 6ee06cce5c630..612afde357857 100644 --- a/library/rtstartup/rsbegin.rs +++ b/library/rtstartup/rsbegin.rs @@ -24,11 +24,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "sync"] auto trait Sync {} diff --git a/library/rtstartup/rsend.rs b/library/rtstartup/rsend.rs index d763971445069..9f0110f8e79e2 100644 --- a/library/rtstartup/rsend.rs +++ b/library/rtstartup/rsend.rs @@ -11,11 +11,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "sync"] trait Sync {} diff --git a/src/doc/rustc-dev-guide/src/solve/candidate-preference.md b/src/doc/rustc-dev-guide/src/solve/candidate-preference.md index 7fc39269d116d..a19bb85022798 100644 --- a/src/doc/rustc-dev-guide/src/solve/candidate-preference.md +++ b/src/doc/rustc-dev-guide/src/solve/candidate-preference.md @@ -17,7 +17,7 @@ This document provides additional details and references to explain *why* we've Trivial builtin impls are builtin impls which are known to be always applicable for well-formed types. This means that if one exists, using another candidate should never have fewer constraints. -We currently only consider `Sized` - and `MetaSized` - impls to be trivial. +We currently only consider `Sized` - and `SizeOfVal` - impls to be trivial. This is necessary to prevent a lifetime error for the following pattern diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 09b2bc5dcef1d..c241a6dc73785 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -287,9 +287,9 @@ pub(crate) fn build_trait(cx: &mut DocContext<'_>, did: DefId) -> clean::Trait { let (generics, mut supertrait_bounds) = separate_self_bounds(generics); supertrait_bounds.retain(|b| { - // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized` + // FIXME(sized-hierarchy): Always skip `` bounds so that only `?Sized` // is shown and none of the new sizedness traits leak into documentation. - !b.is_meta_sized_bound(cx) + !b.is_size_of_val_bound(cx) }); clean::Trait { def_id: did, generics, items: trait_items, bounds: supertrait_bounds } @@ -300,9 +300,9 @@ fn build_trait_alias(cx: &mut DocContext<'_>, did: DefId) -> clean::TraitAlias { let (generics, mut bounds) = separate_self_bounds(generics); bounds.retain(|b| { - // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized` + // FIXME(sized-hierarchy): Always skip `` bounds so that only `?Sized` // is shown and none of the new sizedness traits leak into documentation. - !b.is_meta_sized_bound(cx) + !b.is_size_of_val_bound(cx) }); clean::TraitAlias { generics, bounds } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index f54339429fa58..94d9ffbea2b54 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -901,8 +901,8 @@ fn clean_ty_generics_inner<'tcx>( if b.is_sized_bound(cx) { has_sized = true; false - } else if b.is_meta_sized_bound(cx) { - // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized` + } else if b.is_size_of_val_bound(cx) { + // FIXME(sized-hierarchy): Always skip `` bounds so that only `?Sized` // is shown and none of the new sizedness traits leak into documentation. false } else { @@ -1457,9 +1457,9 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo }); bounds.retain(|b| { - // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized` + // FIXME(sized-hierarchy): Always skip `` bounds so that only `?Sized` // is shown and none of the new sizedness traits leak into documentation. - !b.is_meta_sized_bound(cx) + !b.is_size_of_val_bound(cx) }); // Our Sized/?Sized bound didn't get handled when creating the generics @@ -2306,9 +2306,9 @@ fn clean_middle_opaque_bounds<'tcx>( _ => return None, }; - // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized` + // FIXME(sized-hierarchy): Always skip `` bounds so that only `?Sized` // is shown and none of the new sizedness traits leak into documentation. - if cx.tcx.is_lang_item(trait_ref.def_id(), LangItem::MetaSized) { + if cx.tcx.is_lang_item(trait_ref.def_id(), LangItem::SizeOfVal) { return None; } diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs index 6fb878ea54856..323ae4b663329 100644 --- a/src/librustdoc/clean/simplify.rs +++ b/src/librustdoc/clean/simplify.rs @@ -142,8 +142,8 @@ pub(crate) fn sized_bounds(cx: &mut DocContext<'_>, generics: &mut clean::Generi if bounds.iter().any(|b| b.is_sized_bound(cx)) { sized_params.insert(*param); false - } else if bounds.iter().any(|b| b.is_meta_sized_bound(cx)) { - // FIXME(sized-hierarchy): Always skip `MetaSized` bounds so that only `?Sized` + } else if bounds.iter().any(|b| b.is_size_of_val_bound(cx)) { + // FIXME(sized-hierarchy): Always skip `` bounds so that only `?Sized` // is shown and none of the new sizedness traits leak into documentation. false } else { diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index ad70fc1096691..4c8a2daf50303 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1123,8 +1123,8 @@ impl GenericBound { self.is_bounded_by_lang_item(cx, LangItem::Sized) } - pub(crate) fn is_meta_sized_bound(&self, cx: &DocContext<'_>) -> bool { - self.is_bounded_by_lang_item(cx, LangItem::MetaSized) + pub(crate) fn is_size_of_val_bound(&self, cx: &DocContext<'_>) -> bool { + self.is_bounded_by_lang_item(cx, LangItem::SizeOfVal) } fn is_bounded_by_lang_item(&self, cx: &DocContext<'_>, lang_item: LangItem) -> bool { diff --git a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs index af5498c353d43..2a066d7a782d7 100644 --- a/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs +++ b/src/tools/clippy/clippy_lints/src/methods/unnecessary_to_owned.rs @@ -388,11 +388,11 @@ fn check_other_call_arg<'tcx>( && let (input, n_refs, _) = peel_and_count_ty_refs(*input) && let (trait_predicates, _) = get_input_traits_and_projections(cx, callee_def_id, input) && let Some(sized_def_id) = cx.tcx.lang_items().sized_trait() - && let Some(meta_sized_def_id) = cx.tcx.lang_items().meta_sized_trait() + && let Some(size_of_val_def_id) = cx.tcx.lang_items().size_of_val_trait() && let [trait_predicate] = trait_predicates .iter() .filter(|trait_predicate| trait_predicate.def_id() != sized_def_id) - .filter(|trait_predicate| trait_predicate.def_id() != meta_sized_def_id) + .filter(|trait_predicate| trait_predicate.def_id() != size_of_val_def_id) .collect::>()[..] && let Some(deref_trait_id) = cx.tcx.get_diagnostic_item(sym::Deref) && let Some(as_ref_trait_id) = cx.tcx.get_diagnostic_item(sym::AsRef) diff --git a/src/tools/clippy/clippy_lints/src/needless_borrows_for_generic_args.rs b/src/tools/clippy/clippy_lints/src/needless_borrows_for_generic_args.rs index c77398cbc836f..f16c8819b84f2 100644 --- a/src/tools/clippy/clippy_lints/src/needless_borrows_for_generic_args.rs +++ b/src/tools/clippy/clippy_lints/src/needless_borrows_for_generic_args.rs @@ -175,7 +175,7 @@ fn needless_borrow_count<'tcx>( ) -> usize { let destruct_trait_def_id = cx.tcx.lang_items().destruct_trait(); let sized_trait_def_id = cx.tcx.lang_items().sized_trait(); - let meta_sized_trait_def_id = cx.tcx.lang_items().meta_sized_trait(); + let size_of_val_trait_def_id = cx.tcx.lang_items().size_of_val_trait(); let drop_trait_def_id = cx.tcx.lang_items().drop_trait(); let fn_sig = cx.tcx.fn_sig(fn_id).instantiate_identity().skip_binder(); @@ -211,7 +211,7 @@ fn needless_borrow_count<'tcx>( .all(|trait_def_id| { Some(trait_def_id) == destruct_trait_def_id || Some(trait_def_id) == sized_trait_def_id - || Some(trait_def_id) == meta_sized_trait_def_id + || Some(trait_def_id) == size_of_val_trait_def_id || cx.tcx.is_diagnostic_item(sym::Any, trait_def_id) }) { diff --git a/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs b/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs index fb5f21acf2af2..9c35574df35ca 100644 --- a/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs +++ b/src/tools/clippy/clippy_lints/src/needless_pass_by_value.rs @@ -118,7 +118,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue { ]; let sized_trait = need!(cx.tcx.lang_items().sized_trait()); - let meta_sized_trait = need!(cx.tcx.lang_items().meta_sized_trait()); + let size_of_val_trait = need!(cx.tcx.lang_items().size_of_val_trait()); let preds = traits::elaborate(cx.tcx, cx.param_env.caller_bounds().iter()) .filter(|p| !p.is_global()) @@ -126,7 +126,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue { // Note that we do not want to deal with qualified predicates here. match pred.kind().no_bound_vars() { Some(ty::ClauseKind::Trait(pred)) - if pred.def_id() != sized_trait && pred.def_id() != meta_sized_trait => + if pred.def_id() != sized_trait && pred.def_id() != size_of_val_trait => { Some(pred) }, diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs index 1484b8c8bcc45..4954724fb6662 100644 --- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs +++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs @@ -34,11 +34,11 @@ pub fn is_min_const_fn<'tcx>(cx: &LateContext<'tcx>, body: &Body<'tcx>, msrv: Ms } if !msrv.meets(cx, msrvs::CONST_FN_TRAIT_BOUND) && let Some(sized_did) = cx.tcx.lang_items().sized_trait() - && let Some(meta_sized_did) = cx.tcx.lang_items().meta_sized_trait() + && let Some(size_of_val_did) = cx.tcx.lang_items().size_of_val_trait() && cx.tcx.param_env(def_id).caller_bounds().iter().any(|bound| { bound.as_trait_clause().is_some_and(|clause| { let did = clause.def_id(); - did != sized_did && did != meta_sized_did + did != sized_did && did != size_of_val_did }) }) { diff --git a/src/tools/clippy/tests/ui/def_id_nocore.rs b/src/tools/clippy/tests/ui/def_id_nocore.rs index 6aa023a8d4500..1c6b4111dffea 100644 --- a/src/tools/clippy/tests/ui/def_id_nocore.rs +++ b/src/tools/clippy/tests/ui/def_id_nocore.rs @@ -8,11 +8,11 @@ unsafe extern "C" {} #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} #[lang = "freeze"] diff --git a/src/tools/clippy/tests/ui/manual_take_nocore.rs b/src/tools/clippy/tests/ui/manual_take_nocore.rs index ef4f23395028e..ce543082d1ff3 100644 --- a/src/tools/clippy/tests/ui/manual_take_nocore.rs +++ b/src/tools/clippy/tests/ui/manual_take_nocore.rs @@ -10,11 +10,11 @@ unsafe extern "C" {} #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} #[lang = "freeze"] diff --git a/tests/assembly-llvm/large_data_threshold.rs b/tests/assembly-llvm/large_data_threshold.rs index f3b37eb7f83de..28c561cfa9985 100644 --- a/tests/assembly-llvm/large_data_threshold.rs +++ b/tests/assembly-llvm/large_data_threshold.rs @@ -14,11 +14,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "drop_in_place"] fn drop_in_place(_: *mut T) {} diff --git a/tests/assembly-llvm/nvptx-c-abi-arg-v7.rs b/tests/assembly-llvm/nvptx-c-abi-arg-v7.rs index 6f5ef792e9b34..6d9ba21bdec35 100644 --- a/tests/assembly-llvm/nvptx-c-abi-arg-v7.rs +++ b/tests/assembly-llvm/nvptx-c-abi-arg-v7.rs @@ -12,10 +12,10 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/assembly-llvm/nvptx-c-abi-ret-v7.rs b/tests/assembly-llvm/nvptx-c-abi-ret-v7.rs index 02ec9facee7a8..d3f05ce1cfb84 100644 --- a/tests/assembly-llvm/nvptx-c-abi-ret-v7.rs +++ b/tests/assembly-llvm/nvptx-c-abi-ret-v7.rs @@ -12,10 +12,10 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/assembly-llvm/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs b/tests/assembly-llvm/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs index 00f6fe9332d94..6e7276c9d1360 100644 --- a/tests/assembly-llvm/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs +++ b/tests/assembly-llvm/nvptx-kernel-abi/nvptx-kernel-args-abi-v7.rs @@ -22,10 +22,10 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/assembly-llvm/small_data_threshold.rs b/tests/assembly-llvm/small_data_threshold.rs index 2abe8687d8b26..2ad867afc23d2 100644 --- a/tests/assembly-llvm/small_data_threshold.rs +++ b/tests/assembly-llvm/small_data_threshold.rs @@ -22,11 +22,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "drop_in_place"] fn drop_in_place(_: *mut T) {} diff --git a/tests/auxiliary/minicore.rs b/tests/auxiliary/minicore.rs index d84357edd0423..506084f767520 100644 --- a/tests/auxiliary/minicore.rs +++ b/tests/auxiliary/minicore.rs @@ -48,19 +48,19 @@ macro_rules! impl_marker_trait { )] pub trait PointeeSized {} -#[lang = "meta_sized"] +#[lang = "size_of_val"] #[diagnostic::on_unimplemented( message = "the size for values of type `{Self}` cannot be known", label = "doesn't have a known size" )] -pub trait MetaSized: PointeeSized {} +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] #[diagnostic::on_unimplemented( message = "the size for values of type `{Self}` cannot be known at compilation time", label = "doesn't have a size known at compile-time" )] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "destruct"] #[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)] diff --git a/tests/codegen-llvm/abi-x86-sse.rs b/tests/codegen-llvm/abi-x86-sse.rs index 68d2acfb527b8..9bab2a1bef0f2 100644 --- a/tests/codegen-llvm/abi-x86-sse.rs +++ b/tests/codegen-llvm/abi-x86-sse.rs @@ -17,10 +17,10 @@ #![crate_type = "lib"] #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "pointee_sized"] trait PointeeSized {} diff --git a/tests/codegen-llvm/emscripten-catch-unwind-js-eh.rs b/tests/codegen-llvm/emscripten-catch-unwind-js-eh.rs index c641c0a63d541..bc3e603d7424c 100644 --- a/tests/codegen-llvm/emscripten-catch-unwind-js-eh.rs +++ b/tests/codegen-llvm/emscripten-catch-unwind-js-eh.rs @@ -12,11 +12,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "freeze"] trait Freeze {} #[lang = "copy"] diff --git a/tests/codegen-llvm/emscripten-catch-unwind-wasm-eh.rs b/tests/codegen-llvm/emscripten-catch-unwind-wasm-eh.rs index 88c95b088aaaa..2946127b9a1ea 100644 --- a/tests/codegen-llvm/emscripten-catch-unwind-wasm-eh.rs +++ b/tests/codegen-llvm/emscripten-catch-unwind-wasm-eh.rs @@ -11,11 +11,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "freeze"] trait Freeze {} #[lang = "copy"] diff --git a/tests/codegen-llvm/terminating-catchpad.rs b/tests/codegen-llvm/terminating-catchpad.rs index 7c98ea94fdc13..d8ff1483341d1 100644 --- a/tests/codegen-llvm/terminating-catchpad.rs +++ b/tests/codegen-llvm/terminating-catchpad.rs @@ -22,11 +22,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} unsafe extern "C-unwind" { safe fn unwinds(); diff --git a/tests/codegen-llvm/unwind-abis/aapcs-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/aapcs-unwind-abi.rs index ecace722e0dbe..fe94a1cc710e9 100644 --- a/tests/codegen-llvm/unwind-abis/aapcs-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/aapcs-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `aapcs` and // `aapcs-unwind` extern functions. `aapcs-unwind` functions MUST NOT have this attribute. We diff --git a/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs index 7df46813ed1dd..69c936aef0ab3 100644 --- a/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/fastcall-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `fastcall` and // `fastcall-unwind` extern functions. `fastcall-unwind` functions MUST NOT have this attribute. We diff --git a/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs index cc06ee125495a..ec39ae7caddde 100644 --- a/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/stdcall-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `stdcall` and `stdcall-unwind` // extern functions. `stdcall-unwind` functions MUST NOT have this attribute. We disable diff --git a/tests/codegen-llvm/unwind-abis/sysv64-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/sysv64-unwind-abi.rs index 69bfaf80b4be6..ce0fdd723dce6 100644 --- a/tests/codegen-llvm/unwind-abis/sysv64-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/sysv64-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `sysv64` and // `sysv64-unwind` extern functions. `sysv64-unwind` functions MUST NOT have this attribute. We diff --git a/tests/codegen-llvm/unwind-abis/thiscall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/thiscall-unwind-abi.rs index 05f6b8b70e171..56d0e4de17df6 100644 --- a/tests/codegen-llvm/unwind-abis/thiscall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/thiscall-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `thiscall` and // `thiscall-unwind` extern functions. `thiscall-unwind` functions MUST NOT have this attribute. We diff --git a/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs index d001a16b32a1c..ee4ac0ffe557c 100644 --- a/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/vectorcall-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `vectorcall` and // `vectorcall-unwind` extern functions. `vectorcall-unwind` functions MUST NOT have this attribute. diff --git a/tests/codegen-llvm/unwind-abis/win64-unwind-abi.rs b/tests/codegen-llvm/unwind-abis/win64-unwind-abi.rs index 257f00b54e4d8..bb99074b225d2 100644 --- a/tests/codegen-llvm/unwind-abis/win64-unwind-abi.rs +++ b/tests/codegen-llvm/unwind-abis/win64-unwind-abi.rs @@ -6,11 +6,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // Test that `nounwind` attributes are correctly applied to exported `win64` and // `win64-unwind` extern functions. `win64-unwind` functions MUST NOT have this attribute. We diff --git a/tests/codegen-units/item-collection/implicit-panic-call.rs b/tests/codegen-units/item-collection/implicit-panic-call.rs index 3b442942cc5c4..14fafafec35f8 100644 --- a/tests/codegen-units/item-collection/implicit-panic-call.rs +++ b/tests/codegen-units/item-collection/implicit-panic-call.rs @@ -32,11 +32,11 @@ fn panic_div_overflow() -> ! { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/mir-opt/inline/inline_instruction_set.rs b/tests/mir-opt/inline/inline_instruction_set.rs index 5baef21c6de7e..819fa3b2b1d6d 100644 --- a/tests/mir-opt/inline/inline_instruction_set.rs +++ b/tests/mir-opt/inline/inline_instruction_set.rs @@ -26,11 +26,11 @@ macro_rules! asm { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/run-make/amdgpu-kd/foo.rs b/tests/run-make/amdgpu-kd/foo.rs index a097e9211a799..facfd3b40dadf 100644 --- a/tests/run-make/amdgpu-kd/foo.rs +++ b/tests/run-make/amdgpu-kd/foo.rs @@ -7,11 +7,11 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[no_mangle] extern "gpu-kernel" fn kernel() {} diff --git a/tests/run-make/arm64ec-import-export-static/export.rs b/tests/run-make/arm64ec-import-export-static/export.rs index ca6ccf00ca17e..176ebb2f08a24 100644 --- a/tests/run-make/arm64ec-import-export-static/export.rs +++ b/tests/run-make/arm64ec-import-export-static/export.rs @@ -7,10 +7,10 @@ // This is needed because of #![no_core]: #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "sync"] trait Sync {} impl Sync for i32 {} diff --git a/tests/run-make/atomic-lock-free/atomic_lock_free.rs b/tests/run-make/atomic-lock-free/atomic_lock_free.rs index 92ffd111ce8b7..3c5708ba29577 100644 --- a/tests/run-make/atomic-lock-free/atomic_lock_free.rs +++ b/tests/run-make/atomic-lock-free/atomic_lock_free.rs @@ -19,11 +19,11 @@ unsafe fn atomic_xadd(dst: *mut T, src: U) -> T #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} #[lang = "freeze"] diff --git a/tests/run-make/cross-lang-lto-riscv-abi/riscv-xlto.rs b/tests/run-make/cross-lang-lto-riscv-abi/riscv-xlto.rs index dbccf8cea039f..db0d90e78d37d 100644 --- a/tests/run-make/cross-lang-lto-riscv-abi/riscv-xlto.rs +++ b/tests/run-make/cross-lang-lto-riscv-abi/riscv-xlto.rs @@ -4,10 +4,10 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[no_mangle] pub fn hello() {} diff --git a/tests/run-make/fat-then-thin-lto/lib.rs b/tests/run-make/fat-then-thin-lto/lib.rs index c675dcb6e8a84..240717c342815 100644 --- a/tests/run-make/fat-then-thin-lto/lib.rs +++ b/tests/run-make/fat-then-thin-lto/lib.rs @@ -5,9 +5,9 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} pub fn foo() {} diff --git a/tests/run-make/linker-plugin-lto-fat/main.rs b/tests/run-make/linker-plugin-lto-fat/main.rs index ad2a90bc80190..aadf83ebf9639 100644 --- a/tests/run-make/linker-plugin-lto-fat/main.rs +++ b/tests/run-make/linker-plugin-lto-fat/main.rs @@ -5,10 +5,10 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} extern "C" { fn ir_callee(); diff --git a/tests/run-make/min-global-align/min_global_align.rs b/tests/run-make/min-global-align/min_global_align.rs index fd6f83570300a..ffd15f1ec52cf 100644 --- a/tests/run-make/min-global-align/min_global_align.rs +++ b/tests/run-make/min-global-align/min_global_align.rs @@ -12,11 +12,11 @@ pub static CONST_BOOL_REF: &'static bool = &CONST_BOOL; #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/run-make/raw-dylib-cross-compilation/lib.rs b/tests/run-make/raw-dylib-cross-compilation/lib.rs index 8d53ac04485eb..15d1aca143aba 100644 --- a/tests/run-make/raw-dylib-cross-compilation/lib.rs +++ b/tests/run-make/raw-dylib-cross-compilation/lib.rs @@ -6,10 +6,10 @@ // This is needed because of #![no_core]: #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[link(name = "extern_1", kind = "raw-dylib")] extern "C" { diff --git a/tests/run-make/rustdoc-target-modifiers/d.rs b/tests/run-make/rustdoc-target-modifiers/d.rs index 6cbff06079ed2..ca809ae719fbf 100644 --- a/tests/run-make/rustdoc-target-modifiers/d.rs +++ b/tests/run-make/rustdoc-target-modifiers/d.rs @@ -4,9 +4,9 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} pub fn f() {} diff --git a/tests/run-make/simd-ffi/simd.rs b/tests/run-make/simd-ffi/simd.rs index 1cd961ff87e7b..d55d3e97bb7d2 100644 --- a/tests/run-make/simd-ffi/simd.rs +++ b/tests/run-make/simd-ffi/simd.rs @@ -55,11 +55,11 @@ pub fn bar(a: i32x4, b: i32x4) -> i32x4 { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} diff --git a/tests/run-make/target-specs/foo.rs b/tests/run-make/target-specs/foo.rs index aead76dff87c2..5aeb34efafc34 100644 --- a/tests/run-make/target-specs/foo.rs +++ b/tests/run-make/target-specs/foo.rs @@ -7,11 +7,11 @@ trait Copy {} #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "freeze"] auto trait Freeze {} diff --git a/tests/rustdoc-html/file-creation-111249.rs b/tests/rustdoc-html/file-creation-111249.rs index 7a075a1583f30..95b7c173f133c 100644 --- a/tests/rustdoc-html/file-creation-111249.rs +++ b/tests/rustdoc-html/file-creation-111249.rs @@ -7,14 +7,14 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} //@ files "foo" "['all.html', 'visible', 'index.html', 'sidebar-items.js', 'hidden', \ -// 'struct.Bar.html', 'trait.Sized.html', 'trait.MetaSized.html', 'trait.PointeeSized.html']" +// 'struct.Bar.html', 'trait.Sized.html', 'trait.SizeOfVal.html', 'trait.PointeeSized.html']" //@ files "foo/visible" "['trait.Foo.html', 'index.html', 'sidebar-items.js']" //@ files "foo/hidden" "['inner']" //@ files "foo/hidden/inner" "['trait.Foo.html']" diff --git a/tests/rustdoc-html/intra-doc/auxiliary/my-core.rs b/tests/rustdoc-html/intra-doc/auxiliary/my-core.rs index a33b0582b31a8..349cb1a403692 100644 --- a/tests/rustdoc-html/intra-doc/auxiliary/my-core.rs +++ b/tests/rustdoc-html/intra-doc/auxiliary/my-core.rs @@ -16,11 +16,11 @@ impl char { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "clone"] pub trait Clone: Sized {} diff --git a/tests/rustdoc-html/intra-doc/no-doc-primitive.rs b/tests/rustdoc-html/intra-doc/no-doc-primitive.rs index 9ce43e26aa19f..1a606dce3a4ea 100644 --- a/tests/rustdoc-html/intra-doc/no-doc-primitive.rs +++ b/tests/rustdoc-html/intra-doc/no-doc-primitive.rs @@ -13,11 +13,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} impl char { pub fn len_utf8(self) -> usize { diff --git a/tests/rustdoc-html/intra-doc/prim-methods-local.rs b/tests/rustdoc-html/intra-doc/prim-methods-local.rs index f6aa1ed215654..bdfbc9bb67b78 100644 --- a/tests/rustdoc-html/intra-doc/prim-methods-local.rs +++ b/tests/rustdoc-html/intra-doc/prim-methods-local.rs @@ -22,11 +22,11 @@ impl char { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "clone"] pub trait Clone: Sized {} diff --git a/tests/rustdoc-html/intra-doc/prim-self.rs b/tests/rustdoc-html/intra-doc/prim-self.rs index 21368fab99358..b2882770a8e4b 100644 --- a/tests/rustdoc-html/intra-doc/prim-self.rs +++ b/tests/rustdoc-html/intra-doc/prim-self.rs @@ -40,8 +40,8 @@ impl S { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} diff --git a/tests/rustdoc-html/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs b/tests/rustdoc-html/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs index cd4d76baca1f1..c7f8291c4d6d0 100644 --- a/tests/rustdoc-html/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs +++ b/tests/rustdoc-html/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs @@ -14,11 +14,11 @@ impl Box { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[doc(notable_trait)] pub trait FakeIterator {} diff --git a/tests/rustdoc-html/primitive/cross-crate-primitive-doc.rs b/tests/rustdoc-html/primitive/cross-crate-primitive-doc.rs index 3c159d57f13f1..c1df060749046 100644 --- a/tests/rustdoc-html/primitive/cross-crate-primitive-doc.rs +++ b/tests/rustdoc-html/primitive/cross-crate-primitive-doc.rs @@ -8,11 +8,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} extern crate primitive_doc; diff --git a/tests/rustdoc-html/reexport/cfg_doc_reexport.rs b/tests/rustdoc-html/reexport/cfg_doc_reexport.rs index 2c3b3110fb724..a2f88c4ef4dbd 100644 --- a/tests/rustdoc-html/reexport/cfg_doc_reexport.rs +++ b/tests/rustdoc-html/reexport/cfg_doc_reexport.rs @@ -7,11 +7,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} //@ has 'foo/index.html' //@ has - '//dt/*[@class="stab portability"]' 'foobar' diff --git a/tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064-2.rs b/tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064-2.rs index 8f0a5806b0918..5944b6f304db4 100644 --- a/tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064-2.rs +++ b/tests/rustdoc-html/reexport/reexport-trait-from-hidden-111064-2.rs @@ -6,14 +6,14 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} //@ files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \ -// 'visible', 'trait.Sized.html', 'trait.MetaSized.html', 'trait.PointeeSized.html']" +// 'visible', 'trait.Sized.html', 'trait.SizeOfVal.html', 'trait.PointeeSized.html']" //@ files "foo/hidden" "['inner']" //@ files "foo/hidden/inner" "['trait.Foo.html']" //@ files "foo/visible" "['index.html', 'sidebar-items.js', 'trait.Foo.html']" diff --git a/tests/rustdoc-html/safe-intrinsic.rs b/tests/rustdoc-html/safe-intrinsic.rs index a40116894a84a..7b0116a258a54 100644 --- a/tests/rustdoc-html/safe-intrinsic.rs +++ b/tests/rustdoc-html/safe-intrinsic.rs @@ -8,11 +8,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} //@ has 'foo/fn.abort.html' //@ has - '//pre[@class="rust item-decl"]' 'pub fn abort() -> !' diff --git a/tests/rustdoc-json/impls/auto.rs b/tests/rustdoc-json/impls/auto.rs index 104c4891502d4..d8db43013c70c 100644 --- a/tests/rustdoc-json/impls/auto.rs +++ b/tests/rustdoc-json/impls/auto.rs @@ -4,11 +4,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "legacy_receiver"] pub trait LegacyReceiver {} diff --git a/tests/rustdoc-json/primitives/primitive_impls.rs b/tests/rustdoc-json/primitives/primitive_impls.rs index 2bdbb86862686..a10dbaba70e8c 100644 --- a/tests/rustdoc-json/primitives/primitive_impls.rs +++ b/tests/rustdoc-json/primitives/primitive_impls.rs @@ -9,11 +9,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} /// Only core can do this impl i32 { diff --git a/tests/rustdoc-ui/lints/custom_code_classes_in_docs-warning3.rs b/tests/rustdoc-ui/lints/custom_code_classes_in_docs-warning3.rs index 32ba331527da6..72acad8c5bb9a 100644 --- a/tests/rustdoc-ui/lints/custom_code_classes_in_docs-warning3.rs +++ b/tests/rustdoc-ui/lints/custom_code_classes_in_docs-warning3.rs @@ -8,11 +8,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} /// ```{class="} /// main; diff --git a/tests/rustdoc-ui/target-feature-stability.rs b/tests/rustdoc-ui/target-feature-stability.rs index 7751298721981..791c23fdad7f9 100644 --- a/tests/rustdoc-ui/target-feature-stability.rs +++ b/tests/rustdoc-ui/target-feature-stability.rs @@ -17,11 +17,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} // `fp-armv8` is "forbidden" on aarch64 as we tie it to `neon`. #[target_feature(enable = "fp-armv8")] diff --git a/tests/ui/abi/fixed_x18.rs b/tests/ui/abi/fixed_x18.rs index 0f09b0105fca5..b4843901b12e1 100644 --- a/tests/ui/abi/fixed_x18.rs +++ b/tests/ui/abi/fixed_x18.rs @@ -23,9 +23,9 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} //~? ERROR the `-Zfixed-x18` flag is not supported on the ` diff --git a/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs b/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs index 824327ad06d36..06387b1aec754 100644 --- a/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs +++ b/tests/ui/abi/shadow-call-stack-without-fixed-x18.rs @@ -11,11 +11,11 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[no_mangle] pub fn foo() {} diff --git a/tests/ui/attributes/dump-preds.stderr b/tests/ui/attributes/dump-preds.stderr index 99139761d7ccf..58b4d954ca595 100644 --- a/tests/ui/attributes/dump-preds.stderr +++ b/tests/ui/attributes/dump-preds.stderr @@ -4,7 +4,7 @@ error: rustc_dump_predicates LL | trait Trait: Iterator | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } + = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } = note: Binder { value: TraitPredicate(<::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] } = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } @@ -17,7 +17,7 @@ error: rustc_dump_predicates LL | type Assoc: std::ops::Deref | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } + = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } = note: Binder { value: TraitPredicate(<::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] } = note: Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] } diff --git a/tests/ui/attributes/export/lang-item.rs b/tests/ui/attributes/export/lang-item.rs index 92ca1d742e1cb..07a483ba9436d 100644 --- a/tests/ui/attributes/export/lang-item.rs +++ b/tests/ui/attributes/export/lang-item.rs @@ -7,9 +7,9 @@ //~^ ERROR lang items are not allowed in stable dylibs pub trait PointeeSized {} -#[lang = "meta_sized"] +#[lang = "size_of_val"] //~^ ERROR lang items are not allowed in stable dylibs -pub trait MetaSized: PointeeSized {} +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] //~^ ERROR lang items are not allowed in stable dylibs diff --git a/tests/ui/attributes/export/lang-item.stderr b/tests/ui/attributes/export/lang-item.stderr index 211c0b9b07bb5..68ab51db56e97 100644 --- a/tests/ui/attributes/export/lang-item.stderr +++ b/tests/ui/attributes/export/lang-item.stderr @@ -7,8 +7,8 @@ LL | #[lang = "pointee_sized"] error: lang items are not allowed in stable dylibs --> $DIR/lang-item.rs:10:1 | -LL | #[lang = "meta_sized"] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[lang = "size_of_val"] + | ^^^^^^^^^^^^^^^^^^^^^^^ error: lang items are not allowed in stable dylibs --> $DIR/lang-item.rs:14:1 diff --git a/tests/ui/codegen/mismatched-data-layouts.rs b/tests/ui/codegen/mismatched-data-layouts.rs index bf866c3b1c9d0..90a231778e339 100644 --- a/tests/ui/codegen/mismatched-data-layouts.rs +++ b/tests/ui/codegen/mismatched-data-layouts.rs @@ -14,10 +14,10 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} //~? ERROR differs from LLVM target's diff --git a/tests/ui/compile-flags/invalid/branch-protection-missing-pac-ret.rs b/tests/ui/compile-flags/invalid/branch-protection-missing-pac-ret.rs index bb23f9fe5c673..4177738569f7c 100644 --- a/tests/ui/compile-flags/invalid/branch-protection-missing-pac-ret.rs +++ b/tests/ui/compile-flags/invalid/branch-protection-missing-pac-ret.rs @@ -16,11 +16,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} //[BADFLAGS]~? ERROR incorrect value `leaf` for unstable option `branch-protection` //[BADFLAGSPC]~? ERROR incorrect value `pc` for unstable option `branch-protection` diff --git a/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr b/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr index 825b9e941584c..3ee23627125cf 100644 --- a/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr +++ b/tests/ui/consts/const-size_of_val-align_of_val-extern-type.stderr @@ -2,11 +2,11 @@ error[E0277]: the size for values of type `Opaque` cannot be known --> $DIR/const-size_of_val-align_of_val-extern-type.rs:10:43 | LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; - | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Opaque` + | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SizeOfVal` is not implemented for `Opaque` | | | required by a bound introduced by this call | - = note: the trait bound `Opaque: MetaSized` is not satisfied + = note: the trait bound `Opaque: SizeOfVal` is not satisfied note: required by a bound in `std::intrinsics::size_of_val` --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL help: consider borrowing here @@ -20,11 +20,11 @@ error[E0277]: the size for values of type `Opaque` cannot be known --> $DIR/const-size_of_val-align_of_val-extern-type.rs:12:45 | LL | const _ALIGN: usize = unsafe { align_of_val(&4 as *const i32 as *const Opaque) }; - | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Opaque` + | ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SizeOfVal` is not implemented for `Opaque` | | | required by a bound introduced by this call | - = note: the trait bound `Opaque: MetaSized` is not satisfied + = note: the trait bound `Opaque: SizeOfVal` is not satisfied note: required by a bound in `std::intrinsics::align_of_val` --> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL help: consider borrowing here diff --git a/tests/ui/debuginfo/dwarf-versions.rs b/tests/ui/debuginfo/dwarf-versions.rs index ccf33542960fc..626b038acdb47 100644 --- a/tests/ui/debuginfo/dwarf-versions.rs +++ b/tests/ui/debuginfo/dwarf-versions.rs @@ -32,11 +32,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} pub fn foo() {} diff --git a/tests/ui/dyn-compatibility/pointeesized.rs b/tests/ui/dyn-compatibility/pointeesized.rs index 863abd704eadc..72e3351e5c9b9 100644 --- a/tests/ui/dyn-compatibility/pointeesized.rs +++ b/tests/ui/dyn-compatibility/pointeesized.rs @@ -1,5 +1,5 @@ //@ run-pass -//! This test and `sized-*.rs` and `metasized.rs` test that dyn-compatibility correctly +//! This test and `sized-*.rs` and `sizeofval.rs` test that dyn-compatibility correctly //! handles sizedness traits, which are special in several parts of the compiler. #![feature(sized_hierarchy)] // PointeeSized is effectively removed before reaching the trait solver, diff --git a/tests/ui/dyn-compatibility/sized-3.rs b/tests/ui/dyn-compatibility/sized-3.rs index 84ee391445e7e..911ea0ff72b0f 100644 --- a/tests/ui/dyn-compatibility/sized-3.rs +++ b/tests/ui/dyn-compatibility/sized-3.rs @@ -1,4 +1,4 @@ -//! This test and `metasized.rs` and `pointeesized.rs` test that dyn-compatibility correctly +//! This test and `sizeofval.rs` and `pointeesized.rs` test that dyn-compatibility correctly //! handles the different sizedness traits, which are special in several parts of the compiler. trait Foo: std::fmt::Debug + Sized {} diff --git a/tests/ui/dyn-compatibility/metasized.rs b/tests/ui/dyn-compatibility/sizeofval.rs similarity index 63% rename from tests/ui/dyn-compatibility/metasized.rs rename to tests/ui/dyn-compatibility/sizeofval.rs index ff233c5ca7647..2819743fba9da 100644 --- a/tests/ui/dyn-compatibility/metasized.rs +++ b/tests/ui/dyn-compatibility/sizeofval.rs @@ -2,17 +2,17 @@ //! This test and `sized-*.rs` and `pointeesized.rs` test that dyn-compatibility correctly //! handles sizedness traits, which are special in several parts of the compiler. #![feature(sized_hierarchy)] -use std::marker::MetaSized; +use std::marker::SizeOfVal; -trait Foo: std::fmt::Debug + MetaSized {} +trait Foo: std::fmt::Debug + SizeOfVal {} -impl Foo for T {} +impl Foo for T {} -fn unsize_sized(x: Box) -> Box { +fn unsize_sized(x: Box) -> Box { x } -fn unsize_subtrait(x: Box) -> Box { +fn unsize_subtrait(x: Box) -> Box { x } diff --git a/tests/ui/extern/extern-types-size_of_val.stderr b/tests/ui/extern/extern-types-size_of_val.stderr index 44282c3c99a19..31a675035d606 100644 --- a/tests/ui/extern/extern-types-size_of_val.stderr +++ b/tests/ui/extern/extern-types-size_of_val.stderr @@ -2,11 +2,11 @@ error[E0277]: the size for values of type `A` cannot be known --> $DIR/extern-types-size_of_val.rs:14:17 | LL | size_of_val(x); - | ----------- ^ the trait `MetaSized` is not implemented for `A` + | ----------- ^ the trait `SizeOfVal` is not implemented for `A` | | | required by a bound introduced by this call | - = note: the trait bound `A: MetaSized` is not satisfied + = note: the trait bound `A: SizeOfVal` is not satisfied note: required by a bound in `std::mem::size_of_val` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL help: consider borrowing here @@ -20,11 +20,11 @@ error[E0277]: the size for values of type `A` cannot be known --> $DIR/extern-types-size_of_val.rs:16:18 | LL | align_of_val(x); - | ------------ ^ the trait `MetaSized` is not implemented for `A` + | ------------ ^ the trait `SizeOfVal` is not implemented for `A` | | | required by a bound introduced by this call | - = note: the trait bound `A: MetaSized` is not satisfied + = note: the trait bound `A: SizeOfVal` is not satisfied note: required by a bound in `std::mem::align_of_val` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL help: consider borrowing here diff --git a/tests/ui/extern/extern-types-unsized.stderr b/tests/ui/extern/extern-types-unsized.stderr index 9953e5686632a..908f88932b584 100644 --- a/tests/ui/extern/extern-types-unsized.stderr +++ b/tests/ui/extern/extern-types-unsized.stderr @@ -65,7 +65,7 @@ error[E0277]: the size for values of type `A` cannot be known LL | assert_sized::>(); | ^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `A` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `A` note: required by a bound in `Bar` --> $DIR/extern-types-unsized.rs:14:12 | @@ -100,7 +100,7 @@ error[E0277]: the size for values of type `A` cannot be known LL | assert_sized::>>(); | ^^^^^^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `A` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `A` note: required by a bound in `Bar` --> $DIR/extern-types-unsized.rs:14:12 | diff --git a/tests/ui/extern/unsized-extern-derefmove.stderr b/tests/ui/extern/unsized-extern-derefmove.stderr index 7eb9c6800dc6c..83f2417fde310 100644 --- a/tests/ui/extern/unsized-extern-derefmove.stderr +++ b/tests/ui/extern/unsized-extern-derefmove.stderr @@ -4,7 +4,7 @@ error[E0277]: the size for values of type `Device` cannot be known LL | unsafe fn make_device() -> Box { | ^^^^^^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `Device` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `Device` note: required by a bound in `Box` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL @@ -12,11 +12,11 @@ error[E0277]: the size for values of type `Device` cannot be known --> $DIR/unsized-extern-derefmove.rs:11:19 | LL | Box::from_raw(0 as *mut _) - | ------------- ^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Device` + | ------------- ^^^^^^^^^^^ the trait `SizeOfVal` is not implemented for `Device` | | | required by a bound introduced by this call | - = note: the trait bound `Device: MetaSized` is not satisfied + = note: the trait bound `Device: SizeOfVal` is not satisfied note: required by a bound in `Box::::from_raw` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL help: consider borrowing here @@ -32,7 +32,7 @@ error[E0277]: the size for values of type `Device` cannot be known LL | Box::from_raw(0 as *mut _) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `Device` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `Device` note: required by a bound in `Box` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL @@ -55,7 +55,7 @@ error[E0277]: the size for values of type `Device` cannot be known LL | let d: Device = unsafe { *make_device() }; | ^^^^^^^^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `Device` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `Device` note: required by a bound in `Box` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL diff --git a/tests/ui/feature-gates/feature-gate-sized-hierarchy.rs b/tests/ui/feature-gates/feature-gate-sized-hierarchy.rs index 33688c2e2ce03..22c96d027ee7c 100644 --- a/tests/ui/feature-gates/feature-gate-sized-hierarchy.rs +++ b/tests/ui/feature-gates/feature-gate-sized-hierarchy.rs @@ -1,19 +1,19 @@ #![feature(extern_types)] #![feature(sized_hierarchy)] -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; fn needs_pointeesized() {} -fn needs_metasized() {} +fn needs_sizeofval() {} fn needs_sized() {} fn main() { needs_pointeesized::(); - needs_metasized::(); + needs_sizeofval::(); needs_sized::(); needs_pointeesized::(); - needs_metasized::(); + needs_sizeofval::(); needs_sized::(); //~^ ERROR the size for values of type `str` cannot be known at compilation time @@ -22,7 +22,7 @@ fn main() { } needs_pointeesized::(); - needs_metasized::(); + needs_sizeofval::(); //~^ ERROR the size for values of type `main::Foo` cannot be known needs_sized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time diff --git a/tests/ui/feature-gates/feature-gate-sized-hierarchy.stderr b/tests/ui/feature-gates/feature-gate-sized-hierarchy.stderr index 8e97c73c7d21c..80717392fb7fa 100644 --- a/tests/ui/feature-gates/feature-gate-sized-hierarchy.stderr +++ b/tests/ui/feature-gates/feature-gate-sized-hierarchy.stderr @@ -14,15 +14,15 @@ LL | fn needs_sized() {} error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/feature-gate-sized-hierarchy.rs:25:23 | -LL | needs_metasized::(); +LL | needs_sizeofval::(); | ^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` -note: required by a bound in `needs_metasized` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` +note: required by a bound in `needs_sizeofval` --> $DIR/feature-gate-sized-hierarchy.rs:7:23 | -LL | fn needs_metasized() {} - | ^^^^^^^^^ required by this bound in `needs_metasized` +LL | fn needs_sizeofval() {} + | ^^^^^^^^^ required by this bound in `needs_sizeofval` error[E0277]: the size for values of type `main::Foo` cannot be known at compilation time --> $DIR/feature-gate-sized-hierarchy.rs:27:19 diff --git a/tests/ui/lang-items/issue-83471.rs b/tests/ui/lang-items/issue-83471.rs index 9952faa2472ae..bdff729db7ae8 100644 --- a/tests/ui/lang-items/issue-83471.rs +++ b/tests/ui/lang-items/issue-83471.rs @@ -9,13 +9,13 @@ //~^ ERROR: lang items are subject to change [E0658] pub trait PointeeSized {} -#[lang = "meta_sized"] +#[lang = "size_of_val"] //~^ ERROR: lang items are subject to change [E0658] -pub trait MetaSized: PointeeSized {} +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] //~^ ERROR: lang items are subject to change [E0658] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "fn"] //~^ ERROR: lang items are subject to change [E0658] diff --git a/tests/ui/lang-items/issue-83471.stderr b/tests/ui/lang-items/issue-83471.stderr index 1d5b1c4cd3ed7..08040c8eae914 100644 --- a/tests/ui/lang-items/issue-83471.stderr +++ b/tests/ui/lang-items/issue-83471.stderr @@ -16,8 +16,8 @@ LL | #[lang = "pointee_sized"] error[E0658]: lang items are subject to change --> $DIR/issue-83471.rs:12:1 | -LL | #[lang = "meta_sized"] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[lang = "size_of_val"] + | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/lang-items/issue-87573.rs b/tests/ui/lang-items/issue-87573.rs index 97146df0ba766..a170e5a97547d 100644 --- a/tests/ui/lang-items/issue-87573.rs +++ b/tests/ui/lang-items/issue-87573.rs @@ -10,11 +10,11 @@ pub static STATIC_BOOL: bool = true; #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/ui/lang-items/lang-item-generic-requirements.rs b/tests/ui/lang-items/lang-item-generic-requirements.rs index 2f80567d9e71a..65e1f55c622d8 100644 --- a/tests/ui/lang-items/lang-item-generic-requirements.rs +++ b/tests/ui/lang-items/lang-item-generic-requirements.rs @@ -7,11 +7,11 @@ #[lang = "pointee_sized"] pub trait MyPointeeSized {} -#[lang = "meta_sized"] -pub trait MyMetaSized: MyPointeeSized {} +#[lang = "size_of_val"] +pub trait MySizeOfVal: MyPointeeSized {} #[lang = "sized"] -trait MySized: MyMetaSized {} +trait MySized: MySizeOfVal {} #[lang = "add"] trait MyAdd<'a, T> {} diff --git a/tests/ui/lang-items/start_lang_item_args.rs b/tests/ui/lang-items/start_lang_item_args.rs index 1da761545a8ff..d3902d6d9dc8d 100644 --- a/tests/ui/lang-items/start_lang_item_args.rs +++ b/tests/ui/lang-items/start_lang_item_args.rs @@ -8,9 +8,9 @@ #[lang = "copy"] pub trait Copy {} #[lang = "sized"] -pub trait Sized: MetaSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +pub trait Sized: SizeOfVal {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "pointee_sized"] pub trait PointeeSized {} diff --git a/tests/ui/lang-items/start_lang_item_with_target_feature.rs b/tests/ui/lang-items/start_lang_item_with_target_feature.rs index 19036819d3d80..1db6ad885261b 100644 --- a/tests/ui/lang-items/start_lang_item_with_target_feature.rs +++ b/tests/ui/lang-items/start_lang_item_with_target_feature.rs @@ -10,11 +10,11 @@ pub trait Copy {} #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "start"] #[target_feature(enable = "avx2")] diff --git a/tests/ui/panic-handler/panic-handler-requires-panic-info.rs b/tests/ui/panic-handler/panic-handler-requires-panic-info.rs index 618ac7d88ddf2..4c317eab5649b 100644 --- a/tests/ui/panic-handler/panic-handler-requires-panic-info.rs +++ b/tests/ui/panic-handler/panic-handler-requires-panic-info.rs @@ -14,8 +14,8 @@ fn panic() -> ! { #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} diff --git a/tests/ui/privacy/privacy1.rs b/tests/ui/privacy/privacy1.rs index 333d94f41798d..713bf749c344a 100644 --- a/tests/ui/privacy/privacy1.rs +++ b/tests/ui/privacy/privacy1.rs @@ -3,10 +3,10 @@ #![no_core] // makes debugging this test *a lot* easier (during resolve) #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "pointee_sized"] pub trait PointeeSized {} diff --git a/tests/ui/privacy/privacy4.rs b/tests/ui/privacy/privacy4.rs index 6091613271fdf..dd02510262833 100644 --- a/tests/ui/privacy/privacy4.rs +++ b/tests/ui/privacy/privacy4.rs @@ -1,8 +1,8 @@ #![feature(lang_items, no_core)] #![no_core] // makes debugging this test *a lot* easier (during resolve) -#[lang = "sized"] pub trait Sized: MetaSized {} -#[lang = "meta_sized"] pub trait MetaSized: PointeeSized {} +#[lang = "sized"] pub trait Sized: SizeOfVal {} +#[lang = "size_of_val"] pub trait SizeOfVal: PointeeSized {} #[lang = "pointee_sized"] pub trait PointeeSized {} #[lang="copy"] pub trait Copy {} diff --git a/tests/ui/sized-hierarchy/alias-bounds.rs b/tests/ui/sized-hierarchy/alias-bounds.rs index 87b4bab11b746..5eba3e21465d9 100644 --- a/tests/ui/sized-hierarchy/alias-bounds.rs +++ b/tests/ui/sized-hierarchy/alias-bounds.rs @@ -4,7 +4,7 @@ //@[next] compile-flags: -Znext-solver #![feature(sized_hierarchy)] -use std::marker::{PointeeSized, MetaSized}; +use std::marker::{PointeeSized, SizeOfVal}; trait Id: PointeeSized { type This: PointeeSized; @@ -14,7 +14,7 @@ impl Id for T { type This = T; } -fn requires_metasized() {} +fn requires_sizeofval() {} fn foo() where @@ -23,6 +23,6 @@ where { // `T: Sized` from where bounds (`T: PointeeSized` removes any default bounds and // `::This: Sized` normalizes to `T: Sized`). This should trivially satisfy - // `T: MetaSized`. - requires_metasized::(); + // `T: SizeOfVal`. + requires_sizeofval::(); } diff --git a/tests/ui/sized-hierarchy/auxiliary/pretty-print-dep.rs b/tests/ui/sized-hierarchy/auxiliary/pretty-print-dep.rs index a7d18d9036856..49c6416fb4b58 100644 --- a/tests/ui/sized-hierarchy/auxiliary/pretty-print-dep.rs +++ b/tests/ui/sized-hierarchy/auxiliary/pretty-print-dep.rs @@ -1,6 +1,6 @@ #![feature(sized_hierarchy)] -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; pub trait SizedTr {} @@ -10,9 +10,9 @@ pub trait NegSizedTr {} impl NegSizedTr for T {} -pub trait MetaSizedTr {} +pub trait SizeOfValTr {} -impl MetaSizedTr for T {} +impl SizeOfValTr for T {} pub trait PointeeSizedTr: PointeeSized {} diff --git a/tests/ui/sized-hierarchy/default-bound.rs b/tests/ui/sized-hierarchy/default-bound.rs index bbb2c6d96baa8..f8e071209c819 100644 --- a/tests/ui/sized-hierarchy/default-bound.rs +++ b/tests/ui/sized-hierarchy/default-bound.rs @@ -1,7 +1,7 @@ //@ check-fail #![feature(extern_types, sized_hierarchy)] -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; fn bare() {} @@ -11,9 +11,9 @@ fn sized() {} fn neg_sized() {} -fn metasized() {} +fn sizeofval() {} -fn neg_metasized() {} +fn neg_sizeofval() {} //~^ ERROR bound modifier `?` can only be applied to `Sized` @@ -30,11 +30,11 @@ fn main() { //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time sized::<[u8]>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - metasized::<[u8]>(); + sizeofval::<[u8]>(); pointeesized::<[u8]>(); - // Functions which should have a `T: MetaSized` bound - check for an error given a - // non-MetaSized type: + // Functions which should have a `T: SizeOfVal` bound - check for an error given a + // non-SizeOfVal type: unsafe extern "C" { type Foo; } @@ -43,7 +43,7 @@ fn main() { //~^ ERROR the size for values of type `main::Foo` cannot be known sized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known - metasized::(); + sizeofval::(); //~^ ERROR the size for values of type `main::Foo` cannot be known pointeesized::(); } diff --git a/tests/ui/sized-hierarchy/default-bound.stderr b/tests/ui/sized-hierarchy/default-bound.stderr index 9929e2dba524a..22ac1f3c159b6 100644 --- a/tests/ui/sized-hierarchy/default-bound.stderr +++ b/tests/ui/sized-hierarchy/default-bound.stderr @@ -1,7 +1,7 @@ error: bound modifier `?` can only be applied to `Sized` --> $DIR/default-bound.rs:16:21 | -LL | fn neg_metasized() {} +LL | fn neg_sizeofval() {} | ^^^^^^^^^^ error: bound modifier `?` can only be applied to `Sized` @@ -73,15 +73,15 @@ LL | fn sized() {} error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/default-bound.rs:46:17 | -LL | metasized::(); +LL | sizeofval::(); | ^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` -note: required by a bound in `metasized` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` +note: required by a bound in `sizeofval` --> $DIR/default-bound.rs:14:17 | -LL | fn metasized() {} - | ^^^^^^^^^ required by this bound in `metasized` +LL | fn sizeofval() {} + | ^^^^^^^^^ required by this bound in `sizeofval` error: aborting due to 7 previous errors diff --git a/tests/ui/sized-hierarchy/default-supertrait.rs b/tests/ui/sized-hierarchy/default-supertrait.rs index b13f9d90081cd..3b09ce0627fbf 100644 --- a/tests/ui/sized-hierarchy/default-supertrait.rs +++ b/tests/ui/sized-hierarchy/default-supertrait.rs @@ -1,16 +1,16 @@ //@ check-fail #![feature(sized_hierarchy)] -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; trait Sized_: Sized { } trait NegSized: ?Sized { } //~^ ERROR relaxed bounds are not permitted in supertrait bounds -trait MetaSized_: MetaSized { } +trait SizeOfVal_: SizeOfVal { } -trait NegMetaSized: ?MetaSized { } +trait NegSizeOfVal: ?SizeOfVal { } //~^ ERROR relaxed bounds are not permitted in supertrait bounds //~| ERROR bound modifier `?` can only be applied to `Sized` //~| ERROR bound modifier `?` can only be applied to `Sized` @@ -27,19 +27,19 @@ trait NegPointeeSized: ?PointeeSized { } trait Bare {} fn requires_sized() {} -fn requires_metasized() {} +fn requires_sizeofval() {} fn requires_pointeesized() {} fn with_sized_supertrait() { requires_sized::(); - requires_metasized::(); + requires_sizeofval::(); requires_pointeesized::(); } -fn with_metasized_supertrait() { +fn with_sizeofval_supertrait() { requires_sized::(); //~^ ERROR the size for values of type `T` cannot be known at compilation time - requires_metasized::(); + requires_sizeofval::(); requires_pointeesized::(); } @@ -47,16 +47,16 @@ fn with_metasized_supertrait() { fn with_pointeesized_supertrait() { requires_sized::(); //~^ ERROR the size for values of type `T` cannot be known - requires_metasized::(); + requires_sizeofval::(); //~^ ERROR the size for values of type `T` cannot be known requires_pointeesized::(); } -// `T` inherits the `const MetaSized` implicit supertrait of `Bare`. +// `T` inherits the `const SizeOfVal` implicit supertrait of `Bare`. fn with_bare_trait() { requires_sized::(); //~^ ERROR the size for values of type `T` cannot be known - requires_metasized::(); + requires_sizeofval::(); requires_pointeesized::(); } diff --git a/tests/ui/sized-hierarchy/default-supertrait.stderr b/tests/ui/sized-hierarchy/default-supertrait.stderr index 35875163774d4..9480f0c669716 100644 --- a/tests/ui/sized-hierarchy/default-supertrait.stderr +++ b/tests/ui/sized-hierarchy/default-supertrait.stderr @@ -9,7 +9,7 @@ LL | trait NegSized: ?Sized { } error: relaxed bounds are not permitted in supertrait bounds --> $DIR/default-supertrait.rs:13:21 | -LL | trait NegMetaSized: ?MetaSized { } +LL | trait NegSizeOfVal: ?SizeOfVal { } | ^^^^^^^^^^ error: relaxed bounds are not permitted in supertrait bounds @@ -21,13 +21,13 @@ LL | trait NegPointeeSized: ?PointeeSized { } error: bound modifier `?` can only be applied to `Sized` --> $DIR/default-supertrait.rs:13:21 | -LL | trait NegMetaSized: ?MetaSized { } +LL | trait NegSizeOfVal: ?SizeOfVal { } | ^^^^^^^^^^ error: bound modifier `?` can only be applied to `Sized` --> $DIR/default-supertrait.rs:13:21 | -LL | trait NegMetaSized: ?MetaSized { } +LL | trait NegSizeOfVal: ?SizeOfVal { } | ^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` @@ -35,7 +35,7 @@ LL | trait NegMetaSized: ?MetaSized { } error: bound modifier `?` can only be applied to `Sized` --> $DIR/default-supertrait.rs:13:21 | -LL | trait NegMetaSized: ?MetaSized { } +LL | trait NegSizeOfVal: ?SizeOfVal { } | ^^^^^^^^^^ | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` @@ -65,7 +65,7 @@ LL | trait NegPointeeSized: ?PointeeSized { } error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/default-supertrait.rs:40:22 | -LL | fn with_metasized_supertrait() { +LL | fn with_sizeofval_supertrait() { | - this type parameter needs to be `Sized` LL | requires_sized::(); | ^ doesn't have a size known at compile-time @@ -93,17 +93,17 @@ LL | fn requires_sized() {} error[E0277]: the size for values of type `T` cannot be known --> $DIR/default-supertrait.rs:50:26 | -LL | requires_metasized::(); +LL | requires_sizeofval::(); | ^ doesn't have a known size | -note: required by a bound in `requires_metasized` +note: required by a bound in `requires_sizeofval` --> $DIR/default-supertrait.rs:30:26 | -LL | fn requires_metasized() {} - | ^^^^^^^^^ required by this bound in `requires_metasized` -help: consider further restricting type parameter `T` with unstable trait `MetaSized` +LL | fn requires_sizeofval() {} + | ^^^^^^^^^ required by this bound in `requires_sizeofval` +help: consider further restricting type parameter `T` with unstable trait `SizeOfVal` | -LL | fn with_pointeesized_supertrait() { +LL | fn with_pointeesized_supertrait() { | ++++++++++++++++++++++++ error[E0277]: the size for values of type `T` cannot be known at compilation time diff --git a/tests/ui/sized-hierarchy/elaboration-opt-regions-1.rs b/tests/ui/sized-hierarchy/elaboration-opt-regions-1.rs index d59227beae817..1d24b4bc43d65 100644 --- a/tests/ui/sized-hierarchy/elaboration-opt-regions-1.rs +++ b/tests/ui/sized-hierarchy/elaboration-opt-regions-1.rs @@ -4,15 +4,15 @@ //@[next] compile-flags: -Znext-solver #![feature(sized_hierarchy)] -use std::marker::{PhantomData, MetaSized, PointeeSized}; +use std::marker::{PhantomData, SizeOfVal, PointeeSized}; struct Foo<'a, T: PointeeSized>(*mut &'a (), T); -fn requires_metasized<'a, T: MetaSized>(f: &'a T) {} +fn requires_sizeofval<'a, T: SizeOfVal>(f: &'a T) {} fn foo<'a, T: PointeeSized>(f: &Foo<'a, T>) where Foo<'a, T>: Sized { - requires_metasized(f); + requires_sizeofval(f); } diff --git a/tests/ui/sized-hierarchy/elaboration-opt-regions.rs b/tests/ui/sized-hierarchy/elaboration-opt-regions.rs index 66e600f3dc96b..c2022869761dc 100644 --- a/tests/ui/sized-hierarchy/elaboration-opt-regions.rs +++ b/tests/ui/sized-hierarchy/elaboration-opt-regions.rs @@ -4,15 +4,15 @@ //@[next] compile-flags: -Znext-solver #![feature(sized_hierarchy)] -use std::marker::{PhantomData, MetaSized, PointeeSized}; +use std::marker::{PhantomData, SizeOfVal, PointeeSized}; struct Foo<'a, T: PointeeSized>(PhantomData<&'a T>, T); -fn requires_metasized() {} +fn requires_sizeofval() {} fn foo<'a, T: 'a + PointeeSized>() where Foo<'a, T>: Sized { - requires_metasized::>(); + requires_sizeofval::>(); } diff --git a/tests/ui/sized-hierarchy/elaboration-simple.rs b/tests/ui/sized-hierarchy/elaboration-simple.rs index 87e100166a298..b05b12c038a21 100644 --- a/tests/ui/sized-hierarchy/elaboration-simple.rs +++ b/tests/ui/sized-hierarchy/elaboration-simple.rs @@ -7,7 +7,7 @@ trait Trait {} fn f() { - require_metasized::(); + require_sizeofval::(); } -fn require_metasized() {} +fn require_sizeofval() {} diff --git a/tests/ui/sized-hierarchy/extern-type-behind-ptr.rs b/tests/ui/sized-hierarchy/extern-type-behind-ptr.rs index 70a84aabf2cfb..06c16f17f4131 100644 --- a/tests/ui/sized-hierarchy/extern-type-behind-ptr.rs +++ b/tests/ui/sized-hierarchy/extern-type-behind-ptr.rs @@ -1,7 +1,7 @@ //@ check-pass #![feature(extern_types, sized_hierarchy)] -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; pub fn hash(_: *const T) { unimplemented!(); diff --git a/tests/ui/sized-hierarchy/impls.rs b/tests/ui/sized-hierarchy/impls.rs index 643f7bc7c46cb..99d68e995a33d 100644 --- a/tests/ui/sized-hierarchy/impls.rs +++ b/tests/ui/sized-hierarchy/impls.rs @@ -6,15 +6,15 @@ #![feature(coroutines, extern_types, f16, never_type, unsized_fn_params)] use std::fmt::Debug; -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; -// This test checks that `Sized` and `MetaSized` are automatically implemented appropriately. +// This test checks that `Sized` and `SizeOfVal` are automatically implemented appropriately. fn needs_sized() { } fn takes_sized(_t: T) { } -fn needs_metasized() { } -fn takes_metasized(_t: T) { } +fn needs_sizeofval() { } +fn takes_sizeofval(_t: T) { } fn needs_pointeesized() { } fn takes_pointeesized(_t: T) { } @@ -22,151 +22,151 @@ fn takes_pointeesized(_t: T) { } fn main() { // `bool` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `char` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `i8` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `i16` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `i32` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `i64` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `i128` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `u8` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `u16` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `u32` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `u64` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `u128` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `f16` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `f32` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `f64` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `*const` needs_sized::<*const u8>(); - needs_metasized::<*const u8>(); + needs_sizeofval::<*const u8>(); needs_pointeesized::<*const u8>(); // `*mut` needs_sized::<*mut u8>(); - needs_metasized::<*mut u8>(); + needs_sizeofval::<*mut u8>(); needs_pointeesized::<*mut u8>(); // `&` needs_sized::<&u8>(); - needs_metasized::<&u8>(); + needs_sizeofval::<&u8>(); needs_pointeesized::<&u8>(); // `&mut` needs_sized::<&mut u8>(); - needs_metasized::<&mut u8>(); + needs_sizeofval::<&mut u8>(); needs_pointeesized::<&mut u8>(); // fn-def fn foo(x: u8) -> u8 { x } takes_sized(foo); - takes_metasized(foo); + takes_sizeofval(foo); takes_pointeesized(foo); // fn-ptr takes_sized:: u8>(foo); - takes_metasized:: u8>(foo); + takes_sizeofval:: u8>(foo); takes_pointeesized:: u8>(foo); // `[T; x]` needs_sized::<[u8; 1]>(); - needs_metasized::<[u8; 1]>(); + needs_sizeofval::<[u8; 1]>(); needs_pointeesized::<[u8; 1]>(); // `|a| { a }` takes_sized(|a| { a }); - takes_metasized(|a| { a }); + takes_sizeofval(|a| { a }); takes_pointeesized(|a| { a }); // `async |a| { a }` takes_sized(async |a| { a }); - takes_metasized(async |a| { a }); + takes_sizeofval(async |a| { a }); takes_pointeesized(async |a| { a }); // `|a| { yield a }` takes_sized(#[coroutine] |a| { yield a }); - takes_metasized(#[coroutine] |a| { yield a }); + takes_sizeofval(#[coroutine] |a| { yield a }); takes_pointeesized(#[coroutine] |a| { yield a }); // `!` needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `str` needs_sized::(); //~^ ERROR the size for values of type `str` cannot be known at compilation time - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `[T]` needs_sized::<[u8]>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_metasized::<[u8]>(); + needs_sizeofval::<[u8]>(); needs_pointeesized::<[u8]>(); // `dyn Debug` needs_sized::(); //~^ ERROR the size for values of type `dyn Debug` cannot be known at compilation time - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // `extern type` @@ -175,24 +175,24 @@ fn main() { } needs_sized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time - needs_metasized::(); + needs_sizeofval::(); //~^ ERROR the size for values of type `main::Foo` cannot be known needs_pointeesized::(); // empty tuple needs_sized::<()>(); - needs_metasized::<()>(); + needs_sizeofval::<()>(); needs_pointeesized::<()>(); // tuple w/ all elements sized needs_sized::<(u32, u32)>(); - needs_metasized::<(u32, u32)>(); + needs_sizeofval::<(u32, u32)>(); needs_pointeesized::<(u32, u32)>(); - // tuple w/ all elements metasized + // tuple w/ all elements sizeofval needs_sized::<([u8], [u8])>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_metasized::<([u8], [u8])>(); + needs_sizeofval::<([u8], [u8])>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time needs_pointeesized::<([u8], [u8])>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time @@ -200,106 +200,106 @@ fn main() { // tuple w/ all elements pointeesized needs_sized::<(Foo, Foo)>(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time - needs_metasized::<(Foo, Foo)>(); + needs_sizeofval::<(Foo, Foo)>(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time //~| ERROR the size for values of type `main::Foo` cannot be known needs_pointeesized::<(Foo, Foo)>(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time - // tuple w/ last element metasized + // tuple w/ last element sizeofval needs_sized::<(u32, [u8])>(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_metasized::<(u32, [u8])>(); + needs_sizeofval::<(u32, [u8])>(); needs_pointeesized::<(u32, [u8])>(); // tuple w/ last element pointeesized needs_sized::<(u32, Foo)>(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time - needs_metasized::<(u32, Foo)>(); + needs_sizeofval::<(u32, Foo)>(); //~^ ERROR the size for values of type `main::Foo` cannot be known needs_pointeesized::<(u32, Foo)>(); // struct w/ no fields struct StructEmpty {} needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // struct w/ all fields sized struct StructAllFieldsSized { x: u32, y: u32 } needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); - // struct w/ all fields metasized - struct StructAllFieldsMetaSized { x: [u8], y: [u8] } + // struct w/ all fields sizeofval + struct StructAllFieldsSizeOfVal { x: [u8], y: [u8] } //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_sized::(); + needs_sized::(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_metasized::(); - needs_pointeesized::(); + needs_sizeofval::(); + needs_pointeesized::(); // struct w/ all fields unsized struct StructAllFieldsUnsized { x: Foo, y: Foo } //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time needs_sized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time - needs_metasized::(); + needs_sizeofval::(); //~^ ERROR the size for values of type `main::Foo` cannot be known needs_pointeesized::(); - // struct w/ last fields metasized - struct StructLastFieldMetaSized { x: u32, y: [u8] } - needs_sized::(); + // struct w/ last fields sizeofval + struct StructLastFieldSizeOfVal { x: u32, y: [u8] } + needs_sized::(); //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_metasized::(); - needs_pointeesized::(); + needs_sizeofval::(); + needs_pointeesized::(); // struct w/ last fields unsized struct StructLastFieldUnsized { x: u32, y: Foo } needs_sized::(); //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time - needs_metasized::(); + needs_sizeofval::(); //~^ ERROR the size for values of type `main::Foo` cannot be known needs_pointeesized::(); // enum w/ no fields enum EnumEmpty {} needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); // enum w/ all variant fields sized enum EnumAllFieldsSized { Qux { x: u32, y: u32 } } needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); - // enum w/ all variant fields metasized - enum EnumAllFieldsMetaSized { Qux { x: [u8], y: [u8] } } + // enum w/ all variant fields sizeofval + enum EnumAllFieldsSizeOfVal { Qux { x: [u8], y: [u8] } } //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_sized::(); - needs_metasized::(); - needs_pointeesized::(); + needs_sized::(); + needs_sizeofval::(); + needs_pointeesized::(); // enum w/ all variant fields unsized enum EnumAllFieldsUnsized { Qux { x: Foo, y: Foo } } //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); - // enum w/ last variant fields metasized - enum EnumLastFieldMetaSized { Qux { x: u32, y: [u8] } } + // enum w/ last variant fields sizeofval + enum EnumLastFieldSizeOfVal { Qux { x: u32, y: [u8] } } //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time - needs_sized::(); - needs_metasized::(); - needs_pointeesized::(); + needs_sized::(); + needs_sizeofval::(); + needs_pointeesized::(); // enum w/ last variant fields unsized enum EnumLastFieldUnsized { Qux { x: u32, y: Foo } } //~^ ERROR the size for values of type `main::Foo` cannot be known at compilation time needs_sized::(); - needs_metasized::(); + needs_sizeofval::(); needs_pointeesized::(); } diff --git a/tests/ui/sized-hierarchy/impls.stderr b/tests/ui/sized-hierarchy/impls.stderr index 25c6c933149fd..a1578e2989901 100644 --- a/tests/ui/sized-hierarchy/impls.stderr +++ b/tests/ui/sized-hierarchy/impls.stderr @@ -1,7 +1,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:235:42 | -LL | struct StructAllFieldsMetaSized { x: [u8], y: [u8] } +LL | struct StructAllFieldsSizeOfVal { x: [u8], y: [u8] } | ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` @@ -9,11 +9,11 @@ LL | struct StructAllFieldsMetaSized { x: [u8], y: [u8] } = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | -LL | struct StructAllFieldsMetaSized { x: &[u8], y: [u8] } +LL | struct StructAllFieldsSizeOfVal { x: &[u8], y: [u8] } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | -LL | struct StructAllFieldsMetaSized { x: Box<[u8]>, y: [u8] } +LL | struct StructAllFieldsSizeOfVal { x: Box<[u8]>, y: [u8] } | ++++ + error[E0277]: the size for values of type `main::Foo` cannot be known at compilation time @@ -37,7 +37,7 @@ LL | struct StructAllFieldsUnsized { x: Box, y: Foo } error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:279:44 | -LL | enum EnumAllFieldsMetaSized { Qux { x: [u8], y: [u8] } } +LL | enum EnumAllFieldsSizeOfVal { Qux { x: [u8], y: [u8] } } | ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` @@ -45,11 +45,11 @@ LL | enum EnumAllFieldsMetaSized { Qux { x: [u8], y: [u8] } } = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | -LL | enum EnumAllFieldsMetaSized { Qux { x: &[u8], y: [u8] } } +LL | enum EnumAllFieldsSizeOfVal { Qux { x: &[u8], y: [u8] } } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | -LL | enum EnumAllFieldsMetaSized { Qux { x: Box<[u8]>, y: [u8] } } +LL | enum EnumAllFieldsSizeOfVal { Qux { x: Box<[u8]>, y: [u8] } } | ++++ + error[E0277]: the size for values of type `main::Foo` cannot be known at compilation time @@ -73,7 +73,7 @@ LL | enum EnumAllFieldsUnsized { Qux { x: Box, y: Foo } } error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:293:52 | -LL | enum EnumLastFieldMetaSized { Qux { x: u32, y: [u8] } } +LL | enum EnumLastFieldSizeOfVal { Qux { x: u32, y: [u8] } } | ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` @@ -81,11 +81,11 @@ LL | enum EnumLastFieldMetaSized { Qux { x: u32, y: [u8] } } = help: change the field's type to have a statically known size help: borrowed types always have a statically known size | -LL | enum EnumLastFieldMetaSized { Qux { x: u32, y: &[u8] } } +LL | enum EnumLastFieldSizeOfVal { Qux { x: u32, y: &[u8] } } | + help: the `Box` type always has a statically known size and allocates its contents in the heap | -LL | enum EnumLastFieldMetaSized { Qux { x: u32, y: Box<[u8]> } } +LL | enum EnumLastFieldSizeOfVal { Qux { x: u32, y: Box<[u8]> } } | ++++ + error[E0277]: the size for values of type `main::Foo` cannot be known at compilation time @@ -161,15 +161,15 @@ LL | fn needs_sized() { } error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/impls.rs:178:23 | -LL | needs_metasized::(); +LL | needs_sizeofval::(); | ^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` -note: required by a bound in `needs_metasized` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` +note: required by a bound in `needs_sizeofval` --> $DIR/impls.rs:16:23 | -LL | fn needs_metasized() { } - | ^^^^^^^^^ required by this bound in `needs_metasized` +LL | fn needs_sizeofval() { } + | ^^^^^^^^^ required by this bound in `needs_sizeofval` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:193:19 @@ -183,7 +183,7 @@ LL | needs_sized::<([u8], [u8])>(); error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:195:23 | -LL | needs_metasized::<([u8], [u8])>(); +LL | needs_sizeofval::<([u8], [u8])>(); | ^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` @@ -210,7 +210,7 @@ LL | needs_sized::<(Foo, Foo)>(); error[E0277]: the size for values of type `main::Foo` cannot be known at compilation time --> $DIR/impls.rs:203:23 | -LL | needs_metasized::<(Foo, Foo)>(); +LL | needs_sizeofval::<(Foo, Foo)>(); | ^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `main::Foo` @@ -219,16 +219,16 @@ LL | needs_metasized::<(Foo, Foo)>(); error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/impls.rs:203:23 | -LL | needs_metasized::<(Foo, Foo)>(); +LL | needs_sizeofval::<(Foo, Foo)>(); | ^^^^^^^^^^ doesn't have a known size | - = help: within `(main::Foo, main::Foo)`, the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` + = help: within `(main::Foo, main::Foo)`, the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` = note: required because it appears within the type `(main::Foo, main::Foo)` -note: required by a bound in `needs_metasized` +note: required by a bound in `needs_sizeofval` --> $DIR/impls.rs:16:23 | -LL | fn needs_metasized() { } - | ^^^^^^^^^ required by this bound in `needs_metasized` +LL | fn needs_sizeofval() { } + | ^^^^^^^^^ required by this bound in `needs_sizeofval` error[E0277]: the size for values of type `main::Foo` cannot be known at compilation time --> $DIR/impls.rs:206:26 @@ -270,28 +270,28 @@ LL | fn needs_sized() { } error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/impls.rs:218:23 | -LL | needs_metasized::<(u32, Foo)>(); +LL | needs_sizeofval::<(u32, Foo)>(); | ^^^^^^^^^^ doesn't have a known size | - = help: within `(u32, main::Foo)`, the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` + = help: within `(u32, main::Foo)`, the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` = note: required because it appears within the type `(u32, main::Foo)` -note: required by a bound in `needs_metasized` +note: required by a bound in `needs_sizeofval` --> $DIR/impls.rs:16:23 | -LL | fn needs_metasized() { } - | ^^^^^^^^^ required by this bound in `needs_metasized` +LL | fn needs_sizeofval() { } + | ^^^^^^^^^ required by this bound in `needs_sizeofval` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:237:19 | -LL | needs_sized::(); +LL | needs_sized::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `StructAllFieldsMetaSized`, the trait `Sized` is not implemented for `[u8]` -note: required because it appears within the type `StructAllFieldsMetaSized` + = help: within `StructAllFieldsSizeOfVal`, the trait `Sized` is not implemented for `[u8]` +note: required because it appears within the type `StructAllFieldsSizeOfVal` --> $DIR/impls.rs:235:12 | -LL | struct StructAllFieldsMetaSized { x: [u8], y: [u8] } +LL | struct StructAllFieldsSizeOfVal { x: [u8], y: [u8] } | ^^^^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `needs_sized` --> $DIR/impls.rs:13:19 @@ -320,32 +320,32 @@ LL | fn needs_sized() { } error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/impls.rs:247:23 | -LL | needs_metasized::(); +LL | needs_sizeofval::(); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size | - = help: within `StructAllFieldsUnsized`, the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` + = help: within `StructAllFieldsUnsized`, the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` note: required because it appears within the type `StructAllFieldsUnsized` --> $DIR/impls.rs:243:12 | LL | struct StructAllFieldsUnsized { x: Foo, y: Foo } | ^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `needs_metasized` +note: required by a bound in `needs_sizeofval` --> $DIR/impls.rs:16:23 | -LL | fn needs_metasized() { } - | ^^^^^^^^^ required by this bound in `needs_metasized` +LL | fn needs_sizeofval() { } + | ^^^^^^^^^ required by this bound in `needs_sizeofval` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/impls.rs:253:19 | -LL | needs_sized::(); +LL | needs_sized::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `StructLastFieldMetaSized`, the trait `Sized` is not implemented for `[u8]` -note: required because it appears within the type `StructLastFieldMetaSized` + = help: within `StructLastFieldSizeOfVal`, the trait `Sized` is not implemented for `[u8]` +note: required because it appears within the type `StructLastFieldSizeOfVal` --> $DIR/impls.rs:252:12 | -LL | struct StructLastFieldMetaSized { x: u32, y: [u8] } +LL | struct StructLastFieldSizeOfVal { x: u32, y: [u8] } | ^^^^^^^^^^^^^^^^^^^^^^^^ note: required by a bound in `needs_sized` --> $DIR/impls.rs:13:19 @@ -374,20 +374,20 @@ LL | fn needs_sized() { } error[E0277]: the size for values of type `main::Foo` cannot be known --> $DIR/impls.rs:262:23 | -LL | needs_metasized::(); +LL | needs_sizeofval::(); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size | - = help: within `StructLastFieldUnsized`, the nightly-only, unstable trait `MetaSized` is not implemented for `main::Foo` + = help: within `StructLastFieldUnsized`, the nightly-only, unstable trait `SizeOfVal` is not implemented for `main::Foo` note: required because it appears within the type `StructLastFieldUnsized` --> $DIR/impls.rs:259:12 | LL | struct StructLastFieldUnsized { x: u32, y: Foo } | ^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `needs_metasized` +note: required by a bound in `needs_sizeofval` --> $DIR/impls.rs:16:23 | -LL | fn needs_metasized() { } - | ^^^^^^^^^ required by this bound in `needs_metasized` +LL | fn needs_sizeofval() { } + | ^^^^^^^^^ required by this bound in `needs_sizeofval` error: aborting due to 27 previous errors diff --git a/tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs b/tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs index 44453b65e7cd1..b58023e99fe44 100644 --- a/tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs +++ b/tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs @@ -5,7 +5,7 @@ //@[next] compile-flags: -Znext-solver // Test that we avoid incomplete inference when normalizing. Without this, -// `Trait`'s implicit `MetaSized` supertrait requires proving `T::Assoc<_>: MetaSized` +// `Trait`'s implicit `SizeOfVal` supertrait requires proving `T::Assoc<_>: SizeOfVal` // before checking the `new` arguments, resulting in eagerly constraining the inference // var to `u32`. This is undesirable and would breaking code. diff --git a/tests/ui/sized-hierarchy/overflow.current.stderr b/tests/ui/sized-hierarchy/overflow.current.stderr index da58a6d2f7bf6..6e2493931529b 100644 --- a/tests/ui/sized-hierarchy/overflow.current.stderr +++ b/tests/ui/sized-hierarchy/overflow.current.stderr @@ -1,4 +1,4 @@ -error[E0275]: overflow evaluating the requirement `Element: MetaSized` +error[E0275]: overflow evaluating the requirement `Element: SizeOfVal` --> $DIR/overflow.rs:17:16 | LL | struct Element(> as ParseTokens>::Output); diff --git a/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.rs b/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.rs index 0412ff651cee6..4a5af62a2eee2 100644 --- a/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.rs +++ b/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.rs @@ -2,7 +2,7 @@ //@ compile-flags: --crate-type=lib extern crate pretty_print_dep; -use pretty_print_dep::{SizedTr, NegSizedTr, MetaSizedTr, PointeeSizedTr}; +use pretty_print_dep::{SizedTr, NegSizedTr, SizeOfValTr, PointeeSizedTr}; // Test that printing the sizedness trait bounds in the conflicting impl error without enabling // `sized_hierarchy` will continue to print `?Sized`, even if the dependency is compiled with @@ -19,8 +19,8 @@ impl SizedTr for X {} impl NegSizedTr for X {} //~^ ERROR conflicting implementations of trait `NegSizedTr` for type `X<_>` -impl MetaSizedTr for X {} -//~^ ERROR conflicting implementations of trait `MetaSizedTr` for type `X<_>` +impl SizeOfValTr for X {} +//~^ ERROR conflicting implementations of trait `SizeOfValTr` for type `X<_>` impl PointeeSizedTr for X {} //~^ ERROR conflicting implementations of trait `PointeeSizedTr` for type `X<_>` diff --git a/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.stderr b/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.stderr index cb9bfd178f88d..f92e8e25b4d71 100644 --- a/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.stderr +++ b/tests/ui/sized-hierarchy/pretty-print-no-feat-dep-has-feat.stderr @@ -17,14 +17,14 @@ LL | impl NegSizedTr for X {} - impl NegSizedTr for T where T: ?Sized; -error[E0119]: conflicting implementations of trait `MetaSizedTr` for type `X<_>` +error[E0119]: conflicting implementations of trait `SizeOfValTr` for type `X<_>` --> $DIR/pretty-print-no-feat-dep-has-feat.rs:22:1 | -LL | impl MetaSizedTr for X {} +LL | impl SizeOfValTr for X {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: conflicting implementation in crate `pretty_print_dep`: - - impl MetaSizedTr for T + - impl SizeOfValTr for T where T: ?Sized; error[E0119]: conflicting implementations of trait `PointeeSizedTr` for type `X<_>` diff --git a/tests/ui/sized-hierarchy/pretty-print-opaque.rs b/tests/ui/sized-hierarchy/pretty-print-opaque.rs index 2aceee23a0171..2d039d4c5cbcc 100644 --- a/tests/ui/sized-hierarchy/pretty-print-opaque.rs +++ b/tests/ui/sized-hierarchy/pretty-print-opaque.rs @@ -1,7 +1,7 @@ //@ compile-flags: --crate-type=lib #![feature(sized_hierarchy)] -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; pub trait Tr: PointeeSized {} impl Tr for u32 {} @@ -18,16 +18,16 @@ pub fn neg_sized() -> Box { if true { let x = neg_sized(); let y: Box = x; -//~^ ERROR: the size for values of type `impl Tr + MetaSized` cannot be known +//~^ ERROR: the size for values of type `impl Tr + SizeOfVal` cannot be known } Box::new(1u32) } -pub fn metasized() -> Box { +pub fn sizeofval() -> Box { if true { - let x = metasized(); + let x = sizeofval(); let y: Box = x; -//~^ ERROR: the size for values of type `impl Tr + MetaSized` cannot be known +//~^ ERROR: the size for values of type `impl Tr + SizeOfVal` cannot be known } Box::new(1u32) } diff --git a/tests/ui/sized-hierarchy/pretty-print-opaque.stderr b/tests/ui/sized-hierarchy/pretty-print-opaque.stderr index 9f9289d0f3918..fa4e696dec78d 100644 --- a/tests/ui/sized-hierarchy/pretty-print-opaque.stderr +++ b/tests/ui/sized-hierarchy/pretty-print-opaque.stderr @@ -4,27 +4,27 @@ error[E0277]: the size for values of type `impl Tr + PointeeSized` cannot be kno LL | pub fn pointeesized() -> Box { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `impl Tr + PointeeSized` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `impl Tr + PointeeSized` note: required by a bound in `Box` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL -error[E0277]: the size for values of type `impl Tr + MetaSized` cannot be known at compilation time +error[E0277]: the size for values of type `impl Tr + SizeOfVal` cannot be known at compilation time --> $DIR/pretty-print-opaque.rs:20:30 | LL | let y: Box = x; | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `impl Tr + MetaSized` - = note: required for the cast from `Box` to `Box` + = help: the trait `Sized` is not implemented for `impl Tr + SizeOfVal` + = note: required for the cast from `Box` to `Box` -error[E0277]: the size for values of type `impl Tr + MetaSized` cannot be known at compilation time +error[E0277]: the size for values of type `impl Tr + SizeOfVal` cannot be known at compilation time --> $DIR/pretty-print-opaque.rs:29:30 | LL | let y: Box = x; | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `impl Tr + MetaSized` - = note: required for the cast from `Box` to `Box` + = help: the trait `Sized` is not implemented for `impl Tr + SizeOfVal` + = note: required for the cast from `Box` to `Box` error[E0277]: the size for values of type `impl Tr + PointeeSized` cannot be known --> $DIR/pretty-print-opaque.rs:38:17 @@ -32,7 +32,7 @@ error[E0277]: the size for values of type `impl Tr + PointeeSized` cannot be kno LL | let x = pointeesized(); | ^^^^^^^^^^^^^^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `impl Tr + PointeeSized` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `impl Tr + PointeeSized` note: required by a bound in `Box` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL @@ -51,7 +51,7 @@ error[E0277]: the size for values of type `impl Tr + PointeeSized` cannot be kno LL | let y: Box = x; | ^ doesn't have a known size | - = help: the nightly-only, unstable trait `MetaSized` is not implemented for `impl Tr + PointeeSized` + = help: the nightly-only, unstable trait `SizeOfVal` is not implemented for `impl Tr + PointeeSized` = note: required for the cast from `Box` to `Box` error: aborting due to 6 previous errors diff --git a/tests/ui/sized-hierarchy/pretty-print.rs b/tests/ui/sized-hierarchy/pretty-print.rs index 0908e76490ce7..aade9f6b1b744 100644 --- a/tests/ui/sized-hierarchy/pretty-print.rs +++ b/tests/ui/sized-hierarchy/pretty-print.rs @@ -8,10 +8,10 @@ // It isn't possible to write a test that matches the multiline note containing the important // diagnostic output being tested - so check the stderr changes carefully! -use std::marker::{MetaSized, PointeeSized}; +use std::marker::{SizeOfVal, PointeeSized}; extern crate pretty_print_dep; -use pretty_print_dep::{SizedTr, MetaSizedTr, PointeeSizedTr}; +use pretty_print_dep::{SizedTr, SizeOfValTr, PointeeSizedTr}; struct X(T); @@ -21,8 +21,8 @@ impl SizedTr for X {} impl pretty_print_dep::NegSizedTr for X {} //~^ ERROR conflicting implementations of trait `NegSizedTr` for type `X<_>` -impl MetaSizedTr for X {} -//~^ ERROR conflicting implementations of trait `MetaSizedTr` for type `X<_>` +impl SizeOfValTr for X {} +//~^ ERROR conflicting implementations of trait `SizeOfValTr` for type `X<_>` impl PointeeSizedTr for X {} //~^ ERROR conflicting implementations of trait `PointeeSizedTr` for type `X<_>` diff --git a/tests/ui/sized-hierarchy/pretty-print.stderr b/tests/ui/sized-hierarchy/pretty-print.stderr index 3602c804945bd..147f4fdc84f2c 100644 --- a/tests/ui/sized-hierarchy/pretty-print.stderr +++ b/tests/ui/sized-hierarchy/pretty-print.stderr @@ -16,17 +16,17 @@ LL | impl pretty_print_dep::NegSizedTr for X {} | = note: conflicting implementation in crate `pretty_print_dep`: - impl NegSizedTr for T - where T: MetaSized; + where T: SizeOfVal; -error[E0119]: conflicting implementations of trait `MetaSizedTr` for type `X<_>` +error[E0119]: conflicting implementations of trait `SizeOfValTr` for type `X<_>` --> $DIR/pretty-print.rs:24:1 | -LL | impl MetaSizedTr for X {} +LL | impl SizeOfValTr for X {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: conflicting implementation in crate `pretty_print_dep`: - - impl MetaSizedTr for T - where T: MetaSized; + - impl SizeOfValTr for T + where T: SizeOfVal; error[E0119]: conflicting implementations of trait `PointeeSizedTr` for type `X<_>` --> $DIR/pretty-print.rs:27:1 diff --git a/tests/ui/sized-hierarchy/trait-alias-elaboration.rs b/tests/ui/sized-hierarchy/trait-alias-elaboration.rs index a5b4443ffddd3..65418e270728f 100644 --- a/tests/ui/sized-hierarchy/trait-alias-elaboration.rs +++ b/tests/ui/sized-hierarchy/trait-alias-elaboration.rs @@ -1,14 +1,14 @@ #![feature(sized_hierarchy, trait_alias)] -use std::marker::MetaSized; +use std::marker::SizeOfVal; -// Trait aliases also have implicit `MetaSized` bounds, like traits. These are filtered out during +// Trait aliases also have implicit `SizeOfVal` bounds, like traits. These are filtered out during // elaboration of trait aliases when lowering `dyn TraitAlias` - however, if the user explicitly -// wrote `MetaSized` in the `dyn Trait` then that should still be an error so as not to accidentally +// wrote `SizeOfVal` in the `dyn Trait` then that should still be an error so as not to accidentally // accept this going forwards. trait Qux = Clone; -type Foo = dyn Qux + MetaSized; +type Foo = dyn Qux + SizeOfVal; //~^ ERROR: only auto traits can be used as additional traits in a trait object type Bar = dyn Qux; diff --git a/tests/ui/sized-hierarchy/trait-alias-elaboration.stderr b/tests/ui/sized-hierarchy/trait-alias-elaboration.stderr index 394aae6f8e32f..6eb39346d191a 100644 --- a/tests/ui/sized-hierarchy/trait-alias-elaboration.stderr +++ b/tests/ui/sized-hierarchy/trait-alias-elaboration.stderr @@ -4,12 +4,12 @@ error[E0225]: only auto traits can be used as additional traits in a trait objec LL | trait Qux = Clone; | ------------------ additional non-auto trait LL | -LL | type Foo = dyn Qux + MetaSized; +LL | type Foo = dyn Qux + SizeOfVal; | ^^^ --------- first non-auto trait | | | second non-auto trait comes from this alias | - = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: MetaSized + MetaSized + Clone {}` + = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: SizeOfVal + SizeOfVal + Clone {}` = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error: aborting due to 1 previous error diff --git a/tests/ui/stack-protector/warn-stack-protector-unsupported.rs b/tests/ui/stack-protector/warn-stack-protector-unsupported.rs index 9e0e126dabe66..fcd20e70f1f8a 100644 --- a/tests/ui/stack-protector/warn-stack-protector-unsupported.rs +++ b/tests/ui/stack-protector/warn-stack-protector-unsupported.rs @@ -15,11 +15,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] trait Copy {} diff --git a/tests/ui/suggestions/apitit-unimplemented-method.rs b/tests/ui/suggestions/apitit-unimplemented-method.rs index c0cd709e2300a..c3b2544771fcf 100644 --- a/tests/ui/suggestions/apitit-unimplemented-method.rs +++ b/tests/ui/suggestions/apitit-unimplemented-method.rs @@ -8,7 +8,7 @@ struct Local; impl Trait for Local {} //~^ ERROR not all trait items implemented //~| HELP implement the missing item: `fn foo(_: impl Sized) { todo!() }` -//~| HELP implement the missing item: `fn bar(_: impl Sized) where Foo: MetaSized { todo!() }` +//~| HELP implement the missing item: `fn bar(_: impl Sized) where Foo: SizeOfVal { todo!() }` //~| HELP implement the missing item: `fn baz() { todo!() }` //~| HELP implement the missing item: `fn quux<'a: 'b, 'b, T>() where T: ?Sized { todo!() }` diff --git a/tests/ui/suggestions/apitit-unimplemented-method.stderr b/tests/ui/suggestions/apitit-unimplemented-method.stderr index 1f2e0ea2cad94..87af1cbbf8c53 100644 --- a/tests/ui/suggestions/apitit-unimplemented-method.stderr +++ b/tests/ui/suggestions/apitit-unimplemented-method.stderr @@ -5,7 +5,7 @@ LL | impl Trait for Local {} | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `baz`, `quux` in implementation | = help: implement the missing item: `fn foo(_: impl Sized) { todo!() }` - = help: implement the missing item: `fn bar(_: impl Sized) where Foo: MetaSized { todo!() }` + = help: implement the missing item: `fn bar(_: impl Sized) where Foo: SizeOfVal { todo!() }` = help: implement the missing item: `fn baz() { todo!() }` = help: implement the missing item: `fn quux<'a: 'b, 'b, T>() where T: ?Sized { todo!() }` diff --git a/tests/ui/suggestions/auxiliary/dep.rs b/tests/ui/suggestions/auxiliary/dep.rs index c28c8b8a52f51..4e93d1ff929da 100644 --- a/tests/ui/suggestions/auxiliary/dep.rs +++ b/tests/ui/suggestions/auxiliary/dep.rs @@ -1,6 +1,6 @@ #![feature(sized_hierarchy)] -use std::marker::MetaSized; +use std::marker::SizeOfVal; pub struct Foo { inner: T, @@ -10,7 +10,7 @@ pub trait Trait { fn foo(_: impl Sized); fn bar(_: impl Sized) where - Foo: MetaSized; + Foo: SizeOfVal; fn baz<'a, const N: usize>(); fn quux<'a: 'b, 'b, T: ?Sized>(); } diff --git a/tests/ui/target-cpu/explicit-target-cpu.rs b/tests/ui/target-cpu/explicit-target-cpu.rs index cfec444372728..d38d9be5ddad0 100644 --- a/tests/ui/target-cpu/explicit-target-cpu.rs +++ b/tests/ui/target-cpu/explicit-target-cpu.rs @@ -33,8 +33,8 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang="sized"] trait Sized {} diff --git a/tests/ui/traits/const-traits/auxiliary/minicore.rs b/tests/ui/traits/const-traits/auxiliary/minicore.rs index 2e5df13d021d5..0f3ddf7406a30 100644 --- a/tests/ui/traits/const-traits/auxiliary/minicore.rs +++ b/tests/ui/traits/const-traits/auxiliary/minicore.rs @@ -21,11 +21,11 @@ #[lang = "pointee_sized"] pub trait PointeeSized {} -#[lang = "meta_sized"] -pub trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +pub trait SizeOfVal: PointeeSized {} #[lang = "sized"] -pub trait Sized: MetaSized {} +pub trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} @@ -114,10 +114,10 @@ impl LegacyReceiver for &mut T {} #[lang = "receiver"] pub trait Receiver { #[lang = "receiver_target"] - type Target: MetaSized; + type Target: SizeOfVal; } -impl Receiver for T { +impl Receiver for T { type Target = ::Target; } @@ -160,13 +160,13 @@ fn panic_fmt() {} #[lang = "index"] pub const trait Index { - type Output: MetaSized; + type Output: SizeOfVal; fn index(&self, index: Idx) -> &Self::Output; } pub const unsafe trait SliceIndex { - type Output: MetaSized; + type Output: SizeOfVal; fn index(self, slice: &T) -> &Self::Output; } @@ -205,12 +205,12 @@ impl<'a, 'b: 'a, T: PointeeSized + Unsize, U: PointeeSized> CoerceUnsized<&'a #[lang = "deref"] pub const trait Deref { #[lang = "deref_target"] - type Target: MetaSized; + type Target: SizeOfVal; fn deref(&self) -> &Self::Target; } -impl const Deref for &T { +impl const Deref for &T { type Target = T; fn deref(&self) -> &T { @@ -218,7 +218,7 @@ impl const Deref for &T { } } -impl const Deref for &mut T { +impl const Deref for &mut T { type Target = T; fn deref(&self) -> &T { @@ -435,7 +435,7 @@ struct Ref<'b, T: PointeeSized + 'b> { borrow: &'b UnsafeCell<()>, } -impl Deref for Ref<'_, T> { +impl Deref for Ref<'_, T> { type Target = T; #[inline] diff --git a/tests/ui/traits/default_auto_traits/default-bounds.rs b/tests/ui/traits/default_auto_traits/default-bounds.rs index 8535f82fc0129..f405c69908fc8 100644 --- a/tests/ui/traits/default_auto_traits/default-bounds.rs +++ b/tests/ui/traits/default_auto_traits/default-bounds.rs @@ -14,11 +14,11 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} diff --git a/tests/ui/traits/default_auto_traits/extern-types.rs b/tests/ui/traits/default_auto_traits/extern-types.rs index df106d83171c9..fb7d461870bf2 100644 --- a/tests/ui/traits/default_auto_traits/extern-types.rs +++ b/tests/ui/traits/default_auto_traits/extern-types.rs @@ -10,11 +10,11 @@ #[lang = "pointee_sized"] trait PointeeSized {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized {} #[lang = "sized"] -trait Sized: MetaSized {} +trait Sized: SizeOfVal {} #[lang = "copy"] pub trait Copy {} diff --git a/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.rs b/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.rs index 2e1a5d2424bfa..78e7713f63c76 100644 --- a/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.rs +++ b/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.rs @@ -15,11 +15,11 @@ #[lang = "pointee_sized"] trait PointeeSized: ?Leak {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized + ?Leak {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized + ?Leak {} #[lang = "sized"] -trait Sized: MetaSized + ?Leak {} +trait Sized: SizeOfVal + ?Leak {} #[lang = "copy"] pub trait Copy: ?Leak {} diff --git a/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs b/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs index ac4c4aca2efe3..4b15e87485fe9 100644 --- a/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs +++ b/tests/ui/traits/default_auto_traits/maybe-bounds-in-traits.rs @@ -20,11 +20,11 @@ pub trait Copy: ?Leak {} #[lang = "pointee_sized"] trait PointeeSized: ?Leak {} -#[lang = "meta_sized"] -trait MetaSized: PointeeSized + ?Leak {} +#[lang = "size_of_val"] +trait SizeOfVal: PointeeSized + ?Leak {} #[lang = "sized"] -trait Sized: MetaSized + ?Leak {} +trait Sized: SizeOfVal + ?Leak {} #[lang = "legacy_receiver"] trait LegacyReceiver: ?Leak {} diff --git a/tests/ui/traits/negative-bounds/negative-metasized.current.stderr b/tests/ui/traits/negative-bounds/negative-metasized.current.stderr deleted file mode 100644 index 4ff516513364a..0000000000000 --- a/tests/ui/traits/negative-bounds/negative-metasized.current.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0277]: the trait bound `T: !MetaSized` is not satisfied - --> $DIR/negative-metasized.rs:12:11 - | -LL | foo::(); - | ^ the trait bound `T: !MetaSized` is not satisfied - | -note: required by a bound in `foo` - --> $DIR/negative-metasized.rs:9:11 - | -LL | fn foo() {} - | ^^^^^^^^^^ required by this bound in `foo` - -error[E0277]: the trait bound `(): !MetaSized` is not satisfied - --> $DIR/negative-metasized.rs:17:11 - | -LL | foo::<()>(); - | ^^ the trait bound `(): !MetaSized` is not satisfied - | -note: required by a bound in `foo` - --> $DIR/negative-metasized.rs:9:11 - | -LL | fn foo() {} - | ^^^^^^^^^^ required by this bound in `foo` - -error[E0277]: the trait bound `str: !MetaSized` is not satisfied - --> $DIR/negative-metasized.rs:19:11 - | -LL | foo::(); - | ^^^ the trait bound `str: !MetaSized` is not satisfied - | -note: required by a bound in `foo` - --> $DIR/negative-metasized.rs:9:11 - | -LL | fn foo() {} - | ^^^^^^^^^^ required by this bound in `foo` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/negative-bounds/negative-metasized.next.stderr b/tests/ui/traits/negative-bounds/negative-metasized.next.stderr deleted file mode 100644 index 4ff516513364a..0000000000000 --- a/tests/ui/traits/negative-bounds/negative-metasized.next.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0277]: the trait bound `T: !MetaSized` is not satisfied - --> $DIR/negative-metasized.rs:12:11 - | -LL | foo::(); - | ^ the trait bound `T: !MetaSized` is not satisfied - | -note: required by a bound in `foo` - --> $DIR/negative-metasized.rs:9:11 - | -LL | fn foo() {} - | ^^^^^^^^^^ required by this bound in `foo` - -error[E0277]: the trait bound `(): !MetaSized` is not satisfied - --> $DIR/negative-metasized.rs:17:11 - | -LL | foo::<()>(); - | ^^ the trait bound `(): !MetaSized` is not satisfied - | -note: required by a bound in `foo` - --> $DIR/negative-metasized.rs:9:11 - | -LL | fn foo() {} - | ^^^^^^^^^^ required by this bound in `foo` - -error[E0277]: the trait bound `str: !MetaSized` is not satisfied - --> $DIR/negative-metasized.rs:19:11 - | -LL | foo::(); - | ^^^ the trait bound `str: !MetaSized` is not satisfied - | -note: required by a bound in `foo` - --> $DIR/negative-metasized.rs:9:11 - | -LL | fn foo() {} - | ^^^^^^^^^^ required by this bound in `foo` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/negative-bounds/negative-metasized.rs b/tests/ui/traits/negative-bounds/negative-metasized.rs deleted file mode 100644 index 479037be852f4..0000000000000 --- a/tests/ui/traits/negative-bounds/negative-metasized.rs +++ /dev/null @@ -1,21 +0,0 @@ -//@ revisions: current next -//@ ignore-compare-mode-next-solver (explicit revisions) -//@[next] compile-flags: -Znext-solver -#![feature(negative_bounds)] -#![feature(sized_hierarchy)] - -use std::marker::MetaSized; - -fn foo() {} - -fn bar() { - foo::(); - //~^ ERROR the trait bound `T: !MetaSized` is not satisfied -} - -fn main() { - foo::<()>(); - //~^ ERROR the trait bound `(): !MetaSized` is not satisfied - foo::(); - //~^ ERROR the trait bound `str: !MetaSized` is not satisfied -} diff --git a/tests/ui/traits/negative-bounds/negative-sizeofval.current.stderr b/tests/ui/traits/negative-bounds/negative-sizeofval.current.stderr new file mode 100644 index 0000000000000..7e8b8e2d6c81a --- /dev/null +++ b/tests/ui/traits/negative-bounds/negative-sizeofval.current.stderr @@ -0,0 +1,39 @@ +error[E0277]: the trait bound `T: !SizeOfVal` is not satisfied + --> $DIR/negative-sizeofval.rs:12:11 + | +LL | foo::(); + | ^ the trait bound `T: !SizeOfVal` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sizeofval.rs:9:11 + | +LL | fn foo() {} + | ^^^^^^^^^^ required by this bound in `foo` + +error[E0277]: the trait bound `(): !SizeOfVal` is not satisfied + --> $DIR/negative-sizeofval.rs:17:11 + | +LL | foo::<()>(); + | ^^ the trait bound `(): !SizeOfVal` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sizeofval.rs:9:11 + | +LL | fn foo() {} + | ^^^^^^^^^^ required by this bound in `foo` + +error[E0277]: the trait bound `str: !SizeOfVal` is not satisfied + --> $DIR/negative-sizeofval.rs:19:11 + | +LL | foo::(); + | ^^^ the trait bound `str: !SizeOfVal` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sizeofval.rs:9:11 + | +LL | fn foo() {} + | ^^^^^^^^^^ required by this bound in `foo` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/negative-bounds/negative-sizeofval.next.stderr b/tests/ui/traits/negative-bounds/negative-sizeofval.next.stderr new file mode 100644 index 0000000000000..7e8b8e2d6c81a --- /dev/null +++ b/tests/ui/traits/negative-bounds/negative-sizeofval.next.stderr @@ -0,0 +1,39 @@ +error[E0277]: the trait bound `T: !SizeOfVal` is not satisfied + --> $DIR/negative-sizeofval.rs:12:11 + | +LL | foo::(); + | ^ the trait bound `T: !SizeOfVal` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sizeofval.rs:9:11 + | +LL | fn foo() {} + | ^^^^^^^^^^ required by this bound in `foo` + +error[E0277]: the trait bound `(): !SizeOfVal` is not satisfied + --> $DIR/negative-sizeofval.rs:17:11 + | +LL | foo::<()>(); + | ^^ the trait bound `(): !SizeOfVal` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sizeofval.rs:9:11 + | +LL | fn foo() {} + | ^^^^^^^^^^ required by this bound in `foo` + +error[E0277]: the trait bound `str: !SizeOfVal` is not satisfied + --> $DIR/negative-sizeofval.rs:19:11 + | +LL | foo::(); + | ^^^ the trait bound `str: !SizeOfVal` is not satisfied + | +note: required by a bound in `foo` + --> $DIR/negative-sizeofval.rs:9:11 + | +LL | fn foo() {} + | ^^^^^^^^^^ required by this bound in `foo` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/traits/negative-bounds/negative-sizeofval.rs b/tests/ui/traits/negative-bounds/negative-sizeofval.rs new file mode 100644 index 0000000000000..21c48e353f3dc --- /dev/null +++ b/tests/ui/traits/negative-bounds/negative-sizeofval.rs @@ -0,0 +1,21 @@ +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +#![feature(negative_bounds)] +#![feature(sized_hierarchy)] + +use std::marker::SizeOfVal; + +fn foo() {} + +fn bar() { + foo::(); + //~^ ERROR the trait bound `T: !SizeOfVal` is not satisfied +} + +fn main() { + foo::<()>(); + //~^ ERROR the trait bound `(): !SizeOfVal` is not satisfied + foo::(); + //~^ ERROR the trait bound `str: !SizeOfVal` is not satisfied +}