Auto merge of #132377 - matthiaskrgr:rollup-3p1c6hs, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - #132368 (Remove `do_not_const_check` from `Iterator` methods)
 - #132373 (Make sure `type_param_predicates` resolves correctly for RPITIT)
 - #132374 (Remove dead code stemming from the old effects desugaring)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-10-31 00:46:22 +00:00
commit 75eff9a574
15 changed files with 27 additions and 116 deletions

View File

@ -821,8 +821,7 @@ pub(super) fn check_specialization_validity<'tcx>(
let result = opt_result.unwrap_or(Ok(())); let result = opt_result.unwrap_or(Ok(()));
if let Err(parent_impl) = result { if let Err(parent_impl) = result {
// FIXME(effects) the associated type from effects could be specialized if !tcx.is_impl_trait_in_trait(impl_item) {
if !tcx.is_impl_trait_in_trait(impl_item) && !tcx.is_effects_desugared_assoc_ty(impl_item) {
report_forbidden_specialization(tcx, impl_item, parent_impl); report_forbidden_specialization(tcx, impl_item, parent_impl);
} else { } else {
tcx.dcx().delayed_bug(format!("parent item: {parent_impl:?} not marked as default")); tcx.dcx().delayed_bug(format!("parent item: {parent_impl:?} not marked as default"));

View File

@ -2042,7 +2042,7 @@ pub(super) fn check_type_bounds<'tcx>(
// A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR, // A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR,
// which we currently use to get the span for an impl's associated type. Instead, for these, // which we currently use to get the span for an impl's associated type. Instead, for these,
// use the def_span for the synthesized associated type. // use the def_span for the synthesized associated type.
let impl_ty_span = if impl_ty.is_impl_trait_in_trait() || impl_ty.is_effects_desugaring { let impl_ty_span = if impl_ty.is_impl_trait_in_trait() {
tcx.def_span(impl_ty_def_id) tcx.def_span(impl_ty_def_id)
} else { } else {
match tcx.hir_node_by_def_id(impl_ty_def_id) { match tcx.hir_node_by_def_id(impl_ty_def_id) {

View File

@ -379,9 +379,6 @@ pub(super) fn explicit_item_bounds_with_filter(
} }
let bounds = match tcx.hir_node_by_def_id(def_id) { let bounds = match tcx.hir_node_by_def_id(def_id) {
_ if tcx.is_effects_desugared_assoc_ty(def_id.to_def_id()) => {
associated_type_bounds(tcx, def_id, &[], tcx.def_span(def_id), filter)
}
hir::Node::TraitItem(hir::TraitItem { hir::Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Type(bounds, _), kind: hir::TraitItemKind::Type(bounds, _),
span, span,

View File

@ -757,6 +757,16 @@ pub(super) fn type_param_predicates<'tcx>(
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
(item_def_id, def_id, assoc_name): (LocalDefId, LocalDefId, Ident), (item_def_id, def_id, assoc_name): (LocalDefId, LocalDefId, Ident),
) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> { ) -> ty::EarlyBinder<'tcx, &'tcx [(ty::Clause<'tcx>, Span)]> {
match tcx.opt_rpitit_info(item_def_id.to_def_id()) {
Some(ty::ImplTraitInTraitData::Trait { opaque_def_id, .. }) => {
return tcx.type_param_predicates((opaque_def_id.expect_local(), def_id, assoc_name));
}
Some(ty::ImplTraitInTraitData::Impl { .. }) => {
unreachable!("should not be lowering bounds on RPITIT in impl")
}
None => {}
}
use rustc_hir::*; use rustc_hir::*;
use rustc_middle::ty::Ty; use rustc_middle::ty::Ty;

View File

@ -140,9 +140,7 @@ pub(super) fn lower_trait_object_ty(
tcx.associated_items(pred.def_id()) tcx.associated_items(pred.def_id())
.in_definition_order() .in_definition_order()
.filter(|item| item.kind == ty::AssocKind::Type) .filter(|item| item.kind == ty::AssocKind::Type)
.filter(|item| { .filter(|item| !item.is_impl_trait_in_trait())
!item.is_impl_trait_in_trait() && !item.is_effects_desugaring
})
.map(|item| item.def_id), .map(|item| item.def_id),
); );
} }

View File

@ -1365,7 +1365,6 @@ pub(crate) fn differs_from(&self, other: &Self) -> bool {
trait_item_def_id: _, trait_item_def_id: _,
fn_has_self_parameter: _, fn_has_self_parameter: _,
opt_rpitit_info: _, opt_rpitit_info: _,
is_effects_desugaring: _,
}, },
kind: _, kind: _,
import_ids: _, import_ids: _,

View File

@ -1317,9 +1317,7 @@ fn get_associated_item_or_field_def_ids(
} }
fn get_associated_item(self, id: DefIndex, sess: &'a Session) -> ty::AssocItem { fn get_associated_item(self, id: DefIndex, sess: &'a Session) -> ty::AssocItem {
let name = if self.root.tables.opt_rpitit_info.get(self, id).is_some() let name = if self.root.tables.opt_rpitit_info.get(self, id).is_some() {
|| self.root.tables.is_effects_desugaring.get(self, id)
{
kw::Empty kw::Empty
} else { } else {
self.item_name(id) self.item_name(id)
@ -1342,7 +1340,6 @@ fn get_associated_item(self, id: DefIndex, sess: &'a Session) -> ty::AssocItem {
container, container,
fn_has_self_parameter: has_self, fn_has_self_parameter: has_self,
opt_rpitit_info, opt_rpitit_info,
is_effects_desugaring: self.root.tables.is_effects_desugaring.get(self, id),
} }
} }

View File

@ -1677,9 +1677,6 @@ fn encode_info_for_assoc_item(&mut self, def_id: DefId) {
self.encode_precise_capturing_args(def_id); self.encode_precise_capturing_args(def_id);
} }
} }
if item.is_effects_desugaring {
self.tables.is_effects_desugaring.set(def_id.index, true);
}
} }
fn encode_precise_capturing_args(&mut self, def_id: DefId) { fn encode_precise_capturing_args(&mut self, def_id: DefId) {

View File

@ -396,7 +396,6 @@ fn encode(&self, buf: &mut FileEncoder) -> LazyTables {
inherent_impls: Table<DefIndex, LazyArray<DefIndex>>, inherent_impls: Table<DefIndex, LazyArray<DefIndex>>,
associated_types_for_impl_traits_in_associated_fn: Table<DefIndex, LazyArray<DefId>>, associated_types_for_impl_traits_in_associated_fn: Table<DefIndex, LazyArray<DefId>>,
opt_rpitit_info: Table<DefIndex, Option<LazyValue<ty::ImplTraitInTraitData>>>, opt_rpitit_info: Table<DefIndex, Option<LazyValue<ty::ImplTraitInTraitData>>>,
is_effects_desugaring: Table<DefIndex, bool>,
unused_generic_params: Table<DefIndex, UnusedGenericParams>, unused_generic_params: Table<DefIndex, UnusedGenericParams>,
// Reexported names are not associated with individual `DefId`s, // Reexported names are not associated with individual `DefId`s,
// e.g. a glob import can introduce a lot of names, all with the same `DefId`. // e.g. a glob import can introduce a lot of names, all with the same `DefId`.

View File

@ -34,8 +34,6 @@ pub struct AssocItem {
/// return-position `impl Trait` in trait desugaring. The `ImplTraitInTraitData` /// return-position `impl Trait` in trait desugaring. The `ImplTraitInTraitData`
/// provides additional information about its source. /// provides additional information about its source.
pub opt_rpitit_info: Option<ty::ImplTraitInTraitData>, pub opt_rpitit_info: Option<ty::ImplTraitInTraitData>,
pub is_effects_desugaring: bool,
} }
impl AssocItem { impl AssocItem {

View File

@ -1625,16 +1625,6 @@ pub fn opt_rpitit_info(self, def_id: DefId) -> Option<ImplTraitInTraitData> {
} }
} }
/// Whether the `def_id` is an associated type that was desugared from a
/// `#[const_trait]` or `impl_const`.
pub fn is_effects_desugared_assoc_ty(self, def_id: DefId) -> bool {
if let DefKind::AssocTy = self.def_kind(def_id) {
self.associated_item(def_id).is_effects_desugaring
} else {
false
}
}
pub fn find_field_index(self, ident: Ident, variant: &VariantDef) -> Option<FieldIdx> { pub fn find_field_index(self, ident: Ident, variant: &VariantDef) -> Option<FieldIdx> {
variant.fields.iter_enumerated().find_map(|(i, field)| { variant.fields.iter_enumerated().find_map(|(i, field)| {
self.hygienic_eq(ident, field.ident(self), variant.def_id).then_some(i) self.hygienic_eq(ident, field.ident(self), variant.def_id).then_some(i)

View File

@ -5222,12 +5222,6 @@ fn point_at_assoc_type_restriction<G: EmissionGuarantee>(
let ty::ClauseKind::Projection(proj) = clause else { let ty::ClauseKind::Projection(proj) = clause else {
return; return;
}; };
// avoid ICEing since effects desugared associated types don't have names.
// this path should only be hit for `~const` on invalid places, so they
// will have an informative error already.
if tcx.is_effects_desugared_assoc_ty(proj.projection_term.def_id) {
return;
}
let name = tcx.item_name(proj.projection_term.def_id); let name = tcx.item_name(proj.projection_term.def_id);
let mut predicates = generics.predicates.iter().peekable(); let mut predicates = generics.predicates.iter().peekable();
let mut prev: Option<&hir::WhereBoundPredicate<'_>> = None; let mut prev: Option<&hir::WhereBoundPredicate<'_>> = None;

View File

@ -143,7 +143,6 @@ fn associated_item_from_trait_item_ref(trait_item_ref: &hir::TraitItemRef) -> ty
container: ty::TraitContainer, container: ty::TraitContainer,
fn_has_self_parameter: has_self, fn_has_self_parameter: has_self,
opt_rpitit_info: None, opt_rpitit_info: None,
is_effects_desugaring: false,
} }
} }
@ -163,7 +162,6 @@ fn associated_item_from_impl_item_ref(impl_item_ref: &hir::ImplItemRef) -> ty::A
container: ty::ImplContainer, container: ty::ImplContainer,
fn_has_self_parameter: has_self, fn_has_self_parameter: has_self,
opt_rpitit_info: None, opt_rpitit_info: None,
is_effects_desugaring: false,
} }
} }
@ -275,7 +273,6 @@ fn associated_type_for_impl_trait_in_trait(
fn_def_id: fn_def_id.to_def_id(), fn_def_id: fn_def_id.to_def_id(),
opaque_def_id: opaque_ty_def_id.to_def_id(), opaque_def_id: opaque_ty_def_id.to_def_id(),
}), }),
is_effects_desugaring: false,
}); });
// Copy visility of the containing function. // Copy visility of the containing function.
@ -327,7 +324,6 @@ fn associated_type_for_impl_trait_in_impl(
container: ty::ImplContainer, container: ty::ImplContainer,
fn_has_self_parameter: false, fn_has_self_parameter: false,
opt_rpitit_info: Some(ImplTraitInTraitData::Impl { fn_def_id: impl_fn_def_id.to_def_id() }), opt_rpitit_info: Some(ImplTraitInTraitData::Impl { fn_def_id: impl_fn_def_id.to_def_id() }),
is_effects_desugaring: false,
}); });
// Copy visility of the containing function. // Copy visility of the containing function.

