diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 408da6d5d86d8..0b09e9fbb853a 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -578,7 +578,7 @@ declare_features! ( /// be used to describe E or vise-versa. (unstable, result_ffi_guarantees, "1.80.0", Some(110503)), /// Allows bounding the return type of AFIT/RPITIT. - (incomplete, return_type_notation, "1.70.0", Some(109417)), + (unstable, return_type_notation, "1.70.0", Some(109417)), /// Allows `extern "rust-cold"`. (unstable, rust_cold_cc, "1.63.0", Some(97544)), /// Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 17273f1f8fc66..71216023ecc33 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1668,10 +1668,17 @@ pub enum ArrayLen<'hir> { } impl ArrayLen<'_> { - pub fn hir_id(&self) -> HirId { + pub fn span(self) -> Span { + match self { + ArrayLen::Infer(arg) => arg.span, + ArrayLen::Body(body) => body.span(), + } + } + + pub fn hir_id(self) -> HirId { match self { - ArrayLen::Infer(InferArg { hir_id, .. }) | ArrayLen::Body(ConstArg { hir_id, .. }) => { - *hir_id + ArrayLen::Infer(InferArg { hir_id, .. }) | ArrayLen::Body(&ConstArg { hir_id, .. }) => { + hir_id } } } diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index e7efa32bdb094..015a728325094 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -1491,8 +1491,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { expr: &'tcx hir::Expr<'tcx>, ) -> Ty<'tcx> { let tcx = self.tcx; - let count = self.lower_array_length(count); - if let Some(count) = count.try_eval_target_usize(tcx, self.param_env) { + let count_span = count.span(); + let count = self.try_structurally_resolve_const(count_span, self.lower_array_length(count)); + + if let Some(count) = count.try_to_target_usize(tcx) { self.suggest_array_len(expr, count); } @@ -1520,19 +1522,24 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { return Ty::new_error(tcx, guar); } - self.check_repeat_element_needs_copy_bound(element, count, element_ty); + // If the length is 0, we don't create any elements, so we don't copy any. + // If the length is 1, we don't copy that one element, we move it. Only check + // for `Copy` if the length is larger, or unevaluated. + // FIXME(min_const_generic_exprs): We could perhaps defer this check so that + // we don't require `::CONST` doesn't unnecessarily require `Copy`. + if count.try_to_target_usize(tcx).is_none_or(|x| x > 1) { + self.enforce_repeat_element_needs_copy_bound(element, element_ty); + } let ty = Ty::new_array_with_const_len(tcx, t, count); - self.register_wf_obligation(ty.into(), expr.span, ObligationCauseCode::WellFormed(None)); - ty } - fn check_repeat_element_needs_copy_bound( + /// Requires that `element_ty` is `Copy` (unless it's a const expression itself). + fn enforce_repeat_element_needs_copy_bound( &self, element: &hir::Expr<'_>, - count: ty::Const<'tcx>, element_ty: Ty<'tcx>, ) { let tcx = self.tcx; @@ -1565,27 +1572,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { _ => traits::IsConstable::No, }; - // If the length is 0, we don't create any elements, so we don't copy any. If the length is 1, we - // don't copy that one element, we move it. Only check for Copy if the length is larger. - if count.try_eval_target_usize(tcx, self.param_env).is_none_or(|len| len > 1) { - let lang_item = self.tcx.require_lang_item(LangItem::Copy, None); - let code = traits::ObligationCauseCode::RepeatElementCopy { - is_constable, - elt_type: element_ty, - elt_span: element.span, - elt_stmt_span: self - .tcx - .hir() - .parent_iter(element.hir_id) - .find_map(|(_, node)| match node { - hir::Node::Item(it) => Some(it.span), - hir::Node::Stmt(stmt) => Some(stmt.span), - _ => None, - }) - .expect("array repeat expressions must be inside an item or statement"), - }; - self.require_type_meets(element_ty, element.span, code, lang_item); - } + let lang_item = self.tcx.require_lang_item(LangItem::Copy, None); + let code = traits::ObligationCauseCode::RepeatElementCopy { + is_constable, + elt_type: element_ty, + elt_span: element.span, + elt_stmt_span: self + .tcx + .hir() + .parent_iter(element.hir_id) + .find_map(|(_, node)| match node { + hir::Node::Item(it) => Some(it.span), + hir::Node::Stmt(stmt) => Some(stmt.span), + _ => None, + }) + .expect("array repeat expressions must be inside an item or statement"), + }; + self.require_type_meets(element_ty, element.span, code, lang_item); } fn check_expr_tuple( @@ -2800,9 +2803,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { len: ty::Const<'tcx>, ) { err.span_label(field.span, "unknown field"); - if let (Some(len), Ok(user_index)) = - (len.try_eval_target_usize(self.tcx, self.param_env), field.as_str().parse::()) - { + if let (Some(len), Ok(user_index)) = ( + self.try_structurally_resolve_const(base.span, len).try_to_target_usize(self.tcx), + field.as_str().parse::(), + ) { let help = "instead of using tuple indexing, use array indexing"; let applicability = if len < user_index { Applicability::MachineApplicable diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index 7cae6e08f81bb..2c469c0d52c4f 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -1470,6 +1470,33 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } + #[instrument(level = "debug", skip(self, sp), ret)] + pub fn try_structurally_resolve_const(&self, sp: Span, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { + // FIXME(min_const_generic_exprs): We could process obligations here if `ct` is a var. + + if self.next_trait_solver() + && let ty::ConstKind::Unevaluated(..) = ct.kind() + { + // We need to use a separate variable here as otherwise the temporary for + // `self.fulfillment_cx.borrow_mut()` is alive in the `Err` branch, resulting + // in a reentrant borrow, causing an ICE. + let result = self + .at(&self.misc(sp), self.param_env) + .structurally_normalize_const(ct, &mut **self.fulfillment_cx.borrow_mut()); + match result { + Ok(normalized_ct) => normalized_ct, + Err(errors) => { + let guar = self.err_ctxt().report_fulfillment_errors(errors); + return ty::Const::new_error(self.tcx, guar); + } + } + } else if self.tcx.features().generic_const_exprs { + ct.normalize(self.tcx, self.param_env) + } else { + ct + } + } + /// Resolves `ty` by a single level if `ty` is a type variable. /// /// When the new solver is enabled, this will also attempt to normalize diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs index b09bd476576d3..5f89f7dedc2cc 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs @@ -1502,7 +1502,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Create an dummy type `&[_]` so that both &[] and `&Vec` can coerce to it. let dummy_ty = if let ty::Array(elem_ty, size) = peeled.kind() && let ty::Infer(_) = elem_ty.kind() - && size.try_eval_target_usize(self.tcx, self.param_env) == Some(0) + && self + .try_structurally_resolve_const(provided_expr.span, *size) + .try_to_target_usize(self.tcx) + == Some(0) { let slice = Ty::new_slice(self.tcx, *elem_ty); Ty::new_imm_ref(self.tcx, self.tcx.lifetimes.re_static, slice) diff --git a/compiler/rustc_hir_typeck/src/intrinsicck.rs b/compiler/rustc_hir_typeck/src/intrinsicck.rs index 81d940a3f9b47..a4121adf628af 100644 --- a/compiler/rustc_hir_typeck/src/intrinsicck.rs +++ b/compiler/rustc_hir_typeck/src/intrinsicck.rs @@ -101,7 +101,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } Ok(SizeSkeleton::Generic(size)) => { - if let Some(size) = size.try_eval_target_usize(tcx, self.param_env) { + if let Some(size) = + self.try_structurally_resolve_const(span, size).try_to_target_usize(tcx) + { format!("{size} bytes") } else { format!("generic size {size}") diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs index 805fb39480c17..feb47209f5e7b 100644 --- a/compiler/rustc_hir_typeck/src/method/suggest.rs +++ b/compiler/rustc_hir_typeck/src/method/suggest.rs @@ -1721,20 +1721,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - if item_name.name == sym::as_str && rcvr_ty.peel_refs().is_str() { - let msg = "remove this method call"; - let mut fallback_span = true; - if let SelfSource::MethodCall(expr) = source { - let call_expr = self.tcx.hir().expect_expr(self.tcx.parent_hir_id(expr.hir_id)); - if let Some(span) = call_expr.span.trim_start(expr.span) { - err.span_suggestion(span, msg, "", Applicability::MachineApplicable); - fallback_span = false; - } - } - if fallback_span { - err.span_label(span, msg); - } - } else if let Some(similar_candidate) = similar_candidate { + if let Some(similar_candidate) = similar_candidate { // Don't emit a suggestion if we found an actual method // that had unsatisfied trait bounds if unsatisfied_predicates.is_empty() diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index 51964b8e753f3..49c5a7d8a652d 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -2412,7 +2412,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { len: ty::Const<'tcx>, min_len: u64, ) -> (Option>, Ty<'tcx>) { - let len = len.try_eval_target_usize(self.tcx, self.param_env); + let len = self.try_structurally_resolve_const(span, len).try_to_target_usize(self.tcx); let guar = if let Some(len) = len { // Now we know the length... diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs index 5c92791a02903..ffedee8a1e816 100644 --- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs @@ -57,7 +57,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { this.in_scope(region_scope, lint_level, |this| this.as_rvalue(block, scope, value)) } ExprKind::Repeat { value, count } => { - if Some(0) == count.try_eval_target_usize(this.tcx, this.param_env) { + if Some(0) == count.try_to_target_usize(this.tcx) { this.build_zero_repeat(block, value, scope, source_info) } else { let value_operand = unpack!( diff --git a/compiler/rustc_mir_build/src/build/matches/match_pair.rs b/compiler/rustc_mir_build/src/build/matches/match_pair.rs index 25151f78c5738..6df50057ee83a 100644 --- a/compiler/rustc_mir_build/src/build/matches/match_pair.rs +++ b/compiler/rustc_mir_build/src/build/matches/match_pair.rs @@ -42,7 +42,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let tcx = self.tcx; let (min_length, exact_size) = if let Some(place_resolved) = place.try_to_place(self) { match place_resolved.ty(&self.local_decls, tcx).ty.kind() { - ty::Array(_, length) => (length.eval_target_usize(tcx, self.param_env), true), + ty::Array(_, length) => ( + length + .try_to_target_usize(tcx) + .expect("expected len of array pat to be definite"), + true, + ), _ => ((prefix.len() + suffix.len()).try_into().unwrap(), false), } } else { diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs index d78e1f5da09f0..04e921ecc2e05 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs @@ -441,7 +441,9 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> { ty::Slice(..) => PatKind::Slice { prefix, slice, suffix }, // Fixed-length array, `[T; len]`. ty::Array(_, len) => { - let len = len.eval_target_usize(self.tcx, self.param_env); + let len = len + .try_to_target_usize(self.tcx) + .expect("expected len of array pat to be definite"); assert!(len >= prefix.len() as u64 + suffix.len() as u64); PatKind::Array { prefix, slice, suffix } } diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index d164b8ab832dd..72737fb98cbf7 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -352,7 +352,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { ty::Array(sub_ty, len) => { // We treat arrays of a constant but unknown length like slices. ConstructorSet::Slice { - array_len: len.try_eval_target_usize(cx.tcx, cx.param_env).map(|l| l as usize), + array_len: len.try_to_target_usize(cx.tcx).map(|l| l as usize), subtype_is_empty: cx.is_uninhabited(*sub_ty), } } @@ -685,9 +685,12 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { } PatKind::Array { prefix, slice, suffix } | PatKind::Slice { prefix, slice, suffix } => { let array_len = match ty.kind() { - ty::Array(_, length) => { - Some(length.eval_target_usize(cx.tcx, cx.param_env) as usize) - } + ty::Array(_, length) => Some( + length + .try_to_target_usize(cx.tcx) + .expect("expected len of array pat to be definite") + as usize, + ), ty::Slice(_) => None, _ => span_bug!(pat.span, "bad ty {} for slice pattern", ty.inner()), }; diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index 79de9bbb351f2..f3da7ff1ca7b0 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -607,45 +607,40 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { let _ = write!(self.out, "{bits:x}_"); } + // Handle `str` as partial support for unsized constants + ty::Str => { + let tcx = self.tcx(); + // HACK(jaic1): hide the `str` type behind a reference + // for the following transformation from valtree to raw bytes + let ref_ty = Ty::new_imm_ref(tcx, tcx.lifetimes.re_static, ct_ty); + let slice = valtree.try_to_raw_bytes(tcx, ref_ty).unwrap_or_else(|| { + bug!("expected to get raw bytes from valtree {:?} for type {:}", valtree, ct_ty) + }); + let s = std::str::from_utf8(slice).expect("non utf8 str from MIR interpreter"); + + // "e" for str as a basic type + self.push("e"); + + // FIXME(eddyb) use a specialized hex-encoding loop. + for byte in s.bytes() { + let _ = write!(self.out, "{byte:02x}"); + } + + self.push("_"); + } + // FIXME(valtrees): Remove the special case for `str` // here and fully support unsized constants. - ty::Ref(_, inner_ty, mutbl) => { + ty::Ref(_, _, mutbl) => { self.push(match mutbl { hir::Mutability::Not => "R", hir::Mutability::Mut => "Q", }); - match inner_ty.kind() { - ty::Str if mutbl.is_not() => { - let slice = - valtree.try_to_raw_bytes(self.tcx(), ct_ty).unwrap_or_else(|| { - bug!( - "expected to get raw bytes from valtree {:?} for type {:}", - valtree, - ct_ty - ) - }); - let s = - std::str::from_utf8(slice).expect("non utf8 str from MIR interpreter"); - - self.push("e"); - - // FIXME(eddyb) use a specialized hex-encoding loop. - for byte in s.bytes() { - let _ = write!(self.out, "{byte:02x}"); - } - - self.push("_"); - } - _ => { - let pointee_ty = ct_ty - .builtin_deref(true) - .expect("tried to dereference on non-ptr type"); - let dereferenced_const = - ty::Const::new_value(self.tcx, valtree, pointee_ty); - dereferenced_const.print(self)?; - } - } + let pointee_ty = + ct_ty.builtin_deref(true).expect("tried to dereference on non-ptr type"); + let dereferenced_const = ty::Const::new_value(self.tcx, valtree, pointee_ty); + dereferenced_const.print(self)?; } ty::Array(..) | ty::Tuple(..) | ty::Adt(..) | ty::Slice(_) => { diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index f9aab33d532e2..19e2679ae4da7 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -17,7 +17,7 @@ use rustc_middle::traits::SignatureMismatchData; use rustc_middle::traits::select::OverflowError; use rustc_middle::ty::abstract_const::NotConstEvaluatable; use rustc_middle::ty::error::{ExpectedFound, TypeError}; -use rustc_middle::ty::fold::{BottomUpFolder, TypeFolder, TypeSuperFoldable}; +use rustc_middle::ty::fold::{TypeFolder, TypeSuperFoldable}; use rustc_middle::ty::print::{ FmtPrinter, Print, PrintTraitPredicateExt as _, PrintTraitRefExt as _, with_forced_trimmed_paths, @@ -1788,22 +1788,18 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { return false; } - let cand = self.resolve_vars_if_possible(impl_trait_ref).fold_with( - &mut BottomUpFolder { - tcx: self.tcx, - ty_op: |ty| ty, - lt_op: |lt| lt, - ct_op: |ct| ct.normalize(self.tcx, ty::ParamEnv::empty()), - }, - ); - if cand.references_error() { + let impl_trait_ref = self.resolve_vars_if_possible(impl_trait_ref); + if impl_trait_ref.references_error() { return false; } err.highlighted_help(vec![ - StringPart::normal(format!("the trait `{}` ", cand.print_trait_sugared())), + StringPart::normal(format!( + "the trait `{}` ", + impl_trait_ref.print_trait_sugared() + )), StringPart::highlighted("is"), StringPart::normal(" implemented for `"), - StringPart::highlighted(cand.self_ty().to_string()), + StringPart::highlighted(impl_trait_ref.self_ty().to_string()), StringPart::normal("`"), ]); @@ -1915,15 +1911,18 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { let mut impl_candidates: Vec<_> = impl_candidates .iter() .cloned() + .filter(|cand| !cand.trait_ref.references_error()) .map(|mut cand| { - // Fold the consts so that they shows up as, e.g., `10` - // instead of `core::::array::{impl#30}::{constant#0}`. - cand.trait_ref = cand.trait_ref.fold_with(&mut BottomUpFolder { - tcx: self.tcx, - ty_op: |ty| ty, - lt_op: |lt| lt, - ct_op: |ct| ct.normalize(self.tcx, ty::ParamEnv::empty()), - }); + // Normalize the trait ref in its *own* param-env so + // that consts are folded and any trivial projections + // are normalized. + cand.trait_ref = self + .tcx + .try_normalize_erasing_regions( + self.tcx.param_env(cand.impl_def_id), + cand.trait_ref, + ) + .unwrap_or(cand.trait_ref); cand }) .collect(); diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index 9639d9d319cf4..6df7fac949c2f 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -4620,7 +4620,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { format!("&{}{ty}", mutability.prefix_str()) } } - ty::Array(ty, len) if let Some(len) = len.try_eval_target_usize(tcx, param_env) => { + ty::Array(ty, len) if let Some(len) = len.try_to_target_usize(tcx) => { if len == 0 { "[]".to_string() } else if self.type_is_copy_modulo_regions(param_env, ty) || len == 1 { diff --git a/compiler/rustc_trait_selection/src/traits/structural_normalize.rs b/compiler/rustc_trait_selection/src/traits/structural_normalize.rs index 9d657ade86bfe..3814f8112e92e 100644 --- a/compiler/rustc_trait_selection/src/traits/structural_normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/structural_normalize.rs @@ -46,4 +46,44 @@ impl<'tcx> At<'_, 'tcx> { Ok(self.normalize(ty).into_value_registering_obligations(self.infcx, fulfill_cx)) } } + + fn structurally_normalize_const( + &self, + ct: ty::Const<'tcx>, + fulfill_cx: &mut dyn TraitEngine<'tcx, E>, + ) -> Result, Vec> { + assert!(!ct.is_ct_infer(), "should have resolved vars before calling"); + + if self.infcx.next_trait_solver() { + let ty::ConstKind::Unevaluated(..) = ct.kind() else { + return Ok(ct); + }; + + let new_infer_ct = self.infcx.next_const_var(self.cause.span); + + // We simply emit an `alias-eq` goal here, since that will take care of + // normalizing the LHS of the projection until it is a rigid projection + // (or a not-yet-defined opaque in scope). + let obligation = Obligation::new( + self.infcx.tcx, + self.cause.clone(), + self.param_env, + ty::PredicateKind::AliasRelate( + ct.into(), + new_infer_ct.into(), + ty::AliasRelationDirection::Equate, + ), + ); + + fulfill_cx.register_predicate_obligation(self.infcx, obligation); + let errors = fulfill_cx.select_where_possible(self.infcx); + if !errors.is_empty() { + return Err(errors); + } + + Ok(self.infcx.resolve_vars_if_possible(new_infer_ct)) + } else { + Ok(self.normalize(ct).into_value_registering_obligations(self.infcx, fulfill_cx)) + } + } } diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index f0597f295b3f0..ff5ddd16e07e3 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -93,6 +93,7 @@ // tidy-alphabetical-start #![cfg_attr(not(no_global_oom_handling), feature(const_alloc_error))] #![cfg_attr(not(no_global_oom_handling), feature(const_btree_len))] +#![cfg_attr(test, feature(str_as_str))] #![feature(alloc_layout_extra)] #![feature(allocator_api)] #![feature(array_chunks)] diff --git a/library/alloc/src/rc/tests.rs b/library/alloc/src/rc/tests.rs index 84e8b325f71fc..333e1bde31c1e 100644 --- a/library/alloc/src/rc/tests.rs +++ b/library/alloc/src/rc/tests.rs @@ -448,7 +448,11 @@ fn test_from_box_str() { use std::string::String; let s = String::from("foo").into_boxed_str(); + assert_eq!((&&&s).as_str(), "foo"); + let r: Rc = Rc::from(s); + assert_eq!((&r).as_str(), "foo"); + assert_eq!(r.as_str(), "foo"); assert_eq!(&r[..], "foo"); } diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs index 7d64b382501bb..3dcaab6a12beb 100644 --- a/library/core/src/char/methods.rs +++ b/library/core/src/char/methods.rs @@ -638,8 +638,7 @@ impl char { #[rustc_const_stable(feature = "const_char_len_utf", since = "1.52.0")] #[inline] pub const fn len_utf16(self) -> usize { - let ch = self as u32; - if (ch & 0xFFFF) == ch { 1 } else { 2 } + len_utf16(self as u32) } /// Encodes this character as UTF-8 into the provided byte buffer, @@ -709,8 +708,9 @@ impl char { /// '𝕊'.encode_utf16(&mut b); /// ``` #[stable(feature = "unicode_encode_char", since = "1.15.0")] + #[rustc_const_unstable(feature = "const_char_encode_utf16", issue = "130660")] #[inline] - pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] { + pub const fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] { encode_utf16_raw(self as u32, dst) } @@ -1279,7 +1279,7 @@ impl char { /// /// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] - #[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")] + #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] #[inline] pub const fn make_ascii_uppercase(&mut self) { *self = self.to_ascii_uppercase(); @@ -1305,7 +1305,7 @@ impl char { /// /// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] - #[rustc_const_unstable(feature = "const_char_make_ascii", issue = "130698")] + #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] #[inline] pub const fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); @@ -1747,7 +1747,12 @@ const fn len_utf8(code: u32) -> usize { } } -/// Encodes a raw u32 value as UTF-8 into the provided byte buffer, +#[inline] +const fn len_utf16(code: u32) -> usize { + if (code & 0xFFFF) == code { 1 } else { 2 } +} + +/// Encodes a raw `u32` value as UTF-8 into the provided byte buffer, /// and then returns the subslice of the buffer that contains the encoded character. /// /// Unlike `char::encode_utf8`, this method also handles codepoints in the surrogate range. @@ -1801,7 +1806,7 @@ pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] { unsafe { slice::from_raw_parts_mut(dst.as_mut_ptr(), len) } } -/// Encodes a raw u32 value as UTF-16 into the provided `u16` buffer, +/// Encodes a raw `u32` value as UTF-16 into the provided `u16` buffer, /// and then returns the subslice of the buffer that contains the encoded character. /// /// Unlike `char::encode_utf16`, this method also handles codepoints in the surrogate range. @@ -1812,28 +1817,33 @@ pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] { /// Panics if the buffer is not large enough. /// A buffer of length 2 is large enough to encode any `char`. #[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")] +#[rustc_const_unstable(feature = "const_char_encode_utf16", issue = "130660")] #[doc(hidden)] #[inline] -pub fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] { - // SAFETY: each arm checks whether there are enough bits to write into - unsafe { - if (code & 0xFFFF) == code && !dst.is_empty() { - // The BMP falls through - *dst.get_unchecked_mut(0) = code as u16; - slice::from_raw_parts_mut(dst.as_mut_ptr(), 1) - } else if dst.len() >= 2 { - // Supplementary planes break into surrogates. +pub const fn encode_utf16_raw(mut code: u32, dst: &mut [u16]) -> &mut [u16] { + const fn panic_at_const(_code: u32, _len: usize, _dst_len: usize) { + // Note that we cannot format in constant expressions. + panic!("encode_utf16: buffer does not have enough bytes to encode code point"); + } + fn panic_at_rt(code: u32, len: usize, dst_len: usize) { + panic!( + "encode_utf16: need {len} bytes to encode U+{code:04X} but buffer has just {dst_len}", + ); + } + let len = len_utf16(code); + match (len, &mut *dst) { + (1, [a, ..]) => { + *a = code as u16; + } + (2, [a, b, ..]) => { code -= 0x1_0000; - *dst.get_unchecked_mut(0) = 0xD800 | ((code >> 10) as u16); - *dst.get_unchecked_mut(1) = 0xDC00 | ((code as u16) & 0x3FF); - slice::from_raw_parts_mut(dst.as_mut_ptr(), 2) - } else { - panic!( - "encode_utf16: need {} units to encode U+{:X}, but the buffer has {}", - char::from_u32_unchecked(code).len_utf16(), - code, - dst.len(), - ) + + *a = (code >> 10) as u16 | 0xD800; + *b = (code & 0x3FF) as u16 | 0xDC00; } - } + // FIXME(const-hack): We would prefer to have streamlined panics when formatters become const-friendly. + _ => const_eval_select((code, len, dst.len()), panic_at_const, panic_at_rt), + }; + // SAFETY: `<&mut [u16]>::as_mut_ptr` is guaranteed to return a valid pointer and `len` has been tested to be within bounds. + unsafe { slice::from_raw_parts_mut(dst.as_mut_ptr(), len) } } diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 8826bf52b412f..a30b57c19d402 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -119,6 +119,7 @@ #![feature(const_bigint_helper_methods)] #![feature(const_black_box)] #![feature(const_cell_into_inner)] +#![feature(const_char_encode_utf16)] #![feature(const_char_encode_utf8)] #![feature(const_eval_select)] #![feature(const_exact_div)] diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index 19f5b79d26149..31e35015d2de1 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -624,8 +624,9 @@ impl u8 { /// /// [`to_ascii_uppercase`]: Self::to_ascii_uppercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] + #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] #[inline] - pub fn make_ascii_uppercase(&mut self) { + pub const fn make_ascii_uppercase(&mut self) { *self = self.to_ascii_uppercase(); } @@ -649,8 +650,9 @@ impl u8 { /// /// [`to_ascii_lowercase`]: Self::to_ascii_lowercase #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] + #[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] #[inline] - pub fn make_ascii_lowercase(&mut self) { + pub const fn make_ascii_lowercase(&mut self) { *self = self.to_ascii_lowercase(); } diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 712bf011c273e..300dde3dd4396 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -2740,6 +2740,17 @@ impl str { pub fn substr_range(&self, substr: &str) -> Option> { self.as_bytes().subslice_range(substr.as_bytes()) } + + /// Returns the same string as a string slice `&str`. + /// + /// This method is redundant when used directly on `&str`, but + /// it helps dereferencing other string-like types to string slices, + /// for example references to `Box` or `Arc`. + #[inline] + #[unstable(feature = "str_as_str", issue = "130366")] + pub fn as_str(&self) -> &str { + self + } } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/std/tests/thread.rs b/library/std/tests/thread.rs index 79a981d0b0d18..fc9917178b244 100644 --- a/library/std/tests/thread.rs +++ b/library/std/tests/thread.rs @@ -37,3 +37,21 @@ fn thread_local_containing_const_statements() { assert_eq!(CELL.get(), 1); assert_eq!(REFCELL.take(), 1); } + +#[test] +// Include an ignore list on purpose, so that new platforms don't miss it +#[cfg_attr( + any( + target_os = "redox", + target_os = "l4re", + target_env = "sgx", + target_os = "solid_asp3", + target_os = "teeos", + target_os = "wasi" + ), + should_panic +)] +fn available_parallelism() { + // check that std::thread::available_parallelism() returns a valid value + assert!(thread::available_parallelism().is_ok()); +} diff --git a/tests/codegen/issues/issue-111508-vec-tryinto-array.rs b/tests/codegen/issues/issue-111508-vec-tryinto-array.rs deleted file mode 100644 index 6415724b40ad5..0000000000000 --- a/tests/codegen/issues/issue-111508-vec-tryinto-array.rs +++ /dev/null @@ -1,22 +0,0 @@ -//@ compile-flags: -O -// This regress since Rust version 1.72. -//@ min-llvm-version: 18.1.4 - -#![crate_type = "lib"] - -use std::convert::TryInto; - -const N: usize = 24; - -// CHECK-LABEL: @example -// CHECK-NOT: unwrap_failed -#[no_mangle] -pub fn example(a: Vec) -> u8 { - if a.len() != 32 { - return 0; - } - - let a: [u8; 32] = a.try_into().unwrap(); - - a[15] + a[N] -} diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs index af64901ace022..f00aaec1a8c2c 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs @@ -1,7 +1,6 @@ //@ edition: 2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { async fn method() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr index 6808147008756..c6b9f3eff90ec 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr @@ -1,66 +1,57 @@ error[E0575]: expected associated type, found associated function `Trait::method` - --> $DIR/bad-inputs-and-output.rs:28:36 + --> $DIR/bad-inputs-and-output.rs:27:36 | LL | fn foo_qualified() where ::method(i32): Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type error[E0575]: expected associated type, found associated function `Trait::method` - --> $DIR/bad-inputs-and-output.rs:31:36 + --> $DIR/bad-inputs-and-output.rs:30:36 | LL | fn bar_qualified() where ::method() -> (): Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type error[E0575]: expected associated type, found associated function `Trait::method` - --> $DIR/bad-inputs-and-output.rs:34:36 + --> $DIR/bad-inputs-and-output.rs:33:36 | LL | fn baz_qualified() where ::method(): Send {} | ^^^^^^^^^^^^^^^^^^^^^^ not a associated type -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/bad-inputs-and-output.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: argument types not allowed with return type notation - --> $DIR/bad-inputs-and-output.rs:10:23 + --> $DIR/bad-inputs-and-output.rs:9:23 | LL | fn foo>() {} | ^^^^^ help: remove the input types: `()` error: return type not allowed with return type notation - --> $DIR/bad-inputs-and-output.rs:13:25 + --> $DIR/bad-inputs-and-output.rs:12:25 | LL | fn bar (): Send>>() {} | ^^^^^^ help: remove the return type error: return type notation arguments must be elided with `..` - --> $DIR/bad-inputs-and-output.rs:16:23 + --> $DIR/bad-inputs-and-output.rs:15:23 | LL | fn baz>() {} | ^^ help: add `..`: `(..)` error: argument types not allowed with return type notation - --> $DIR/bad-inputs-and-output.rs:19:40 + --> $DIR/bad-inputs-and-output.rs:18:40 | LL | fn foo_path() where T::method(i32): Send {} | ^^^^^ help: remove the input types: `()` error: return type not allowed with return type notation - --> $DIR/bad-inputs-and-output.rs:22:42 + --> $DIR/bad-inputs-and-output.rs:21:42 | LL | fn bar_path() where T::method() -> (): Send {} | ^^^^^^ help: remove the return type error: return type notation arguments must be elided with `..` - --> $DIR/bad-inputs-and-output.rs:25:40 + --> $DIR/bad-inputs-and-output.rs:24:40 | LL | fn baz_path() where T::method(): Send {} | ^^ help: add `..`: `(..)` -error: aborting due to 9 previous errors; 1 warning emitted +error: aborting due to 9 previous errors For more information about this error, try `rustc --explain E0575`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/bare-path.rs b/tests/ui/associated-type-bounds/return-type-notation/bare-path.rs index 185c05236332b..2bbeb62b922cb 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bare-path.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/bare-path.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Tr { const CONST: usize; diff --git a/tests/ui/associated-type-bounds/return-type-notation/bare-path.stderr b/tests/ui/associated-type-bounds/return-type-notation/bare-path.stderr index dca2bdeab0a7d..913f84b924c28 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bare-path.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/bare-path.stderr @@ -1,23 +1,14 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/bare-path.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation not allowed in this position yet - --> $DIR/bare-path.rs:15:23 + --> $DIR/bare-path.rs:14:23 | LL | let _ = T::CONST::(..); | ^^^^ error: return type notation not allowed in this position yet - --> $DIR/bare-path.rs:17:12 + --> $DIR/bare-path.rs:16:12 | LL | let _: T::method(..); | ^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.rs b/tests/ui/associated-type-bounds/return-type-notation/basic.rs index be489a19a7ad2..cb5872dff444c 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/basic.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/basic.rs @@ -3,7 +3,6 @@ //@ [with] check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { async fn method() -> Result<(), ()>; diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr deleted file mode 100644 index 9d4bb356caa8b..0000000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/basic.with.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/basic.rs:5:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr b/tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr index e9fd8503296e9..110d2a0058310 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr @@ -1,29 +1,20 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/basic.rs:5:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: future cannot be sent between threads safely - --> $DIR/basic.rs:23:13 + --> $DIR/basic.rs:22:13 | LL | is_send(foo::()); | ^^^^^^^^^^ future returned by `foo` is not `Send` | = help: within `impl Future>`, the trait `Send` is not implemented for `impl Future> { ::method(..) }`, which is required by `impl Future>: Send` note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/basic.rs:13:5 + --> $DIR/basic.rs:12:5 | LL | T::method().await?; | ^^^^^^^^^^^ await occurs here on type `impl Future> { ::method(..) }`, which is not `Send` note: required by a bound in `is_send` - --> $DIR/basic.rs:17:20 + --> $DIR/basic.rs:16:20 | LL | fn is_send(_: impl Send) {} | ^^^^ required by this bound in `is_send` -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/return-type-notation/display.rs b/tests/ui/associated-type-bounds/return-type-notation/display.rs index c5be2ca00ea1c..2d613b71c55d2 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/display.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/display.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait {} fn needs_trait(_: impl Trait) {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/display.stderr b/tests/ui/associated-type-bounds/return-type-notation/display.stderr index 4915ec1aa8315..b895d79695272 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/display.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/display.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/display.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0277]: the trait bound `impl Sized { ::method(..) }: Trait` is not satisfied - --> $DIR/display.rs:15:17 + --> $DIR/display.rs:14:17 | LL | needs_trait(T::method()); | ----------- ^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized { ::method(..) }` @@ -16,13 +7,13 @@ LL | needs_trait(T::method()); | required by a bound introduced by this call | note: required by a bound in `needs_trait` - --> $DIR/display.rs:5:24 + --> $DIR/display.rs:4:24 | LL | fn needs_trait(_: impl Trait) {} | ^^^^^ required by this bound in `needs_trait` error[E0277]: the trait bound `impl Sized { ::method_with_lt(..) }: Trait` is not satisfied - --> $DIR/display.rs:17:17 + --> $DIR/display.rs:16:17 | LL | needs_trait(T::method_with_lt()); | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized { ::method_with_lt(..) }` @@ -30,13 +21,13 @@ LL | needs_trait(T::method_with_lt()); | required by a bound introduced by this call | note: required by a bound in `needs_trait` - --> $DIR/display.rs:5:24 + --> $DIR/display.rs:4:24 | LL | fn needs_trait(_: impl Trait) {} | ^^^^^ required by this bound in `needs_trait` error[E0277]: the trait bound `impl Sized: Trait` is not satisfied - --> $DIR/display.rs:19:17 + --> $DIR/display.rs:18:17 | LL | needs_trait(T::method_with_ty()); | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized` @@ -44,18 +35,18 @@ LL | needs_trait(T::method_with_ty()); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/display.rs:4:1 + --> $DIR/display.rs:3:1 | LL | trait Trait {} | ^^^^^^^^^^^ note: required by a bound in `needs_trait` - --> $DIR/display.rs:5:24 + --> $DIR/display.rs:4:24 | LL | fn needs_trait(_: impl Trait) {} | ^^^^^ required by this bound in `needs_trait` error[E0277]: the trait bound `impl Sized: Trait` is not satisfied - --> $DIR/display.rs:21:17 + --> $DIR/display.rs:20:17 | LL | needs_trait(T::method_with_ct()); | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized` @@ -63,16 +54,16 @@ LL | needs_trait(T::method_with_ct()); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/display.rs:4:1 + --> $DIR/display.rs:3:1 | LL | trait Trait {} | ^^^^^^^^^^^ note: required by a bound in `needs_trait` - --> $DIR/display.rs:5:24 + --> $DIR/display.rs:4:24 | LL | fn needs_trait(_: impl Trait) {} | ^^^^^ required by this bound in `needs_trait` -error: aborting due to 4 previous errors; 1 warning emitted +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/equality.rs b/tests/ui/associated-type-bounds/return-type-notation/equality.rs index 95c16fa1e3f84..cff0df58b7496 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/equality.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/equality.rs @@ -1,7 +1,6 @@ //@ edition: 2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete use std::future::Future; diff --git a/tests/ui/associated-type-bounds/return-type-notation/equality.stderr b/tests/ui/associated-type-bounds/return-type-notation/equality.stderr index d76b1bd1c0510..870f17ee70d2e 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/equality.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/equality.stderr @@ -1,17 +1,8 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/equality.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation is not allowed to use type equality - --> $DIR/equality.rs:12:18 + --> $DIR/equality.rs:11:18 | LL | fn test>>>() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs b/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs index d4f21f47c6c64..c6ae6690c72f5 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait<'a> { fn late<'b>(&'b self, _: &'a ()) -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.stderr b/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.stderr deleted file mode 100644 index c67231c07f723..0000000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/higher-ranked-bound-works.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/higher-ranked-bound-works.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.rs b/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.rs index 4d026b7d1d859..69d0b4b1f8ac4 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.rs @@ -1,7 +1,6 @@ //@ edition: 2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait HealthCheck { async fn check() -> bool; diff --git a/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.stderr b/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.stderr index 12f32a75eda32..2abf47f002672 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-120208-higher-ranked-const.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation is not allowed for functions that have const parameters - --> $DIR/issue-120208-higher-ranked-const.rs:12:21 + --> $DIR/issue-120208-higher-ranked-const.rs:11:21 | LL | async fn check() -> bool; | -------------- const parameter declared here @@ -16,5 +7,5 @@ LL | async fn check() -> bool; LL | HC: HealthCheck + Send + 'static, | ^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error diff --git a/tests/ui/associated-type-bounds/return-type-notation/missing.rs b/tests/ui/associated-type-bounds/return-type-notation/missing.rs index 3a04a56339ba5..e116ae0ca3bb4 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/missing.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/missing.rs @@ -1,7 +1,6 @@ //@ edition: 2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { async fn method() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/missing.stderr b/tests/ui/associated-type-bounds/return-type-notation/missing.stderr index 5cb8e2642f51c..0eb965603439c 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/missing.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/missing.stderr @@ -1,18 +1,9 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/missing.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0220]: associated function `methid` not found for `Trait` - --> $DIR/missing.rs:10:17 + --> $DIR/missing.rs:9:17 | LL | fn bar>() {} | ^^^^^^ help: there is an associated function with a similar name: `method` -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0220`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.rs b/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.rs index 9bdc2d00233e0..8dfc2376fbd4e 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.rs @@ -2,7 +2,6 @@ #![allow(non_camel_case_types)] #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { type test; diff --git a/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.stderr b/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.stderr deleted file mode 100644 index f4ece074b2856..0000000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/namespace-conflict.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/namespace-conflict.rs:4:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs index 35d6dd799c703..0e9dd90095286 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { fn method() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr index e308c927bf0e8..4d3dac2d168f7 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/non-rpitit.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/non-rpitit.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation used on function that is not `async` and does not return `impl Trait` - --> $DIR/non-rpitit.rs:8:19 + --> $DIR/non-rpitit.rs:7:19 | LL | fn method() {} | ----------- this function must be `async` or return `impl Trait` @@ -19,7 +10,7 @@ LL | fn bound>() {} = note: function returns `()`, which is not compatible with associated type return bounds error: return type notation used on function that is not `async` and does not return `impl Trait` - --> $DIR/non-rpitit.rs:11:30 + --> $DIR/non-rpitit.rs:10:30 | LL | fn method() {} | ----------- this function must be `async` or return `impl Trait` @@ -29,5 +20,5 @@ LL | fn path() where T: Trait, T::method(..): Send {} | = note: function returns `()`, which is not compatible with associated type return bounds -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/associated-type-bounds/return-type-notation/not-a-method.rs b/tests/ui/associated-type-bounds/return-type-notation/not-a-method.rs index d94ec6b74d9d2..89a414a3bc863 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/not-a-method.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/not-a-method.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete fn function() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/not-a-method.stderr b/tests/ui/associated-type-bounds/return-type-notation/not-a-method.stderr index 8add2d4629675..ab987ee48e6c8 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/not-a-method.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/not-a-method.stderr @@ -1,49 +1,40 @@ error[E0575]: expected function, found function `function` - --> $DIR/not-a-method.rs:8:5 + --> $DIR/not-a-method.rs:7:5 | LL | function(..): Send, | ^^^^^^^^^^^^ not a function error[E0573]: expected type, found function `function` - --> $DIR/not-a-method.rs:16:5 + --> $DIR/not-a-method.rs:15:5 | LL | function(): Send, | ^^^^^^^^^^ not a type error[E0576]: cannot find function `method` in this scope - --> $DIR/not-a-method.rs:28:5 + --> $DIR/not-a-method.rs:27:5 | LL | method(..): Send, | ^^^^^^ not found in this scope error[E0412]: cannot find type `method` in this scope - --> $DIR/not-a-method.rs:37:5 + --> $DIR/not-a-method.rs:36:5 | LL | method(): Send, | ^^^^^^ not found in this scope -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/not-a-method.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation not allowed in this position yet - --> $DIR/not-a-method.rs:8:5 + --> $DIR/not-a-method.rs:7:5 | LL | function(..): Send, | ^^^^^^^^^^^^ error: return type notation not allowed in this position yet - --> $DIR/not-a-method.rs:28:5 + --> $DIR/not-a-method.rs:27:5 | LL | method(..): Send, | ^^^^^^^^^^ -error: aborting due to 6 previous errors; 1 warning emitted +error: aborting due to 6 previous errors Some errors have detailed explanations: E0412, E0573, E0575, E0576. For more information about an error, try `rustc --explain E0412`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.rs b/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.rs index cb42c33e364da..f9aba1754653a 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait A { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.stderr index e841049ac66bd..80705424035ce 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-ambiguous.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-ambiguous.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0221]: ambiguous associated function `method` in bounds of `T` - --> $DIR/path-ambiguous.rs:13:5 + --> $DIR/path-ambiguous.rs:12:5 | LL | fn method() -> impl Sized; | -------------------------- ambiguous `method` from `A` @@ -29,7 +20,7 @@ LL | ::method(..): Send, | ~~~~~~~~~~ error[E0221]: ambiguous associated function `method` in bounds of `T` - --> $DIR/path-ambiguous.rs:22:5 + --> $DIR/path-ambiguous.rs:21:5 | LL | fn method() -> impl Sized; | -------------------------- ambiguous `method` from `A` @@ -49,6 +40,6 @@ help: use fully-qualified syntax to disambiguate LL | ::method(..): Send, | ~~~~~~~~~~ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0221`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.rs b/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.rs index 56abd167fb6b7..d8bdec0910752 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.stderr deleted file mode 100644 index 3db033d8cf5ed..0000000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/path-constrained-in-method.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-constrained-in-method.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.rs b/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.rs index a4d8f00537105..8591357dd9eaa 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait A<'a> { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.stderr index 22de6165503a1..2a9a1a1e8994c 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-higher-ranked.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-higher-ranked.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0212]: cannot use the associated function of a trait with uninferred generic parameters - --> $DIR/path-higher-ranked.rs:12:5 + --> $DIR/path-higher-ranked.rs:11:5 | LL | T::method(..): Send, | ^^^^^^^^^^^^^ @@ -19,7 +10,7 @@ LL | >::method(..): Send, | ~~~~~~~~~~~~~~ error[E0212]: cannot use the associated function of a trait with uninferred generic parameters - --> $DIR/path-higher-ranked.rs:20:5 + --> $DIR/path-higher-ranked.rs:19:5 | LL | T::method(..): Send, | ^^^^^^^^^^^^^ @@ -29,6 +20,6 @@ help: use a fully qualified path with inferred lifetimes LL | >::method(..): Send, | ~~~~~~~~~~~~~~ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0212`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-missing.rs b/tests/ui/associated-type-bounds/return-type-notation/path-missing.rs index c1a7b95ca2daa..8cab48bd0c454 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-missing.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-missing.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait A { #[allow(non_camel_case_types)] diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-missing.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-missing.stderr index 0130c3bc61460..edac09db89dae 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-missing.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-missing.stderr @@ -1,33 +1,24 @@ error[E0576]: cannot find method or associated constant `method` in trait `A` - --> $DIR/path-missing.rs:11:15 + --> $DIR/path-missing.rs:10:15 | LL | ::method(..): Send, | ^^^^^^ not found in `A` error[E0575]: expected method or associated constant, found associated type `A::bad` - --> $DIR/path-missing.rs:13:5 + --> $DIR/path-missing.rs:12:5 | LL | ::bad(..): Send, | ^^^^^^^^^^^^^^^^^ | = note: can't use a type alias as a constructor -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-missing.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0220]: associated function `method` not found for `T` - --> $DIR/path-missing.rs:20:8 + --> $DIR/path-missing.rs:19:8 | LL | T::method(..): Send, | ^^^^^^ associated function `method` not found -error: aborting due to 3 previous errors; 1 warning emitted +error: aborting due to 3 previous errors Some errors have detailed explanations: E0220, E0575, E0576. For more information about an error, try `rustc --explain E0220`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.rs b/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.rs index d2636789c10ab..17a3d0f7af675 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.stderr index d66b0a109fc17..6dbb5dabc0e43 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-no-qself.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-no-qself.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0223]: ambiguous associated type - --> $DIR/path-no-qself.rs:10:5 + --> $DIR/path-no-qself.rs:9:5 | LL | Trait::method(..): Send, | ^^^^^^^^^^^^^^^^^ @@ -18,6 +9,6 @@ help: if there were a type named `Example` that implemented `Trait`, you could u LL | ::method: Send, | ~~~~~~~~~~~~~~~~~~~~~~~~~~ -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0223`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.rs b/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.rs index b0e6ea852b04d..8107772f151ef 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.stderr index cd1aa9813e351..38202bdbf0727 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-non-param-qself.stderr @@ -1,30 +1,21 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-non-param-qself.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0223]: ambiguous associated function - --> $DIR/path-non-param-qself.rs:12:5 + --> $DIR/path-non-param-qself.rs:11:5 | LL | <()>::method(..): Send, | ^^^^^^^^^^^^^^^^ error[E0223]: ambiguous associated function - --> $DIR/path-non-param-qself.rs:14:5 + --> $DIR/path-non-param-qself.rs:13:5 | LL | i32::method(..): Send, | ^^^^^^^^^^^^^^^ error[E0223]: ambiguous associated function - --> $DIR/path-non-param-qself.rs:16:5 + --> $DIR/path-non-param-qself.rs:15:5 | LL | Adt::method(..): Send, | ^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors; 1 warning emitted +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0223`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.rs b/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.rs index 0cf84457ba73f..d805556f4c720 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.stderr deleted file mode 100644 index ab33647583ca3..0000000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/path-self-qself.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-self-qself.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-type-param.rs b/tests/ui/associated-type-bounds/return-type-notation/path-type-param.rs index 693a300eb1d98..6e2355c389b88 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-type-param.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-type-param.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-type-param.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-type-param.stderr index 0d33d4f97d7ac..67e83060a76b2 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-type-param.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-type-param.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-type-param.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation is not allowed for functions that have type parameters - --> $DIR/path-type-param.rs:10:5 + --> $DIR/path-type-param.rs:9:5 | LL | fn method() -> impl Sized; | - type parameter declared here @@ -17,7 +8,7 @@ LL | ::method(..): Send, | ^^^^^^^^^^^^^^^^^^^^^^ error: return type notation is not allowed for functions that have type parameters - --> $DIR/path-type-param.rs:17:5 + --> $DIR/path-type-param.rs:16:5 | LL | fn method() -> impl Sized; | - type parameter declared here @@ -25,5 +16,5 @@ LL | fn method() -> impl Sized; LL | ::method(..): Send, | ^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.rs b/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.rs index a5b0b0e4e251c..c9cb0f953e26b 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.stderr index 7d32a428555e8..95810342d5ae2 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/path-unsatisfied.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-unsatisfied.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0277]: `*mut ()` cannot be sent between threads safely - --> $DIR/path-unsatisfied.rs:23:12 + --> $DIR/path-unsatisfied.rs:22:12 | LL | fn method() -> impl Sized { | ---------- within this `impl Sized` @@ -18,12 +9,12 @@ LL | test::(); | = help: within `impl Sized`, the trait `Send` is not implemented for `*mut ()`, which is required by `impl Sized: Send` note: required because it appears within the type `impl Sized` - --> $DIR/path-unsatisfied.rs:10:20 + --> $DIR/path-unsatisfied.rs:9:20 | LL | fn method() -> impl Sized { | ^^^^^^^^^^ note: required by a bound in `test` - --> $DIR/path-unsatisfied.rs:18:20 + --> $DIR/path-unsatisfied.rs:17:20 | LL | fn test() | ---- required by a bound in this function @@ -31,6 +22,6 @@ LL | where LL | T::method(..): Send, | ^^^^ required by this bound in `test` -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-works.rs b/tests/ui/associated-type-bounds/return-type-notation/path-works.rs index 027bc89f13e08..87abfc07ee9f2 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/path-works.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/path-works.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Trait { fn method() -> impl Sized; diff --git a/tests/ui/associated-type-bounds/return-type-notation/path-works.stderr b/tests/ui/associated-type-bounds/return-type-notation/path-works.stderr deleted file mode 100644 index b1ec8069ba0d4..0000000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/path-works.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/path-works.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/issue-110963-early.stderr b/tests/ui/async-await/return-type-notation/issue-110963-early.stderr index acad8bd379170..d6c3bd12aee3b 100644 --- a/tests/ui/async-await/return-type-notation/issue-110963-early.stderr +++ b/tests/ui/async-await/return-type-notation/issue-110963-early.stderr @@ -1,12 +1,3 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-110963-early.rs:4:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: implementation of `Send` is not general enough --> $DIR/issue-110963-early.rs:14:5 | @@ -36,5 +27,5 @@ LL | | }); = note: ...but `Send` is actually implemented for the type `impl Future { ::check<'2>(..) }`, for some specific lifetime `'2` = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/return-type-notation/issue-110963-late.rs b/tests/ui/async-await/return-type-notation/issue-110963-late.rs index cb9c0b97f1e99..1f56361f5e50f 100644 --- a/tests/ui/async-await/return-type-notation/issue-110963-late.rs +++ b/tests/ui/async-await/return-type-notation/issue-110963-late.rs @@ -2,7 +2,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait HealthCheck { async fn check(&mut self) -> bool; diff --git a/tests/ui/async-await/return-type-notation/issue-110963-late.stderr b/tests/ui/async-await/return-type-notation/issue-110963-late.stderr deleted file mode 100644 index 9c6966537a73a..0000000000000 --- a/tests/ui/async-await/return-type-notation/issue-110963-late.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-110963-late.rs:4:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.current.stderr b/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.current.stderr deleted file mode 100644 index 4837815fad4ad..0000000000000 --- a/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.current.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/normalizing-self-auto-trait-issue-109924.rs:7:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.next.stderr b/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.next.stderr deleted file mode 100644 index 4837815fad4ad..0000000000000 --- a/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.next.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/normalizing-self-auto-trait-issue-109924.rs:7:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs b/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs index 24041ed080752..3fbd74eddcbbf 100644 --- a/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs +++ b/tests/ui/async-await/return-type-notation/normalizing-self-auto-trait-issue-109924.rs @@ -5,7 +5,6 @@ //@ edition:2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { async fn bar(&self); diff --git a/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs index 2f6e04c385384..fdbeb4f3c8758 100644 --- a/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs +++ b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.rs @@ -2,7 +2,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete use std::future::Future; diff --git a/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr b/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr deleted file mode 100644 index 4a52e807bff9e..0000000000000 --- a/tests/ui/async-await/return-type-notation/rtn-implied-in-supertrait.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/rtn-implied-in-supertrait.rs:4:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs index 1e971d0aea71d..bbdfcf607318b 100644 --- a/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs +++ b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.rs @@ -1,5 +1,4 @@ #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete // Shouldn't ICE when we have a (bad) RTN in an impl header diff --git a/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr index e061587f49189..2bbf1d504747f 100644 --- a/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr +++ b/tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/rtn-in-impl-signature.rs:1:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0229]: associated item constraints are not allowed here - --> $DIR/rtn-in-impl-signature.rs:10:17 + --> $DIR/rtn-in-impl-signature.rs:9:17 | LL | impl Super1<'_, bar(..): Send> for () {} | ^^^^^^^^^^^^^ associated item constraint not allowed here @@ -20,7 +11,7 @@ LL + impl Super1<'_> for () {} | error[E0046]: not all trait items implemented, missing: `bar` - --> $DIR/rtn-in-impl-signature.rs:10:1 + --> $DIR/rtn-in-impl-signature.rs:9:1 | LL | fn bar<'b>() -> bool; | --------------------- `bar` from trait @@ -28,7 +19,7 @@ LL | fn bar<'b>() -> bool; LL | impl Super1<'_, bar(..): Send> for () {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `bar` in implementation -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors Some errors have detailed explanations: E0046, E0229. For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/async-await/return-type-notation/super-method-bound-ambig.rs b/tests/ui/async-await/return-type-notation/super-method-bound-ambig.rs index 452568f3e4695..1db19628fa37d 100644 --- a/tests/ui/async-await/return-type-notation/super-method-bound-ambig.rs +++ b/tests/ui/async-await/return-type-notation/super-method-bound-ambig.rs @@ -1,7 +1,6 @@ //@ edition:2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Super1<'a> { async fn test(); diff --git a/tests/ui/async-await/return-type-notation/super-method-bound-ambig.stderr b/tests/ui/async-await/return-type-notation/super-method-bound-ambig.stderr index 9a6fdd7f2ac6b..e32b07771dc92 100644 --- a/tests/ui/async-await/return-type-notation/super-method-bound-ambig.stderr +++ b/tests/ui/async-await/return-type-notation/super-method-bound-ambig.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/super-method-bound-ambig.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error[E0221]: ambiguous associated function `test` in bounds of `Foo` - --> $DIR/super-method-bound-ambig.rs:25:12 + --> $DIR/super-method-bound-ambig.rs:24:12 | LL | async fn test(); | ---------------- ambiguous `test` from `for<'a> Super1<'a>` @@ -19,6 +10,6 @@ LL | async fn test(); LL | T: Foo, | ^^^^^^^^^^^^^^ ambiguous associated function `test` -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0221`. diff --git a/tests/ui/async-await/return-type-notation/super-method-bound.rs b/tests/ui/async-await/return-type-notation/super-method-bound.rs index 1aa8258a09b7d..a1d0307698218 100644 --- a/tests/ui/async-await/return-type-notation/super-method-bound.rs +++ b/tests/ui/async-await/return-type-notation/super-method-bound.rs @@ -2,7 +2,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Super<'a> { async fn test(); diff --git a/tests/ui/async-await/return-type-notation/super-method-bound.stderr b/tests/ui/async-await/return-type-notation/super-method-bound.stderr deleted file mode 100644 index 64fda71c1a1d9..0000000000000 --- a/tests/ui/async-await/return-type-notation/super-method-bound.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/super-method-bound.rs:4:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/supertrait-bound.rs b/tests/ui/async-await/return-type-notation/supertrait-bound.rs index 9c74c10b33319..8d73a34ac482f 100644 --- a/tests/ui/async-await/return-type-notation/supertrait-bound.rs +++ b/tests/ui/async-await/return-type-notation/supertrait-bound.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete and may not be safe to use trait IntFactory { fn stream(&self) -> impl Iterator; diff --git a/tests/ui/async-await/return-type-notation/supertrait-bound.stderr b/tests/ui/async-await/return-type-notation/supertrait-bound.stderr deleted file mode 100644 index eb6917fc7d58c..0000000000000 --- a/tests/ui/async-await/return-type-notation/supertrait-bound.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/supertrait-bound.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs b/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs index 06a966df4451a..edb92d8e26588 100644 --- a/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs +++ b/tests/ui/async-await/return-type-notation/ty-or-ct-params.rs @@ -1,7 +1,6 @@ //@ edition: 2021 #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { async fn bar() {} diff --git a/tests/ui/async-await/return-type-notation/ty-or-ct-params.stderr b/tests/ui/async-await/return-type-notation/ty-or-ct-params.stderr index 1c000bc6c3318..0e43d69bddc68 100644 --- a/tests/ui/async-await/return-type-notation/ty-or-ct-params.stderr +++ b/tests/ui/async-await/return-type-notation/ty-or-ct-params.stderr @@ -1,14 +1,5 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/ty-or-ct-params.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - error: return type notation is not allowed for functions that have type parameters - --> $DIR/ty-or-ct-params.rs:14:12 + --> $DIR/ty-or-ct-params.rs:13:12 | LL | async fn bar() {} | - type parameter declared here @@ -17,7 +8,7 @@ LL | T: Foo, | ^^^^^^^^^^^^^ error: return type notation is not allowed for functions that have const parameters - --> $DIR/ty-or-ct-params.rs:14:27 + --> $DIR/ty-or-ct-params.rs:13:27 | LL | async fn baz() {} | -------------- const parameter declared here @@ -25,5 +16,5 @@ LL | async fn baz() {} LL | T: Foo, | ^^^^^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 2 previous errors diff --git a/tests/ui/binop/binary-op-suggest-deref.stderr b/tests/ui/binop/binary-op-suggest-deref.stderr index ec17074e3050f..01852fbc63308 100644 --- a/tests/ui/binop/binary-op-suggest-deref.stderr +++ b/tests/ui/binop/binary-op-suggest-deref.stderr @@ -303,8 +303,8 @@ LL | let _ = FOO & (*"Sized".to_string().into_boxed_str()); | = help: the trait `BitAnd` is not implemented for `i32` = help: the following other types implement trait `BitAnd`: - `&'a i32` implements `BitAnd` - `&i32` implements `BitAnd<&i32>` + `&i32` implements `BitAnd` + `&i32` implements `BitAnd` `i32` implements `BitAnd<&i32>` `i32` implements `BitAnd` diff --git a/tests/ui/binop/binop-mul-i32-f32.stderr b/tests/ui/binop/binop-mul-i32-f32.stderr index 33d8fba172ce2..dfb96a078cc6c 100644 --- a/tests/ui/binop/binop-mul-i32-f32.stderr +++ b/tests/ui/binop/binop-mul-i32-f32.stderr @@ -6,8 +6,8 @@ LL | x * y | = help: the trait `Mul` is not implemented for `i32` = help: the following other types implement trait `Mul`: - `&'a i32` implements `Mul` - `&i32` implements `Mul<&i32>` + `&i32` implements `Mul` + `&i32` implements `Mul` `i32` implements `Mul<&i32>` `i32` implements `Mul` diff --git a/tests/ui/binop/shift-various-bad-types.stderr b/tests/ui/binop/shift-various-bad-types.stderr index 7313cb3fb84f3..d7c9eb5f9df32 100644 --- a/tests/ui/binop/shift-various-bad-types.stderr +++ b/tests/ui/binop/shift-various-bad-types.stderr @@ -6,14 +6,14 @@ LL | 22 >> p.char; | = help: the trait `Shr` is not implemented for `{integer}` = help: the following other types implement trait `Shr`: - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` + `&i128` implements `Shr<&i16>` + `&i128` implements `Shr<&i32>` + `&i128` implements `Shr<&i64>` + `&i128` implements `Shr<&i8>` + `&i128` implements `Shr<&isize>` + `&i128` implements `Shr<&u128>` + `&i128` implements `Shr<&u16>` + `&i128` implements `Shr<&u32>` and 568 others error[E0277]: no implementation for `{integer} >> &str` @@ -24,14 +24,14 @@ LL | 22 >> p.str; | = help: the trait `Shr<&str>` is not implemented for `{integer}` = help: the following other types implement trait `Shr`: - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` + `&i128` implements `Shr<&i16>` + `&i128` implements `Shr<&i32>` + `&i128` implements `Shr<&i64>` + `&i128` implements `Shr<&i8>` + `&i128` implements `Shr<&isize>` + `&i128` implements `Shr<&u128>` + `&i128` implements `Shr<&u16>` + `&i128` implements `Shr<&u32>` and 568 others error[E0277]: no implementation for `{integer} >> &Panolpy` @@ -42,14 +42,14 @@ LL | 22 >> p; | = help: the trait `Shr<&Panolpy>` is not implemented for `{integer}` = help: the following other types implement trait `Shr`: - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` - `&'a i128` implements `Shr` + `&i128` implements `Shr<&i16>` + `&i128` implements `Shr<&i32>` + `&i128` implements `Shr<&i64>` + `&i128` implements `Shr<&i8>` + `&i128` implements `Shr<&isize>` + `&i128` implements `Shr<&u128>` + `&i128` implements `Shr<&u16>` + `&i128` implements `Shr<&u32>` and 568 others error[E0308]: mismatched types diff --git a/tests/ui/borrowck/alias-liveness/rtn-static.rs b/tests/ui/borrowck/alias-liveness/rtn-static.rs index 6aa5d8fc7a107..5b6cf5b5c7ccc 100644 --- a/tests/ui/borrowck/alias-liveness/rtn-static.rs +++ b/tests/ui/borrowck/alias-liveness/rtn-static.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(return_type_notation)] -//~^ WARN the feature `return_type_notation` is incomplete trait Foo { fn borrow(&mut self) -> impl Sized + '_; diff --git a/tests/ui/borrowck/alias-liveness/rtn-static.stderr b/tests/ui/borrowck/alias-liveness/rtn-static.stderr deleted file mode 100644 index e9202db2c7902..0000000000000 --- a/tests/ui/borrowck/alias-liveness/rtn-static.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/rtn-static.rs:3:12 - | -LL | #![feature(return_type_notation)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #109417 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/const-generics/generic_const_exprs/different-fn.stderr b/tests/ui/const-generics/generic_const_exprs/different-fn.stderr index 52917df0da157..ac80463480db1 100644 --- a/tests/ui/const-generics/generic_const_exprs/different-fn.stderr +++ b/tests/ui/const-generics/generic_const_exprs/different-fn.stderr @@ -2,10 +2,10 @@ error[E0308]: mismatched types --> $DIR/different-fn.rs:10:5 | LL | [0; size_of::>()] - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `size_of::()`, found `size_of::>()` + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `size_of::()`, found `0` | = note: expected constant `size_of::()` - found constant `size_of::>()` + found constant `0` error: unconstrained generic constant --> $DIR/different-fn.rs:10:9 diff --git a/tests/ui/const-generics/occurs-check/unused-substs-1.stderr b/tests/ui/const-generics/occurs-check/unused-substs-1.stderr index 8c66c4fefb7ed..0184a05932707 100644 --- a/tests/ui/const-generics/occurs-check/unused-substs-1.stderr +++ b/tests/ui/const-generics/occurs-check/unused-substs-1.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `A<_>: Bar<_>` is not satisfied LL | let _ = A; | ^ the trait `Bar<_>` is not implemented for `A<_>` | - = help: the trait `Bar<_>` is implemented for `A<7>` + = help: the trait `Bar<_>` is implemented for `A<{ 6 + 1 }>` note: required by a bound in `A` --> $DIR/unused-substs-1.rs:9:11 | diff --git a/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs b/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs new file mode 100644 index 0000000000000..359126f125167 --- /dev/null +++ b/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs @@ -0,0 +1,24 @@ +//@ check-pass +//@ compile-flags: -Csymbol-mangling-version=v0 +#![allow(incomplete_features)] +#![feature(unsized_const_params)] + +// Regression test for #116303 + +#[derive(PartialEq, Eq)] +struct MyStr(str); +impl std::marker::UnsizedConstParamTy for MyStr {} + +fn function_with_my_str() -> &'static MyStr { + S +} + +impl MyStr { + const fn new(s: &'static str) -> &'static MyStr { + unsafe { std::mem::transmute(s) } + } +} + +pub fn main() { + let f = function_with_my_str::<{ MyStr::new("hello") }>(); +} diff --git a/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr b/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr index 0d9b718cd067f..f6eda69e12791 100644 --- a/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr +++ b/tests/ui/consts/const-eval/const-eval-overflow-3b.stderr @@ -12,8 +12,8 @@ LL | = [0; (i8::MAX + 1u8) as usize]; | = help: the trait `Add` is not implemented for `i8` = help: the following other types implement trait `Add`: - `&'a i8` implements `Add` - `&i8` implements `Add<&i8>` + `&i8` implements `Add` + `&i8` implements `Add` `i8` implements `Add<&i8>` `i8` implements `Add` diff --git a/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr b/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr index 32fe30dc88247..399f21a989429 100644 --- a/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr +++ b/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr @@ -12,8 +12,8 @@ LL | : [u32; (i8::MAX as i8 + 1u8) as usize] | = help: the trait `Add` is not implemented for `i8` = help: the following other types implement trait `Add`: - `&'a i8` implements `Add` - `&i8` implements `Add<&i8>` + `&i8` implements `Add` + `&i8` implements `Add` `i8` implements `Add<&i8>` `i8` implements `Add` diff --git a/tests/ui/impl-trait/equality.stderr b/tests/ui/impl-trait/equality.stderr index 12d886a002454..fd6f4b34241aa 100644 --- a/tests/ui/impl-trait/equality.stderr +++ b/tests/ui/impl-trait/equality.stderr @@ -30,8 +30,8 @@ LL | n + sum_to(n - 1) | = help: the trait `Add` is not implemented for `u32` = help: the following other types implement trait `Add`: - `&'a u32` implements `Add` - `&u32` implements `Add<&u32>` + `&u32` implements `Add` + `&u32` implements `Add` `u32` implements `Add<&u32>` `u32` implements `Add` diff --git a/tests/ui/issues/issue-11771.stderr b/tests/ui/issues/issue-11771.stderr index 8205ee0c38d53..5603dc18b635f 100644 --- a/tests/ui/issues/issue-11771.stderr +++ b/tests/ui/issues/issue-11771.stderr @@ -6,14 +6,14 @@ LL | 1 + | = help: the trait `Add<()>` is not implemented for `{integer}` = help: the following other types implement trait `Add`: - `&'a f128` implements `Add` - `&'a f16` implements `Add` - `&'a f32` implements `Add` - `&'a f64` implements `Add` - `&'a i128` implements `Add` - `&'a i16` implements `Add` - `&'a i32` implements `Add` - `&'a i64` implements `Add` + `&f128` implements `Add` + `&f128` implements `Add` + `&f16` implements `Add` + `&f16` implements `Add` + `&f32` implements `Add` + `&f32` implements `Add` + `&f64` implements `Add` + `&f64` implements `Add` and 56 others error[E0277]: cannot add `()` to `{integer}` @@ -24,14 +24,14 @@ LL | 1 + | = help: the trait `Add<()>` is not implemented for `{integer}` = help: the following other types implement trait `Add`: - `&'a f128` implements `Add` - `&'a f16` implements `Add` - `&'a f32` implements `Add` - `&'a f64` implements `Add` - `&'a i128` implements `Add` - `&'a i16` implements `Add` - `&'a i32` implements `Add` - `&'a i64` implements `Add` + `&f128` implements `Add` + `&f128` implements `Add` + `&f16` implements `Add` + `&f16` implements `Add` + `&f32` implements `Add` + `&f32` implements `Add` + `&f64` implements `Add` + `&f64` implements `Add` and 56 others error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-24352.stderr b/tests/ui/issues/issue-24352.stderr index 2e7dc254d914d..3e0f812b5c757 100644 --- a/tests/ui/issues/issue-24352.stderr +++ b/tests/ui/issues/issue-24352.stderr @@ -6,8 +6,8 @@ LL | 1.0f64 - 1 | = help: the trait `Sub<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Sub`: - `&'a f64` implements `Sub` - `&f64` implements `Sub<&f64>` + `&f64` implements `Sub` + `&f64` implements `Sub` `f64` implements `Sub<&f64>` `f64` implements `Sub` help: consider using a floating-point literal by writing it with `.0` diff --git a/tests/ui/issues/issue-50582.stderr b/tests/ui/issues/issue-50582.stderr index 7203fdeb0bbca..af7a36f62fb88 100644 --- a/tests/ui/issues/issue-50582.stderr +++ b/tests/ui/issues/issue-50582.stderr @@ -16,14 +16,14 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new(); | = help: the trait `Add<()>` is not implemented for `{integer}` = help: the following other types implement trait `Add`: - `&'a f128` implements `Add` - `&'a f16` implements `Add` - `&'a f32` implements `Add` - `&'a f64` implements `Add` - `&'a i128` implements `Add` - `&'a i16` implements `Add` - `&'a i32` implements `Add` - `&'a i64` implements `Add` + `&f128` implements `Add` + `&f128` implements `Add` + `&f16` implements `Add` + `&f16` implements `Add` + `&f32` implements `Add` + `&f32` implements `Add` + `&f64` implements `Add` + `&f64` implements `Add` and 56 others error: aborting due to 2 previous errors diff --git a/tests/ui/iterators/invalid-iterator-chain-fixable.stderr b/tests/ui/iterators/invalid-iterator-chain-fixable.stderr index a7685e4938d88..3d3bbab881926 100644 --- a/tests/ui/iterators/invalid-iterator-chain-fixable.stderr +++ b/tests/ui/iterators/invalid-iterator-chain-fixable.stderr @@ -33,7 +33,7 @@ LL | println!("{}", scores.sum::()); | = help: the trait `Sum<()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain-fixable.rs:14:10 @@ -66,7 +66,7 @@ LL | .sum::(), | = help: the trait `Sum<()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain-fixable.rs:23:14 @@ -99,7 +99,7 @@ LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::()); | = help: the trait `Sum<()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain-fixable.rs:27:38 diff --git a/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr b/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr index 189f089ba51a7..1f1f7c99e5610 100644 --- a/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr +++ b/tests/ui/iterators/invalid-iterator-chain-with-int-infer.stderr @@ -8,7 +8,7 @@ LL | let x = Some(()).iter().map(|()| 1).sum::(); | = help: the trait `Sum<{integer}>` is not implemented for `f32` = help: the following other types implement trait `Sum`: - `f32` implements `Sum<&'a f32>` + `f32` implements `Sum<&f32>` `f32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain-with-int-infer.rs:2:29 diff --git a/tests/ui/iterators/invalid-iterator-chain.stderr b/tests/ui/iterators/invalid-iterator-chain.stderr index f72a9f702dcec..bc35fcd489df5 100644 --- a/tests/ui/iterators/invalid-iterator-chain.stderr +++ b/tests/ui/iterators/invalid-iterator-chain.stderr @@ -33,7 +33,7 @@ LL | println!("{}", scores.sum::()); | = help: the trait `Sum<()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain.rs:12:10 @@ -65,7 +65,7 @@ LL | .sum::(), | = help: the trait `Sum<()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain.rs:25:14 @@ -104,7 +104,7 @@ LL | .sum::(), | = help: the trait `Sum` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain.rs:33:14 @@ -134,7 +134,7 @@ LL | println!("{}", vec![0, 1].iter().map(|x| { x; }).sum::()); | = help: the trait `Sum<()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain.rs:38:38 @@ -162,7 +162,7 @@ LL | println!("{}", vec![(), ()].iter().sum::()); | = help: the trait `Sum<&()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/invalid-iterator-chain.rs:39:33 diff --git a/tests/ui/lazy-type-alias/trailing-where-clause.stderr b/tests/ui/lazy-type-alias/trailing-where-clause.stderr index 9fabbe91d25a4..93cd3145928b7 100644 --- a/tests/ui/lazy-type-alias/trailing-where-clause.stderr +++ b/tests/ui/lazy-type-alias/trailing-where-clause.stderr @@ -9,7 +9,7 @@ LL | let _: Alias<()>; `String` implements `From<&mut str>` `String` implements `From<&str>` `String` implements `From>` - `String` implements `From>` + `String` implements `From>` `String` implements `From` note: required by a bound in `Alias` --> $DIR/trailing-where-clause.rs:8:13 diff --git a/tests/ui/mismatched_types/binops.stderr b/tests/ui/mismatched_types/binops.stderr index 92f21a67c3707..c0cac5375230a 100644 --- a/tests/ui/mismatched_types/binops.stderr +++ b/tests/ui/mismatched_types/binops.stderr @@ -6,14 +6,14 @@ LL | 1 + Some(1); | = help: the trait `Add>` is not implemented for `{integer}` = help: the following other types implement trait `Add`: - `&'a f128` implements `Add` - `&'a f16` implements `Add` - `&'a f32` implements `Add` - `&'a f64` implements `Add` - `&'a i128` implements `Add` - `&'a i16` implements `Add` - `&'a i32` implements `Add` - `&'a i64` implements `Add` + `&f128` implements `Add` + `&f128` implements `Add` + `&f16` implements `Add` + `&f16` implements `Add` + `&f32` implements `Add` + `&f32` implements `Add` + `&f64` implements `Add` + `&f64` implements `Add` and 56 others error[E0277]: cannot subtract `Option<{integer}>` from `usize` @@ -24,8 +24,8 @@ LL | 2 as usize - Some(1); | = help: the trait `Sub>` is not implemented for `usize` = help: the following other types implement trait `Sub`: - `&'a usize` implements `Sub` - `&usize` implements `Sub<&usize>` + `&usize` implements `Sub` + `&usize` implements `Sub` `usize` implements `Sub<&usize>` `usize` implements `Sub` @@ -37,14 +37,14 @@ LL | 3 * (); | = help: the trait `Mul<()>` is not implemented for `{integer}` = help: the following other types implement trait `Mul`: - `&'a f128` implements `Mul` - `&'a f16` implements `Mul` - `&'a f32` implements `Mul` - `&'a f64` implements `Mul` - `&'a i128` implements `Mul` - `&'a i16` implements `Mul` - `&'a i32` implements `Mul` - `&'a i64` implements `Mul` + `&f128` implements `Mul` + `&f128` implements `Mul` + `&f16` implements `Mul` + `&f16` implements `Mul` + `&f32` implements `Mul` + `&f32` implements `Mul` + `&f64` implements `Mul` + `&f64` implements `Mul` and 57 others error[E0277]: cannot divide `{integer}` by `&str` @@ -55,14 +55,14 @@ LL | 4 / ""; | = help: the trait `Div<&str>` is not implemented for `{integer}` = help: the following other types implement trait `Div`: - `&'a f128` implements `Div` - `&'a f16` implements `Div` - `&'a f32` implements `Div` - `&'a f64` implements `Div` - `&'a i128` implements `Div` - `&'a i16` implements `Div` - `&'a i32` implements `Div` - `&'a i64` implements `Div` + `&f128` implements `Div` + `&f128` implements `Div` + `&f16` implements `Div` + `&f16` implements `Div` + `&f32` implements `Div` + `&f32` implements `Div` + `&f64` implements `Div` + `&f64` implements `Div` and 62 others error[E0277]: can't compare `{integer}` with `String` diff --git a/tests/ui/never_type/issue-13352.stderr b/tests/ui/never_type/issue-13352.stderr index 7134e4d40a6a7..6818fa860051d 100644 --- a/tests/ui/never_type/issue-13352.stderr +++ b/tests/ui/never_type/issue-13352.stderr @@ -6,8 +6,8 @@ LL | 2_usize + (loop {}); | = help: the trait `Add<()>` is not implemented for `usize` = help: the following other types implement trait `Add`: - `&'a usize` implements `Add` - `&usize` implements `Add<&usize>` + `&usize` implements `Add` + `&usize` implements `Add` `usize` implements `Add<&usize>` `usize` implements `Add` diff --git a/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr b/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr index a910666bd56ce..ec560fc5ed5c5 100644 --- a/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr +++ b/tests/ui/numbers-arithmetic/not-suggest-float-literal.stderr @@ -6,8 +6,8 @@ LL | x + 100.0 | = help: the trait `Add<{float}>` is not implemented for `u8` = help: the following other types implement trait `Add`: - `&'a u8` implements `Add` - `&u8` implements `Add<&u8>` + `&u8` implements `Add` + `&u8` implements `Add` `u8` implements `Add<&u8>` `u8` implements `Add` @@ -19,8 +19,8 @@ LL | x + "foo" | = help: the trait `Add<&str>` is not implemented for `f64` = help: the following other types implement trait `Add`: - `&'a f64` implements `Add` - `&f64` implements `Add<&f64>` + `&f64` implements `Add` + `&f64` implements `Add` `f64` implements `Add<&f64>` `f64` implements `Add` @@ -32,8 +32,8 @@ LL | x + y | = help: the trait `Add<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Add`: - `&'a f64` implements `Add` - `&f64` implements `Add<&f64>` + `&f64` implements `Add` + `&f64` implements `Add` `f64` implements `Add<&f64>` `f64` implements `Add` @@ -45,8 +45,8 @@ LL | x - 100.0 | = help: the trait `Sub<{float}>` is not implemented for `u8` = help: the following other types implement trait `Sub`: - `&'a u8` implements `Sub` - `&u8` implements `Sub<&u8>` + `&u8` implements `Sub` + `&u8` implements `Sub` `u8` implements `Sub<&u8>` `u8` implements `Sub` @@ -58,8 +58,8 @@ LL | x - "foo" | = help: the trait `Sub<&str>` is not implemented for `f64` = help: the following other types implement trait `Sub`: - `&'a f64` implements `Sub` - `&f64` implements `Sub<&f64>` + `&f64` implements `Sub` + `&f64` implements `Sub` `f64` implements `Sub<&f64>` `f64` implements `Sub` @@ -71,8 +71,8 @@ LL | x - y | = help: the trait `Sub<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Sub`: - `&'a f64` implements `Sub` - `&f64` implements `Sub<&f64>` + `&f64` implements `Sub` + `&f64` implements `Sub` `f64` implements `Sub<&f64>` `f64` implements `Sub` @@ -84,8 +84,8 @@ LL | x * 100.0 | = help: the trait `Mul<{float}>` is not implemented for `u8` = help: the following other types implement trait `Mul`: - `&'a u8` implements `Mul` - `&u8` implements `Mul<&u8>` + `&u8` implements `Mul` + `&u8` implements `Mul` `u8` implements `Mul<&u8>` `u8` implements `Mul` @@ -97,8 +97,8 @@ LL | x * "foo" | = help: the trait `Mul<&str>` is not implemented for `f64` = help: the following other types implement trait `Mul`: - `&'a f64` implements `Mul` - `&f64` implements `Mul<&f64>` + `&f64` implements `Mul` + `&f64` implements `Mul` `f64` implements `Mul<&f64>` `f64` implements `Mul` @@ -110,8 +110,8 @@ LL | x * y | = help: the trait `Mul<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Mul`: - `&'a f64` implements `Mul` - `&f64` implements `Mul<&f64>` + `&f64` implements `Mul` + `&f64` implements `Mul` `f64` implements `Mul<&f64>` `f64` implements `Mul` @@ -123,8 +123,8 @@ LL | x / 100.0 | = help: the trait `Div<{float}>` is not implemented for `u8` = help: the following other types implement trait `Div`: - `&'a u8` implements `Div` - `&u8` implements `Div<&u8>` + `&u8` implements `Div` + `&u8` implements `Div` `u8` implements `Div<&u8>` `u8` implements `Div>` `u8` implements `Div` @@ -137,8 +137,8 @@ LL | x / "foo" | = help: the trait `Div<&str>` is not implemented for `f64` = help: the following other types implement trait `Div`: - `&'a f64` implements `Div` - `&f64` implements `Div<&f64>` + `&f64` implements `Div` + `&f64` implements `Div` `f64` implements `Div<&f64>` `f64` implements `Div` @@ -150,8 +150,8 @@ LL | x / y | = help: the trait `Div<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Div`: - `&'a f64` implements `Div` - `&f64` implements `Div<&f64>` + `&f64` implements `Div` + `&f64` implements `Div` `f64` implements `Div<&f64>` `f64` implements `Div` diff --git a/tests/ui/numbers-arithmetic/suggest-float-literal.stderr b/tests/ui/numbers-arithmetic/suggest-float-literal.stderr index 8585ac485dbb2..d8bff8614a4e5 100644 --- a/tests/ui/numbers-arithmetic/suggest-float-literal.stderr +++ b/tests/ui/numbers-arithmetic/suggest-float-literal.stderr @@ -6,8 +6,8 @@ LL | x + 100 | = help: the trait `Add<{integer}>` is not implemented for `f32` = help: the following other types implement trait `Add`: - `&'a f32` implements `Add` - `&f32` implements `Add<&f32>` + `&f32` implements `Add` + `&f32` implements `Add` `f32` implements `Add<&f32>` `f32` implements `Add` help: consider using a floating-point literal by writing it with `.0` @@ -23,8 +23,8 @@ LL | x + 100 | = help: the trait `Add<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Add`: - `&'a f64` implements `Add` - `&f64` implements `Add<&f64>` + `&f64` implements `Add` + `&f64` implements `Add` `f64` implements `Add<&f64>` `f64` implements `Add` help: consider using a floating-point literal by writing it with `.0` @@ -40,8 +40,8 @@ LL | x - 100 | = help: the trait `Sub<{integer}>` is not implemented for `f32` = help: the following other types implement trait `Sub`: - `&'a f32` implements `Sub` - `&f32` implements `Sub<&f32>` + `&f32` implements `Sub` + `&f32` implements `Sub` `f32` implements `Sub<&f32>` `f32` implements `Sub` help: consider using a floating-point literal by writing it with `.0` @@ -57,8 +57,8 @@ LL | x - 100 | = help: the trait `Sub<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Sub`: - `&'a f64` implements `Sub` - `&f64` implements `Sub<&f64>` + `&f64` implements `Sub` + `&f64` implements `Sub` `f64` implements `Sub<&f64>` `f64` implements `Sub` help: consider using a floating-point literal by writing it with `.0` @@ -74,8 +74,8 @@ LL | x * 100 | = help: the trait `Mul<{integer}>` is not implemented for `f32` = help: the following other types implement trait `Mul`: - `&'a f32` implements `Mul` - `&f32` implements `Mul<&f32>` + `&f32` implements `Mul` + `&f32` implements `Mul` `f32` implements `Mul<&f32>` `f32` implements `Mul` help: consider using a floating-point literal by writing it with `.0` @@ -91,8 +91,8 @@ LL | x * 100 | = help: the trait `Mul<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Mul`: - `&'a f64` implements `Mul` - `&f64` implements `Mul<&f64>` + `&f64` implements `Mul` + `&f64` implements `Mul` `f64` implements `Mul<&f64>` `f64` implements `Mul` help: consider using a floating-point literal by writing it with `.0` @@ -108,8 +108,8 @@ LL | x / 100 | = help: the trait `Div<{integer}>` is not implemented for `f32` = help: the following other types implement trait `Div`: - `&'a f32` implements `Div` - `&f32` implements `Div<&f32>` + `&f32` implements `Div` + `&f32` implements `Div` `f32` implements `Div<&f32>` `f32` implements `Div` help: consider using a floating-point literal by writing it with `.0` @@ -125,8 +125,8 @@ LL | x / 100 | = help: the trait `Div<{integer}>` is not implemented for `f64` = help: the following other types implement trait `Div`: - `&'a f64` implements `Div` - `&f64` implements `Div<&f64>` + `&f64` implements `Div` + `&f64` implements `Div` `f64` implements `Div<&f64>` `f64` implements `Div` help: consider using a floating-point literal by writing it with `.0` diff --git a/tests/ui/on-unimplemented/sum.stderr b/tests/ui/on-unimplemented/sum.stderr index f8e266a872782..d89cc2f7bf3b9 100644 --- a/tests/ui/on-unimplemented/sum.stderr +++ b/tests/ui/on-unimplemented/sum.stderr @@ -8,7 +8,7 @@ LL | vec![(), ()].iter().sum::(); | = help: the trait `Sum<&()>` is not implemented for `i32` = help: the following other types implement trait `Sum`: - `i32` implements `Sum<&'a i32>` + `i32` implements `Sum<&i32>` `i32` implements `Sum` note: the method call chain might not have had the expected associated types --> $DIR/sum.rs:4:18 @@ -30,7 +30,7 @@ LL | vec![(), ()].iter().product::(); | = help: the trait `Product<&()>` is not implemented for `i32` = help: the following other types implement trait `Product`: - `i32` implements `Product<&'a i32>` + `i32` implements `Product<&i32>` `i32` implements `Product` note: the method call chain might not have had the expected associated types --> $DIR/sum.rs:7:18 diff --git a/tests/ui/span/multiline-span-simple.stderr b/tests/ui/span/multiline-span-simple.stderr index 2454769863b9c..d815f141fa090 100644 --- a/tests/ui/span/multiline-span-simple.stderr +++ b/tests/ui/span/multiline-span-simple.stderr @@ -6,8 +6,8 @@ LL | foo(1 as u32 + | = help: the trait `Add<()>` is not implemented for `u32` = help: the following other types implement trait `Add`: - `&'a u32` implements `Add` - `&u32` implements `Add<&u32>` + `&u32` implements `Add` + `&u32` implements `Add` `u32` implements `Add<&u32>` `u32` implements `Add` diff --git a/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr b/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr index 2733bbff36b54..530d868163b8d 100644 --- a/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr +++ b/tests/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr @@ -6,7 +6,7 @@ LL | foo::(s); | | | required by a bound introduced by this call | - = help: the trait `Trait` is implemented for `&'a mut S` + = help: the trait `Trait` is implemented for `&mut S` = note: `for<'b> Trait` is implemented for `&'b mut S`, but not for `&'b S` note: required by a bound in `foo` --> $DIR/imm-ref-trait-object-literal-bound-regions.rs:11:20 diff --git a/tests/ui/suggestions/imm-ref-trait-object-literal.stderr b/tests/ui/suggestions/imm-ref-trait-object-literal.stderr index e01102e3864ea..79fa468dc4947 100644 --- a/tests/ui/suggestions/imm-ref-trait-object-literal.stderr +++ b/tests/ui/suggestions/imm-ref-trait-object-literal.stderr @@ -6,7 +6,7 @@ LL | foo(&s); | | | required by a bound introduced by this call | - = help: the trait `Trait` is implemented for `&'a mut S` + = help: the trait `Trait` is implemented for `&mut S` note: required by a bound in `foo` --> $DIR/imm-ref-trait-object-literal.rs:7:11 | diff --git a/tests/ui/suggestions/into-str.stderr b/tests/ui/suggestions/into-str.stderr index 6c1e1ec428fe7..ac6e531fee2b7 100644 --- a/tests/ui/suggestions/into-str.stderr +++ b/tests/ui/suggestions/into-str.stderr @@ -12,7 +12,7 @@ LL | foo(String::new()); `String` implements `From<&mut str>` `String` implements `From<&str>` `String` implements `From>` - `String` implements `From>` + `String` implements `From>` `String` implements `From` = note: required for `String` to implement `Into<&str>` note: required by a bound in `foo` diff --git a/tests/ui/suggestions/remove-as_str.rs b/tests/ui/suggestions/remove-as_str.rs deleted file mode 100644 index 289a784ba6af3..0000000000000 --- a/tests/ui/suggestions/remove-as_str.rs +++ /dev/null @@ -1,21 +0,0 @@ -fn foo1(s: &str) { - s.as_str(); - //~^ ERROR no method named `as_str` found -} - -fn foo2<'a>(s: &'a str) { - s.as_str(); - //~^ ERROR no method named `as_str` found -} - -fn foo3(s: &mut str) { - s.as_str(); - //~^ ERROR no method named `as_str` found -} - -fn foo4(s: &&str) { - s.as_str(); - //~^ ERROR no method named `as_str` found -} - -fn main() {} diff --git a/tests/ui/suggestions/remove-as_str.stderr b/tests/ui/suggestions/remove-as_str.stderr deleted file mode 100644 index 534c497780a95..0000000000000 --- a/tests/ui/suggestions/remove-as_str.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0599]: no method named `as_str` found for reference `&str` in the current scope - --> $DIR/remove-as_str.rs:2:7 - | -LL | s.as_str(); - | -^^^^^^-- help: remove this method call - -error[E0599]: no method named `as_str` found for reference `&'a str` in the current scope - --> $DIR/remove-as_str.rs:7:7 - | -LL | s.as_str(); - | -^^^^^^-- help: remove this method call - -error[E0599]: no method named `as_str` found for mutable reference `&mut str` in the current scope - --> $DIR/remove-as_str.rs:12:7 - | -LL | s.as_str(); - | -^^^^^^-- help: remove this method call - -error[E0599]: no method named `as_str` found for reference `&&str` in the current scope - --> $DIR/remove-as_str.rs:17:7 - | -LL | s.as_str(); - | -^^^^^^-- help: remove this method call - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/traits/question-mark-result-err-mismatch.stderr b/tests/ui/traits/question-mark-result-err-mismatch.stderr index 66276bcbe3bb0..0e0ae6d59901f 100644 --- a/tests/ui/traits/question-mark-result-err-mismatch.stderr +++ b/tests/ui/traits/question-mark-result-err-mismatch.stderr @@ -35,7 +35,7 @@ LL | .map_err(|_| ())?; `String` implements `From<&mut str>` `String` implements `From<&str>` `String` implements `From>` - `String` implements `From>` + `String` implements `From>` `String` implements `From` = note: required for `Result<(), String>` to implement `FromResidual>` diff --git a/tests/ui/traits/suggest-dereferences/invalid-suggest-deref-issue-127590.stderr b/tests/ui/traits/suggest-dereferences/invalid-suggest-deref-issue-127590.stderr index a3ed51ace0880..85d6cdf779b44 100644 --- a/tests/ui/traits/suggest-dereferences/invalid-suggest-deref-issue-127590.stderr +++ b/tests/ui/traits/suggest-dereferences/invalid-suggest-deref-issue-127590.stderr @@ -23,7 +23,7 @@ LL | for (src, dest) in std::iter::zip(fields.iter(), &variant.iter()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&std::slice::Iter<'_, {integer}>` is not an iterator | = help: the trait `Iterator` is not implemented for `&std::slice::Iter<'_, {integer}>`, which is required by `Zip, &std::slice::Iter<'_, {integer}>>: IntoIterator` - = help: the trait `Iterator` is implemented for `std::slice::Iter<'a, T>` + = help: the trait `Iterator` is implemented for `std::slice::Iter<'_, T>` = note: required for `Zip, &std::slice::Iter<'_, {integer}>>` to implement `Iterator` = note: required for `Zip, &std::slice::Iter<'_, {integer}>>` to implement `IntoIterator` @@ -52,7 +52,7 @@ LL | for (src, dest) in std::iter::zip(fields.iter(), &variant.iter().clone( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&std::slice::Iter<'_, {integer}>` is not an iterator | = help: the trait `Iterator` is not implemented for `&std::slice::Iter<'_, {integer}>`, which is required by `Zip, &std::slice::Iter<'_, {integer}>>: IntoIterator` - = help: the trait `Iterator` is implemented for `std::slice::Iter<'a, T>` + = help: the trait `Iterator` is implemented for `std::slice::Iter<'_, T>` = note: required for `Zip, &std::slice::Iter<'_, {integer}>>` to implement `Iterator` = note: required for `Zip, &std::slice::Iter<'_, {integer}>>` to implement `IntoIterator` diff --git a/tests/ui/type/type-check-defaults.stderr b/tests/ui/type/type-check-defaults.stderr index 499e8142cc8f4..9c48250612971 100644 --- a/tests/ui/type/type-check-defaults.stderr +++ b/tests/ui/type/type-check-defaults.stderr @@ -66,8 +66,8 @@ LL | trait ProjectionPred> where T::Item : Add {} | = help: the trait `Add` is not implemented for `i32` = help: the following other types implement trait `Add`: - `&'a i32` implements `Add` - `&i32` implements `Add<&i32>` + `&i32` implements `Add` + `&i32` implements `Add` `i32` implements `Add<&i32>` `i32` implements `Add` diff --git a/tests/ui/typeck/issue-81293.stderr b/tests/ui/typeck/issue-81293.stderr index 3c48db335b5f0..82661fc717233 100644 --- a/tests/ui/typeck/issue-81293.stderr +++ b/tests/ui/typeck/issue-81293.stderr @@ -21,8 +21,8 @@ LL | a = c + b * 5; | = help: the trait `Add` is not implemented for `usize` = help: the following other types implement trait `Add`: - `&'a usize` implements `Add` - `&usize` implements `Add<&usize>` + `&usize` implements `Add` + `&usize` implements `Add` `usize` implements `Add<&usize>` `usize` implements `Add` diff --git a/tests/ui/typeck/issue-90101.stderr b/tests/ui/typeck/issue-90101.stderr index d6832d1b34ffc..796e904a43829 100644 --- a/tests/ui/typeck/issue-90101.stderr +++ b/tests/ui/typeck/issue-90101.stderr @@ -9,7 +9,7 @@ LL | func(Path::new("hello").to_path_buf().to_string_lossy(), "world") = help: the following other types implement trait `From`: `PathBuf` implements `From<&T>` `PathBuf` implements `From>` - `PathBuf` implements `From>` + `PathBuf` implements `From>` `PathBuf` implements `From` `PathBuf` implements `From` = note: required for `Cow<'_, str>` to implement `Into` diff --git a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr index a0430240dc43b..f8be11a24e3da 100644 --- a/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/tests/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -6,8 +6,8 @@ LL | >::add(1, 2); | = help: the trait `Add` is not implemented for `i32` = help: the following other types implement trait `Add`: - `&'a i32` implements `Add` - `&i32` implements `Add<&i32>` + `&i32` implements `Add` + `&i32` implements `Add` `i32` implements `Add<&i32>` `i32` implements `Add` @@ -63,8 +63,8 @@ LL | >::add(1, 2); | = help: the trait `Add` is not implemented for `i32` = help: the following other types implement trait `Add`: - `&'a i32` implements `Add` - `&i32` implements `Add<&i32>` + `&i32` implements `Add` + `&i32` implements `Add` `i32` implements `Add<&i32>` `i32` implements `Add`