View File

@ -106,7 +106,6 @@ pub trait Iterator {
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "iter_next_chunk", reason = "recently added", issue = "98326")] #[unstable(feature = "iter_next_chunk", reason = "recently added", issue = "98326")]
#[rustc_do_not_const_check]
fn next_chunk<const N: usize>( fn next_chunk<const N: usize>(
&mut self, &mut self,
) -> Result<[Self::Item; N], array::IntoIter<Self::Item, N>> ) -> Result<[Self::Item; N], array::IntoIter<Self::Item, N>>
@ -184,7 +183,6 @@ fn next_chunk<const N: usize>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn size_hint(&self) -> (usize, Option<usize>) { fn size_hint(&self) -> (usize, Option<usize>) {
(0, None) (0, None)
} }
@ -220,7 +218,6 @@ fn size_hint(&self) -> (usize, Option<usize>) {
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn count(self) -> usize fn count(self) -> usize
where where
Self: Sized, Self: Sized,
@ -249,7 +246,6 @@ fn count(self) -> usize
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn last(self) -> Option<Self::Item> fn last(self) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -297,7 +293,6 @@ fn some<T>(_: Option<T>, x: T) -> Option<T> {
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "iter_advance_by", reason = "recently added", issue = "77404")] #[unstable(feature = "iter_advance_by", reason = "recently added", issue = "77404")]
#[rustc_do_not_const_check]
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> { fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
for i in 0..n { for i in 0..n {
if self.next().is_none() { if self.next().is_none() {
@ -349,7 +344,6 @@ fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn nth(&mut self, n: usize) -> Option<Self::Item> { fn nth(&mut self, n: usize) -> Option<Self::Item> {
self.advance_by(n).ok()?; self.advance_by(n).ok()?;
self.next() self.next()
@ -400,7 +394,6 @@ fn nth(&mut self, n: usize) -> Option<Self::Item> {
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iterator_step_by", since = "1.28.0")] #[stable(feature = "iterator_step_by", since = "1.28.0")]
#[rustc_do_not_const_check]
fn step_by(self, step: usize) -> StepBy<Self> fn step_by(self, step: usize) -> StepBy<Self>
where where
Self: Sized, Self: Sized,
@ -472,7 +465,6 @@ fn step_by(self, step: usize) -> StepBy<Self>
/// [`OsStr`]: ../../std/ffi/struct.OsStr.html /// [`OsStr`]: ../../std/ffi/struct.OsStr.html
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter> fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter>
where where
Self: Sized, Self: Sized,
@ -591,7 +583,6 @@ fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter>
/// [`zip`]: crate::iter::zip /// [`zip`]: crate::iter::zip
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn zip<U>(self, other: U) -> Zip<Self, U::IntoIter> fn zip<U>(self, other: U) -> Zip<Self, U::IntoIter>
where where
Self: Sized, Self: Sized,
@ -634,7 +625,6 @@ fn zip<U>(self, other: U) -> Zip<Self, U::IntoIter>
/// [`intersperse_with`]: Iterator::intersperse_with /// [`intersperse_with`]: Iterator::intersperse_with
#[inline] #[inline]
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")] #[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
#[rustc_do_not_const_check]
fn intersperse(self, separator: Self::Item) -> Intersperse<Self> fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
where where
Self: Sized, Self: Sized,
@ -693,7 +683,6 @@ fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
/// [`intersperse`]: Iterator::intersperse /// [`intersperse`]: Iterator::intersperse
#[inline] #[inline]
#[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")] #[unstable(feature = "iter_intersperse", reason = "recently added", issue = "79524")]
#[rustc_do_not_const_check]
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where where
Self: Sized, Self: Sized,
@ -753,7 +742,6 @@ fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
#[rustc_diagnostic_item = "IteratorMap"] #[rustc_diagnostic_item = "IteratorMap"]
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn map<B, F>(self, f: F) -> Map<Self, F> fn map<B, F>(self, f: F) -> Map<Self, F>
where where
Self: Sized, Self: Sized,
@ -799,7 +787,6 @@ fn map<B, F>(self, f: F) -> Map<Self, F>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iterator_for_each", since = "1.21.0")] #[stable(feature = "iterator_for_each", since = "1.21.0")]
#[rustc_do_not_const_check]
fn for_each<F>(self, f: F) fn for_each<F>(self, f: F)
where where
Self: Sized, Self: Sized,
@ -875,7 +862,6 @@ fn call<T>(mut f: impl FnMut(T)) -> impl FnMut((), T) {
/// Note that `iter.filter(f).next()` is equivalent to `iter.find(f)`. /// Note that `iter.filter(f).next()` is equivalent to `iter.find(f)`.
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
#[cfg_attr(not(test), rustc_diagnostic_item = "iter_filter")] #[cfg_attr(not(test), rustc_diagnostic_item = "iter_filter")]
fn filter<P>(self, predicate: P) -> Filter<Self, P> fn filter<P>(self, predicate: P) -> Filter<Self, P>
where where
@ -922,7 +908,6 @@ fn filter<P>(self, predicate: P) -> Filter<Self, P>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where where
Self: Sized, Self: Sized,
@ -969,7 +954,6 @@ fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
#[cfg_attr(not(test), rustc_diagnostic_item = "enumerate_method")] #[cfg_attr(not(test), rustc_diagnostic_item = "enumerate_method")]
fn enumerate(self) -> Enumerate<Self> fn enumerate(self) -> Enumerate<Self>
where where
@ -1042,7 +1026,6 @@ fn enumerate(self) -> Enumerate<Self>
/// [`next`]: Iterator::next /// [`next`]: Iterator::next
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn peekable(self) -> Peekable<Self> fn peekable(self) -> Peekable<Self>
where where
Self: Sized, Self: Sized,
@ -1108,7 +1091,6 @@ fn peekable(self) -> Peekable<Self>
#[inline] #[inline]
#[doc(alias = "drop_while")] #[doc(alias = "drop_while")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where where
Self: Sized, Self: Sized,
@ -1190,7 +1172,6 @@ fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
/// the iteration should stop, but wasn't placed back into the iterator. /// the iteration should stop, but wasn't placed back into the iterator.
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where where
Self: Sized, Self: Sized,
@ -1279,7 +1260,6 @@ fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
/// [`fuse`]: Iterator::fuse /// [`fuse`]: Iterator::fuse
#[inline] #[inline]
#[stable(feature = "iter_map_while", since = "1.57.0")] #[stable(feature = "iter_map_while", since = "1.57.0")]
#[rustc_do_not_const_check]
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where where
Self: Sized, Self: Sized,
@ -1309,7 +1289,6 @@ fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn skip(self, n: usize) -> Skip<Self> fn skip(self, n: usize) -> Skip<Self>
where where
Self: Sized, Self: Sized,
@ -1363,7 +1342,6 @@ fn skip(self, n: usize) -> Skip<Self>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn take(self, n: usize) -> Take<Self> fn take(self, n: usize) -> Take<Self>
where where
Self: Sized, Self: Sized,
@ -1411,7 +1389,6 @@ fn take(self, n: usize) -> Take<Self>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where where
Self: Sized, Self: Sized,
@ -1450,7 +1427,6 @@ fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where where
Self: Sized, Self: Sized,
@ -1535,7 +1511,6 @@ fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
/// [`flat_map()`]: Iterator::flat_map /// [`flat_map()`]: Iterator::flat_map
#[inline] #[inline]
#[stable(feature = "iterator_flatten", since = "1.29.0")] #[stable(feature = "iterator_flatten", since = "1.29.0")]
#[rustc_do_not_const_check]
fn flatten(self) -> Flatten<Self> fn flatten(self) -> Flatten<Self>
where where
Self: Sized, Self: Sized,
@ -1692,7 +1667,6 @@ fn flatten(self) -> Flatten<Self>
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")] #[unstable(feature = "iter_map_windows", reason = "recently added", issue = "87155")]
#[rustc_do_not_const_check]
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where where
Self: Sized, Self: Sized,
@ -1759,7 +1733,6 @@ fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn fuse(self) -> Fuse<Self> fn fuse(self) -> Fuse<Self>
where where
Self: Sized, Self: Sized,
@ -1844,7 +1817,6 @@ fn fuse(self) -> Fuse<Self>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn inspect<F>(self, f: F) -> Inspect<Self, F> fn inspect<F>(self, f: F) -> Inspect<Self, F>
where where
Self: Sized, Self: Sized,
@ -1873,7 +1845,6 @@ fn inspect<F>(self, f: F) -> Inspect<Self, F>
/// assert_eq!(of_rust, vec!["of", "Rust"]); /// assert_eq!(of_rust, vec!["of", "Rust"]);
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn by_ref(&mut self) -> &mut Self fn by_ref(&mut self) -> &mut Self
where where
Self: Sized, Self: Sized,
@ -1993,7 +1964,6 @@ fn by_ref(&mut self) -> &mut Self
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"] #[must_use = "if you really need to exhaust the iterator, consider `.for_each(drop)` instead"]
#[cfg_attr(not(test), rustc_diagnostic_item = "iterator_collect_fn")] #[cfg_attr(not(test), rustc_diagnostic_item = "iterator_collect_fn")]
#[rustc_do_not_const_check]
fn collect<B: FromIterator<Self::Item>>(self) -> B fn collect<B: FromIterator<Self::Item>>(self) -> B
where where
Self: Sized, Self: Sized,
@ -2072,7 +2042,6 @@ fn collect<B: FromIterator<Self::Item>>(self) -> B
/// [`collect`]: Iterator::collect /// [`collect`]: Iterator::collect
#[inline] #[inline]
#[unstable(feature = "iterator_try_collect", issue = "94047")] #[unstable(feature = "iterator_try_collect", issue = "94047")]
#[rustc_do_not_const_check]
fn try_collect<B>(&mut self) -> ChangeOutputType<Self::Item, B> fn try_collect<B>(&mut self) -> ChangeOutputType<Self::Item, B>
where where
Self: Sized, Self: Sized,
@ -2145,7 +2114,6 @@ fn try_collect<B>(&mut self) -> ChangeOutputType<Self::Item, B>
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "iter_collect_into", reason = "new API", issue = "94780")] #[unstable(feature = "iter_collect_into", reason = "new API", issue = "94780")]
#[rustc_do_not_const_check]
fn collect_into<E: Extend<Self::Item>>(self, collection: &mut E) -> &mut E fn collect_into<E: Extend<Self::Item>>(self, collection: &mut E) -> &mut E
where where
Self: Sized, Self: Sized,
@ -2178,7 +2146,6 @@ fn collect_into<E: Extend<Self::Item>>(self, collection: &mut E) -> &mut E
/// assert_eq!(odd, vec![1, 3]); /// assert_eq!(odd, vec![1, 3]);
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn partition<B, F>(self, f: F) -> (B, B) fn partition<B, F>(self, f: F) -> (B, B)
where where
Self: Sized, Self: Sized,
@ -2241,7 +2208,6 @@ fn extend<'a, T, B: Extend<T>>(
/// assert!(a[i..].iter().all(|&n| n % 2 == 1)); // odds /// assert!(a[i..].iter().all(|&n| n % 2 == 1)); // odds
/// ``` /// ```
#[unstable(feature = "iter_partition_in_place", reason = "new API", issue = "62543")] #[unstable(feature = "iter_partition_in_place", reason = "new API", issue = "62543")]
#[rustc_do_not_const_check]
fn partition_in_place<'a, T: 'a, P>(mut self, ref mut predicate: P) -> usize fn partition_in_place<'a, T: 'a, P>(mut self, ref mut predicate: P) -> usize
where where
Self: Sized + DoubleEndedIterator<Item = &'a mut T>, Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
@ -2299,7 +2265,6 @@ fn is_true<T>(predicate: &mut impl FnMut(&T) -> bool) -> impl FnMut(&&mut T) ->
/// assert!(!"IntoIterator".chars().is_partitioned(char::is_uppercase)); /// assert!(!"IntoIterator".chars().is_partitioned(char::is_uppercase));
/// ``` /// ```
#[unstable(feature = "iter_is_partitioned", reason = "new API", issue = "62544")] #[unstable(feature = "iter_is_partitioned", reason = "new API", issue = "62544")]
#[rustc_do_not_const_check]
fn is_partitioned<P>(mut self, mut predicate: P) -> bool fn is_partitioned<P>(mut self, mut predicate: P) -> bool
where where
Self: Sized, Self: Sized,
@ -2394,7 +2359,6 @@ fn is_partitioned<P>(mut self, mut predicate: P) -> bool
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iterator_try_fold", since = "1.27.0")] #[stable(feature = "iterator_try_fold", since = "1.27.0")]
#[rustc_do_not_const_check]
fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R
where where
Self: Sized, Self: Sized,
@ -2453,7 +2417,6 @@ fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iterator_try_fold", since = "1.27.0")] #[stable(feature = "iterator_try_fold", since = "1.27.0")]
#[rustc_do_not_const_check]
fn try_for_each<F, R>(&mut self, f: F) -> R fn try_for_each<F, R>(&mut self, f: F) -> R
where where
Self: Sized, Self: Sized,
@ -2573,7 +2536,6 @@ fn call<T, R>(mut f: impl FnMut(T) -> R) -> impl FnMut((), T) -> R {
#[doc(alias = "inject", alias = "foldl")] #[doc(alias = "inject", alias = "foldl")]
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn fold<B, F>(mut self, init: B, mut f: F) -> B fn fold<B, F>(mut self, init: B, mut f: F) -> B
where where
Self: Sized, Self: Sized,
@ -2611,7 +2573,6 @@ fn fold<B, F>(mut self, init: B, mut f: F) -> B
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iterator_fold_self", since = "1.51.0")] #[stable(feature = "iterator_fold_self", since = "1.51.0")]
#[rustc_do_not_const_check]
fn reduce<F>(mut self, f: F) -> Option<Self::Item> fn reduce<F>(mut self, f: F) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -2683,7 +2644,6 @@ fn reduce<F>(mut self, f: F) -> Option<Self::Item>
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "iterator_try_reduce", reason = "new API", issue = "87053")] #[unstable(feature = "iterator_try_reduce", reason = "new API", issue = "87053")]
#[rustc_do_not_const_check]
fn try_reduce<R>( fn try_reduce<R>(
&mut self, &mut self,
f: impl FnMut(Self::Item, Self::Item) -> R, f: impl FnMut(Self::Item, Self::Item) -> R,
@ -2742,7 +2702,6 @@ fn try_reduce<R>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn all<F>(&mut self, f: F) -> bool fn all<F>(&mut self, f: F) -> bool
where where
Self: Sized, Self: Sized,
@ -2796,7 +2755,6 @@ fn check<T>(mut f: impl FnMut(T) -> bool) -> impl FnMut((), T) -> ControlFlow<()
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn any<F>(&mut self, f: F) -> bool fn any<F>(&mut self, f: F) -> bool
where where
Self: Sized, Self: Sized,
@ -2860,7 +2818,6 @@ fn check<T>(mut f: impl FnMut(T) -> bool) -> impl FnMut((), T) -> ControlFlow<()
/// Note that `iter.find(f)` is equivalent to `iter.filter(f).next()`. /// Note that `iter.find(f)` is equivalent to `iter.filter(f).next()`.
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn find<P>(&mut self, predicate: P) -> Option<Self::Item> fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -2892,7 +2849,6 @@ fn check<T>(mut predicate: impl FnMut(&T) -> bool) -> impl FnMut((), T) -> Contr
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iterator_find_map", since = "1.30.0")] #[stable(feature = "iterator_find_map", since = "1.30.0")]
#[rustc_do_not_const_check]
fn find_map<B, F>(&mut self, f: F) -> Option<B> fn find_map<B, F>(&mut self, f: F) -> Option<B>
where where
Self: Sized, Self: Sized,
@ -2951,7 +2907,6 @@ fn check<T, B>(mut f: impl FnMut(T) -> Option<B>) -> impl FnMut((), T) -> Contro
/// ``` /// ```
#[inline] #[inline]
#[unstable(feature = "try_find", reason = "new API", issue = "63178")] #[unstable(feature = "try_find", reason = "new API", issue = "63178")]
#[rustc_do_not_const_check]
fn try_find<R>( fn try_find<R>(
&mut self, &mut self,
f: impl FnMut(&Self::Item) -> R, f: impl FnMut(&Self::Item) -> R,
@ -3035,7 +2990,6 @@ fn check<I, V, R>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn position<P>(&mut self, predicate: P) -> Option<usize> fn position<P>(&mut self, predicate: P) -> Option<usize>
where where
Self: Sized, Self: Sized,
@ -3100,7 +3054,6 @@ fn check<'a, T>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn rposition<P>(&mut self, predicate: P) -> Option<usize> fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where where
P: FnMut(Self::Item) -> bool, P: FnMut(Self::Item) -> bool,
@ -3150,7 +3103,6 @@ fn check<T>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn max(self) -> Option<Self::Item> fn max(self) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -3187,7 +3139,6 @@ fn max(self) -> Option<Self::Item>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn min(self) -> Option<Self::Item> fn min(self) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -3210,7 +3161,6 @@ fn min(self) -> Option<Self::Item>
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iter_cmp_by_key", since = "1.6.0")] #[stable(feature = "iter_cmp_by_key", since = "1.6.0")]
#[rustc_do_not_const_check]
fn max_by_key<B: Ord, F>(self, f: F) -> Option<Self::Item> fn max_by_key<B: Ord, F>(self, f: F) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -3244,7 +3194,6 @@ fn compare<T, B: Ord>((x_p, _): &(B, T), (y_p, _): &(B, T)) -> Ordering {
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iter_max_by", since = "1.15.0")] #[stable(feature = "iter_max_by", since = "1.15.0")]
#[rustc_do_not_const_check]
fn max_by<F>(self, compare: F) -> Option<Self::Item> fn max_by<F>(self, compare: F) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -3272,7 +3221,6 @@ fn fold<T>(mut compare: impl FnMut(&T, &T) -> Ordering) -> impl FnMut(T, T) -> T
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iter_cmp_by_key", since = "1.6.0")] #[stable(feature = "iter_cmp_by_key", since = "1.6.0")]
#[rustc_do_not_const_check]
fn min_by_key<B: Ord, F>(self, f: F) -> Option<Self::Item> fn min_by_key<B: Ord, F>(self, f: F) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -3306,7 +3254,6 @@ fn compare<T, B: Ord>((x_p, _): &(B, T), (y_p, _): &(B, T)) -> Ordering {
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "iter_min_by", since = "1.15.0")] #[stable(feature = "iter_min_by", since = "1.15.0")]
#[rustc_do_not_const_check]
fn min_by<F>(self, compare: F) -> Option<Self::Item> fn min_by<F>(self, compare: F) -> Option<Self::Item>
where where
Self: Sized, Self: Sized,
@ -3344,7 +3291,6 @@ fn fold<T>(mut compare: impl FnMut(&T, &T) -> Ordering) -> impl FnMut(T, T) -> T
#[inline] #[inline]
#[doc(alias = "reverse")] #[doc(alias = "reverse")]
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn rev(self) -> Rev<Self> fn rev(self) -> Rev<Self>
where where
Self: Sized + DoubleEndedIterator, Self: Sized + DoubleEndedIterator,
@ -3381,7 +3327,6 @@ fn rev(self) -> Rev<Self>
/// assert_eq!(z, [3, 6]); /// assert_eq!(z, [3, 6]);
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB) fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where where
FromA: Default + Extend<A>, FromA: Default + Extend<A>,
@ -3412,7 +3357,6 @@ fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
/// assert_eq!(v_map, vec![1, 2, 3]); /// assert_eq!(v_map, vec![1, 2, 3]);
/// ``` /// ```
#[stable(feature = "iter_copied", since = "1.36.0")] #[stable(feature = "iter_copied", since = "1.36.0")]
#[rustc_do_not_const_check]
#[cfg_attr(not(test), rustc_diagnostic_item = "iter_copied")] #[cfg_attr(not(test), rustc_diagnostic_item = "iter_copied")]
fn copied<'a, T: 'a>(self) -> Copied<Self> fn copied<'a, T: 'a>(self) -> Copied<Self>
where where
@ -3461,7 +3405,6 @@ fn copied<'a, T: 'a>(self) -> Copied<Self>
/// assert_eq!(&[vec![23]], &faster[..]); /// assert_eq!(&[vec![23]], &faster[..]);
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
#[cfg_attr(not(test), rustc_diagnostic_item = "iter_cloned")] #[cfg_attr(not(test), rustc_diagnostic_item = "iter_cloned")]
fn cloned<'a, T: 'a>(self) -> Cloned<Self> fn cloned<'a, T: 'a>(self) -> Cloned<Self>
where where
@ -3495,7 +3438,6 @@ fn cloned<'a, T: 'a>(self) -> Cloned<Self>
/// ``` /// ```
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[inline] #[inline]
#[rustc_do_not_const_check]
fn cycle(self) -> Cycle<Self> fn cycle(self) -> Cycle<Self>
where where
Self: Sized + Clone, Self: Sized + Clone,
@ -3539,7 +3481,6 @@ fn cycle(self) -> Cycle<Self>
/// ``` /// ```
#[track_caller] #[track_caller]
#[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")] #[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")]
#[rustc_do_not_const_check]
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where where
Self: Sized, Self: Sized,
@ -3571,7 +3512,6 @@ fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
/// assert_eq!(sum, 6); /// assert_eq!(sum, 6);
/// ``` /// ```
#[stable(feature = "iter_arith", since = "1.11.0")] #[stable(feature = "iter_arith", since = "1.11.0")]
#[rustc_do_not_const_check]
fn sum<S>(self) -> S fn sum<S>(self) -> S
where where
Self: Sized, Self: Sized,
@ -3604,7 +3544,6 @@ fn sum<S>(self) -> S
/// assert_eq!(factorial(5), 120); /// assert_eq!(factorial(5), 120);
/// ``` /// ```
#[stable(feature = "iter_arith", since = "1.11.0")] #[stable(feature = "iter_arith", since = "1.11.0")]
#[rustc_do_not_const_check]
fn product<P>(self) -> P fn product<P>(self) -> P
where where
Self: Sized, Self: Sized,
@ -3626,7 +3565,6 @@ fn product<P>(self) -> P
/// assert_eq!([1, 2].iter().cmp([1].iter()), Ordering::Greater); /// assert_eq!([1, 2].iter().cmp([1].iter()), Ordering::Greater);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn cmp<I>(self, other: I) -> Ordering fn cmp<I>(self, other: I) -> Ordering
where where
I: IntoIterator<Item = Self::Item>, I: IntoIterator<Item = Self::Item>,
@ -3654,7 +3592,6 @@ fn cmp<I>(self, other: I) -> Ordering
/// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (2 * x).cmp(&y)), Ordering::Greater); /// assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (2 * x).cmp(&y)), Ordering::Greater);
/// ``` /// ```
#[unstable(feature = "iter_order_by", issue = "64295")] #[unstable(feature = "iter_order_by", issue = "64295")]
#[rustc_do_not_const_check]
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where where
Self: Sized, Self: Sized,
@ -3711,7 +3648,6 @@ fn compare<X, Y, F>(mut cmp: F) -> impl FnMut(X, Y) -> ControlFlow<Ordering>
/// ``` /// ```
/// ///
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn partial_cmp<I>(self, other: I) -> Option<Ordering> fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where where
I: IntoIterator, I: IntoIterator,
@ -3748,7 +3684,6 @@ fn partial_cmp<I>(self, other: I) -> Option<Ordering>
/// ); /// );
/// ``` /// ```
#[unstable(feature = "iter_order_by", issue = "64295")] #[unstable(feature = "iter_order_by", issue = "64295")]
#[rustc_do_not_const_check]
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering> fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where where
Self: Sized, Self: Sized,
@ -3782,7 +3717,6 @@ fn compare<X, Y, F>(mut partial_cmp: F) -> impl FnMut(X, Y) -> ControlFlow<Optio
/// assert_eq!([1].iter().eq([1, 2].iter()), false); /// assert_eq!([1].iter().eq([1, 2].iter()), false);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn eq<I>(self, other: I) -> bool fn eq<I>(self, other: I) -> bool
where where
I: IntoIterator, I: IntoIterator,
@ -3806,7 +3740,6 @@ fn eq<I>(self, other: I) -> bool
/// assert!(xs.iter().eq_by(&ys, |&x, &y| x * x == y)); /// assert!(xs.iter().eq_by(&ys, |&x, &y| x * x == y));
/// ``` /// ```
#[unstable(feature = "iter_order_by", issue = "64295")] #[unstable(feature = "iter_order_by", issue = "64295")]
#[rustc_do_not_const_check]
fn eq_by<I, F>(self, other: I, eq: F) -> bool fn eq_by<I, F>(self, other: I, eq: F) -> bool
where where
Self: Sized, Self: Sized,
@ -3839,7 +3772,6 @@ fn compare<X, Y, F>(mut eq: F) -> impl FnMut(X, Y) -> ControlFlow<()>
/// assert_eq!([1].iter().ne([1, 2].iter()), true); /// assert_eq!([1].iter().ne([1, 2].iter()), true);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn ne<I>(self, other: I) -> bool fn ne<I>(self, other: I) -> bool
where where
I: IntoIterator, I: IntoIterator,
@ -3861,7 +3793,6 @@ fn ne<I>(self, other: I) -> bool
/// assert_eq!([1, 2].iter().lt([1, 2].iter()), false); /// assert_eq!([1, 2].iter().lt([1, 2].iter()), false);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn lt<I>(self, other: I) -> bool fn lt<I>(self, other: I) -> bool
where where
I: IntoIterator, I: IntoIterator,
@ -3883,7 +3814,6 @@ fn lt<I>(self, other: I) -> bool
/// assert_eq!([1, 2].iter().le([1, 2].iter()), true); /// assert_eq!([1, 2].iter().le([1, 2].iter()), true);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn le<I>(self, other: I) -> bool fn le<I>(self, other: I) -> bool
where where
I: IntoIterator, I: IntoIterator,
@ -3905,7 +3835,6 @@ fn le<I>(self, other: I) -> bool
/// assert_eq!([1, 2].iter().gt([1, 2].iter()), false); /// assert_eq!([1, 2].iter().gt([1, 2].iter()), false);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn gt<I>(self, other: I) -> bool fn gt<I>(self, other: I) -> bool
where where
I: IntoIterator, I: IntoIterator,
@ -3927,7 +3856,6 @@ fn gt<I>(self, other: I) -> bool
/// assert_eq!([1, 2].iter().ge([1, 2].iter()), true); /// assert_eq!([1, 2].iter().ge([1, 2].iter()), true);
/// ``` /// ```
#[stable(feature = "iter_order", since = "1.5.0")] #[stable(feature = "iter_order", since = "1.5.0")]
#[rustc_do_not_const_check]
fn ge<I>(self, other: I) -> bool fn ge<I>(self, other: I) -> bool
where where
I: IntoIterator, I: IntoIterator,
@ -3957,7 +3885,6 @@ fn ge<I>(self, other: I) -> bool
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "is_sorted", since = "1.82.0")] #[stable(feature = "is_sorted", since = "1.82.0")]
#[rustc_do_not_const_check]
fn is_sorted(self) -> bool fn is_sorted(self) -> bool
where where
Self: Sized, Self: Sized,
@ -3984,7 +3911,6 @@ fn is_sorted(self) -> bool
/// assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| true)); /// assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| true));
/// ``` /// ```
#[stable(feature = "is_sorted", since = "1.82.0")] #[stable(feature = "is_sorted", since = "1.82.0")]
#[rustc_do_not_const_check]
fn is_sorted_by<F>(mut self, compare: F) -> bool fn is_sorted_by<F>(mut self, compare: F) -> bool
where where
Self: Sized, Self: Sized,
@ -4029,7 +3955,6 @@ fn check<'a, T>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "is_sorted", since = "1.82.0")] #[stable(feature = "is_sorted", since = "1.82.0")]
#[rustc_do_not_const_check]
fn is_sorted_by_key<F, K>(self, f: F) -> bool fn is_sorted_by_key<F, K>(self, f: F) -> bool
where where
Self: Sized, Self: Sized,
@ -4045,7 +3970,6 @@ fn is_sorted_by_key<F, K>(self, f: F) -> bool
#[inline] #[inline]
#[doc(hidden)] #[doc(hidden)]
#[unstable(feature = "trusted_random_access", issue = "none")] #[unstable(feature = "trusted_random_access", issue = "none")]
#[rustc_do_not_const_check]
unsafe fn __iterator_get_unchecked(&mut self, _idx: usize) -> Self::Item unsafe fn __iterator_get_unchecked(&mut self, _idx: usize) -> Self::Item
where where
Self: TrustedRandomAccessNoCoerce, Self: TrustedRandomAccessNoCoerce,

View File

@ -0,0 +1,13 @@
//@ check-pass
// Ensure that we can resolve a shorthand projection in an item bound in an RPITIT.
pub trait Bar {
type Foo;
}
pub trait Baz {
fn boom<X: Bar>() -> impl Bar<Foo = X::Foo>;
}
fn main() {}