diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 2b86128b3f793..e1ea464dedb1e 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -332,8 +332,8 @@ pub type GenericBounds = Vec; pub enum ParamKindOrd { Lifetime, Type, - // `unordered` is only `true` if `sess.has_features().const_generics` - // is active. Specifically, if it's only `min_const_generics`, it will still require + // `unordered` is only `true` if `sess.unordered_const_ty_params()` + // returns true. Specifically, if it's only `min_const_generics`, it will still require // ordering consts after types. Const { unordered: bool }, // `Infer` is not actually constructed directly from the AST, but is implicitly constructed diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index c0ea710fdcb4e..73abd2bb83b9e 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -1351,7 +1351,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> { } fn visit_generics(&mut self, generics: &'a Generics) { - let cg_defaults = self.session.features_untracked().const_generics_defaults; + let cg_defaults = self.session.features_untracked().unordered_const_ty_params(); let mut prev_param_default = None; for param in &generics.params { diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 557271e32adb4..1defb65ed8793 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -687,7 +687,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) { gate_all!(trait_alias, "trait aliases are experimental"); gate_all!(associated_type_bounds, "associated type bounds are unstable"); gate_all!(crate_visibility_modifier, "`crate` visibility modifier is experimental"); - gate_all!(const_generics, "const generics are unstable"); gate_all!(decl_macro, "`macro` is experimental"); gate_all!(box_patterns, "box pattern syntax is experimental"); gate_all!(exclusive_range_pattern, "exclusive range pattern syntax is experimental"); diff --git a/compiler/rustc_error_codes/src/error_codes/E0671.md b/compiler/rustc_error_codes/src/error_codes/E0671.md index a993ce826a737..d4dbfb7a5d8e6 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0671.md +++ b/compiler/rustc_error_codes/src/error_codes/E0671.md @@ -4,8 +4,6 @@ Const parameters cannot depend on type parameters. The following is therefore invalid: ```compile_fail,E0770 -#![feature(const_generics)] - fn const_id() -> T { // error N } diff --git a/compiler/rustc_error_codes/src/error_codes/E0741.md b/compiler/rustc_error_codes/src/error_codes/E0741.md index 91379bfe05c65..70d963cd41f21 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0741.md +++ b/compiler/rustc_error_codes/src/error_codes/E0741.md @@ -3,7 +3,7 @@ A non-structural-match type was used as the type of a const generic parameter. Erroneous code example: ```compile_fail,E0741 -#![feature(const_generics)] +#![feature(adt_const_params)] struct A; @@ -16,7 +16,7 @@ may be used as the types of const generic parameters. To fix the previous code example, we derive `PartialEq` and `Eq`: ``` -#![feature(const_generics)] +#![feature(adt_const_params)] #[derive(PartialEq, Eq)] // We derive both traits here. struct A; diff --git a/compiler/rustc_error_codes/src/error_codes/E0770.md b/compiler/rustc_error_codes/src/error_codes/E0770.md index b39163a9de3fd..cd8fc481bf0cd 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0770.md +++ b/compiler/rustc_error_codes/src/error_codes/E0770.md @@ -3,7 +3,6 @@ The type of a const parameter references other generic parameters. Erroneous code example: ```compile_fail,E0770 -#![feature(const_generics)] fn foo() {} // error! ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0771.md b/compiler/rustc_error_codes/src/error_codes/E0771.md index 824a955f6b3f4..a2a1a20f23033 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0771.md +++ b/compiler/rustc_error_codes/src/error_codes/E0771.md @@ -4,7 +4,7 @@ allowed. Erroneous code example: ```compile_fail,E0771 -#![feature(const_generics)] +#![feature(adt_const_params)] fn function_with_str<'a, const STRING: &'a str>() {} // error! ``` @@ -13,7 +13,7 @@ To fix this issue, the lifetime in the const generic need to be changed to `'static`: ``` -#![feature(const_generics)] +#![feature(adt_const_params)] fn function_with_str() {} // ok! ``` diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 18294dfad240d..725f8b8763af1 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -273,7 +273,7 @@ declare_features! ( /// Allows patterns with concurrent by-move and by-ref bindings. /// For example, you can write `Foo(a, ref b)` where `a` is by-move and `b` is by-ref. (accepted, move_ref_pattern, "1.49.0", Some(68354), None), - /// The smallest useful subset of `const_generics`. + /// The smallest useful subset of const generics. (accepted, min_const_generics, "1.51.0", Some(74878), None), /// The `unsafe_op_in_unsafe_fn` lint (allowed by default): no longer treat an unsafe function as an unsafe block. (accepted, unsafe_block_in_unsafe_fn, "1.52.0", Some(71668), None), diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 5ae106353da61..1ff2c75966ab6 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -71,7 +71,7 @@ macro_rules! declare_features { } pub fn unordered_const_ty_params(&self) -> bool { - self.const_generics || self.const_generics_defaults + self.const_generics_defaults || self.generic_const_exprs || self.adt_const_params } /// Some features are known to be incomplete and using them is likely to have @@ -453,9 +453,6 @@ declare_features! ( /// Allows using `#[ffi_returns_twice]` on foreign functions. (active, ffi_returns_twice, "1.34.0", Some(58314), None), - /// Allows const generic types (e.g. `struct Foo(...);`). - (incomplete, const_generics, "1.34.0", Some(44580), None), - /// Allows using `#[optimize(X)]`. (active, optimize_attribute, "1.34.0", Some(54882), None), @@ -545,15 +542,9 @@ declare_features! ( /// Allows capturing variables in scope using format_args! (active, format_args_capture, "1.46.0", Some(67984), None), - /// Lazily evaluate constants. This allows constants to depend on type parameters. - (incomplete, lazy_normalization_consts, "1.46.0", Some(72219), None), - /// Allows `if let` guard in match arms. (active, if_let_guard, "1.47.0", Some(51114), None), - /// Allows non-trivial generic constants which have to be manually propagated upwards. - (incomplete, const_evaluatable_checked, "1.48.0", Some(76560), None), - /// Allows basic arithmetic on floating point types in a `const fn`. (active, const_fn_floating_point_arithmetic, "1.48.0", Some(57241), None), @@ -679,6 +670,12 @@ declare_features! ( /// Allows using doc(primitive) without a future-incompat warning (active, doc_primitive, "1.56.0", Some(88070), None), + /// Allows non-trivial generic constants which have to have wfness manually propagated to callers + (incomplete, generic_const_exprs, "1.56.0", Some(76560), None), + + /// Allows additional const parameter types, such as `&'static str` or user defined types + (incomplete, adt_const_params, "1.56.0", Some(44580), None), + // ------------------------------------------------------------------------- // feature-group-end: actual feature gates // ------------------------------------------------------------------------- diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index a8aa3c606c6c0..8e498a5446ea8 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -102,6 +102,9 @@ declare_features! ( (removed, extern_in_paths, "1.33.0", Some(55600), None, Some("subsumed by `::foo::bar` paths")), (removed, quote, "1.33.0", Some(29601), None, None), + /// Allows const generic types (e.g. `struct Foo(...);`). + (removed, const_generics, "1.34.0", Some(44580), None, + Some("removed in favor of `#![feature(adt_const_params]` and `#![feature(generic_const_exprs)]`")), /// Allows `[x; N]` where `x` is a constant (RFC 2203). (removed, const_in_array_repeat_expressions, "1.37.0", Some(49147), None, Some("removed due to causing promotable bugs")), @@ -128,9 +131,13 @@ declare_features! ( Some("Removed in favor of `~const` bound in #![feature(const_trait_impl)]")), /// Allows `#[no_debug]`. (removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")), + /// Lazily evaluate constants. This allows constants to depend on type parameters. + (removed, lazy_normalization_consts, "1.46.0", Some(72219), None, Some("superseded by `generic_const_exprs`")), /// Allows comparing raw pointers during const eval. (removed, const_compare_raw_pointers, "1.46.0", Some(53020), None, Some("cannot be allowed in const eval in any meaningful way")), + /// Allows non-trivial generic constants which have to be manually propagated upwards. + (removed, const_evaluatable_checked, "1.48.0", Some(76560), None, Some("renamed to `generic_const_exprs`")), /// Allows using the `#[link_args]` attribute. (removed, link_args, "1.53.0", Some(29596), None, Some("removed in favor of using `-C link-arg=ARG` on command line, \ diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 3816888db1062..853415c4173b5 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -307,7 +307,7 @@ pub enum Res { /// We do however allow `Self` in repeat expression even if it is generic to not break code /// which already works on stable while causing the `const_evaluatable_unchecked` future compat lint. /// - /// FIXME(lazy_normalization_consts): Remove this bodge once that feature is stable. + /// FIXME(generic_const_exprs): Remove this bodge once that feature is stable. SelfTy( /// Optionally, the trait associated with this `Self` type. Option, diff --git a/compiler/rustc_infer/src/infer/canonical/query_response.rs b/compiler/rustc_infer/src/infer/canonical/query_response.rs index c3c28d7008151..6a97a6c43c11e 100644 --- a/compiler/rustc_infer/src/infer/canonical/query_response.rs +++ b/compiler/rustc_infer/src/infer/canonical/query_response.rs @@ -678,7 +678,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> { fn const_equate(&mut self, _a: &'tcx Const<'tcx>, _b: &'tcx Const<'tcx>) { span_bug!( self.cause.span(self.infcx.tcx), - "lazy_normalization_consts: unreachable `const_equate`" + "generic_const_exprs: unreachable `const_equate`" ); } diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 32308910aa7d9..a0ee212bed0cd 100644 --- a/compiler/rustc_infer/src/infer/combine.rs +++ b/compiler/rustc_infer/src/infer/combine.rs @@ -202,7 +202,7 @@ impl<'infcx, 'tcx> InferCtxt<'infcx, 'tcx> { /// A good example of this is the following: /// /// ```rust - /// #![feature(const_generics)] + /// #![feature(generic_const_exprs)] /// /// fn bind(value: [u8; N]) -> [u8; 3 + 4] { /// todo!() diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index a5b4fa15921b8..88b9e92119f60 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -2340,7 +2340,7 @@ declare_lint! { /// ### Example /// /// ```rust - /// #![feature(const_generics)] + /// #![feature(generic_const_exprs)] /// ``` /// /// {{produces}} diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 89542a1ebabe2..de7c6d9e09530 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1420,8 +1420,8 @@ impl<'tcx> TyCtxt<'tcx> { #[inline] pub fn lazy_normalization(self) -> bool { let features = self.features(); - // Note: We do not enable lazy normalization for `min_const_generics`. - features.const_generics || features.lazy_normalization_consts + // Note: We only use lazy normalization for generic const expressions. + features.generic_const_exprs } #[inline] diff --git a/compiler/rustc_middle/src/ty/relate.rs b/compiler/rustc_middle/src/ty/relate.rs index 44981f171d50a..9d1be212f5b8c 100644 --- a/compiler/rustc_middle/src/ty/relate.rs +++ b/compiler/rustc_middle/src/ty/relate.rs @@ -577,13 +577,13 @@ pub fn super_relate_consts>( } (ty::ConstKind::Unevaluated(au), ty::ConstKind::Unevaluated(bu)) - if tcx.features().const_evaluatable_checked => + if tcx.features().generic_const_exprs => { tcx.try_unify_abstract_consts((au.shrink(), bu.shrink())) } // While this is slightly incorrect, it shouldn't matter for `min_const_generics` - // and is the better alternative to waiting until `const_evaluatable_checked` can + // and is the better alternative to waiting until `generic_const_exprs` can // be stabilized. (ty::ConstKind::Unevaluated(au), ty::ConstKind::Unevaluated(bu)) if au.def == bu.def && au.promoted == bu.promoted => diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs index 079a9ed878a7f..9c376c6c93e2e 100644 --- a/compiler/rustc_privacy/src/lib.rs +++ b/compiler/rustc_privacy/src/lib.rs @@ -136,7 +136,7 @@ where } ty::PredicateKind::RegionOutlives(..) => ControlFlow::CONTINUE, ty::PredicateKind::ConstEvaluatable(uv) - if self.def_id_visitor.tcx().features().const_evaluatable_checked => + if self.def_id_visitor.tcx().features().generic_const_exprs => { let tcx = self.def_id_visitor.tcx(); if let Ok(Some(ct)) = AbstractConst::new(tcx, uv) { @@ -1809,7 +1809,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'tcx> { self.visit(self.tcx.type_of(param.def_id)); } } - // FIXME(const_evaluatable_checked): May want to look inside const here + // FIXME(generic_const_exprs): May want to look inside const here GenericParamDefKind::Const { .. } => { self.visit(self.tcx.type_of(param.def_id)); } diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index ca2c22854c4f5..0b1687d1bd8c3 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -506,8 +506,7 @@ impl<'a> Resolver<'a> { if self.session.is_nightly_build() { err.help( - "use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` \ - to allow generic const expressions" + "use `#![feature(generic_const_exprs)]` to allow generic const expressions", ); } diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index b3601ecf1d3ac..45657f2d0f22a 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2245,7 +2245,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> { } /// Non-static lifetimes are prohibited in anonymous constants under `min_const_generics`. - /// This function will emit an error if `const_generics` is not enabled, the body identified by + /// This function will emit an error if `generic_const_exprs` is not enabled, the body identified by /// `body_id` is an anonymous constant and `lifetime_ref` is non-static. crate fn maybe_emit_forbidden_non_static_lifetime_error( &self, @@ -2264,7 +2264,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> { if !self.tcx.lazy_normalization() && is_anon_const && !is_allowed_lifetime { feature_err( &self.tcx.sess.parse_sess, - sym::const_generics, + sym::generic_const_exprs, lifetime_ref.span, "a non-static lifetime is not allowed in a `const`", ) diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index bc2c46ec0aa7c..e901d4c00ab79 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -2301,7 +2301,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { match *scope { Scope::Body { id, s } => { // Non-static lifetimes are prohibited in anonymous constants without - // `const_generics`. + // `generic_const_exprs`. self.maybe_emit_forbidden_non_static_lifetime_error(id, lifetime_ref); outermost_body = Some(id); diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index e308ea1a1be5b..da3beac081961 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -2734,10 +2734,7 @@ impl<'a> Resolver<'a> { ConstantItemRibKind(trivial, _) => { let features = self.session.features_untracked(); // HACK(min_const_generics): We currently only allow `N` or `{ N }`. - if !(trivial - || features.const_generics - || features.lazy_normalization_consts) - { + if !(trivial || features.generic_const_exprs) { // HACK(min_const_generics): If we encounter `Self` in an anonymous constant // we can't easily tell if it's generic at this stage, so we instead remember // this and then enforce the self type to be concrete later on. @@ -2809,10 +2806,7 @@ impl<'a> Resolver<'a> { ConstantItemRibKind(trivial, _) => { let features = self.session.features_untracked(); // HACK(min_const_generics): We currently only allow `N` or `{ N }`. - if !(trivial - || features.const_generics - || features.lazy_normalization_consts) - { + if !(trivial || features.generic_const_exprs) { if record_used { self.report_error( span, diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index f788eb7d2126e..19c02ba45c447 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -284,6 +284,7 @@ symbols! { add_assign, add_with_overflow, address, + adt_const_params, advanced_slice_patterns, adx_target_feature, alias, @@ -662,6 +663,7 @@ symbols! { generators, generic_arg_infer, generic_associated_types, + generic_const_exprs, generic_param_attrs, get_context, global_allocator, diff --git a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs index 5c0bd1d8962f0..ddabe5967d79c 100644 --- a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs +++ b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs @@ -34,7 +34,7 @@ pub fn is_const_evaluatable<'cx, 'tcx>( span: Span, ) -> Result<(), NotConstEvaluatable> { debug!("is_const_evaluatable({:?})", uv); - if infcx.tcx.features().const_evaluatable_checked { + if infcx.tcx.features().generic_const_exprs { let tcx = infcx.tcx; match AbstractConst::new(tcx, uv)? { // We are looking at a generic abstract constant. @@ -537,9 +537,9 @@ pub(super) fn mir_abstract_const<'tcx>( tcx: TyCtxt<'tcx>, def: ty::WithOptConstParam, ) -> Result]>, ErrorReported> { - if tcx.features().const_evaluatable_checked { + if tcx.features().generic_const_exprs { match tcx.def_kind(def.did) { - // FIXME(const_evaluatable_checked): We currently only do this for anonymous constants, + // FIXME(generic_const_exprs): We currently only do this for anonymous constants, // meaning that we do not look into associated constants. I(@lcnr) am not yet sure whether // we want to look into them or treat them as opaque projections. // @@ -568,7 +568,7 @@ pub(super) fn try_unify_abstract_consts<'tcx>( Ok(false) })() .unwrap_or_else(|ErrorReported| true) - // FIXME(const_evaluatable_checked): We should instead have this + // FIXME(generic_const_exprs): We should instead have this // method return the resulting `ty::Const` and return `ConstKind::Error` // on `ErrorReported`. } @@ -656,13 +656,13 @@ pub(super) fn try_unify<'tcx>( // branch should only be taking when dealing with associated constants, at // which point directly comparing them seems like the desired behavior. // - // FIXME(const_evaluatable_checked): This isn't actually the case. + // FIXME(generic_const_exprs): This isn't actually the case. // We also take this branch for concrete anonymous constants and // expand generic anonymous constants with concrete substs. (ty::ConstKind::Unevaluated(a_uv), ty::ConstKind::Unevaluated(b_uv)) => { a_uv == b_uv } - // FIXME(const_evaluatable_checked): We may want to either actually try + // FIXME(generic_const_exprs): We may want to either actually try // to evaluate `a_ct` and `b_ct` if they are are fully concrete or something like // this, for now we just return false here. _ => false, diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 6a7aafc334ba2..9fd5cb2a0b33c 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -794,7 +794,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { ) } SelectionError::NotConstEvaluatable(NotConstEvaluatable::MentionsParam) => { - if !self.tcx.features().const_evaluatable_checked { + if !self.tcx.features().generic_const_exprs { let mut err = self.tcx.sess.struct_span_err( span, "constant expression depends on a generic parameter", @@ -803,7 +803,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { // issue. However, this is currently not actually possible // (see https://github.com/rust-lang/rust/issues/66962#issuecomment-575907083). // - // Note that with `feature(const_evaluatable_checked)` this case should not + // Note that with `feature(generic_const_exprs)` this case should not // be reachable. err.note("this may fail depending on what value the parameter takes"); err.emit(); diff --git a/compiler/rustc_trait_selection/src/traits/fulfill.rs b/compiler/rustc_trait_selection/src/traits/fulfill.rs index f214930c57fe4..18abcc72bcee8 100644 --- a/compiler/rustc_trait_selection/src/traits/fulfill.rs +++ b/compiler/rustc_trait_selection/src/traits/fulfill.rs @@ -572,7 +572,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> { ty::PredicateKind::ConstEquate(c1, c2) => { debug!(?c1, ?c2, "equating consts"); let tcx = self.selcx.tcx(); - if tcx.features().const_evaluatable_checked { + if tcx.features().generic_const_exprs { // FIXME: we probably should only try to unify abstract constants // if the constants depend on generic parameters. // diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs index dd974e6fd4f1c..041fd65e8fa49 100644 --- a/compiler/rustc_trait_selection/src/traits/object_safety.rs +++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs @@ -855,7 +855,7 @@ fn contains_illegal_self_type_reference<'tcx, T: TypeFoldable<'tcx>>( fn visit_predicate(&mut self, pred: ty::Predicate<'tcx>) -> ControlFlow { if let ty::PredicateKind::ConstEvaluatable(ct) = pred.kind().skip_binder() { - // FIXME(const_evaluatable_checked): We should probably deduplicate the logic for + // FIXME(generic_const_exprs): We should probably deduplicate the logic for // `AbstractConst`s here, it might make sense to change `ConstEvaluatable` to // take a `ty::Const` instead. use rustc_middle::mir::abstract_const::Node; diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 6cf1dabad8592..5214277a37d53 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -619,7 +619,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ty::PredicateKind::ConstEquate(c1, c2) => { debug!(?c1, ?c2, "evaluate_predicate_recursively: equating consts"); - if self.tcx().features().const_evaluatable_checked { + if self.tcx().features().generic_const_exprs { // FIXME: we probably should only try to unify abstract constants // if the constants depend on generic parameters. // diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index 5ade3828b7265..17716afe3208f 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -290,7 +290,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) { let err_ty_str; let mut is_ptr = true; - let err = if tcx.features().const_generics { + let err = if tcx.features().adt_const_params { match ty.peel_refs().kind() { ty::FnPtr(_) => Some("function pointers"), ty::RawPtr(_) => Some("raw pointers"), @@ -328,7 +328,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) { err.note("the only supported types are integers, `bool` and `char`"); if tcx.sess.is_nightly_build() { err.help( - "more complex types are supported with `#![feature(const_generics)]`", + "more complex types are supported with `#![feature(adt_const_params)]`", ); } err.emit() diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index 145a0c5413bb8..b8e8854847fb4 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -1489,7 +1489,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics { } // HACK(eddyb) this provides the correct generics when - // `feature(const_generics)` is enabled, so that const expressions + // `feature(generic_const_expressions)` is enabled, so that const expressions // used with const generics, e.g. `Foo<{N+1}>`, can work at all. // // Note that we do not supply the parent generics when using @@ -2300,7 +2300,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP } } - if tcx.features().const_evaluatable_checked { + if tcx.features().generic_const_exprs { predicates.extend(const_evaluatable_predicates_of(tcx, def_id.expect_local())); } diff --git a/src/test/debuginfo/function-names.rs b/src/test/debuginfo/function-names.rs index b9e59f8e8297c..dec25bb4c203c 100644 --- a/src/test/debuginfo/function-names.rs +++ b/src/test/debuginfo/function-names.rs @@ -82,8 +82,8 @@ #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] #![omit_gdb_pretty_printer_section] -#![feature(const_generics, generators, generator_trait)] -#![allow(incomplete_features)] // for const_generics +#![feature(adt_const_params, generators, generator_trait)] +#![allow(incomplete_features)] use Mod1::TestTrait2; use std::ops::Generator; diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-1.rs b/src/test/incremental/const-generics/hash-tyvid-regression-1.rs index f98ae59ddfe3c..b5a0108a0a397 100644 --- a/src/test/incremental/const-generics/hash-tyvid-regression-1.rs +++ b/src/test/incremental/const-generics/hash-tyvid-regression-1.rs @@ -1,5 +1,5 @@ // revisions: cfail -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs, adt_const_params)] #![allow(incomplete_features)] // regression test for #77650 fn c() diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-1.stderr b/src/test/incremental/const-generics/hash-tyvid-regression-1.stderr deleted file mode 100644 index cb8ca3abd7f94..0000000000000 --- a/src/test/incremental/const-generics/hash-tyvid-regression-1.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0277]: the trait bound `[T; _]: From<()>` is not satisfied - --> $DIR/hash-tyvid-regression-1.rs:9:5 - | -LL | <[T; N.get()]>::try_from(()) - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<()>` is not implemented for `[T; _]` - | - = note: required because of the requirements on the impl of `Into<[T; _]>` for `()` - = note: required because of the requirements on the impl of `TryFrom<()>` for `[T; _]` -note: required by `try_from` - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn try_from(value: T) -> Result; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/hash-tyvid-regression-1.rs:9:5 - | -LL | <[T; N.get()]>::try_from(()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Result` - | - = note: expected unit type `()` - found enum `Result<[T; _], Infallible>` -help: consider using a semicolon here - | -LL | <[T; N.get()]>::try_from(()); - | + -help: try adding a return type - | -LL | -> Result<[T; _], Infallible> where - | +++++++++++++++++++++++++++++ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0277, E0308. -For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-2.rs b/src/test/incremental/const-generics/hash-tyvid-regression-2.rs index 22536ff56d7ce..bba22bf5dc161 100644 --- a/src/test/incremental/const-generics/hash-tyvid-regression-2.rs +++ b/src/test/incremental/const-generics/hash-tyvid-regression-2.rs @@ -1,5 +1,5 @@ // revisions: cfail -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs, adt_const_params, const_generics_defaults)] #![allow(incomplete_features)] // regression test for #77650 struct C([T; N.get()]) diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-2.stderr b/src/test/incremental/const-generics/hash-tyvid-regression-2.stderr deleted file mode 100644 index 0e6040ef02e7a..0000000000000 --- a/src/test/incremental/const-generics/hash-tyvid-regression-2.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0277]: can't compare `[B; _]` with `&&[A]` - --> $DIR/hash-tyvid-regression-2.rs:12:16 - | -LL | self.0 == other - | ^^ no implementation for `[B; _] == &&[A]` - | - = help: the trait `PartialEq<&&[A]>` is not implemented for `[B; _]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-3.rs b/src/test/incremental/const-generics/hash-tyvid-regression-3.rs index 76b1ae11c7d03..61f568f79ef92 100644 --- a/src/test/incremental/const-generics/hash-tyvid-regression-3.rs +++ b/src/test/incremental/const-generics/hash-tyvid-regression-3.rs @@ -1,5 +1,5 @@ // revisions: cfail -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // regression test for #79251 struct Node diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-3.stderr b/src/test/incremental/const-generics/hash-tyvid-regression-3.stderr deleted file mode 100644 index 555d46756dcb9..0000000000000 --- a/src/test/incremental/const-generics/hash-tyvid-regression-3.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0599]: no method named `some_function` found for struct `SmallVec` in the current scope - --> $DIR/hash-tyvid-regression-3.rs:17:19 - | -LL | node.keys.some_function(); - | ^^^^^^^^^^^^^ method not found in `SmallVec<{ D * 2 }>` -... -LL | struct SmallVec {} - | ------------------------------- method `some_function` not found for this - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-4.rs b/src/test/incremental/const-generics/hash-tyvid-regression-4.rs index 35a675a2ab4d2..12e8ac7abadc0 100644 --- a/src/test/incremental/const-generics/hash-tyvid-regression-4.rs +++ b/src/test/incremental/const-generics/hash-tyvid-regression-4.rs @@ -1,5 +1,5 @@ // revisions: cfail -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // regression test for #79251 #[derive(Debug)] diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-4.stderr b/src/test/incremental/const-generics/hash-tyvid-regression-4.stderr deleted file mode 100644 index c9a6715e571c9..0000000000000 --- a/src/test/incremental/const-generics/hash-tyvid-regression-4.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0599]: no method named `push` found for struct `SmallVec` in the current scope - --> $DIR/hash-tyvid-regression-4.rs:23:19 - | -LL | node.keys.push(k); - | ^^^^ method not found in `SmallVec<_, { D * 2 }>` -... -LL | struct SmallVec { - | ---------------------------------- method `push` not found for this - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/incremental/const-generics/issue-61338.rs b/src/test/incremental/const-generics/issue-61338.rs index 00b3b29698bed..e9d67fee2969a 100644 --- a/src/test/incremental/const-generics/issue-61338.rs +++ b/src/test/incremental/const-generics/issue-61338.rs @@ -1,7 +1,5 @@ // revisions:rpass1 -#![feature(const_generics)] - struct Struct(T); impl Struct<[T; N]> { diff --git a/src/test/incremental/const-generics/issue-61516.rs b/src/test/incremental/const-generics/issue-61516.rs index a193bf998dc73..c781484d1e2e9 100644 --- a/src/test/incremental/const-generics/issue-61516.rs +++ b/src/test/incremental/const-generics/issue-61516.rs @@ -1,7 +1,5 @@ // revisions:rpass1 -#![feature(const_generics)] - struct FakeArray(T); impl FakeArray { diff --git a/src/test/incremental/const-generics/issue-62536.rs b/src/test/incremental/const-generics/issue-62536.rs index 0eaeb910be64a..93c1dbf44e938 100644 --- a/src/test/incremental/const-generics/issue-62536.rs +++ b/src/test/incremental/const-generics/issue-62536.rs @@ -1,7 +1,4 @@ // revisions:cfail1 -#![feature(const_generics)] -//[cfail1]~^ WARN the feature `const_generics` is incomplete - struct S([T; N]); fn f(x: T) -> S { panic!() } diff --git a/src/test/incremental/const-generics/issue-64087.rs b/src/test/incremental/const-generics/issue-64087.rs index 6b10c5404944d..81c813531bd53 100644 --- a/src/test/incremental/const-generics/issue-64087.rs +++ b/src/test/incremental/const-generics/issue-64087.rs @@ -1,6 +1,4 @@ // revisions:cfail1 -#![feature(const_generics)] -//[cfail1]~^ WARN the feature `const_generics` is incomplete fn combinator() -> [T; S] {} //[cfail1]~^ ERROR mismatched types diff --git a/src/test/incremental/const-generics/issue-65623.rs b/src/test/incremental/const-generics/issue-65623.rs index 353e323e67b44..22bbcbcabed1b 100644 --- a/src/test/incremental/const-generics/issue-65623.rs +++ b/src/test/incremental/const-generics/issue-65623.rs @@ -1,6 +1,4 @@ // revisions:rpass1 -#![feature(const_generics)] - pub struct Foo([T; 0]); impl Foo { diff --git a/src/test/incremental/const-generics/issue-68477.rs b/src/test/incremental/const-generics/issue-68477.rs index 925931bc4a635..9e35cf93d0911 100644 --- a/src/test/incremental/const-generics/issue-68477.rs +++ b/src/test/incremental/const-generics/issue-68477.rs @@ -1,6 +1,8 @@ // edition:2018 // revisions:rpass1 -#![feature(const_generics)] + +// Needed to supply generic arguments to the anon const in `[(); FOO]`. +#![feature(generic_const_exprs)] const FOO: usize = 1; diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs index a6edbb2e9f996..8262a2a211b7e 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs @@ -1,5 +1,5 @@ // revisions: cfail -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features, unused_braces)] trait Delegates {} diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs index 52eeec73b0dd3..92bbcba4b38ac 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-2.rs @@ -1,5 +1,5 @@ // revisions: rpass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Z; diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs index 11cca942dd639..fc114f224a2fa 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-3.rs @@ -1,5 +1,5 @@ // revisions: rpass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs, adt_const_params)] #![allow(incomplete_features)] use std::{convert::TryFrom, num::NonZeroUsize}; diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs index 1b769d0a30dce..c05d8355c280d 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-82034.rs @@ -1,5 +1,5 @@ // revisions: rpass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub trait IsTrue {} pub trait IsFalse {} diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs index 20d4993774de3..8886a556dbb25 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-1.rs @@ -1,5 +1,5 @@ // revisions: rpass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub struct Ref<'a, const NUM: usize>(&'a i32); diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-2.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-2.rs index be7ad6d1fa031..db1e2fc2af481 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-2.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-2.rs @@ -1,6 +1,6 @@ // revisions: cfail #![allow(incomplete_features)] -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] pub struct Ref<'a>(&'a i32); diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs index af4f209c90458..5b2f5edc8500e 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-85031-3.rs @@ -1,5 +1,5 @@ // revisions: rpass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn test() {} diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs index ba86336962633..d659c5676336e 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-86953.rs @@ -1,5 +1,5 @@ // revisions: rpass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs index da713631cc1fc..5f5435ba9f289 100644 --- a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs @@ -1,5 +1,5 @@ // revisions: cfail -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features, unused_braces)] struct Buffer diff --git a/src/test/rustdoc/const-generics/add-impl.rs b/src/test/rustdoc/const-generics/add-impl.rs index 123dbaa406b83..7e38eb8369a8a 100644 --- a/src/test/rustdoc/const-generics/add-impl.rs +++ b/src/test/rustdoc/const-generics/add-impl.rs @@ -1,4 +1,3 @@ -#![feature(const_generics)] #![crate_name = "foo"] use std::ops::Add; diff --git a/src/test/rustdoc/const-generics/const-generic-slice.rs b/src/test/rustdoc/const-generics/const-generic-slice.rs index 626a9e2b2109e..b20663c6d68a5 100644 --- a/src/test/rustdoc/const-generics/const-generic-slice.rs +++ b/src/test/rustdoc/const-generics/const-generic-slice.rs @@ -1,5 +1,4 @@ #![crate_name = "foo"] -#![feature(const_generics)] pub trait Array { type Item; diff --git a/src/test/rustdoc/const-generics/const-impl.rs b/src/test/rustdoc/const-generics/const-impl.rs index 7ddcb3a29f28b..fed37f6c9a2d5 100644 --- a/src/test/rustdoc/const-generics/const-impl.rs +++ b/src/test/rustdoc/const-generics/const-impl.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(adt_const_params)] #![crate_name = "foo"] diff --git a/src/test/rustdoc/const-generics/const-evaluatable-checked.rs b/src/test/rustdoc/const-generics/generic_const_exprs.rs similarity index 84% rename from src/test/rustdoc/const-generics/const-evaluatable-checked.rs rename to src/test/rustdoc/const-generics/generic_const_exprs.rs index 1c074fdb3f882..35036a89360e2 100644 --- a/src/test/rustdoc/const-generics/const-evaluatable-checked.rs +++ b/src/test/rustdoc/const-generics/generic_const_exprs.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -#![feature(const_evaluatable_checked, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 // @has foo/struct.Ice.html '//pre[@class="rust struct"]' \ diff --git a/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs b/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs index f4c5dcc72259d..4eac8e31e4529 100644 --- a/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs +++ b/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -#![feature(lazy_normalization_consts)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // Checking if `Send` is implemented for `Hasher` requires us to evaluate a `ConstEquate` predicate, diff --git a/src/test/ui/array-slice-vec/match_arr_unknown_len.rs b/src/test/ui/array-slice-vec/match_arr_unknown_len.rs index 45b2889f1ca4c..d190d7054fee7 100644 --- a/src/test/ui/array-slice-vec/match_arr_unknown_len.rs +++ b/src/test/ui/array-slice-vec/match_arr_unknown_len.rs @@ -1,6 +1,3 @@ -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete - fn is_123(x: [u32; N]) -> bool { match x { [1, 2] => true, //~ ERROR mismatched types diff --git a/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr b/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr index 0ad05b3adeb88..1a14ab40b1f86 100644 --- a/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr +++ b/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr @@ -1,14 +1,5 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/match_arr_unknown_len.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - error[E0308]: mismatched types - --> $DIR/match_arr_unknown_len.rs:6:9 + --> $DIR/match_arr_unknown_len.rs:3:9 | LL | [1, 2] => true, | ^^^^^^ expected `2_usize`, found `N` @@ -16,6 +7,6 @@ LL | [1, 2] => true, = note: expected array `[u32; 2]` found array `[u32; N]` -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr index d3a1cd30e2be6..46a54a12d6245 100644 --- a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr +++ b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr @@ -5,7 +5,7 @@ LL | let _array: [u32; ::Y]; | ^ cannot perform const operation using `A` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr b/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr index 0d84dca5b8099..f2e4ca524a439 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr @@ -5,7 +5,7 @@ LL | links: [u32; A::LINKS], // Shouldn't suggest bounds already there. | ^^^^^^^^ cannot perform const operation using `A` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/async-await/issues/issue-78654.rs b/src/test/ui/async-await/issues/issue-78654.rs index 37ebb4ecac8b8..cc6dc38346907 100644 --- a/src/test/ui/async-await/issues/issue-78654.rs +++ b/src/test/ui/async-await/issues/issue-78654.rs @@ -1,7 +1,7 @@ // edition:2018 // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Foo; diff --git a/src/test/ui/binding/const-param.min.stderr b/src/test/ui/binding/const-param.min.stderr deleted file mode 100644 index 0200c6def2466..0000000000000 --- a/src/test/ui/binding/const-param.min.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0158]: const parameters cannot be referenced in patterns - --> $DIR/const-param.rs:8:9 - | -LL | N => {} - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0158`. diff --git a/src/test/ui/binding/const-param.rs b/src/test/ui/binding/const-param.rs index 4aec801cb1552..2d051808fe0be 100644 --- a/src/test/ui/binding/const-param.rs +++ b/src/test/ui/binding/const-param.rs @@ -1,7 +1,4 @@ // Identifier pattern referring to a const generic parameter is an error (issue #68853). -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] fn check() { match 1 { diff --git a/src/test/ui/binding/const-param.full.stderr b/src/test/ui/binding/const-param.stderr similarity index 87% rename from src/test/ui/binding/const-param.full.stderr rename to src/test/ui/binding/const-param.stderr index 0200c6def2466..adda80810ead2 100644 --- a/src/test/ui/binding/const-param.full.stderr +++ b/src/test/ui/binding/const-param.stderr @@ -1,5 +1,5 @@ error[E0158]: const parameters cannot be referenced in patterns - --> $DIR/const-param.rs:8:9 + --> $DIR/const-param.rs:5:9 | LL | N => {} | ^ diff --git a/src/test/ui/const-generics/apit-with-const-param.rs b/src/test/ui/const-generics/apit-with-const-param.rs index 3bc62141927ae..2a04dc313e9b2 100644 --- a/src/test/ui/const-generics/apit-with-const-param.rs +++ b/src/test/ui/const-generics/apit-with-const-param.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait Trait {} diff --git a/src/test/ui/const-generics/argument_order.full.stderr b/src/test/ui/const-generics/argument_order.full.stderr index e533d4f7fb834..9762748f441f6 100644 --- a/src/test/ui/const-generics/argument_order.full.stderr +++ b/src/test/ui/const-generics/argument_order.full.stderr @@ -1,11 +1,11 @@ error: lifetime parameters must be declared prior to const parameters - --> $DIR/argument_order.rs:11:32 + --> $DIR/argument_order.rs:10:32 | LL | struct AlsoBad { | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>` error[E0747]: lifetime provided when a type was expected - --> $DIR/argument_order.rs:19:23 + --> $DIR/argument_order.rs:18:23 | LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; | ^^^^^^^ diff --git a/src/test/ui/const-generics/argument_order.min.stderr b/src/test/ui/const-generics/argument_order.min.stderr index f23bc6d6a2bfa..afd9ed1a7235d 100644 --- a/src/test/ui/const-generics/argument_order.min.stderr +++ b/src/test/ui/const-generics/argument_order.min.stderr @@ -1,23 +1,23 @@ error: type parameters must be declared prior to const parameters - --> $DIR/argument_order.rs:5:28 + --> $DIR/argument_order.rs:4:28 | LL | struct Bad { | -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `` error: lifetime parameters must be declared prior to const parameters - --> $DIR/argument_order.rs:11:32 + --> $DIR/argument_order.rs:10:32 | LL | struct AlsoBad { | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>` error: type parameters must be declared prior to const parameters - --> $DIR/argument_order.rs:11:36 + --> $DIR/argument_order.rs:10:36 | LL | struct AlsoBad { | ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>` error[E0747]: lifetime provided when a type was expected - --> $DIR/argument_order.rs:19:23 + --> $DIR/argument_order.rs:18:23 | LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; | ^^^^^^^ diff --git a/src/test/ui/const-generics/argument_order.rs b/src/test/ui/const-generics/argument_order.rs index 95eaeea581840..97dd0f1435227 100644 --- a/src/test/ui/const-generics/argument_order.rs +++ b/src/test/ui/const-generics/argument_order.rs @@ -1,6 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics_defaults))] struct Bad { //[min]~^ ERROR type parameters must be declared prior to const parameters diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr deleted file mode 100644 index 0fb23e41b013f..0000000000000 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/array-size-in-generic-struct-param.rs:8:38 - | -LL | struct ArithArrayLen([u32; 0 + N]); - | ^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/array-size-in-generic-struct-param.rs:19:10 - | -LL | arr: [u8; CFG.arr_size], - | ^^^^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs index 732a18714566c..a712f691dbe22 100644 --- a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs +++ b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] #![allow(dead_code)] diff --git a/src/test/ui/const-generics/associated-type-bound-fail.min.stderr b/src/test/ui/const-generics/associated-type-bound-fail.min.stderr deleted file mode 100644 index 7ab430ba830b3..0000000000000 --- a/src/test/ui/const-generics/associated-type-bound-fail.min.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0277]: the trait bound `u16: Bar` is not satisfied - --> $DIR/associated-type-bound-fail.rs:13:5 - | -LL | type Assoc = u16; - | ^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `u16` - | - = help: the following implementations were found: - > -note: required by a bound in `Foo::Assoc` - --> $DIR/associated-type-bound-fail.rs:8:17 - | -LL | type Assoc: Bar; - | ^^^^^^ required by this bound in `Foo::Assoc` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/associated-type-bound-fail.rs b/src/test/ui/const-generics/associated-type-bound-fail.rs index 83b2670080570..937b8bcb63057 100644 --- a/src/test/ui/const-generics/associated-type-bound-fail.rs +++ b/src/test/ui/const-generics/associated-type-bound-fail.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - trait Bar {} trait Foo { diff --git a/src/test/ui/const-generics/associated-type-bound-fail.full.stderr b/src/test/ui/const-generics/associated-type-bound-fail.stderr similarity index 84% rename from src/test/ui/const-generics/associated-type-bound-fail.full.stderr rename to src/test/ui/const-generics/associated-type-bound-fail.stderr index 7ab430ba830b3..60e624fc6a8c4 100644 --- a/src/test/ui/const-generics/associated-type-bound-fail.full.stderr +++ b/src/test/ui/const-generics/associated-type-bound-fail.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `u16: Bar` is not satisfied - --> $DIR/associated-type-bound-fail.rs:13:5 + --> $DIR/associated-type-bound-fail.rs:9:5 | LL | type Assoc = u16; | ^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `u16` @@ -7,7 +7,7 @@ LL | type Assoc = u16; = help: the following implementations were found: > note: required by a bound in `Foo::Assoc` - --> $DIR/associated-type-bound-fail.rs:8:17 + --> $DIR/associated-type-bound-fail.rs:4:17 | LL | type Assoc: Bar; | ^^^^^^ required by this bound in `Foo::Assoc` diff --git a/src/test/ui/const-generics/associated-type-bound.rs b/src/test/ui/const-generics/associated-type-bound.rs index 02f77396c0b60..3044736b47e05 100644 --- a/src/test/ui/const-generics/associated-type-bound.rs +++ b/src/test/ui/const-generics/associated-type-bound.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - trait Bar {} trait Foo { diff --git a/src/test/ui/const-generics/auxiliary/const_generic_lib.rs b/src/test/ui/const-generics/auxiliary/const_generic_lib.rs index 8d4cd9c0d6b7c..922f92d9feb71 100644 --- a/src/test/ui/const-generics/auxiliary/const_generic_lib.rs +++ b/src/test/ui/const-generics/auxiliary/const_generic_lib.rs @@ -1,6 +1,3 @@ -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - pub struct Struct(pub [u8; N]); pub type Alias = Struct<2>; diff --git a/src/test/ui/const-generics/auxiliary/crayte.rs b/src/test/ui/const-generics/auxiliary/crayte.rs index d9baab956c9f3..19a8bb0f4eb21 100644 --- a/src/test/ui/const-generics/auxiliary/crayte.rs +++ b/src/test/ui/const-generics/auxiliary/crayte.rs @@ -1,6 +1,4 @@ // edition:2018 -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] pub trait Foo {} struct Local; diff --git a/src/test/ui/const-generics/auxiliary/generics_of_parent.rs b/src/test/ui/const-generics/auxiliary/generics_of_parent.rs index 576276d902d60..5c2b1f4bddf82 100644 --- a/src/test/ui/const-generics/auxiliary/generics_of_parent.rs +++ b/src/test/ui/const-generics/auxiliary/generics_of_parent.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // library portion of regression test for #87674 diff --git a/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs b/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs index 0d03f56854a77..cd5b8161d08ba 100644 --- a/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs +++ b/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // library portion of testing that `impl Trait<{ expr }>` doesnt diff --git a/src/test/ui/lazy_normalization_consts/trait-resolution-breakage.rs b/src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs similarity index 100% rename from src/test/ui/lazy_normalization_consts/trait-resolution-breakage.rs rename to src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs diff --git a/src/test/ui/lazy_normalization_consts/unevaluated-consts.rs b/src/test/ui/const-generics/backcompat/unevaluated-consts.rs similarity index 100% rename from src/test/ui/lazy_normalization_consts/unevaluated-consts.rs rename to src/test/ui/const-generics/backcompat/unevaluated-consts.rs diff --git a/src/test/ui/const-generics/broken-mir-1.rs b/src/test/ui/const-generics/broken-mir-1.rs index 34255fa9f5881..6b6140e3a730c 100644 --- a/src/test/ui/const-generics/broken-mir-1.rs +++ b/src/test/ui/const-generics/broken-mir-1.rs @@ -1,9 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - pub trait Foo { fn foo(&self); } diff --git a/src/test/ui/const-generics/broken-mir-2.rs b/src/test/ui/const-generics/broken-mir-2.rs index ac358b01672bf..f9e03151374a2 100644 --- a/src/test/ui/const-generics/broken-mir-2.rs +++ b/src/test/ui/const-generics/broken-mir-2.rs @@ -1,9 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - use std::fmt::Debug; #[derive(Debug)] diff --git a/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs b/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs index 44aef859f2de6..a6e767489b79e 100644 --- a/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs +++ b/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] // This test confirms that the types can be inferred correctly for this example with const // generics. Previously this would ICE, and more recently error. diff --git a/src/test/ui/const-generics/closing-args-token.min.stderr b/src/test/ui/const-generics/closing-args-token.min.stderr deleted file mode 100644 index f4bb1e4220769..0000000000000 --- a/src/test/ui/const-generics/closing-args-token.min.stderr +++ /dev/null @@ -1,52 +0,0 @@ -error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/closing-args-token.rs:10:9 - | -LL | S::<5 + 2 >> 7>; - | ^^^^^ - | -help: enclose the `const` expression in braces - | -LL | S::<{ 5 + 2 } >> 7>; - | + + - -error: comparison operators cannot be chained - --> $DIR/closing-args-token.rs:10:16 - | -LL | S::<5 + 2 >> 7>; - | ^ ^ - | -help: split the comparison into two - | -LL | S::<5 + 2 >> 7 && 7>; - | ++++ - -error: comparison operators cannot be chained - --> $DIR/closing-args-token.rs:16:20 - | -LL | S::<{ 5 + 2 } >> 7>; - | ^ ^ - | -help: split the comparison into two - | -LL | S::<{ 5 + 2 } >> 7 && 7>; - | ++++ - -error: expected expression, found `;` - --> $DIR/closing-args-token.rs:21:16 - | -LL | T::<0 >= 3>; - | ^ expected expression - -error: comparison operators cannot be chained - --> $DIR/closing-args-token.rs:27:12 - | -LL | T::>= 2 > 0>; - | ^^ ^ - | -help: split the comparison into two - | -LL | T::>= 2 && 2 > 0>; - | ++++ - -error: aborting due to 5 previous errors - diff --git a/src/test/ui/const-generics/coerce_unsized_array.rs b/src/test/ui/const-generics/coerce_unsized_array.rs index 8e20df2810399..ffd5eb9d462ed 100644 --- a/src/test/ui/const-generics/coerce_unsized_array.rs +++ b/src/test/ui/const-generics/coerce_unsized_array.rs @@ -1,9 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn foo(v: &[u8; N]) -> &[u8] { v } diff --git a/src/test/ui/const-generics/concrete-const-as-fn-arg.rs b/src/test/ui/const-generics/concrete-const-as-fn-arg.rs index 8c31c8651a2b6..372f0433e9511 100644 --- a/src/test/ui/const-generics/concrete-const-as-fn-arg.rs +++ b/src/test/ui/const-generics/concrete-const-as-fn-arg.rs @@ -1,9 +1,5 @@ // Test that a concrete const type i.e. A<2>, can be used as an argument type in a function // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct A; // ok diff --git a/src/test/ui/const-generics/concrete-const-impl-method.rs b/src/test/ui/const-generics/concrete-const-impl-method.rs index 3d3bd2664c8b2..53c9c0ead0f93 100644 --- a/src/test/ui/const-generics/concrete-const-impl-method.rs +++ b/src/test/ui/const-generics/concrete-const-impl-method.rs @@ -1,10 +1,6 @@ // Test that a method/associated non-method within an impl block of a concrete const type i.e. A<2>, // is callable. // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] pub struct A; diff --git a/src/test/ui/const-generics/condition-in-trait-const-arg.rs b/src/test/ui/const-generics/condition-in-trait-const-arg.rs index ad40b48afe5ed..6f85237cf0aaf 100644 --- a/src/test/ui/const-generics/condition-in-trait-const-arg.rs +++ b/src/test/ui/const-generics/condition-in-trait-const-arg.rs @@ -2,7 +2,7 @@ // run-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] trait IsZeroTrait{} diff --git a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs index d1bffae0d94cb..aa0f9131aa7f5 100644 --- a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs +++ b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // This tests that the `conservative_is_privately_uninhabited` fn doesn't cause diff --git a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs index 96dbac1fbef4d..d0864414cc1fd 100644 --- a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs +++ b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // This tests that the `conservative_is_privately_uninhabited` fn doesn't cause diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr index bfa4ba3068628..ac693426fbd98 100644 --- a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr +++ b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr @@ -5,7 +5,7 @@ LL | let _: [u8; foo::()]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:14:23 @@ -14,7 +14,7 @@ LL | let _: [u8; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:24:23 @@ -23,7 +23,7 @@ LL | let _ = [0; bar::()]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:29:24 @@ -32,7 +32,7 @@ LL | let _: Foo<{ foo::() }>; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:30:24 @@ -41,7 +41,7 @@ LL | let _: Foo<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:35:27 @@ -50,7 +50,7 @@ LL | let _ = Foo::<{ foo::() }>; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/const-arg-in-const-arg.rs:36:27 @@ -59,7 +59,7 @@ LL | let _ = Foo::<{ bar::() }>; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:15:23 @@ -67,8 +67,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: [u8; faz::<'a>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:16:23 @@ -76,8 +76,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: [u8; baz::<'a>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:17:23 @@ -85,8 +85,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: [u8; faz::<'b>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:18:23 @@ -94,8 +94,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: [u8; baz::<'b>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:25:23 @@ -103,8 +103,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = [0; faz::<'a>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:26:23 @@ -112,8 +112,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = [0; baz::<'a>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:27:23 @@ -121,8 +121,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = [0; faz::<'b>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:28:23 @@ -130,8 +130,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = [0; baz::<'b>(&())]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:31:24 @@ -139,8 +139,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: Foo<{ faz::<'a>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:32:24 @@ -148,8 +148,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: Foo<{ baz::<'a>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:33:24 @@ -157,8 +157,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: Foo<{ faz::<'b>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:34:24 @@ -166,8 +166,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _: Foo<{ baz::<'b>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:37:27 @@ -175,8 +175,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = Foo::<{ faz::<'a>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:38:27 @@ -184,8 +184,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = Foo::<{ baz::<'a>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:39:27 @@ -193,8 +193,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = Foo::<{ faz::<'b>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/const-arg-in-const-arg.rs:40:27 @@ -202,8 +202,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | let _ = Foo::<{ baz::<'b>(&()) }>; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error: aborting due to 23 previous errors diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.rs b/src/test/ui/const-generics/const-arg-in-const-arg.rs index 8279f4a3f61ea..39f0b23733029 100644 --- a/src/test/ui/const-generics/const-arg-in-const-arg.rs +++ b/src/test/ui/const-generics/const-arg-in-const-arg.rs @@ -1,5 +1,5 @@ // revisions: min -// FIXME(const_generics): This test currently causes an ICE because +// FIXME(generic_const_exprs): This test currently causes an ICE because // we don't yet correctly deal with lifetimes, reenable this test once // this is fixed. diff --git a/src/test/ui/const-generics/const-arg-in-fn.rs b/src/test/ui/const-generics/const-arg-in-fn.rs index 43ed12efb895a..9b225b18d7303 100644 --- a/src/test/ui/const-generics/const-arg-in-fn.rs +++ b/src/test/ui/const-generics/const-arg-in-fn.rs @@ -1,9 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn const_u32_identity() -> u32 { X } diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr deleted file mode 100644 index d0ea51ea4173a..0000000000000 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0747]: constant provided when a type was expected - --> $DIR/const-arg-type-arg-misordered.rs:7:35 - | -LL | fn foo() -> Array { - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs index 5415791d21bb3..8ee17e637aa30 100644 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs +++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - type Array = [T; N]; fn foo() -> Array { diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr similarity index 88% rename from src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr rename to src/test/ui/const-generics/const-arg-type-arg-misordered.stderr index d7b7df0eb55bc..104ee9b48b433 100644 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr +++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr @@ -1,5 +1,5 @@ error[E0747]: constant provided when a type was expected - --> $DIR/const-arg-type-arg-misordered.rs:7:35 + --> $DIR/const-arg-type-arg-misordered.rs:3:35 | LL | fn foo() -> Array { | ^ diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr deleted file mode 100644 index 6ef698bd6a04f..0000000000000 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/const-argument-cross-crate-mismatch.rs:9:67 - | -LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); - | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements - -error[E0308]: mismatched types - --> $DIR/const-argument-cross-crate-mismatch.rs:11:65 - | -LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); - | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs index a8f533eceaa6d..d863d097d5caf 100644 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs +++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs @@ -1,7 +1,4 @@ // aux-build:const_generic_lib.rs -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] extern crate const_generic_lib; diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr similarity index 85% rename from src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr rename to src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr index 6ef698bd6a04f..aefd514f7a68e 100644 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr +++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr @@ -1,11 +1,11 @@ error[E0308]: mismatched types - --> $DIR/const-argument-cross-crate-mismatch.rs:9:67 + --> $DIR/const-argument-cross-crate-mismatch.rs:6:67 | LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements error[E0308]: mismatched types - --> $DIR/const-argument-cross-crate-mismatch.rs:11:65 + --> $DIR/const-argument-cross-crate-mismatch.rs:8:65 | LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements diff --git a/src/test/ui/const-generics/const-argument-if-length.full.stderr b/src/test/ui/const-generics/const-argument-if-length.full.stderr index 8e62147eb7e30..8c5c3b17b5c47 100644 --- a/src/test/ui/const-generics/const-argument-if-length.full.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.full.stderr @@ -1,24 +1,5 @@ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/const-argument-if-length.rs:7:28 - | -LL | pub const fn is_zst() -> usize { - | - this type parameter needs to be `std::marker::Sized` -LL | if std::mem::size_of::() == 0 { - | ^ doesn't have a size known at compile-time - | -note: required by a bound in `std::mem::size_of` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of() -> usize { - | ^ required by this bound in `std::mem::size_of` -help: consider removing the `?Sized` bound to make the type parameter `Sized` - | -LL - pub const fn is_zst() -> usize { -LL + pub const fn is_zst() -> usize { - | - -error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/const-argument-if-length.rs:16:12 + --> $DIR/const-argument-if-length.rs:15:12 | LL | pub struct AtLeastByte { | - this type parameter needs to be `std::marker::Sized` @@ -41,6 +22,14 @@ help: the `Box` type always has a statically known size and allocates its conten LL | value: Box, | ++++ + +error: unconstrained generic constant + --> $DIR/const-argument-if-length.rs:17:10 + | +LL | pad: [u8; is_zst::()], + | ^^^^^^^^^^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); is_zst::()]:` + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/const-argument-if-length.min.stderr b/src/test/ui/const-generics/const-argument-if-length.min.stderr index cdbbbf2a99b3b..b123036bf2506 100644 --- a/src/test/ui/const-generics/const-argument-if-length.min.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.min.stderr @@ -1,14 +1,14 @@ error: generic parameters may not be used in const operations - --> $DIR/const-argument-if-length.rs:18:24 + --> $DIR/const-argument-if-length.rs:17:24 | LL | pad: [u8; is_zst::()], | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/const-argument-if-length.rs:16:12 + --> $DIR/const-argument-if-length.rs:15:12 | LL | pub struct AtLeastByte { | - this type parameter needs to be `std::marker::Sized` diff --git a/src/test/ui/const-generics/const-argument-if-length.rs b/src/test/ui/const-generics/const-argument-if-length.rs index 67ed85f96afd7..db1eafca2c722 100644 --- a/src/test/ui/const-generics/const-argument-if-length.rs +++ b/src/test/ui/const-generics/const-argument-if-length.rs @@ -1,11 +1,10 @@ // revisions: full min +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] pub const fn is_zst() -> usize { if std::mem::size_of::() == 0 { - //[full]~^ ERROR the size for values of type `T` cannot be known at compilation time 1 } else { 0 @@ -17,6 +16,7 @@ pub struct AtLeastByte { //~^ ERROR the size for values of type `T` cannot be known at compilation time pad: [u8; is_zst::()], //[min]~^ ERROR generic parameters may not be used in const operations + //[full]~^^ ERROR unconstrained generic constant } fn main() {} diff --git a/src/test/ui/const-generics/const-argument-non-static-lifetime.rs b/src/test/ui/const-generics/const-argument-non-static-lifetime.rs index dc34621b90500..2aca7bdeb9a14 100644 --- a/src/test/ui/const-generics/const-argument-non-static-lifetime.rs +++ b/src/test/ui/const-generics/const-argument-non-static-lifetime.rs @@ -2,7 +2,7 @@ // revisions: full // FIXME(#75323) Omitted min revision for now due to ICE. -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] #![allow(dead_code)] diff --git a/src/test/ui/const-generics/const-expression-parameter.min.stderr b/src/test/ui/const-generics/const-expression-parameter.min.stderr deleted file mode 100644 index 4ce0ecdf3aab9..0000000000000 --- a/src/test/ui/const-generics/const-expression-parameter.min.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/const-expression-parameter.rs:15:20 - | -LL | i32_identity::<1 + 2>(); - | ^^^^^ - | -help: enclose the `const` expression in braces - | -LL | i32_identity::<{ 1 + 2 }>(); - | + + - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/const-fn-with-const-param.rs b/src/test/ui/const-generics/const-fn-with-const-param.rs index 5c1ee4e0d5a9e..161bfaab48ade 100644 --- a/src/test/ui/const-generics/const-fn-with-const-param.rs +++ b/src/test/ui/const-generics/const-fn-with-const-param.rs @@ -1,9 +1,5 @@ // Checks that `const fn` with const params can be used. // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] const fn const_u32_identity() -> u32 { X diff --git a/src/test/ui/const-generics/const-generic-array-wrapper.rs b/src/test/ui/const-generics/const-generic-array-wrapper.rs deleted file mode 100644 index 224fc794e327f..0000000000000 --- a/src/test/ui/const-generics/const-generic-array-wrapper.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Foo([T; N]); - -impl Foo { - fn foo(&self) -> usize { - N - } -} - -fn main() { - let foo = Foo([0u32; 21]); - assert_eq!(foo.0, [0u32; 21]); - assert_eq!(foo.foo(), 21); -} diff --git a/src/test/ui/const-generics/const-generic-type_name.rs b/src/test/ui/const-generics/const-generic-type_name.rs index 95632f798969f..bb16be9c58c3f 100644 --- a/src/test/ui/const-generics/const-generic-type_name.rs +++ b/src/test/ui/const-generics/const-generic-type_name.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] #[derive(Debug)] struct S; diff --git a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs b/src/test/ui/const-generics/const-param-after-const-literal-arg.rs index 6c2b14f2770da..d8a0e076e0a46 100644 --- a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs +++ b/src/test/ui/const-generics/const-param-after-const-literal-arg.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct Foo; diff --git a/src/test/ui/const-generics/const-param-before-other-params.full.stderr b/src/test/ui/const-generics/const-param-before-other-params.full.stderr index 09a4f66de39c5..982417eb3c61e 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.full.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.full.stderr @@ -1,8 +1,8 @@ error: lifetime parameters must be declared prior to const parameters --> $DIR/const-param-before-other-params.rs:5:21 | -LL | fn bar(_: &'a ()) { - | --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: ()>` +LL | fn bar(_: &'a ()) { + | --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: u8>` error: aborting due to previous error diff --git a/src/test/ui/const-generics/const-param-before-other-params.min.stderr b/src/test/ui/const-generics/const-param-before-other-params.min.stderr index a9349ce43c94e..f439cd9d69fcc 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.min.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.min.stderr @@ -1,32 +1,14 @@ error: lifetime parameters must be declared prior to const parameters --> $DIR/const-param-before-other-params.rs:5:21 | -LL | fn bar(_: &'a ()) { - | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>` +LL | fn bar(_: &'a ()) { + | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: u8>` error: type parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:10:21 + --> $DIR/const-param-before-other-params.rs:9:21 | -LL | fn foo(_: &T) {} - | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `` +LL | fn foo(_: &T) {} + | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `` -error: `()` is forbidden as the type of a const generic parameter - --> $DIR/const-param-before-other-params.rs:5:17 - | -LL | fn bar(_: &'a ()) { - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: `()` is forbidden as the type of a const generic parameter - --> $DIR/const-param-before-other-params.rs:10:17 - | -LL | fn foo(_: &T) {} - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs index 508bb3e6a689e..0a7b57fe626b1 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ b/src/test/ui/const-generics/const-param-before-other-params.rs @@ -1,14 +1,12 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(const_generics_defaults))] #![cfg_attr(full, allow(incomplete_features))] -fn bar(_: &'a ()) { +fn bar(_: &'a ()) { //~^ ERROR lifetime parameters must be declared prior to const parameters - //[min]~^^ ERROR `()` is forbidden as the type of a const generic parameter } -fn foo(_: &T) {} +fn foo(_: &T) {} //[min]~^ ERROR type parameters must be declared prior to const parameters -//[min]~^^ ERROR `()` is forbidden as the type of a const generic parameter fn main() {} diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr b/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr index 119f932745b3f..d6753a74f8574 100644 --- a/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr +++ b/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr @@ -1,29 +1,29 @@ error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:10:19 + --> $DIR/const-param-elided-lifetime.rs:9:19 | LL | struct A; | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:15:15 + --> $DIR/const-param-elided-lifetime.rs:14:15 | LL | impl A { | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:18:21 + --> $DIR/const-param-elided-lifetime.rs:17:21 | LL | fn foo(&self) {} | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:23:15 + --> $DIR/const-param-elided-lifetime.rs:22:15 | LL | impl B for A {} | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:27:17 + --> $DIR/const-param-elided-lifetime.rs:26:17 | LL | fn bar() {} | ^ explicit lifetime name needed here diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr b/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr index 613918f78f36c..48d85e7ff64ec 100644 --- a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr +++ b/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr @@ -1,77 +1,77 @@ error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:10:19 + --> $DIR/const-param-elided-lifetime.rs:9:19 | LL | struct A; | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:15:15 + --> $DIR/const-param-elided-lifetime.rs:14:15 | LL | impl A { | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:18:21 + --> $DIR/const-param-elided-lifetime.rs:17:21 | LL | fn foo(&self) {} | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:23:15 + --> $DIR/const-param-elided-lifetime.rs:22:15 | LL | impl B for A {} | ^ explicit lifetime name needed here error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $DIR/const-param-elided-lifetime.rs:27:17 + --> $DIR/const-param-elided-lifetime.rs:26:17 | LL | fn bar() {} | ^ explicit lifetime name needed here error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs:10:19 + --> $DIR/const-param-elided-lifetime.rs:9:19 | LL | struct A; | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs:15:15 + --> $DIR/const-param-elided-lifetime.rs:14:15 | LL | impl A { | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs:18:21 + --> $DIR/const-param-elided-lifetime.rs:17:21 | LL | fn foo(&self) {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs:23:15 + --> $DIR/const-param-elided-lifetime.rs:22:15 | LL | impl B for A {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs:27:17 + --> $DIR/const-param-elided-lifetime.rs:26:17 | LL | fn bar() {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 10 previous errors diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.rs b/src/test/ui/const-generics/const-param-elided-lifetime.rs index 89715a7b8e9d4..487b82dbf4ac4 100644 --- a/src/test/ui/const-generics/const-param-elided-lifetime.rs +++ b/src/test/ui/const-generics/const-param-elided-lifetime.rs @@ -3,8 +3,7 @@ // elided lifetimes within the type of a const generic parameters to be 'static, like elided // lifetimes within const/static items. // revisions: full min - -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct A; diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr deleted file mode 100644 index c2ec7359c9f7b..0000000000000 --- a/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/const-param-from-outer-fn.rs:8:9 - | -LL | fn foo() { - | - const parameter from outer function -LL | fn bar() -> u32 { - | --- try adding a local generic parameter in this method instead -LL | X - | ^ use of generic parameter from outer function - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/const-generics/const-param-in-async.rs b/src/test/ui/const-generics/const-param-in-async.rs index 9dc9c80241d59..f823431e69b9e 100644 --- a/src/test/ui/const-generics/const-param-in-async.rs +++ b/src/test/ui/const-generics/const-param-in-async.rs @@ -1,8 +1,5 @@ // edition:2018 // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] async fn foo(arg: [u8; N]) -> usize { arg.len() } diff --git a/src/test/ui/const-generics/const-param-in-trait.rs b/src/test/ui/const-generics/const-param-in-trait.rs deleted file mode 100644 index 79b3ae2037eda..0000000000000 --- a/src/test/ui/const-generics/const-param-in-trait.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Check that const parameters are permitted in traits. -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - - -trait Trait {} - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr index 9804363f39a94..a7b78b80ca5ea 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr +++ b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr @@ -17,7 +17,7 @@ LL | pub struct Dependent([(); N]); | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `[u8; _]` is forbidden as the type of a const generic parameter --> $DIR/const-param-type-depends-on-const-param.rs:15:35 @@ -26,7 +26,7 @@ LL | pub struct SelfDependent; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 4 previous errors diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs b/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs index 62b146e016a13..9d50f9a47ff6e 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs +++ b/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs @@ -1,6 +1,6 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] // Currently, const parameters cannot depend on other generic parameters, diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs b/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs index 910a964350226..71d91fd7e7f45 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs +++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs @@ -1,6 +1,6 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] // Currently, const parameters cannot depend on other generic parameters, diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr deleted file mode 100644 index 923964a4070a1..0000000000000 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: const parameter `x` should have an upper case name - --> $DIR/const-parameter-uppercase-lint.rs:8:15 - | -LL | fn noop() { - | ^ help: convert the identifier to upper case (notice the capitalization): `X` - | -note: the lint level is defined here - --> $DIR/const-parameter-uppercase-lint.rs:6:9 - | -LL | #![deny(non_upper_case_globals)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs index 5d97907c2e7fa..b08d62ccc7b16 100644 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs +++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - #![deny(non_upper_case_globals)] fn noop() { diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr similarity index 78% rename from src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr rename to src/test/ui/const-generics/const-parameter-uppercase-lint.stderr index 923964a4070a1..efaa182852aca 100644 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr +++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr @@ -1,11 +1,11 @@ error: const parameter `x` should have an upper case name - --> $DIR/const-parameter-uppercase-lint.rs:8:15 + --> $DIR/const-parameter-uppercase-lint.rs:3:15 | LL | fn noop() { | ^ help: convert the identifier to upper case (notice the capitalization): `X` | note: the lint level is defined here - --> $DIR/const-parameter-uppercase-lint.rs:6:9 + --> $DIR/const-parameter-uppercase-lint.rs:1:9 | LL | #![deny(non_upper_case_globals)] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/const-types.rs b/src/test/ui/const-generics/const-types.rs deleted file mode 100644 index fb150f892edc4..0000000000000 --- a/src/test/ui/const-generics/const-types.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Check that arrays can be used with generic const and type. -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -#![allow(dead_code, unused_variables)] - -struct ConstArray { - array: [T; LEN], -} - -fn main() { - let arr = ConstArray:: { - array: [0; 8], - }; -} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.full.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.full.stderr deleted file mode 100644 index d6a54ead13163..0000000000000 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/feature-gate-const_evaluatable_checked.rs:8:30 - | -LL | fn test() -> Arr where Arr: Default { - | ^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs deleted file mode 100644 index f49ca0251aa93..0000000000000 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs +++ /dev/null @@ -1,16 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -type Arr = [u8; N - 1]; -//[min]~^ ERROR generic parameters may not be used in const operations - -fn test() -> Arr where Arr: Default { - //[full]~^ ERROR constant expression depends - Default::default() -} - -fn main() { - let x = test::<33>(); - assert_eq!(x, [0; 32]); -} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr deleted file mode 100644 index 9f3d94bbd8abe..0000000000000 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/simple.rs:7:53 - | -LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/simple.rs:7:35 - | -LL | fn test() -> [u8; N - 1] where [u8; N - 1]: Default { - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.rs b/src/test/ui/const-generics/const_evaluatable_checked/simple.rs deleted file mode 100644 index 94ad71b6c1ac9..0000000000000 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple.rs +++ /dev/null @@ -1,16 +0,0 @@ -// [full] run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![feature(const_evaluatable_checked)] -#![allow(incomplete_features)] - -fn test() -> [u8; N - 1] where [u8; N - 1]: Default { - //[min]~^ ERROR generic parameters - //[min]~| ERROR generic parameters - Default::default() -} - -fn main() { - let x = test::<33>(); - assert_eq!(x, [0; 32]); -} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr deleted file mode 100644 index 1aa66f9a8ba89..0000000000000 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/simple_fail.rs:6:33 - | -LL | type Arr = [u8; N - 1]; - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/simple_fail.rs:10:48 - | -LL | fn test() -> Arr where [u8; N - 1]: Sized { - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs deleted file mode 100644 index f08d2495b4dd9..0000000000000 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs +++ /dev/null @@ -1,18 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, feature(const_evaluatable_checked))] -#![allow(incomplete_features)] - -type Arr = [u8; N - 1]; -//[min]~^ ERROR generic parameters may not be used in const operations -//[full]~^^ ERROR evaluation of `Arr::<0_usize>::{constant#0}` failed - -fn test() -> Arr where [u8; N - 1]: Sized { -//[min]~^ ERROR generic parameters may not be used in const operations -//[full]~^^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed - todo!() -} - -fn main() { - test::<0>(); -} diff --git a/src/test/ui/const-generics/core-types.rs b/src/test/ui/const-generics/core-types.rs index b6fa478f48df4..91410c4afdf75 100644 --- a/src/test/ui/const-generics/core-types.rs +++ b/src/test/ui/const-generics/core-types.rs @@ -2,7 +2,7 @@ // run-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct A; diff --git a/src/test/ui/const-generics/cross_crate_complex.rs b/src/test/ui/const-generics/cross_crate_complex.rs index 1d495c9562ded..ebde155f77656 100644 --- a/src/test/ui/const-generics/cross_crate_complex.rs +++ b/src/test/ui/const-generics/cross_crate_complex.rs @@ -1,10 +1,6 @@ // aux-build:crayte.rs // edition:2018 // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] extern crate crayte; use crayte::*; diff --git a/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs b/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs index 6514409698e3e..5c548740af239 100644 --- a/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs +++ b/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs @@ -1,6 +1,4 @@ -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] pub struct Defaulted; impl Defaulted { diff --git a/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr b/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr index 44df2ac9f40fa..aa289ec07783e 100644 --- a/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr +++ b/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr @@ -5,7 +5,7 @@ LL | struct Foo; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-generic-default-expr.rs:10:62 @@ -14,7 +14,7 @@ LL | struct Bar() }>(T); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs b/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs index d3558007977e4..814c996fbad6f 100644 --- a/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs +++ b/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs @@ -1,6 +1,6 @@ // revisions: full min //[full] check-pass -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![feature(const_generics_defaults)] #![allow(incomplete_features)] diff --git a/src/test/ui/const-generics/defaults/complex-unord-param.rs b/src/test/ui/const-generics/defaults/complex-unord-param.rs index d24e403e017ef..c27ed298afd16 100644 --- a/src/test/ui/const-generics/defaults/complex-unord-param.rs +++ b/src/test/ui/const-generics/defaults/complex-unord-param.rs @@ -1,7 +1,7 @@ // [full] run-pass // revisions: full min // Checks a complicated usage of unordered params -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(const_generics_defaults))] #![cfg_attr(full, allow(incomplete_features))] #![allow(dead_code)] diff --git a/src/test/ui/const-generics/defaults/const-default.rs b/src/test/ui/const-generics/defaults/const-default.rs index 4fa21b8b1fb78..e7cbf01a30179 100644 --- a/src/test/ui/const-generics/defaults/const-default.rs +++ b/src/test/ui/const-generics/defaults/const-default.rs @@ -1,9 +1,5 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] - pub struct ConstDefault; diff --git a/src/test/ui/const-generics/defaults/default-annotation.rs b/src/test/ui/const-generics/defaults/default-annotation.rs index 8eb8f368b12f3..2b41dbb58873e 100644 --- a/src/test/ui/const-generics/defaults/default-annotation.rs +++ b/src/test/ui/const-generics/defaults/default-annotation.rs @@ -1,13 +1,12 @@ // run-pass #![feature(staged_api)] - -#![feature(const_generics)] #![feature(const_generics_defaults)] #![allow(incomplete_features)] - +// FIXME(const_generics): It seems like we aren't testing the right thing here, +// I would assume that we want the attributes to apply to the const parameter defaults +// themselves. #![stable(feature = "const_default_test", since="none")] - #[unstable(feature = "const_default_stable", issue="none")] pub struct ConstDefaultUnstable; diff --git a/src/test/ui/const-generics/defaults/default-on-impl.min.stderr b/src/test/ui/const-generics/defaults/default-on-impl.min.stderr deleted file mode 100644 index c417a26842ed1..0000000000000 --- a/src/test/ui/const-generics/defaults/default-on-impl.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - --> $DIR/default-on-impl.rs:8:12 - | -LL | impl Foo {} - | ^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/defaults/default-on-impl.rs b/src/test/ui/const-generics/defaults/default-on-impl.rs index 735549defeaf0..280d92f839f4d 100644 --- a/src/test/ui/const-generics/defaults/default-on-impl.rs +++ b/src/test/ui/const-generics/defaults/default-on-impl.rs @@ -1,7 +1,4 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/defaults/default-on-impl.full.stderr b/src/test/ui/const-generics/defaults/default-on-impl.stderr similarity index 85% rename from src/test/ui/const-generics/defaults/default-on-impl.full.stderr rename to src/test/ui/const-generics/defaults/default-on-impl.stderr index c417a26842ed1..0f85ceccc8a80 100644 --- a/src/test/ui/const-generics/defaults/default-on-impl.full.stderr +++ b/src/test/ui/const-generics/defaults/default-on-impl.stderr @@ -1,5 +1,5 @@ error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - --> $DIR/default-on-impl.rs:8:12 + --> $DIR/default-on-impl.rs:5:12 | LL | impl Foo {} | ^ diff --git a/src/test/ui/const-generics/defaults/external.rs b/src/test/ui/const-generics/defaults/external.rs index 32acf567cf2b9..276e74355c258 100644 --- a/src/test/ui/const-generics/defaults/external.rs +++ b/src/test/ui/const-generics/defaults/external.rs @@ -1,9 +1,6 @@ // aux-build:const_defaulty.rs // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] extern crate const_defaulty; use const_defaulty::Defaulted; diff --git a/src/test/ui/const-generics/defaults/cec-concrete-default.rs b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs similarity index 76% rename from src/test/ui/const-generics/defaults/cec-concrete-default.rs rename to src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs index c2a41cf2ad7dd..52cea51aae15c 100644 --- a/src/test/ui/const-generics/defaults/cec-concrete-default.rs +++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked, const_generics_defaults)] +#![feature(generic_const_exprs, const_generics_defaults)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/defaults/cec-concrete-default.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr similarity index 86% rename from src/test/ui/const-generics/defaults/cec-concrete-default.stderr rename to src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr index 090e507b7f34e..905a285370a0d 100644 --- a/src/test/ui/const-generics/defaults/cec-concrete-default.stderr +++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/cec-concrete-default.rs:10:5 + --> $DIR/generic-expr-default-concrete.rs:10:5 | LL | Foo::<10, 12> | ^^^^^^^^^^^^^ expected `11_usize`, found `12_usize` diff --git a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs similarity index 81% rename from src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs rename to src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs index 15822dfac1c5a..3a11631fc47fb 100644 --- a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs +++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked, const_generics_defaults)] +#![feature(generic_const_exprs, const_generics_defaults)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr similarity index 84% rename from src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr rename to src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr index f97fc26a07321..d5a3071b77d15 100644 --- a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr +++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/cec-generic-default-mismatched-types.rs:12:5 + --> $DIR/generic-expr-default-mismatched-types.rs:12:5 | LL | Foo:: | ^^^^^^^^^^^^^^^^^^^ expected `{ N + 1 }`, found `{ N + 2 }` diff --git a/src/test/ui/const-generics/defaults/cec-generic-default.rs b/src/test/ui/const-generics/defaults/generic-expr-default.rs similarity index 88% rename from src/test/ui/const-generics/defaults/cec-generic-default.rs rename to src/test/ui/const-generics/defaults/generic-expr-default.rs index 76ff7c7801b06..0adbd5cdf3173 100644 --- a/src/test/ui/const-generics/defaults/cec-generic-default.rs +++ b/src/test/ui/const-generics/defaults/generic-expr-default.rs @@ -1,4 +1,4 @@ -#![feature(const_evaluatable_checked, const_generics, const_generics_defaults)] +#![feature(generic_const_exprs, const_generics_defaults)] #![allow(incomplete_features)] pub struct Foo; diff --git a/src/test/ui/const-generics/defaults/cec-generic-default.stderr b/src/test/ui/const-generics/defaults/generic-expr-default.stderr similarity index 88% rename from src/test/ui/const-generics/defaults/cec-generic-default.stderr rename to src/test/ui/const-generics/defaults/generic-expr-default.stderr index 0234ea8b9a4a9..ada1498d1c80b 100644 --- a/src/test/ui/const-generics/defaults/cec-generic-default.stderr +++ b/src/test/ui/const-generics/defaults/generic-expr-default.stderr @@ -1,5 +1,5 @@ error: unconstrained generic constant - --> $DIR/cec-generic-default.rs:5:54 + --> $DIR/generic-expr-default.rs:5:54 | LL | pub fn needs_evaluatable_bound() -> Foo { | ^^^^^^^ @@ -7,7 +7,7 @@ LL | pub fn needs_evaluatable_bound() -> Foo { = help: try adding a `where` bound using this expression: `where [(); { N + 1 }]:` error: unconstrained generic constant - --> $DIR/cec-generic-default.rs:14:58 + --> $DIR/generic-expr-default.rs:14:58 | LL | fn needs_evaluatable_bound_alias() -> FooAlias | ^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr index 29d835e36c6eb..725cc36b428c7 100644 --- a/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr +++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr @@ -1,11 +1,11 @@ error: lifetime parameters must be declared prior to const parameters - --> $DIR/intermixed-lifetime.rs:7:28 + --> $DIR/intermixed-lifetime.rs:5:28 | LL | struct Foo(&'a (), T); | -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>` error: lifetime parameters must be declared prior to type parameters - --> $DIR/intermixed-lifetime.rs:10:37 + --> $DIR/intermixed-lifetime.rs:8:37 | LL | struct Bar(&'a (), T); | --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>` diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr index 29d835e36c6eb..725cc36b428c7 100644 --- a/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr +++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr @@ -1,11 +1,11 @@ error: lifetime parameters must be declared prior to const parameters - --> $DIR/intermixed-lifetime.rs:7:28 + --> $DIR/intermixed-lifetime.rs:5:28 | LL | struct Foo(&'a (), T); | -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>` error: lifetime parameters must be declared prior to type parameters - --> $DIR/intermixed-lifetime.rs:10:37 + --> $DIR/intermixed-lifetime.rs:8:37 | LL | struct Bar(&'a (), T); | --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>` diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs index 307e3aaf1fbf3..cc215ab0c2517 100644 --- a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs +++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs @@ -1,8 +1,6 @@ // Checks that lifetimes cannot be interspersed between consts and types. // revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] struct Foo(&'a (), T); //~^ Error lifetime parameters must be declared prior to const parameters diff --git a/src/test/ui/const-generics/defaults/mismatch.full.stderr b/src/test/ui/const-generics/defaults/mismatch.full.stderr deleted file mode 100644 index 4aa8401ab2216..0000000000000 --- a/src/test/ui/const-generics/defaults/mismatch.full.stderr +++ /dev/null @@ -1,58 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/mismatch.rs:12:28 - | -LL | let e: Example::<13> = (); - | ------------- ^^ expected struct `Example`, found `()` - | | - | expected due to this - | - = note: expected struct `Example` - found unit type `()` - -error[E0308]: mismatched types - --> $DIR/mismatch.rs:15:34 - | -LL | let e: Example2:: = (); - | ------------------- ^^ expected struct `Example2`, found `()` - | | - | expected due to this - | - = note: expected struct `Example2` - found unit type `()` - -error[E0308]: mismatched types - --> $DIR/mismatch.rs:18:34 - | -LL | let e: Example3::<13, u32> = (); - | ------------------- ^^ expected struct `Example3`, found `()` - | | - | expected due to this - | - = note: expected struct `Example3` - found unit type `()` - -error[E0308]: mismatched types - --> $DIR/mismatch.rs:21:28 - | -LL | let e: Example3::<7> = (); - | ------------- ^^ expected struct `Example3`, found `()` - | | - | expected due to this - | - = note: expected struct `Example3<7_usize>` - found unit type `()` - -error[E0308]: mismatched types - --> $DIR/mismatch.rs:24:28 - | -LL | let e: Example4::<7> = (); - | ------------- ^^ expected struct `Example4`, found `()` - | | - | expected due to this - | - = note: expected struct `Example4<7_usize>` - found unit type `()` - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/defaults/mismatch.rs b/src/test/ui/const-generics/defaults/mismatch.rs index 9d9a8793aaac0..4ae93a9166d35 100644 --- a/src/test/ui/const-generics/defaults/mismatch.rs +++ b/src/test/ui/const-generics/defaults/mismatch.rs @@ -1,7 +1,4 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] pub struct Example; pub struct Example2(T); diff --git a/src/test/ui/const-generics/defaults/mismatch.min.stderr b/src/test/ui/const-generics/defaults/mismatch.stderr similarity index 94% rename from src/test/ui/const-generics/defaults/mismatch.min.stderr rename to src/test/ui/const-generics/defaults/mismatch.stderr index 4aa8401ab2216..3c7f4fe3b28f1 100644 --- a/src/test/ui/const-generics/defaults/mismatch.min.stderr +++ b/src/test/ui/const-generics/defaults/mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/mismatch.rs:12:28 + --> $DIR/mismatch.rs:9:28 | LL | let e: Example::<13> = (); | ------------- ^^ expected struct `Example`, found `()` @@ -10,7 +10,7 @@ LL | let e: Example::<13> = (); found unit type `()` error[E0308]: mismatched types - --> $DIR/mismatch.rs:15:34 + --> $DIR/mismatch.rs:12:34 | LL | let e: Example2:: = (); | ------------------- ^^ expected struct `Example2`, found `()` @@ -21,7 +21,7 @@ LL | let e: Example2:: = (); found unit type `()` error[E0308]: mismatched types - --> $DIR/mismatch.rs:18:34 + --> $DIR/mismatch.rs:15:34 | LL | let e: Example3::<13, u32> = (); | ------------------- ^^ expected struct `Example3`, found `()` @@ -32,7 +32,7 @@ LL | let e: Example3::<13, u32> = (); found unit type `()` error[E0308]: mismatched types - --> $DIR/mismatch.rs:21:28 + --> $DIR/mismatch.rs:18:28 | LL | let e: Example3::<7> = (); | ------------- ^^ expected struct `Example3`, found `()` @@ -43,7 +43,7 @@ LL | let e: Example3::<7> = (); found unit type `()` error[E0308]: mismatched types - --> $DIR/mismatch.rs:24:28 + --> $DIR/mismatch.rs:21:28 | LL | let e: Example4::<7> = (); | ------------- ^^ expected struct `Example4`, found `()` diff --git a/src/test/ui/const-generics/defaults/needs-feature.min.stderr b/src/test/ui/const-generics/defaults/needs-feature.min.stderr index a4006203e4a27..158fa2ec1c8ff 100644 --- a/src/test/ui/const-generics/defaults/needs-feature.min.stderr +++ b/src/test/ui/const-generics/defaults/needs-feature.min.stderr @@ -1,5 +1,5 @@ error: type parameters must be declared prior to const parameters - --> $DIR/needs-feature.rs:9:26 + --> $DIR/needs-feature.rs:7:26 | LL | struct A(T); | -----------------^----- help: reorder the parameters: lifetimes, then types, then consts: `` diff --git a/src/test/ui/const-generics/defaults/needs-feature.none.stderr b/src/test/ui/const-generics/defaults/needs-feature.none.stderr deleted file mode 100644 index a4006203e4a27..0000000000000 --- a/src/test/ui/const-generics/defaults/needs-feature.none.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: type parameters must be declared prior to const parameters - --> $DIR/needs-feature.rs:9:26 - | -LL | struct A(T); - | -----------------^----- help: reorder the parameters: lifetimes, then types, then consts: `` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/defaults/needs-feature.rs b/src/test/ui/const-generics/defaults/needs-feature.rs index b58dee0712a76..9ba8184e05851 100644 --- a/src/test/ui/const-generics/defaults/needs-feature.rs +++ b/src/test/ui/const-generics/defaults/needs-feature.rs @@ -1,10 +1,8 @@ //[full] run-pass // Verifies that having generic parameters after constants is not permitted without the -// `const_generics` feature. +// `const_generics_defaults` feature. // revisions: min full - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(full, feature(const_generics_defaults))] struct A(T); //[min]~^ ERROR type parameters must be declared prior diff --git a/src/test/ui/const-generics/defaults/simple-defaults.rs b/src/test/ui/const-generics/defaults/simple-defaults.rs index c003cb2c5a6ee..bc01fe2656c9b 100644 --- a/src/test/ui/const-generics/defaults/simple-defaults.rs +++ b/src/test/ui/const-generics/defaults/simple-defaults.rs @@ -1,9 +1,6 @@ // run-pass // Checks that type param defaults are allowed after const params. -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] #![allow(dead_code)] struct FixedOutput<'a, const N: usize, T=u32> { diff --git a/src/test/ui/const-generics/defaults/type-default-const-param-name.rs b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs index e68075ee3c627..8b35c5860d941 100644 --- a/src/test/ui/const-generics/defaults/type-default-const-param-name.rs +++ b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs @@ -1,8 +1,5 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] struct N; diff --git a/src/test/ui/const-generics/defaults/wrong-order.min.stderr b/src/test/ui/const-generics/defaults/wrong-order.min.stderr deleted file mode 100644 index eb0bcb2821556..0000000000000 --- a/src/test/ui/const-generics/defaults/wrong-order.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters with a default must be trailing - --> $DIR/wrong-order.rs:6:10 - | -LL | struct A { - | ^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/defaults/wrong-order.rs b/src/test/ui/const-generics/defaults/wrong-order.rs index 88e9e96ba43f9..33564a48448a7 100644 --- a/src/test/ui/const-generics/defaults/wrong-order.rs +++ b/src/test/ui/const-generics/defaults/wrong-order.rs @@ -1,7 +1,4 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] #![feature(const_generics_defaults)] -#![allow(incomplete_features)] struct A { //~^ ERROR generic parameters with a default must be trailing diff --git a/src/test/ui/const-generics/defaults/wrong-order.full.stderr b/src/test/ui/const-generics/defaults/wrong-order.stderr similarity index 83% rename from src/test/ui/const-generics/defaults/wrong-order.full.stderr rename to src/test/ui/const-generics/defaults/wrong-order.stderr index eb0bcb2821556..47a2c6f3f4193 100644 --- a/src/test/ui/const-generics/defaults/wrong-order.full.stderr +++ b/src/test/ui/const-generics/defaults/wrong-order.stderr @@ -1,5 +1,5 @@ error: generic parameters with a default must be trailing - --> $DIR/wrong-order.rs:6:10 + --> $DIR/wrong-order.rs:3:10 | LL | struct A { | ^ diff --git a/src/test/ui/const-generics/derive-debug-array-wrapper.rs b/src/test/ui/const-generics/derive-debug-array-wrapper.rs deleted file mode 100644 index ce1481d97e9b4..0000000000000 --- a/src/test/ui/const-generics/derive-debug-array-wrapper.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Check that deriving debug on struct with const is permitted. -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -#[derive(Debug)] -struct X { - a: [u32; N], -} - -fn main() {} diff --git a/src/test/ui/const-generics/different_byref.min.stderr b/src/test/ui/const-generics/different_byref.min.stderr deleted file mode 100644 index 93874fb1f5fef..0000000000000 --- a/src/test/ui/const-generics/different_byref.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `[usize; 1]` is forbidden as the type of a const generic parameter - --> $DIR/different_byref.rs:7:23 - | -LL | struct Const {} - | ^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/different_byref.rs b/src/test/ui/const-generics/different_byref.rs deleted file mode 100644 index 7977560ecbcf1..0000000000000 --- a/src/test/ui/const-generics/different_byref.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Check that different const types are different. -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Const {} -//[min]~^ ERROR `[usize; 1]` is forbidden - -fn main() { - let mut x = Const::<{ [3] }> {}; - x = Const::<{ [4] }> {}; - //[full]~^ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/different_byref_simple.min.stderr b/src/test/ui/const-generics/different_generic_args.full.stderr similarity index 89% rename from src/test/ui/const-generics/different_byref_simple.min.stderr rename to src/test/ui/const-generics/different_generic_args.full.stderr index 027e282c398de..a2dcc033627c6 100644 --- a/src/test/ui/const-generics/different_byref_simple.min.stderr +++ b/src/test/ui/const-generics/different_generic_args.full.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/different_byref_simple.rs:11:9 + --> $DIR/different_generic_args.rs:11:9 | LL | u = ConstUsize::<4> {}; | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` diff --git a/src/test/ui/const-generics/different_byref_simple.full.stderr b/src/test/ui/const-generics/different_generic_args.min.stderr similarity index 89% rename from src/test/ui/const-generics/different_byref_simple.full.stderr rename to src/test/ui/const-generics/different_generic_args.min.stderr index 027e282c398de..a2dcc033627c6 100644 --- a/src/test/ui/const-generics/different_byref_simple.full.stderr +++ b/src/test/ui/const-generics/different_generic_args.min.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/different_byref_simple.rs:11:9 + --> $DIR/different_generic_args.rs:11:9 | LL | u = ConstUsize::<4> {}; | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` diff --git a/src/test/ui/const-generics/different_byref_simple.rs b/src/test/ui/const-generics/different_generic_args.rs similarity index 65% rename from src/test/ui/const-generics/different_byref_simple.rs rename to src/test/ui/const-generics/different_generic_args.rs index b48189fc2cba9..9ee0e0747c4c2 100644 --- a/src/test/ui/const-generics/different_byref_simple.rs +++ b/src/test/ui/const-generics/different_generic_args.rs @@ -1,7 +1,7 @@ -// Check that different const types are different. +// Check that types with different const arguments are different. // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] struct ConstUsize {} diff --git a/src/test/ui/const-generics/different_generic_args_array.rs b/src/test/ui/const-generics/different_generic_args_array.rs new file mode 100644 index 0000000000000..4d225dfdd8730 --- /dev/null +++ b/src/test/ui/const-generics/different_generic_args_array.rs @@ -0,0 +1,11 @@ +// Check that different const types are different. +#![feature(adt_const_params)] +#![allow(incomplete_features)] + +struct Const {} + +fn main() { + let mut x = Const::<{ [3] }> {}; + x = Const::<{ [4] }> {}; + //~^ ERROR mismatched types +} diff --git a/src/test/ui/const-generics/different_byref.full.stderr b/src/test/ui/const-generics/different_generic_args_array.stderr similarity index 64% rename from src/test/ui/const-generics/different_byref.full.stderr rename to src/test/ui/const-generics/different_generic_args_array.stderr index d6b32323e2d01..c0709a996ce37 100644 --- a/src/test/ui/const-generics/different_byref.full.stderr +++ b/src/test/ui/const-generics/different_generic_args_array.stderr @@ -1,11 +1,11 @@ error[E0308]: mismatched types - --> $DIR/different_byref.rs:12:9 + --> $DIR/different_generic_args_array.rs:9:9 | LL | x = Const::<{ [4] }> {}; | ^^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` | - = note: expected type `[3_usize]` - found type `[4_usize]` + = note: expected struct `Const<[3_usize]>` + found struct `Const<[4_usize]>` error: aborting due to previous error diff --git a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs index afef748ff4690..6c4ee1af210ba 100644 --- a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs +++ b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // This tests that during error handling for the "trait not implemented" error diff --git a/src/test/ui/const-generics/dyn-supertraits.rs b/src/test/ui/const-generics/dyn-supertraits.rs index 73ed23521c30c..3dee326a186e9 100644 --- a/src/test/ui/const-generics/dyn-supertraits.rs +++ b/src/test/ui/const-generics/dyn-supertraits.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait Foo { fn myfun(&self) -> usize; diff --git a/src/test/ui/const-generics/closing-args-token.rs b/src/test/ui/const-generics/early/closing-args-token.rs similarity index 82% rename from src/test/ui/const-generics/closing-args-token.rs rename to src/test/ui/const-generics/early/closing-args-token.rs index a9b552ebed7a7..cb4d6299ed653 100644 --- a/src/test/ui/const-generics/closing-args-token.rs +++ b/src/test/ui/const-generics/early/closing-args-token.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct S; struct T; diff --git a/src/test/ui/const-generics/closing-args-token.full.stderr b/src/test/ui/const-generics/early/closing-args-token.stderr similarity index 84% rename from src/test/ui/const-generics/closing-args-token.full.stderr rename to src/test/ui/const-generics/early/closing-args-token.stderr index f4bb1e4220769..58fff3a85afe9 100644 --- a/src/test/ui/const-generics/closing-args-token.full.stderr +++ b/src/test/ui/const-generics/early/closing-args-token.stderr @@ -1,5 +1,5 @@ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/closing-args-token.rs:10:9 + --> $DIR/closing-args-token.rs:5:9 | LL | S::<5 + 2 >> 7>; | ^^^^^ @@ -10,7 +10,7 @@ LL | S::<{ 5 + 2 } >> 7>; | + + error: comparison operators cannot be chained - --> $DIR/closing-args-token.rs:10:16 + --> $DIR/closing-args-token.rs:5:16 | LL | S::<5 + 2 >> 7>; | ^ ^ @@ -21,7 +21,7 @@ LL | S::<5 + 2 >> 7 && 7>; | ++++ error: comparison operators cannot be chained - --> $DIR/closing-args-token.rs:16:20 + --> $DIR/closing-args-token.rs:11:20 | LL | S::<{ 5 + 2 } >> 7>; | ^ ^ @@ -32,13 +32,13 @@ LL | S::<{ 5 + 2 } >> 7 && 7>; | ++++ error: expected expression, found `;` - --> $DIR/closing-args-token.rs:21:16 + --> $DIR/closing-args-token.rs:16:16 | LL | T::<0 >= 3>; | ^ expected expression error: comparison operators cannot be chained - --> $DIR/closing-args-token.rs:27:12 + --> $DIR/closing-args-token.rs:22:12 | LL | T::>= 2 > 0>; | ^^ ^ diff --git a/src/test/ui/const-generics/const-expression-parameter.rs b/src/test/ui/const-generics/early/const-expression-parameter.rs similarity index 71% rename from src/test/ui/const-generics/const-expression-parameter.rs rename to src/test/ui/const-generics/early/const-expression-parameter.rs index cb609a5641613..4cf7ba86921ce 100644 --- a/src/test/ui/const-generics/const-expression-parameter.rs +++ b/src/test/ui/const-generics/early/const-expression-parameter.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn i32_identity() -> i32 { 5 } diff --git a/src/test/ui/const-generics/const-expression-parameter.full.stderr b/src/test/ui/const-generics/early/const-expression-parameter.stderr similarity index 87% rename from src/test/ui/const-generics/const-expression-parameter.full.stderr rename to src/test/ui/const-generics/early/const-expression-parameter.stderr index 4ce0ecdf3aab9..4ce1be25edb93 100644 --- a/src/test/ui/const-generics/const-expression-parameter.full.stderr +++ b/src/test/ui/const-generics/early/const-expression-parameter.stderr @@ -1,5 +1,5 @@ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/const-expression-parameter.rs:15:20 + --> $DIR/const-expression-parameter.rs:10:20 | LL | i32_identity::<1 + 2>(); | ^^^^^ diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.rs b/src/test/ui/const-generics/early/const-param-from-outer-fn.rs similarity index 54% rename from src/test/ui/const-generics/const-param-from-outer-fn.rs rename to src/test/ui/const-generics/early/const-param-from-outer-fn.rs index 27b9ca9c291ec..c3b418ee3f8ad 100644 --- a/src/test/ui/const-generics/const-param-from-outer-fn.rs +++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn foo() { fn bar() -> u32 { X //~ ERROR can't use generic parameters from outer function diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.full.stderr b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr similarity index 90% rename from src/test/ui/const-generics/const-param-from-outer-fn.full.stderr rename to src/test/ui/const-generics/early/const-param-from-outer-fn.stderr index c2ec7359c9f7b..a9f9787d87595 100644 --- a/src/test/ui/const-generics/const-param-from-outer-fn.full.stderr +++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr @@ -1,5 +1,5 @@ error[E0401]: can't use generic parameters from outer function - --> $DIR/const-param-from-outer-fn.rs:8:9 + --> $DIR/const-param-from-outer-fn.rs:3:9 | LL | fn foo() { | - const parameter from outer function diff --git a/src/test/ui/const-generics/const-param-hygiene.rs b/src/test/ui/const-generics/early/const-param-hygiene.rs similarity index 71% rename from src/test/ui/const-generics/const-param-hygiene.rs rename to src/test/ui/const-generics/early/const-param-hygiene.rs index 9cafb05fbcb6b..fd4e5b409eefc 100644 --- a/src/test/ui/const-generics/const-param-hygiene.rs +++ b/src/test/ui/const-generics/early/const-param-hygiene.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] macro_rules! bar { ($($t:tt)*) => { impl $($t)* }; diff --git a/src/test/ui/const-generics/const-param-shadowing.rs b/src/test/ui/const-generics/early/const-param-shadowing.rs similarity index 100% rename from src/test/ui/const-generics/const-param-shadowing.rs rename to src/test/ui/const-generics/early/const-param-shadowing.rs diff --git a/src/test/ui/const-generics/const-param-shadowing.stderr b/src/test/ui/const-generics/early/const-param-shadowing.stderr similarity index 100% rename from src/test/ui/const-generics/const-param-shadowing.stderr rename to src/test/ui/const-generics/early/const-param-shadowing.stderr diff --git a/src/test/ui/const-generics/diagnostics.rs b/src/test/ui/const-generics/early/invalid-const-arguments.rs similarity index 86% rename from src/test/ui/const-generics/diagnostics.rs rename to src/test/ui/const-generics/early/invalid-const-arguments.rs index 1581af5ab2751..6619c97588596 100644 --- a/src/test/ui/const-generics/diagnostics.rs +++ b/src/test/ui/const-generics/early/invalid-const-arguments.rs @@ -1,6 +1,4 @@ #![crate_type="lib"] -#![feature(min_const_generics)] -#![allow(incomplete_features)] struct A; trait Foo {} diff --git a/src/test/ui/const-generics/diagnostics.stderr b/src/test/ui/const-generics/early/invalid-const-arguments.stderr similarity index 89% rename from src/test/ui/const-generics/diagnostics.stderr rename to src/test/ui/const-generics/early/invalid-const-arguments.stderr index dd37d4e7a85af..b46e7e24f4921 100644 --- a/src/test/ui/const-generics/diagnostics.stderr +++ b/src/test/ui/const-generics/early/invalid-const-arguments.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `N` in this scope - --> $DIR/diagnostics.rs:7:16 + --> $DIR/invalid-const-arguments.rs:5:16 | LL | struct A; | ---------------------- similarly named struct `A` defined here @@ -17,7 +17,7 @@ LL | impl Foo for A {} | +++ error[E0412]: cannot find type `T` in this scope - --> $DIR/diagnostics.rs:16:32 + --> $DIR/invalid-const-arguments.rs:14:32 | LL | struct A; | ---------------------- similarly named struct `A` defined here @@ -35,7 +35,7 @@ LL | impl Foo for C {} | +++ error[E0747]: unresolved item provided when a constant was expected - --> $DIR/diagnostics.rs:7:16 + --> $DIR/invalid-const-arguments.rs:5:16 | LL | impl Foo for A {} | ^ @@ -46,7 +46,7 @@ LL | impl Foo for A<{ N }> {} | + + error[E0747]: type provided when a constant was expected - --> $DIR/diagnostics.rs:12:19 + --> $DIR/invalid-const-arguments.rs:10:19 | LL | impl Foo for B {} | ^ @@ -57,7 +57,7 @@ LL | impl Foo for B {} | ~~~~~~~~~~~ error[E0747]: unresolved item provided when a constant was expected - --> $DIR/diagnostics.rs:16:32 + --> $DIR/invalid-const-arguments.rs:14:32 | LL | impl Foo for C {} | ^ diff --git a/src/test/ui/const-generics/macro_rules-braces.rs b/src/test/ui/const-generics/early/macro_rules-braces.rs similarity index 67% rename from src/test/ui/const-generics/macro_rules-braces.rs rename to src/test/ui/const-generics/early/macro_rules-braces.rs index 605a10880bbb1..0ae9146359958 100644 --- a/src/test/ui/const-generics/macro_rules-braces.rs +++ b/src/test/ui/const-generics/early/macro_rules-braces.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - mod m { pub const P: usize = 0; } @@ -12,42 +8,42 @@ fn test() { struct Foo; macro_rules! foo { ($x:expr) => { - [u8; $x] //[full]~ ERROR constant expression depends + [u8; $x] } } macro_rules! bar { ($x:expr) => { - [u8; { $x }] //[full]~ ERROR constant expression depends + [u8; { $x }] } } macro_rules! baz { ( $x:expr) => { - Foo<$x> //[full]~ ERROR constant expression depends + Foo<$x> } } macro_rules! biz { ($x:expr) => { - Foo<{ $x }> //[full]~ ERROR constant expression depends + Foo<{ $x }> }; } let _: foo!(N); let _: foo!({ N }); - let _: foo!({{ N }}); //[min]~ ERROR generic parameters may not + let _: foo!({{ N }}); //~ ERROR generic parameters may not let _: foo!(Q); let _: foo!(m::P); let _: bar!(N); - let _: bar!({ N }); //[min]~ ERROR generic parameters may not + let _: bar!({ N }); //~ ERROR generic parameters may not let _: bar!(Q); let _: bar!(m::P); let _: baz!(N); let _: baz!({ N }); - let _: baz!({{ N }}); //[min]~ ERROR generic parameters may not + let _: baz!({{ N }}); //~ ERROR generic parameters may not let _: baz!(Q); let _: baz!({ m::P }); let _: baz!(m::P); //~ ERROR expressions must be enclosed in braces let _: biz!(N); - let _: biz!({ N }); //[min]~ ERROR generic parameters may not + let _: biz!({ N }); //~ ERROR generic parameters may not let _: biz!(Q); let _: biz!(m::P); let _: foo!(3); diff --git a/src/test/ui/const-generics/macro_rules-braces.min.stderr b/src/test/ui/const-generics/early/macro_rules-braces.stderr similarity index 68% rename from src/test/ui/const-generics/macro_rules-braces.min.stderr rename to src/test/ui/const-generics/early/macro_rules-braces.stderr index c2e8c2c9c05ae..49382dbf0bd50 100644 --- a/src/test/ui/const-generics/macro_rules-braces.min.stderr +++ b/src/test/ui/const-generics/early/macro_rules-braces.stderr @@ -1,5 +1,5 @@ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/macro_rules-braces.rs:48:17 + --> $DIR/macro_rules-braces.rs:44:17 | LL | let _: baz!(m::P); | ^^^^ @@ -10,7 +10,7 @@ LL | let _: baz!({ m::P }); | + + error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/macro_rules-braces.rs:68:17 + --> $DIR/macro_rules-braces.rs:64:17 | LL | let _: baz!(10 + 7); | ^^^^^^ @@ -21,40 +21,40 @@ LL | let _: baz!({ 10 + 7 }); | + + error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:36:20 + --> $DIR/macro_rules-braces.rs:32:20 | LL | let _: foo!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:40:19 + --> $DIR/macro_rules-braces.rs:36:19 | LL | let _: bar!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:45:20 + --> $DIR/macro_rules-braces.rs:41:20 | LL | let _: baz!({{ N }}); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:50:19 + --> $DIR/macro_rules-braces.rs:46:19 | LL | let _: biz!({ N }); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/exhaustive-value.full.stderr b/src/test/ui/const-generics/exhaustive-value.full.stderr deleted file mode 100644 index 4e89e4a3b17e9..0000000000000 --- a/src/test/ui/const-generics/exhaustive-value.full.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: the trait bound `(): Foo` is not satisfied - --> $DIR/exhaustive-value.rs:266:5 - | -LL | <() as Foo>::test() - | ^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()` - | - = help: the following implementations were found: - <() as Foo<0_u8>> - <() as Foo<100_u8>> - <() as Foo<101_u8>> - <() as Foo<102_u8>> - and 252 others -note: required by `Foo::test` - --> $DIR/exhaustive-value.rs:6:5 - | -LL | fn test() {} - | ^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/exhaustive-value.rs b/src/test/ui/const-generics/exhaustive-value.rs index 921f9a467078b..778d498343e08 100644 --- a/src/test/ui/const-generics/exhaustive-value.rs +++ b/src/test/ui/const-generics/exhaustive-value.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - trait Foo { fn test() {} } diff --git a/src/test/ui/const-generics/exhaustive-value.min.stderr b/src/test/ui/const-generics/exhaustive-value.stderr similarity index 88% rename from src/test/ui/const-generics/exhaustive-value.min.stderr rename to src/test/ui/const-generics/exhaustive-value.stderr index 4e89e4a3b17e9..0c6aced4bc22b 100644 --- a/src/test/ui/const-generics/exhaustive-value.min.stderr +++ b/src/test/ui/const-generics/exhaustive-value.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): Foo` is not satisfied - --> $DIR/exhaustive-value.rs:266:5 + --> $DIR/exhaustive-value.rs:262:5 | LL | <() as Foo>::test() | ^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()` @@ -11,7 +11,7 @@ LL | <() as Foo>::test() <() as Foo<102_u8>> and 252 others note: required by `Foo::test` - --> $DIR/exhaustive-value.rs:6:5 + --> $DIR/exhaustive-value.rs:2:5 | LL | fn test() {} | ^^^^^^^^^ diff --git a/src/test/ui/const-generics/fn-const-param-call.rs b/src/test/ui/const-generics/fn-const-param-call.rs index 70a104e22227d..dc516fb71c4b4 100644 --- a/src/test/ui/const-generics/fn-const-param-call.rs +++ b/src/test/ui/const-generics/fn-const-param-call.rs @@ -1,7 +1,7 @@ // Check that functions cannot be used as const parameters. // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] fn function() -> u32 { diff --git a/src/test/ui/const-generics/fn-const-param-infer.rs b/src/test/ui/const-generics/fn-const-param-infer.rs index d090479d4c30b..22f5f529c76ab 100644 --- a/src/test/ui/const-generics/fn-const-param-infer.rs +++ b/src/test/ui/const-generics/fn-const-param-infer.rs @@ -1,6 +1,6 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Checked bool>; diff --git a/src/test/ui/const-generics/fn-taking-const-generic-array.rs b/src/test/ui/const-generics/fn-taking-const-generic-array.rs deleted file mode 100644 index 58c1b95893e74..0000000000000 --- a/src/test/ui/const-generics/fn-taking-const-generic-array.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -use std::fmt::Display; - -fn print_slice(slice: &[T; N]) { - for x in slice.iter() { - println!("{}", x); - } -} - -fn main() { - print_slice(&[1, 2, 3]); -} diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr deleted file mode 100644 index 80eac994d55c9..0000000000000 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error: `A` is forbidden as the type of a const generic parameter - --> $DIR/forbid-non-structural_match-types.rs:9:19 - | -LL | struct B; // ok - | ^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: `C` is forbidden as the type of a const generic parameter - --> $DIR/forbid-non-structural_match-types.rs:14:19 - | -LL | struct D; - | ^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter - --> $DIR/forbid-non-structural_match-types.rs:14:19 - | -LL | struct D; - | ^ `C` doesn't derive both `PartialEq` and `Eq` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.rs b/src/test/ui/const-generics/forbid-non-structural_match-types.rs index 0fdb3ed4a5a79..6ae9d5cfbb54f 100644 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.rs +++ b/src/test/ui/const-generics/forbid-non-structural_match-types.rs @@ -1,17 +1,13 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![feature(adt_const_params)] +#![allow(incomplete_features)] #[derive(PartialEq, Eq)] struct A; struct B; // ok -//[min]~^ ERROR `A` is forbidden struct C; struct D; //~ ERROR `C` must be annotated with `#[derive(PartialEq, Eq)]` -//[min]~^ ERROR `C` is forbidden fn main() {} diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.stderr similarity index 85% rename from src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr rename to src/test/ui/const-generics/forbid-non-structural_match-types.stderr index 5c0f17537fa50..81b9bdfbd6027 100644 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr +++ b/src/test/ui/const-generics/forbid-non-structural_match-types.stderr @@ -1,5 +1,5 @@ error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter - --> $DIR/forbid-non-structural_match-types.rs:14:19 + --> $DIR/forbid-non-structural_match-types.rs:11:19 | LL | struct D; | ^ `C` doesn't derive both `PartialEq` and `Eq` diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr deleted file mode 100644 index b827e482977b4..0000000000000 --- a/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0044]: foreign items may not have const parameters - --> $DIR/foreign-item-const-parameter.rs:7:5 - | -LL | fn foo(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters - | - = help: replace the const parameters with concrete consts - -error[E0044]: foreign items may not have type or const parameters - --> $DIR/foreign-item-const-parameter.rs:9:5 - | -LL | fn bar(_: T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have type or const parameters - | - = help: replace the type or const parameters with concrete types or consts - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0044`. diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.rs b/src/test/ui/const-generics/foreign-item-const-parameter.rs index 83caa89f03300..4fe377b5964f7 100644 --- a/src/test/ui/const-generics/foreign-item-const-parameter.rs +++ b/src/test/ui/const-generics/foreign-item-const-parameter.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - extern "C" { fn foo(); //~ ERROR foreign items may not have const parameters diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.stderr similarity index 86% rename from src/test/ui/const-generics/foreign-item-const-parameter.min.stderr rename to src/test/ui/const-generics/foreign-item-const-parameter.stderr index b827e482977b4..b02db8700cffc 100644 --- a/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr +++ b/src/test/ui/const-generics/foreign-item-const-parameter.stderr @@ -1,5 +1,5 @@ error[E0044]: foreign items may not have const parameters - --> $DIR/foreign-item-const-parameter.rs:7:5 + --> $DIR/foreign-item-const-parameter.rs:2:5 | LL | fn foo(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters @@ -7,7 +7,7 @@ LL | fn foo(); = help: replace the const parameters with concrete consts error[E0044]: foreign items may not have type or const parameters - --> $DIR/foreign-item-const-parameter.rs:9:5 + --> $DIR/foreign-item-const-parameter.rs:4:5 | LL | fn bar(_: T); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have type or const parameters diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr deleted file mode 100644 index 2d19a58a1457b..0000000000000 --- a/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/generic-function-call-in-array-length.rs:8:29 - | -LL | fn bar() -> [u32; foo(N)] { - | ^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr deleted file mode 100644 index d7a3f04a8da85..0000000000000 --- a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/generic-function-call-in-array-length.rs:8:39 - | -LL | fn bar() -> [u32; foo(N)] { - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/generic-function-call-in-array-length.rs:11:13 - | -LL | [0; foo(N)] - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.rs b/src/test/ui/const-generics/generic-function-call-in-array-length.rs deleted file mode 100644 index a6d2bbd17eaab..0000000000000 --- a/src/test/ui/const-generics/generic-function-call-in-array-length.rs +++ /dev/null @@ -1,15 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - -const fn foo(n: usize) -> usize { n * 2 } - -fn bar() -> [u32; foo(N)] { - //[min]~^ ERROR generic parameters may not be used in const operations - //[full]~^^ ERROR constant expression depends on a generic parameter - [0; foo(N)] - //[min]~^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic-param-mismatch.min.stderr b/src/test/ui/const-generics/generic-param-mismatch.min.stderr deleted file mode 100644 index aff8780fb0d1c..0000000000000 --- a/src/test/ui/const-generics/generic-param-mismatch.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/generic-param-mismatch.rs:6:5 - | -LL | fn test() -> [u8; M] { - | ------- expected `[u8; M]` because of return type -LL | [0; N] - | ^^^^^^ expected `M`, found `N` - | - = note: expected array `[u8; M]` - found array `[u8; N]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/generic-param-mismatch.rs b/src/test/ui/const-generics/generic-param-mismatch.rs index 22fffe47dcc2f..2e201e50a64e9 100644 --- a/src/test/ui/const-generics/generic-param-mismatch.rs +++ b/src/test/ui/const-generics/generic-param-mismatch.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - fn test() -> [u8; M] { [0; N] //~ ERROR mismatched types } diff --git a/src/test/ui/const-generics/generic-param-mismatch.full.stderr b/src/test/ui/const-generics/generic-param-mismatch.stderr similarity index 91% rename from src/test/ui/const-generics/generic-param-mismatch.full.stderr rename to src/test/ui/const-generics/generic-param-mismatch.stderr index aff8780fb0d1c..d0776d49d71ba 100644 --- a/src/test/ui/const-generics/generic-param-mismatch.full.stderr +++ b/src/test/ui/const-generics/generic-param-mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/generic-param-mismatch.rs:6:5 + --> $DIR/generic-param-mismatch.rs:2:5 | LL | fn test() -> [u8; M] { | ------- expected `[u8; M]` because of return type diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr deleted file mode 100644 index c13882e7fe116..0000000000000 --- a/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/generic-sum-in-array-length.rs:6:45 - | -LL | fn foo(bar: [usize; A + B]) {} - | ^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr deleted file mode 100644 index cff5a62193c37..0000000000000 --- a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/generic-sum-in-array-length.rs:6:53 - | -LL | fn foo(bar: [usize; A + B]) {} - | ^ cannot perform const operation using `A` - | - = help: const parameters may only be used as standalone arguments, i.e. `A` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/generic-sum-in-array-length.rs:6:57 - | -LL | fn foo(bar: [usize; A + B]) {} - | ^ cannot perform const operation using `B` - | - = help: const parameters may only be used as standalone arguments, i.e. `B` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.rs b/src/test/ui/const-generics/generic-sum-in-array-length.rs deleted file mode 100644 index 7ee0394ba14ce..0000000000000 --- a/src/test/ui/const-generics/generic-sum-in-array-length.rs +++ /dev/null @@ -1,11 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - -fn foo(bar: [usize; A + B]) {} -//[min]~^ ERROR generic parameters may not be used in const operations -//[min]~| ERROR generic parameters may not be used in const operations -//[full]~^^^ ERROR constant expression depends on a generic parameter - -fn main() {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-1.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs similarity index 87% rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-1.rs rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs index 744a1c4de48c0..06f00de13a30c 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-1.rs +++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_evaluatable_checked, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo([u8; N as usize]) diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs similarity index 93% rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.rs rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs index 543774649ed51..3b5b87b2b3d63 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.rs +++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs @@ -1,4 +1,4 @@ -#![feature(const_evaluatable_checked, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Evaluatable {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.stderr rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs similarity index 96% rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.rs rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs index 2ca06bd1cb713..7561ae2febbdf 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.rs +++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Trait {} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.stderr rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-4.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs similarity index 94% rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-4.rs rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs index 0bb4fcff4d0b5..184263f899ab2 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-4.rs +++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_evaluatable_checked, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Trait {} diff --git a/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr new file mode 100644 index 0000000000000..deb6f3bd12c1d --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr @@ -0,0 +1,18 @@ +error: unconstrained generic constant + --> $DIR/array-size-in-generic-struct-param.rs:8:38 + | +LL | struct ArithArrayLen([u32; 0 + N]); + | ^^^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); 0 + N]:` + +error: overly complex generic constant + --> $DIR/array-size-in-generic-struct-param.rs:19:15 + | +LL | arr: [u8; CFG.arr_size], + | ^^^^^^^^^^^^ unsupported projection + | + = help: consider moving this anonymous constant into a `const` function + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr similarity index 74% rename from src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr rename to src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr index 8f6e56826fa1c..18e9135d07235 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr @@ -5,7 +5,7 @@ LL | struct ArithArrayLen([u32; 0 + N]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/array-size-in-generic-struct-param.rs:19:15 @@ -14,7 +14,7 @@ LL | arr: [u8; CFG.arr_size], | ^^^ cannot perform const operation using `CFG` | = help: const parameters may only be used as standalone arguments, i.e. `CFG` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: `Config` is forbidden as the type of a const generic parameter --> $DIR/array-size-in-generic-struct-param.rs:17:21 @@ -23,7 +23,7 @@ LL | struct B { | ^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 3 previous errors diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs similarity index 78% rename from src/test/ui/const-generics/array-size-in-generic-struct-param.rs rename to src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs index cd0a9742cd1ab..7d3fe413c1706 100644 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs +++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs @@ -1,12 +1,12 @@ // Tests that array sizes that depend on const-params are checked using `ConstEvaluatable`. // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs, adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] #[allow(dead_code)] struct ArithArrayLen([u32; 0 + N]); -//[full]~^ ERROR constant expression depends on a generic parameter +//[full]~^ ERROR unconstrained generic constant //[min]~^^ ERROR generic parameters may not be used in const operations #[derive(PartialEq, Eq)] @@ -17,7 +17,7 @@ struct Config { struct B { //[min]~^ ERROR `Config` is forbidden arr: [u8; CFG.arr_size], - //[full]~^ ERROR constant expression depends on a generic parameter + //[full]~^ ERROR overly complex generic constant //[min]~^^ ERROR generic parameters may not be used in const operations } diff --git a/src/test/ui/const_evaluatable/associated-const.rs b/src/test/ui/const-generics/generic_const_exprs/associated-const.rs similarity index 100% rename from src/test/ui/const_evaluatable/associated-const.rs rename to src/test/ui/const-generics/generic_const_exprs/associated-const.rs diff --git a/src/test/ui/const-generics/const_evaluatable_checked/associated-consts.rs b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs similarity index 90% rename from src/test/ui/const-generics/const_evaluatable_checked/associated-consts.rs rename to src/test/ui/const-generics/generic_const_exprs/associated-consts.rs index 533fe55b45bee..4d89f188ad777 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/associated-consts.rs +++ b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub trait BlockCipher { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/auxiliary/const_evaluatable_lib.rs b/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs similarity index 76% rename from src/test/ui/const-generics/const_evaluatable_checked/auxiliary/const_evaluatable_lib.rs rename to src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs index 9745dfed46087..15d618caef4b3 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/auxiliary/const_evaluatable_lib.rs +++ b/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub fn test1() -> [u8; std::mem::size_of::() - 1] diff --git a/src/test/ui/const-generics/const_evaluatable_checked/closures.rs b/src/test/ui/const-generics/generic_const_exprs/closures.rs similarity index 71% rename from src/test/ui/const-generics/const_evaluatable_checked/closures.rs rename to src/test/ui/const-generics/generic_const_exprs/closures.rs index 32f43591e37b9..847843fe1a63e 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/closures.rs +++ b/src/test/ui/const-generics/generic_const_exprs/closures.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn test() -> [u8; N + (|| 42)()] {} //~^ ERROR overly complex generic constant diff --git a/src/test/ui/const-generics/const_evaluatable_checked/closures.stderr b/src/test/ui/const-generics/generic_const_exprs/closures.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/closures.stderr rename to src/test/ui/const-generics/generic_const_exprs/closures.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs similarity index 87% rename from src/test/ui/const-generics/const_evaluatable_checked/cross_crate.rs rename to src/test/ui/const-generics/generic_const_exprs/cross_crate.rs index 53b237843871f..dfc69e0b0689d 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate.rs +++ b/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs @@ -1,6 +1,6 @@ // aux-build:const_evaluatable_lib.rs // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] extern crate const_evaluatable_lib; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs similarity index 87% rename from src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs rename to src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs index e3a4d9a96aa1e..b08fffd6922b6 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs +++ b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs @@ -1,5 +1,5 @@ // aux-build:const_evaluatable_lib.rs -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] extern crate const_evaluatable_lib; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr rename to src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs b/src/test/ui/const-generics/generic_const_exprs/different-fn.rs similarity index 84% rename from src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs rename to src/test/ui/const-generics/generic_const_exprs/different-fn.rs index 26c4295cd9b18..e8bc703bda615 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs +++ b/src/test/ui/const-generics/generic_const_exprs/different-fn.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/different-fn.stderr b/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/different-fn.stderr rename to src/test/ui/const-generics/generic_const_exprs/different-fn.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/division.rs b/src/test/ui/const-generics/generic_const_exprs/division.rs similarity index 76% rename from src/test/ui/const-generics/const_evaluatable_checked/division.rs rename to src/test/ui/const-generics/generic_const_exprs/division.rs index 71a5f2d347201..098fa9e0447a4 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/division.rs +++ b/src/test/ui/const-generics/generic_const_exprs/division.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn with_bound() where [u8; N / 2]: Sized { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/dont-eagerly-error-in-is-const-evaluatable.rs b/src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs similarity index 84% rename from src/test/ui/const-generics/const_evaluatable_checked/dont-eagerly-error-in-is-const-evaluatable.rs rename to src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs index 92a410afcb1a9..3543960c3ebdf 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/dont-eagerly-error-in-is-const-evaluatable.rs +++ b/src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(const_generics)] -#![feature(const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // This test is a repro for #82279. It checks that we don't error diff --git a/src/test/ui/const-generics/const_evaluatable_checked/drop_impl.rs b/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs similarity index 78% rename from src/test/ui/const-generics/const_evaluatable_checked/drop_impl.rs rename to src/test/ui/const-generics/generic_const_exprs/drop_impl.rs index 41fb5d70afd6e..077f77aa0f404 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/drop_impl.rs +++ b/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs @@ -1,5 +1,5 @@ //check-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo diff --git a/src/test/ui/const-generics/const_evaluatable_checked/elaborate-trait-pred.rs b/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs similarity index 88% rename from src/test/ui/const-generics/const_evaluatable_checked/elaborate-trait-pred.rs rename to src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs index 4a4fd1e33117f..e4111157ecdbd 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/elaborate-trait-pred.rs +++ b/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs @@ -1,7 +1,7 @@ // run-pass // Test that we use the elaborated predicates from traits // to satisfy const evaluatable predicates. -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.rs b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs similarity index 91% rename from src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.rs rename to src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs index 9f457fbd346cd..80d0662f1f498 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.rs +++ b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs @@ -1,5 +1,5 @@ #![crate_type = "lib"] -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub struct Const; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.stderr b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.stderr rename to src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/evaluated-to-ambig.rs b/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs similarity index 91% rename from src/test/ui/const-generics/const_evaluatable_checked/evaluated-to-ambig.rs rename to src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs index 0f36ce383a84c..340e35e1c65de 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/evaluated-to-ambig.rs +++ b/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs @@ -4,7 +4,7 @@ // only contain generic parameters. This is incorrect as trying to unify `N > 1` with `M > 1` // should fail. #![allow(incomplete_features)] -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] enum Assert {} trait IsTrue {} diff --git a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs new file mode 100644 index 0000000000000..10ab2fd867cfc --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs @@ -0,0 +1,11 @@ +type Arr = [u8; N - 1]; +//~^ ERROR generic parameters may not be used in const operations + +fn test() -> Arr where Arr: Default { + Default::default() +} + +fn main() { + let x = test::<33>(); + assert_eq!(x, [0; 32]); +} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr similarity index 63% rename from src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr rename to src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr index 7de4bfcdd0587..2d60ebaa83a1c 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr @@ -1,11 +1,11 @@ error: generic parameters may not be used in const operations - --> $DIR/feature-gate-const_evaluatable_checked.rs:5:33 + --> $DIR/feature-gate-generic_const_exprs.rs:1:33 | LL | type Arr = [u8; N - 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs b/src/test/ui/const-generics/generic_const_exprs/fn_call.rs similarity index 91% rename from src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs rename to src/test/ui/const-generics/generic_const_exprs/fn_call.rs index c182f5ef81b7d..cbe4277df5683 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs +++ b/src/test/ui/const-generics/generic_const_exprs/fn_call.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] const fn test_me(a: usize, b: usize) -> usize { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs similarity index 77% rename from src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs rename to src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs index 8167d785d7a8e..90953145944fe 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs +++ b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn test() -> [u8; N - 1] { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr rename to src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs b/src/test/ui/const-generics/generic_const_exprs/from-sig.rs similarity index 79% rename from src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs rename to src/test/ui/const-generics/generic_const_exprs/from-sig.rs index 5c05a5acfe96d..28de4f864671d 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs +++ b/src/test/ui/const-generics/generic_const_exprs/from-sig.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const_evaluatable/function-call.rs b/src/test/ui/const-generics/generic_const_exprs/function-call.rs similarity index 100% rename from src/test/ui/const_evaluatable/function-call.rs rename to src/test/ui/const-generics/generic_const_exprs/function-call.rs diff --git a/src/test/ui/const_evaluatable/function-call.stderr b/src/test/ui/const-generics/generic_const_exprs/function-call.stderr similarity index 100% rename from src/test/ui/const_evaluatable/function-call.stderr rename to src/test/ui/const-generics/generic_const_exprs/function-call.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs similarity index 87% rename from src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs rename to src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs index 193a365f9b65b..7120d6ee25183 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs +++ b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs b/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs similarity index 90% rename from src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs rename to src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs index cad06ea4004af..b8058c252e77f 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs +++ b/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::{mem, ptr}; diff --git a/src/test/ui/const-generics/issues/issue-62504.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr similarity index 79% rename from src/test/ui/const-generics/issues/issue-62504.full.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr index efbcdc3d2b783..f2ae361dc81d9 100644 --- a/src/test/ui/const-generics/issues/issue-62504.full.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr @@ -7,13 +7,13 @@ LL | ArrayHolder([0; Self::SIZE]) = note: expected type `X` found type `Self::SIZE` -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/issue-62504.rs:18:25 | LL | ArrayHolder([0; Self::SIZE]) | ^^^^^^^^^^ | - = note: this may fail depending on what value the parameter takes + = help: try adding a `where` bound using this expression: `where [(); Self::SIZE]:` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-62504.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr similarity index 100% rename from src/test/ui/const-generics/issues/issue-62504.min.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr diff --git a/src/test/ui/const-generics/issues/issue-62504.rs b/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs similarity index 66% rename from src/test/ui/const-generics/issues/issue-62504.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-62504.rs index 1b70cd1c37669..a97f4b8ff3131 100644 --- a/src/test/ui/const-generics/issues/issue-62504.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs @@ -1,6 +1,6 @@ // revisions: full min #![allow(incomplete_features)] -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] trait HasSize { @@ -16,8 +16,9 @@ struct ArrayHolder([u32; X]); impl ArrayHolder { pub const fn new() -> Self { ArrayHolder([0; Self::SIZE]) - //~^ ERROR constant expression depends on a generic parameter - //~| ERROR mismatched types + //~^ ERROR mismatched types + //[full]~^^ ERROR unconstrained generic constant + //[min]~^^^ ERROR constant expression depends on a generic parameter } } diff --git a/src/test/ui/const-generics/issues/issue-69654.rs b/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs similarity index 90% rename from src/test/ui/const-generics/issues/issue-69654.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-69654.rs index b1214b12a1440..9b36699bbf112 100644 --- a/src/test/ui/const-generics/issues/issue-69654.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Bar {} diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr similarity index 100% rename from src/test/ui/const-generics/issues/issue-69654.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr diff --git a/src/test/ui/const-generics/issues/issue-72787.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr similarity index 76% rename from src/test/ui/const-generics/issues/issue-72787.min.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr index 86d1da052aee6..3c7a740e8434a 100644 --- a/src/test/ui/const-generics/issues/issue-72787.min.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr @@ -1,20 +1,20 @@ error: generic parameters may not be used in const operations - --> $DIR/issue-72787.rs:10:17 + --> $DIR/issue-72787.rs:11:17 | LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `LHS` | = help: const parameters may only be used as standalone arguments, i.e. `LHS` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/issue-72787.rs:10:24 + --> $DIR/issue-72787.rs:11:24 | LL | Condition<{ LHS <= RHS }>: True | ^^^ cannot perform const operation using `RHS` | = help: const parameters may only be used as standalone arguments, i.e. `RHS` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:25:25 @@ -23,7 +23,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `I` | = help: const parameters may only be used as standalone arguments, i.e. `I` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/issue-72787.rs:25:36 @@ -32,7 +32,7 @@ LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, | ^ cannot perform const operation using `J` | = help: const parameters may only be used as standalone arguments, i.e. `J` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0283]: type annotations needed --> $DIR/issue-72787.rs:21:26 @@ -42,7 +42,7 @@ LL | IsLessOrEqual: True, | = note: cannot satisfy `IsLessOrEqual: True` note: required by a bound in `True` - --> $DIR/issue-72787.rs:7:1 + --> $DIR/issue-72787.rs:8:1 | LL | pub trait True {} | ^^^^^^^^^^^^^^ required by this bound in `True` @@ -55,7 +55,7 @@ LL | IsLessOrEqual: True, | = note: cannot satisfy `IsLessOrEqual: True` note: required by a bound in `True` - --> $DIR/issue-72787.rs:7:1 + --> $DIR/issue-72787.rs:8:1 | LL | pub trait True {} | ^^^^^^^^^^^^^^ required by this bound in `True` diff --git a/src/test/ui/const-generics/issues/issue-72787.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs similarity index 63% rename from src/test/ui/const-generics/issues/issue-72787.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-72787.rs index 16bc9470470f6..77ad57f0640fa 100644 --- a/src/test/ui/const-generics/issues/issue-72787.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs @@ -1,5 +1,6 @@ +// [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] pub struct IsLessOrEqual; @@ -8,8 +9,7 @@ pub trait True {} impl True for IsLessOrEqual where Condition<{ LHS <= RHS }>: True -//[full]~^ Error constant expression depends on a generic parameter -//[min]~^^ Error generic parameters may not be used in const operations +//[min]~^ Error generic parameters may not be used in const operations //[min]~| Error generic parameters may not be used in const operations { } @@ -23,11 +23,7 @@ where //[min]~| Error type annotations needed [E0283] IsLessOrEqual: True, IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, -//[full]~^ constant expression depends on a generic parameter -//[full]~| constant expression depends on a generic parameter -//[full]~| constant expression depends on a generic parameter -//[full]~| constant expression depends on a generic parameter -//[min]~^^^^^ Error generic parameters may not be used in const operations +//[min]~^ Error generic parameters may not be used in const operations //[min]~| Error generic parameters may not be used in const operations // Condition<{ 8 - I <= 8 - J }>: True, { diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr new file mode 100644 index 0000000000000..d536f6fd1d557 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/issue-72819-generic-in-const-eval.rs:20:12 + | +LL | let x: Arr<{usize::MAX}> = Arr {}; + | ^^^^^^^^^^^^^^^^^ expected `false`, found `true` + | + = note: expected type `false` + found type `true` + +error[E0308]: mismatched types + --> $DIR/issue-72819-generic-in-const-eval.rs:20:32 + | +LL | let x: Arr<{usize::MAX}> = Arr {}; + | ^^^ expected `false`, found `true` + | + = note: expected type `false` + found type `true` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr similarity index 74% rename from src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr index 6646be47b31e6..42671412fa77f 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr @@ -5,7 +5,7 @@ LL | where Assert::<{N < usize::MAX / 2}>: IsTrue, | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs similarity index 66% rename from src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs index f612d8bd3f6b1..7a5aa9e47d49c 100644 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs @@ -1,13 +1,12 @@ // Regression test for #72819: ICE due to failure in resolving the const generic in `Arr`'s type // bounds. // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] struct Arr where Assert::<{N < usize::MAX / 2}>: IsTrue, -//[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters may not be used in const operations +//[min]~^ ERROR generic parameters may not be used in const operations { } @@ -19,4 +18,6 @@ impl IsTrue for Assert {} fn main() { let x: Arr<{usize::MAX}> = Arr {}; + //[full]~^ ERROR mismatched types + //[full]~| ERROR mismatched types } diff --git a/src/test/ui/const-generics/issues/issue-73899.rs b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs similarity index 83% rename from src/test/ui/const-generics/issues/issue-73899.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-73899.rs index 2a3a5ab2a3bb0..d1ab1be04733f 100644 --- a/src/test/ui/const-generics/issues/issue-73899.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(const_evaluatable_checked)] -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Foo {} diff --git a/src/test/ui/const-generics/issues/issue-74634.rs b/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs similarity index 83% rename from src/test/ui/const-generics/issues/issue-74634.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-74634.rs index 0f23fa92c3679..cd1f7a9da687d 100644 --- a/src/test/ui/const-generics/issues/issue-74634.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs @@ -1,4 +1,5 @@ -#![feature(const_generics)] +// check-pass +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait If {} @@ -12,7 +13,7 @@ struct True; struct False; impl IsZero for () -where (): If<{N == 0}> { //~ERROR constant expression +where (): If<{N == 0}> { type Answer = True; } diff --git a/src/test/ui/const-generics/issues/issue-76595.rs b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs similarity index 83% rename from src/test/ui/const-generics/issues/issue-76595.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-76595.rs index 2d7051c3a245c..faa8b3d10de4f 100644 --- a/src/test/ui/const-generics/issues/issue-76595.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Bool; diff --git a/src/test/ui/const-generics/issues/issue-76595.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr similarity index 100% rename from src/test/ui/const-generics/issues/issue-76595.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr diff --git a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs similarity index 90% rename from src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs index 8f02bfb937a5a..2fa9a71fbb33c 100644 --- a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // This test is a minimized reproduction for #79518 where diff --git a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr similarity index 100% rename from src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr diff --git a/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs similarity index 87% rename from src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs index a34d74b29e9f0..77d3c98dab922 100644 --- a/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // This tests that the correct `param_env` is used so that diff --git a/src/test/ui/mir/issue-80742.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs similarity index 88% rename from src/test/ui/mir/issue-80742.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-80742.rs index c06d182fd567d..275f69953024c 100644 --- a/src/test/ui/mir/issue-80742.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs @@ -3,8 +3,7 @@ // This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place #![allow(incomplete_features)] -#![feature(const_evaluatable_checked)] -#![feature(const_generics)] +#![feature(generic_const_exprs)] use std::fmt::Debug; use std::marker::PhantomData; diff --git a/src/test/ui/mir/issue-80742.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr similarity index 91% rename from src/test/ui/mir/issue-80742.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr index b2b40bea7082e..56cb11bacbe6b 100644 --- a/src/test/ui/mir/issue-80742.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -7,13 +7,13 @@ LL | intrinsics::size_of::() | size_of called on unsized type `dyn Debug` | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL | - ::: $DIR/issue-80742.rs:23:10 + ::: $DIR/issue-80742.rs:22:10 | LL | [u8; size_of::() + 1]: , - | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:23:10 + | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:22:10 error[E0599]: the function or associated item `new` exists for struct `Inline`, but its trait bounds were not satisfied - --> $DIR/issue-80742.rs:31:36 + --> $DIR/issue-80742.rs:30:36 | LL | / struct Inline LL | | where @@ -44,20 +44,20 @@ LL | intrinsics::size_of::() | size_of called on unsized type `dyn Debug` | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL | - ::: $DIR/issue-80742.rs:15:10 + ::: $DIR/issue-80742.rs:14:10 | LL | [u8; size_of::() + 1]: , - | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:15:10 + | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:14:10 error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time - --> $DIR/issue-80742.rs:31:15 + --> $DIR/issue-80742.rs:30:15 | LL | let dst = Inline::::new(0); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn Debug` note: required by a bound in `Inline` - --> $DIR/issue-80742.rs:13:15 + --> $DIR/issue-80742.rs:12:15 | LL | struct Inline | ^ required by this bound in `Inline` diff --git a/src/test/ui/const-generics/issues/issue-83765.rs b/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs similarity index 94% rename from src/test/ui/const-generics/issues/issue-83765.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-83765.rs index f34badc693e76..fac811d1302fa 100644 --- a/src/test/ui/const-generics/issues/issue-83765.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait TensorDimension { diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr similarity index 100% rename from src/test/ui/const-generics/issues/issue-83765.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr diff --git a/src/test/ui/const-generics/issues/issue-84408.rs b/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs similarity index 92% rename from src/test/ui/const-generics/issues/issue-84408.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-84408.rs index e1ba850a4c1c0..fb2e5590d2163 100644 --- a/src/test/ui/const-generics/issues/issue-84408.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs @@ -1,7 +1,7 @@ // Regression test for #84408. // check-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Melon { diff --git a/src/test/ui/const-generics/issues/issue-85848.rs b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs similarity index 89% rename from src/test/ui/const-generics/issues/issue-85848.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-85848.rs index 478719869b2c4..771e68b0db58a 100644 --- a/src/test/ui/const-generics/issues/issue-85848.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_fn_trait_bound, const_evaluatable_checked)] +#![feature(const_fn_trait_bound, generic_const_exprs)] #![allow(incomplete_features)] trait _Contains { diff --git a/src/test/ui/const-generics/issues/issue-85848.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr similarity index 100% rename from src/test/ui/const-generics/issues/issue-85848.stderr rename to src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/less_than.rs b/src/test/ui/const-generics/generic_const_exprs/less_than.rs similarity index 81% rename from src/test/ui/const-generics/const_evaluatable_checked/less_than.rs rename to src/test/ui/const-generics/generic_const_exprs/less_than.rs index 907ea255abb08..2e9af1bf4f0bd 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/less_than.rs +++ b/src/test/ui/const-generics/generic_const_exprs/less_than.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs b/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs similarity index 88% rename from src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs rename to src/test/ui/const-generics/generic_const_exprs/let-bindings.rs index a6bb39208a42d..cd5d76dd949dd 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs +++ b/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // We do not yet want to support let-bindings in abstract consts, diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr b/src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr rename to src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr diff --git a/src/test/ui/const_evaluatable/needs_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs similarity index 81% rename from src/test/ui/const_evaluatable/needs_where_clause.rs rename to src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs index 498a2ae753361..2bd3c801fbf4a 100644 --- a/src/test/ui/const_evaluatable/needs_where_clause.rs +++ b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs @@ -1,5 +1,5 @@ #![crate_type = "lib"] -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] const fn complex_maths(n : usize) -> usize { diff --git a/src/test/ui/const_evaluatable/needs_where_clause.stderr b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr similarity index 100% rename from src/test/ui/const_evaluatable/needs_where_clause.stderr rename to src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs similarity index 88% rename from src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs rename to src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs index 0fe84c1cd2a72..7e5022817e414 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs +++ b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn callee() -> usize diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-2.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs similarity index 92% rename from src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-2.rs rename to src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs index 4f588238e23ff..769e3ae6895f2 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-2.rs +++ b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_evaluatable_checked, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Generic; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs similarity index 91% rename from src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-1.rs rename to src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs index 4d0b87efc77c3..316887e5e7fa5 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-1.rs +++ b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn zero_init() -> Substs1 diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-2.rs b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs similarity index 91% rename from src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-2.rs rename to src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs index be8219a744669..d45a6465b765a 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-2.rs +++ b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features, unused_parens, unused_braces)] fn zero_init() -> Substs1<{ (N) }> diff --git a/src/test/ui/const_evaluatable/no_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs similarity index 89% rename from src/test/ui/const_evaluatable/no_where_clause.rs rename to src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs index 12f4a22038ef7..9c5de03170b10 100644 --- a/src/test/ui/const_evaluatable/no_where_clause.rs +++ b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features, unused)] const fn complex_maths(n : usize) -> usize { diff --git a/src/test/ui/const_evaluatable/no_where_clause.stderr b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr similarity index 100% rename from src/test/ui/const_evaluatable/no_where_clause.stderr rename to src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs similarity index 86% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.rs rename to src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs index 5be4b41784c27..24d333aba0fde 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.rs +++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.stderr rename to src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs similarity index 89% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs rename to src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs index 5fbd4a5fa2e64..42c1cc507b5c9 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs +++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] #![deny(where_clauses_object_safety)] diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.stderr rename to src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs similarity index 74% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.rs rename to src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs index 9a95908d59d0d..c6c196db6f2a6 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.rs +++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Foo { @@ -16,7 +16,7 @@ fn use_dyn(v: &dyn Foo) where [u8; N + 1]: Sized { } fn main() { - // FIXME(const_evaluatable_checked): Improve the error message here. + // FIXME(generic_const_exprs): Improve the error message here. use_dyn(&()); //~^ ERROR type annotations needed } diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.stderr rename to src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs similarity index 86% rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok.rs rename to src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs index ae78b7936a289..f4c89f6235a0c 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok.rs +++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Foo { diff --git a/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs b/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs new file mode 100644 index 0000000000000..c47a350c7fb43 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs @@ -0,0 +1,14 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +type Arr = [u8; N - 1]; +//~^ ERROR evaluation of `Arr::<0_usize>::{constant#0}` failed + +fn test() -> Arr where [u8; N - 1]: Sized { +//~^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed + todo!() +} + +fn main() { + test::<0>(); +} diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr b/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr similarity index 90% rename from src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr rename to src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr index 1f2313a6028d1..99fc92fb4f0ad 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr @@ -1,11 +1,11 @@ error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed - --> $DIR/simple_fail.rs:10:48 + --> $DIR/simple_fail.rs:7:48 | LL | fn test() -> Arr where [u8; N - 1]: Sized { | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow error[E0080]: evaluation of `Arr::<0_usize>::{constant#0}` failed - --> $DIR/simple_fail.rs:6:33 + --> $DIR/simple_fail.rs:4:33 | LL | type Arr = [u8; N - 1]; | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow diff --git a/src/test/ui/const-generics/const_evaluatable_checked/subexprs_are_const_evalutable.rs b/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs similarity index 86% rename from src/test/ui/const-generics/const_evaluatable_checked/subexprs_are_const_evalutable.rs rename to src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs index 11c0760cdfe05..d6574a3aa2f8b 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/subexprs_are_const_evalutable.rs +++ b/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn make_array() -> [(); M + 1] { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/ty-alias-substitution.rs b/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs similarity index 83% rename from src/test/ui/const-generics/const_evaluatable_checked/ty-alias-substitution.rs rename to src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs index 5c768a61be25e..d058b36385091 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/ty-alias-substitution.rs +++ b/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs @@ -1,6 +1,6 @@ // check-pass // Test that we correctly substitute generic arguments for type aliases. -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] type Alias = [T; N + 1]; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unop.rs b/src/test/ui/const-generics/generic_const_exprs/unop.rs similarity index 82% rename from src/test/ui/const-generics/const_evaluatable_checked/unop.rs rename to src/test/ui/const-generics/generic_const_exprs/unop.rs index 8e0768b1c9595..c12fef083cc73 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/unop.rs +++ b/src/test/ui/const-generics/generic_const_exprs/unop.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unused-complex-default-expr.rs b/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs similarity index 65% rename from src/test/ui/const-generics/const_evaluatable_checked/unused-complex-default-expr.rs rename to src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs index 21f14f58ab5af..67fefd07ec0c4 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/unused-complex-default-expr.rs +++ b/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_generics, const_evaluatable_checked, const_generics_defaults)] +#![feature(generic_const_exprs, const_generics_defaults)] #![allow(incomplete_features)] struct Foo; struct Bar(Foo); diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.rs b/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs similarity index 89% rename from src/test/ui/const-generics/const_evaluatable_checked/unused_expr.rs rename to src/test/ui/const-generics/generic_const_exprs/unused_expr.rs index 9c603c57a4818..c1bf19e0f8d43 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.rs +++ b/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn add() -> [u8; { N + 1; 5 }] { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.stderr b/src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr similarity index 100% rename from src/test/ui/const-generics/const_evaluatable_checked/unused_expr.stderr rename to src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr diff --git a/src/test/ui/const-generics/impl-const-generic-struct.rs b/src/test/ui/const-generics/impl-const-generic-struct.rs index 1aa22698b6405..7eb2c6a51fcfb 100644 --- a/src/test/ui/const-generics/impl-const-generic-struct.rs +++ b/src/test/ui/const-generics/impl-const-generic-struct.rs @@ -1,9 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct S; impl S { diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr deleted file mode 100644 index ebc8f458f79c7..0000000000000 --- a/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position - --> $DIR/impl-trait-with-const-arguments.rs:23:20 - | -LL | assert_eq!(f::<4usize>(Usizable), 20usize); - | ^^^^^^ explicit generic argument not allowed - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0632`. diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.rs b/src/test/ui/const-generics/impl-trait-with-const-arguments.rs index 2e6e49b9c0aa4..24ba393c17f2a 100644 --- a/src/test/ui/const-generics/impl-trait-with-const-arguments.rs +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - trait Usizer { fn m(self) -> usize; } diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr similarity index 86% rename from src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr rename to src/test/ui/const-generics/impl-trait-with-const-arguments.stderr index ebc8f458f79c7..6268a564b06b6 100644 --- a/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr @@ -1,5 +1,5 @@ error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position - --> $DIR/impl-trait-with-const-arguments.rs:23:20 + --> $DIR/impl-trait-with-const-arguments.rs:18:20 | LL | assert_eq!(f::<4usize>(Usizable), 20usize); | ^^^^^^ explicit generic argument not allowed diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr deleted file mode 100644 index 7a12f3bdec278..0000000000000 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied - --> $DIR/incorrect-number-of-const-args.rs:11:5 - | -LL | foo::<0>(); - | ^^^ - supplied 1 generic argument - | | - | expected 2 generic arguments - | -note: function defined here, with 2 generic parameters: `X`, `Y` - --> $DIR/incorrect-number-of-const-args.rs:6:4 - | -LL | fn foo() -> usize { - | ^^^ - - -help: add missing generic argument - | -LL | foo::<0, Y>(); - | +++ - -error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied - --> $DIR/incorrect-number-of-const-args.rs:14:5 - | -LL | foo::<0, 0, 0>(); - | ^^^ - help: remove this generic argument - | | - | expected 2 generic arguments - | -note: function defined here, with 2 generic parameters: `X`, `Y` - --> $DIR/incorrect-number-of-const-args.rs:6:4 - | -LL | fn foo() -> usize { - | ^^^ - - - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.rs b/src/test/ui/const-generics/incorrect-number-of-const-args.rs index 305559d93fdad..de2d126afd75a 100644 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.rs +++ b/src/test/ui/const-generics/incorrect-number-of-const-args.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn foo() -> usize { 0 } diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr similarity index 83% rename from src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr rename to src/test/ui/const-generics/incorrect-number-of-const-args.stderr index 7a12f3bdec278..bf873dacd98e1 100644 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr +++ b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr @@ -1,5 +1,5 @@ error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied - --> $DIR/incorrect-number-of-const-args.rs:11:5 + --> $DIR/incorrect-number-of-const-args.rs:6:5 | LL | foo::<0>(); | ^^^ - supplied 1 generic argument @@ -7,7 +7,7 @@ LL | foo::<0>(); | expected 2 generic arguments | note: function defined here, with 2 generic parameters: `X`, `Y` - --> $DIR/incorrect-number-of-const-args.rs:6:4 + --> $DIR/incorrect-number-of-const-args.rs:1:4 | LL | fn foo() -> usize { | ^^^ - - @@ -17,7 +17,7 @@ LL | foo::<0, Y>(); | +++ error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied - --> $DIR/incorrect-number-of-const-args.rs:14:5 + --> $DIR/incorrect-number-of-const-args.rs:9:5 | LL | foo::<0, 0, 0>(); | ^^^ - help: remove this generic argument @@ -25,7 +25,7 @@ LL | foo::<0, 0, 0>(); | expected 2 generic arguments | note: function defined here, with 2 generic parameters: `X`, `Y` - --> $DIR/incorrect-number-of-const-args.rs:6:4 + --> $DIR/incorrect-number-of-const-args.rs:1:4 | LL | fn foo() -> usize { | ^^^ - - diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr deleted file mode 100644 index 01fb137dd6aff..0000000000000 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/cannot-infer-const-args.rs:11:5 - | -LL | foo(); - | ^^^ cannot infer the value of const parameter `X` declared on the function `foo` - | -help: consider specifying the const argument - | -LL | foo::(); - | ~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs b/src/test/ui/const-generics/infer/cannot-infer-const-args.rs index cc52892bd04b7..f85a72910aff1 100644 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs +++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn foo() -> usize { 0 } diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr similarity index 89% rename from src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr rename to src/test/ui/const-generics/infer/cannot-infer-const-args.stderr index 01fb137dd6aff..828f497240395 100644 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr +++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/cannot-infer-const-args.rs:11:5 + --> $DIR/cannot-infer-const-args.rs:6:5 | LL | foo(); | ^^^ cannot infer the value of const parameter `X` declared on the function `foo` diff --git a/src/test/ui/const-generics/infer/method-chain.min.stderr b/src/test/ui/const-generics/infer/method-chain.min.stderr deleted file mode 100644 index 979d50b85f146..0000000000000 --- a/src/test/ui/const-generics/infer/method-chain.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/method-chain.rs:20:33 - | -LL | Foo.bar().bar().bar().bar().baz(); - | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz` - | -help: consider specifying the const argument - | -LL | Foo.bar().bar().bar().bar().baz::(); - | ~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/method-chain.rs b/src/test/ui/const-generics/infer/method-chain.rs index 8ac6a7d6267b7..0c5eed4894cb3 100644 --- a/src/test/ui/const-generics/infer/method-chain.rs +++ b/src/test/ui/const-generics/infer/method-chain.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct Foo; impl Foo { diff --git a/src/test/ui/const-generics/infer/method-chain.full.stderr b/src/test/ui/const-generics/infer/method-chain.stderr similarity index 93% rename from src/test/ui/const-generics/infer/method-chain.full.stderr rename to src/test/ui/const-generics/infer/method-chain.stderr index 979d50b85f146..53d92e5ae725d 100644 --- a/src/test/ui/const-generics/infer/method-chain.full.stderr +++ b/src/test/ui/const-generics/infer/method-chain.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/method-chain.rs:20:33 + --> $DIR/method-chain.rs:15:33 | LL | Foo.bar().bar().bar().bar().baz(); | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz` diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr deleted file mode 100644 index 31b7fc7ccf5a0..0000000000000 --- a/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/one-param-uninferred.rs:15:23 - | -LL | let _: [u8; 17] = foo(); - | ^^^ cannot infer the value of const parameter `M` declared on the function `foo` - | -help: consider specifying the const argument - | -LL | let _: [u8; 17] = foo::(); - | ~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.rs b/src/test/ui/const-generics/infer/one-param-uninferred.rs index 0e947131f4cdb..d6018650f533d 100644 --- a/src/test/ui/const-generics/infer/one-param-uninferred.rs +++ b/src/test/ui/const-generics/infer/one-param-uninferred.rs @@ -1,10 +1,4 @@ // Test that we emit an error if we cannot properly infer a constant. -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(min, feature(min_const_generics))] - fn foo() -> [u8; N] { todo!() } diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.full.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.stderr similarity index 91% rename from src/test/ui/const-generics/infer/one-param-uninferred.full.stderr rename to src/test/ui/const-generics/infer/one-param-uninferred.stderr index 31b7fc7ccf5a0..acf59170c369e 100644 --- a/src/test/ui/const-generics/infer/one-param-uninferred.full.stderr +++ b/src/test/ui/const-generics/infer/one-param-uninferred.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/one-param-uninferred.rs:15:23 + --> $DIR/one-param-uninferred.rs:9:23 | LL | let _: [u8; 17] = foo(); | ^^^ cannot infer the value of const parameter `M` declared on the function `foo` diff --git a/src/test/ui/const-generics/infer/uninferred-consts.min.stderr b/src/test/ui/const-generics/infer/uninferred-consts.min.stderr deleted file mode 100644 index bee4b693825f3..0000000000000 --- a/src/test/ui/const-generics/infer/uninferred-consts.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/uninferred-consts.rs:13:9 - | -LL | Foo.foo(); - | ^^^ cannot infer the value of const parameter `A` declared on the associated function `foo` - | -help: consider specifying the const argument - | -LL | Foo.foo::(); - | ~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/infer/uninferred-consts.rs b/src/test/ui/const-generics/infer/uninferred-consts.rs index bcd9aadb78af9..657f4b513042c 100644 --- a/src/test/ui/const-generics/infer/uninferred-consts.rs +++ b/src/test/ui/const-generics/infer/uninferred-consts.rs @@ -1,8 +1,4 @@ // Test that we emit an error if we cannot properly infer a constant. -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] // taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893 struct Foo; diff --git a/src/test/ui/const-generics/infer/uninferred-consts.full.stderr b/src/test/ui/const-generics/infer/uninferred-consts.stderr similarity index 91% rename from src/test/ui/const-generics/infer/uninferred-consts.full.stderr rename to src/test/ui/const-generics/infer/uninferred-consts.stderr index bee4b693825f3..a6c79fc058a43 100644 --- a/src/test/ui/const-generics/infer/uninferred-consts.full.stderr +++ b/src/test/ui/const-generics/infer/uninferred-consts.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/uninferred-consts.rs:13:9 + --> $DIR/uninferred-consts.rs:9:9 | LL | Foo.foo(); | ^^^ cannot infer the value of const parameter `A` declared on the associated function `foo` diff --git a/src/test/ui/const-generics/infer_arg_from_pat.rs b/src/test/ui/const-generics/infer_arg_from_pat.rs index 5e2a3eaff5438..10317a1b98fcc 100644 --- a/src/test/ui/const-generics/infer_arg_from_pat.rs +++ b/src/test/ui/const-generics/infer_arg_from_pat.rs @@ -1,10 +1,6 @@ // run-pass // // see issue #70529 -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct A { arr: [u8; N], diff --git a/src/test/ui/const-generics/infer_arr_len_from_pat.rs b/src/test/ui/const-generics/infer_arr_len_from_pat.rs index 0273383856fd9..40f6f5b8d55ce 100644 --- a/src/test/ui/const-generics/infer_arr_len_from_pat.rs +++ b/src/test/ui/const-generics/infer_arr_len_from_pat.rs @@ -1,10 +1,6 @@ // check-pass // // see issue #70529 -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] fn as_chunks() -> [u8; N] { loop {} diff --git a/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs b/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs index 96e5976e44b33..2b8731ba7096c 100644 --- a/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs +++ b/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] fn takes_closure_of_array_3(f: F) where F: Fn([i32; 3]) { f([1, 2, 3]); diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr deleted file mode 100644 index 3e90dbeece958..0000000000000 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/intrinsics-type_name-as-const-argument.rs:14:8 - | -LL | T: Trait<{std::intrinsics::type_name::()}> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr index 8701d54f5c963..b8a1027c9ebdb 100644 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr @@ -1,20 +1,20 @@ error: generic parameters may not be used in const operations - --> $DIR/intrinsics-type_name-as-const-argument.rs:14:44 + --> $DIR/intrinsics-type_name-as-const-argument.rs:15:44 | LL | T: Trait<{std::intrinsics::type_name::()}> | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/intrinsics-type_name-as-const-argument.rs:9:22 + --> $DIR/intrinsics-type_name-as-const-argument.rs:10:22 | LL | trait Trait {} | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs index f24dd42eb2da7..147a00cb26bfc 100644 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs +++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs @@ -1,7 +1,8 @@ +// [full] check-pass // revisions: full min #![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params, generic_const_exprs))] #![feature(core_intrinsics)] #![feature(const_type_name)] @@ -13,7 +14,6 @@ struct Bug where T: Trait<{std::intrinsics::type_name::()}> //[min]~^ ERROR generic parameters may not be used in const operations - //[full]~^^ ERROR constant expression depends on a generic parameter { t: T } diff --git a/src/test/ui/const-generics/invalid-enum.rs b/src/test/ui/const-generics/invalid-enum.rs index 32939dcd2861b..bc3c09238f255 100644 --- a/src/test/ui/const-generics/invalid-enum.rs +++ b/src/test/ui/const-generics/invalid-enum.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(adt_const_params, const_generics_defaults)] #![allow(incomplete_features)] #[derive(PartialEq, Eq)] diff --git a/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs b/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs index f59eb60cb38f0..6a10ee267df93 100644 --- a/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs +++ b/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs @@ -1,5 +1,5 @@ -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] // All of these three items must be in `lib2` to reproduce the error @@ -10,6 +10,6 @@ pub trait TypeFn { pub struct GenericType; // Removing the braces around `42` resolves the crash -impl TypeFn for GenericType<{ 42 }> { +impl TypeFn for GenericType<{ 40 + 2 }> { type Output = (); } diff --git a/src/test/ui/const-generics/issues/auxiliary/impl-const.rs b/src/test/ui/const-generics/issues/auxiliary/impl-const.rs index 4a6b57842217e..de3a40860252e 100644 --- a/src/test/ui/const-generics/issues/auxiliary/impl-const.rs +++ b/src/test/ui/const-generics/issues/auxiliary/impl-const.rs @@ -1,5 +1,4 @@ -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![feature(generic_const_exprs)] pub struct Num; diff --git a/src/test/ui/const-generics/issues/issue-56445-1.full.stderr b/src/test/ui/const-generics/issues/issue-56445-1.full.stderr index 8416d64e1c2de..179643a755293 100644 --- a/src/test/ui/const-generics/issues/issue-56445-1.full.stderr +++ b/src/test/ui/const-generics/issues/issue-56445-1.full.stderr @@ -1,20 +1,11 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-56445-1.rs:3:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - error[E0771]: use of non-static lifetime `'a` in const generic - --> $DIR/issue-56445-1.rs:8:26 + --> $DIR/issue-56445-1.rs:9:26 | LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); | ^^ | = note: for more information, see issue #74052 -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error For more information about this error, try `rustc --explain E0771`. diff --git a/src/test/ui/const-generics/issues/issue-56445-1.min.stderr b/src/test/ui/const-generics/issues/issue-56445-1.min.stderr index f7056f27cb37b..179643a755293 100644 --- a/src/test/ui/const-generics/issues/issue-56445-1.min.stderr +++ b/src/test/ui/const-generics/issues/issue-56445-1.min.stderr @@ -1,5 +1,5 @@ error[E0771]: use of non-static lifetime `'a` in const generic - --> $DIR/issue-56445-1.rs:8:26 + --> $DIR/issue-56445-1.rs:9:26 | LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); | ^^ diff --git a/src/test/ui/const-generics/issues/issue-56445-1.rs b/src/test/ui/const-generics/issues/issue-56445-1.rs index bc9e1dee853e4..aeef778991f06 100644 --- a/src/test/ui/const-generics/issues/issue-56445-1.rs +++ b/src/test/ui/const-generics/issues/issue-56445-1.rs @@ -1,6 +1,7 @@ // Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995. // revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete +#![cfg_attr(full, feature(adt_const_params))] +#![cfg_attr(full, allow(incomplete_features))] #![crate_type = "lib"] use std::marker::PhantomData; diff --git a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr b/src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr deleted file mode 100644 index c03b7252a3c85..0000000000000 --- a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-60818-struct-constructors.rs:3:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs b/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs index 6e64c78cd8c96..0066490dfa37a 100644 --- a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs +++ b/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs @@ -1,6 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete struct Generic; diff --git a/src/test/ui/const-generics/issues/issue-61336-1.full.stderr b/src/test/ui/const-generics/issues/issue-61336-1.full.stderr deleted file mode 100644 index f18728eabbb43..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61336-1.full.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61336-1.rs:3:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-61336-1.rs b/src/test/ui/const-generics/issues/issue-61336-1.rs index c93b296dbb557..beb37e63b5e5d 100644 --- a/src/test/ui/const-generics/issues/issue-61336-1.rs +++ b/src/test/ui/const-generics/issues/issue-61336-1.rs @@ -1,7 +1,4 @@ // build-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete - fn f(x: T) -> [T; N] { [x; N] } diff --git a/src/test/ui/const-generics/issues/issue-61336-2.full.stderr b/src/test/ui/const-generics/issues/issue-61336-2.full.stderr deleted file mode 100644 index 8f07d208091a0..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61336-2.full.stderr +++ /dev/null @@ -1,24 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61336-2.rs:2:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-61336-2.rs:9:5 - | -LL | [x; { N }] - | ^^^^^^^^^^ the trait `Copy` is not implemented for `T` - | - = note: the `Copy` trait is required because the repeated element will be copied -help: consider restricting type parameter `T` - | -LL | fn g(x: T) -> [T; N] { - | +++++++++++++++++++ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/issues/issue-61336-2.rs b/src/test/ui/const-generics/issues/issue-61336-2.rs index a1cf641ff749f..b7cd29f89323a 100644 --- a/src/test/ui/const-generics/issues/issue-61336-2.rs +++ b/src/test/ui/const-generics/issues/issue-61336-2.rs @@ -1,6 +1,3 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete - fn f(x: T) -> [T; N] { [x; { N }] } diff --git a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr b/src/test/ui/const-generics/issues/issue-61336-2.stderr similarity index 93% rename from src/test/ui/const-generics/issues/issue-61336-2.min.stderr rename to src/test/ui/const-generics/issues/issue-61336-2.stderr index 9b62ffc93494b..48aaaf5e5440a 100644 --- a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61336-2.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-61336-2.rs:9:5 + --> $DIR/issue-61336-2.rs:6:5 | LL | [x; { N }] | ^^^^^^^^^^ the trait `Copy` is not implemented for `T` diff --git a/src/test/ui/const-generics/issues/issue-61336.full.stderr b/src/test/ui/const-generics/issues/issue-61336.full.stderr deleted file mode 100644 index 4883463c2e673..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61336.full.stderr +++ /dev/null @@ -1,24 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61336.rs:2:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-61336.rs:9:5 - | -LL | [x; N] - | ^^^^^^ the trait `Copy` is not implemented for `T` - | - = note: the `Copy` trait is required because the repeated element will be copied -help: consider restricting type parameter `T` - | -LL | fn g(x: T) -> [T; N] { - | +++++++++++++++++++ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/issues/issue-61336.rs b/src/test/ui/const-generics/issues/issue-61336.rs index c0106ee38c206..80be1d8e5e540 100644 --- a/src/test/ui/const-generics/issues/issue-61336.rs +++ b/src/test/ui/const-generics/issues/issue-61336.rs @@ -1,6 +1,3 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete - fn f(x: T) -> [T; N] { [x; N] } diff --git a/src/test/ui/const-generics/issues/issue-61336.min.stderr b/src/test/ui/const-generics/issues/issue-61336.stderr similarity index 94% rename from src/test/ui/const-generics/issues/issue-61336.min.stderr rename to src/test/ui/const-generics/issues/issue-61336.stderr index dc891842e1382..665a1a677a1ab 100644 --- a/src/test/ui/const-generics/issues/issue-61336.min.stderr +++ b/src/test/ui/const-generics/issues/issue-61336.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-61336.rs:9:5 + --> $DIR/issue-61336.rs:6:5 | LL | [x; N] | ^^^^^^ the trait `Copy` is not implemented for `T` diff --git a/src/test/ui/const-generics/issues/issue-61422.full.stderr b/src/test/ui/const-generics/issues/issue-61422.full.stderr deleted file mode 100644 index ac6c378295d31..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61422.full.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61422.rs:3:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-61422.rs b/src/test/ui/const-generics/issues/issue-61422.rs index 421f696f3fd8d..0b9cf40d85554 100644 --- a/src/test/ui/const-generics/issues/issue-61422.rs +++ b/src/test/ui/const-generics/issues/issue-61422.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete - use std::mem; // Neither of the uninits below are currently accepted as not UB, however, diff --git a/src/test/ui/const-generics/issues/issue-61432.full.stderr b/src/test/ui/const-generics/issues/issue-61432.full.stderr deleted file mode 100644 index 82b36de45a2aa..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61432.full.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61432.rs:3:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-61432.rs b/src/test/ui/const-generics/issues/issue-61432.rs index 97ab07daccefb..6192af82afb28 100644 --- a/src/test/ui/const-generics/issues/issue-61432.rs +++ b/src/test/ui/const-generics/issues/issue-61432.rs @@ -1,13 +1,6 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete fn promote() { - // works: - // - // let n = N; - // let _ = &n; - let _ = &N; } diff --git a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr deleted file mode 100644 index 56deec16548f5..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-61522-array-len-succ.rs:6:40 - | -LL | pub struct MyArray([u8; COUNT + 1]); - | ^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-61522-array-len-succ.rs:11:24 - | -LL | fn inner(&self) -> &[u8; COUNT + 1] { - | ^^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr deleted file mode 100644 index 36a0a37ae9c3f..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-61522-array-len-succ.rs:6:45 - | -LL | pub struct MyArray([u8; COUNT + 1]); - | ^^^^^ cannot perform const operation using `COUNT` - | - = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/issue-61522-array-len-succ.rs:11:30 - | -LL | fn inner(&self) -> &[u8; COUNT + 1] { - | ^^^^^ cannot perform const operation using `COUNT` - | - = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs deleted file mode 100644 index d4a948b92597d..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs +++ /dev/null @@ -1,18 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -pub struct MyArray([u8; COUNT + 1]); -//[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters may not be used - -impl MyArray { - fn inner(&self) -> &[u8; COUNT + 1] { - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used - &self.0 - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-61747.full.stderr b/src/test/ui/const-generics/issues/issue-61747.full.stderr deleted file mode 100644 index b7f66345c4aa3..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61747.full.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61747.rs:2:27 - | -LL | #![cfg_attr(full, feature(const_generics))] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -error: constant expression depends on a generic parameter - --> $DIR/issue-61747.rs:7:23 - | -LL | fn successor() -> Const<{C + 1}> { - | ^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error; 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-61747.min.stderr b/src/test/ui/const-generics/issues/issue-61747.min.stderr deleted file mode 100644 index b85533ccb46fb..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61747.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-61747.rs:7:30 - | -LL | fn successor() -> Const<{C + 1}> { - | ^ cannot perform const operation using `C` - | - = help: const parameters may only be used as standalone arguments, i.e. `C` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-61747.rs b/src/test/ui/const-generics/issues/issue-61747.rs deleted file mode 100644 index 3aa2e6a5c31dc..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61747.rs +++ /dev/null @@ -1,16 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete - -struct Const; - -impl Const<{C}> { - fn successor() -> Const<{C + 1}> { - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used - Const - } -} - -fn main() { - let _x: Const::<2> = Const::<1>::successor(); -} diff --git a/src/test/ui/const-generics/issues/issue-61935.full.stderr b/src/test/ui/const-generics/issues/issue-61935.full.stderr deleted file mode 100644 index b970f4e4c8e31..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61935.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-61935.rs:9:14 - | -LL | Self:FooImpl<{N==0}> - | ^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-61935.min.stderr b/src/test/ui/const-generics/issues/issue-61935.min.stderr deleted file mode 100644 index 9382dca31530e..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61935.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-61935.rs:9:23 - | -LL | Self:FooImpl<{N==0}> - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-61935.rs b/src/test/ui/const-generics/issues/issue-61935.rs deleted file mode 100644 index ed861c63bf1e3..0000000000000 --- a/src/test/ui/const-generics/issues/issue-61935.rs +++ /dev/null @@ -1,25 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -trait Foo {} - -impl Foo for [(); N] - where - Self:FooImpl<{N==0}> -//[full]~^ERROR constant expression depends on a generic parameter -//[min]~^^ERROR generic parameters may not be used in const operations -{} - -trait FooImpl{} - -impl FooImpl for [(); 0] {} - -impl FooImpl for [();N] {} - -fn foo(_: impl Foo) {} - -fn main() { - foo([]); - foo([()]); -} diff --git a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs b/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs index 1a0e46e599d95..fa76aeae901d1 100644 --- a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs +++ b/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs @@ -1,9 +1,4 @@ // run-pass - -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - pub trait BitLen: Sized { const BIT_LEN: usize; } diff --git a/src/test/ui/const-generics/issues/issue-62220.full.stderr b/src/test/ui/const-generics/issues/issue-62220.full.stderr deleted file mode 100644 index 373360c7ced6c..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62220.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-62220.rs:12:27 - | -LL | pub fn trunc(self) -> (TruncatedVector, T) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-62220.min.stderr b/src/test/ui/const-generics/issues/issue-62220.min.stderr deleted file mode 100644 index 72311d030cf0b..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62220.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-62220.rs:7:59 - | -LL | pub type TruncatedVector = Vector; - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-62220.rs b/src/test/ui/const-generics/issues/issue-62220.rs deleted file mode 100644 index c26784c9813c5..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62220.rs +++ /dev/null @@ -1,24 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -pub struct Vector([T; N]); - -pub type TruncatedVector = Vector; -//[min]~^ ERROR generic parameters may not be used in const operations - -impl Vector { - /// Drop the last component and return the vector with one fewer dimension. - pub fn trunc(self) -> (TruncatedVector, T) { - //[full]~^ ERROR constant expression depends on a generic parameter - unimplemented!() - } -} - -fn vec4(a: T, b: T, c: T, d: T) -> Vector { - Vector([a, b, c, d]) -} - -fn main() { - let (_xyz, _w): (TruncatedVector, u32) = vec4(0u32, 1, 2, 3).trunc(); -} diff --git a/src/test/ui/const-generics/issues/issue-62456.full.stderr b/src/test/ui/const-generics/issues/issue-62456.full.stderr deleted file mode 100644 index 833e70ca6d386..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62456.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-62456.rs:6:20 - | -LL | let _ = [0u64; N + 1]; - | ^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-62456.min.stderr b/src/test/ui/const-generics/issues/issue-62456.min.stderr deleted file mode 100644 index 920318fa0ac34..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62456.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-62456.rs:6:20 - | -LL | let _ = [0u64; N + 1]; - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-62456.rs b/src/test/ui/const-generics/issues/issue-62456.rs deleted file mode 100644 index e24cf36c8ce4e..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62456.rs +++ /dev/null @@ -1,11 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -fn foo() { - let _ = [0u64; N + 1]; - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr b/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr deleted file mode 100644 index 5c9387d4012db..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `NoMatch` is forbidden as the type of a const generic parameter - --> $DIR/issue-62579-no-match.rs:9:17 - | -LL | fn foo() -> bool { - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-62579-no-match.rs b/src/test/ui/const-generics/issues/issue-62579-no-match.rs deleted file mode 100644 index 46813f5256e58..0000000000000 --- a/src/test/ui/const-generics/issues/issue-62579-no-match.rs +++ /dev/null @@ -1,16 +0,0 @@ -// [full] run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -#[derive(PartialEq, Eq)] -struct NoMatch; - -fn foo() -> bool { - //[min]~^ ERROR `NoMatch` is forbidden as the type of a const generic parameter - true -} - -fn main() { - foo::<{NoMatch}>(); -} diff --git a/src/test/ui/const-generics/issues/issue-62878.full.stderr b/src/test/ui/const-generics/issues/issue-62878.full.stderr index 08f6454fa2dfe..f074a65313f12 100644 --- a/src/test/ui/const-generics/issues/issue-62878.full.stderr +++ b/src/test/ui/const-generics/issues/issue-62878.full.stderr @@ -4,21 +4,13 @@ error[E0770]: the type of const parameters must not depend on other generic para LL | fn foo() {} | ^ the type must not depend on the parameter `N` -error: constant expression depends on a generic parameter - --> $DIR/issue-62878.rs:10:14 - | -LL | foo::<_, {[1]}>(); - | ^^^^^ - | - = note: this may fail depending on what value the parameter takes - error[E0308]: mismatched types --> $DIR/issue-62878.rs:10:15 | LL | foo::<_, {[1]}>(); | ^^^ expected `usize`, found array `[{integer}; 1]` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0308, E0770. For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-62878.min.stderr b/src/test/ui/const-generics/issues/issue-62878.min.stderr index e4a71fe061869..af029a6516bc6 100644 --- a/src/test/ui/const-generics/issues/issue-62878.min.stderr +++ b/src/test/ui/const-generics/issues/issue-62878.min.stderr @@ -11,7 +11,7 @@ LL | fn foo() {} | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-62878.rs b/src/test/ui/const-generics/issues/issue-62878.rs index fb6257696b96d..38f5ff77b56a9 100644 --- a/src/test/ui/const-generics/issues/issue-62878.rs +++ b/src/test/ui/const-generics/issues/issue-62878.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics, generic_arg_infer))] +#![cfg_attr(full, feature(adt_const_params, generic_arg_infer))] #![cfg_attr(full, allow(incomplete_features))] fn foo() {} @@ -9,5 +9,4 @@ fn foo() {} fn main() { foo::<_, {[1]}>(); //[full]~^ ERROR mismatched types - //[full]~| ERROR constant expression } diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr index 2fb38addb2d81..b1141cf3bdfbf 100644 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr +++ b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr @@ -5,7 +5,7 @@ LL | fn test() { | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter --> $DIR/issue-63322-forbid-dyn.rs:9:18 diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs index 334e2aac02a48..01a6caa130f38 100644 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs +++ b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] trait A {} diff --git a/src/test/ui/const-generics/issues/issue-64494.full.stderr b/src/test/ui/const-generics/issues/issue-64494.full.stderr deleted file mode 100644 index abb26d6cf1753..0000000000000 --- a/src/test/ui/const-generics/issues/issue-64494.full.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-64494.rs:15:53 - | -LL | impl MyTrait for T where Is<{T::VAL == 5}>: True {} - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-64494.rs:18:53 - | -LL | impl MyTrait for T where Is<{T::VAL == 6}>: True {} - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr deleted file mode 100644 index 846db0c91b6e7..0000000000000 --- a/src/test/ui/const-generics/issues/issue-64494.min.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-64494.rs:15:38 - | -LL | impl MyTrait for T where Is<{T::VAL == 5}>: True {} - | ^^^^^^ cannot perform const operation using `T` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/issue-64494.rs:18:38 - | -LL | impl MyTrait for T where Is<{T::VAL == 6}>: True {} - | ^^^^^^ cannot perform const operation using `T` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error[E0119]: conflicting implementations of trait `MyTrait` - --> $DIR/issue-64494.rs:18:1 - | -LL | impl MyTrait for T where Is<{T::VAL == 5}>: True {} - | ------------------------------------ first implementation here -... -LL | impl MyTrait for T where Is<{T::VAL == 6}>: True {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/const-generics/issues/issue-64494.rs b/src/test/ui/const-generics/issues/issue-64494.rs deleted file mode 100644 index 96d19203109a5..0000000000000 --- a/src/test/ui/const-generics/issues/issue-64494.rs +++ /dev/null @@ -1,23 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -trait Foo { - const VAL: usize; -} - -trait MyTrait {} - -trait True {} -struct Is; -impl True for Is<{true}> {} - -impl MyTrait for T where Is<{T::VAL == 5}>: True {} -//[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters may not be used in const operations -impl MyTrait for T where Is<{T::VAL == 6}>: True {} -//[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters may not be used in const operations -//[min]~| ERROR conflicting implementations of trait `MyTrait` - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-64519.rs b/src/test/ui/const-generics/issues/issue-64519.rs index 8c603b74b9071..969289b26e80d 100644 --- a/src/test/ui/const-generics/issues/issue-64519.rs +++ b/src/test/ui/const-generics/issues/issue-64519.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct Foo { state: Option<[u8; D]>, } diff --git a/src/test/ui/const-generics/issues/issue-64519.stderr b/src/test/ui/const-generics/issues/issue-64519.stderr deleted file mode 100644 index 6552aea4ad1f1..0000000000000 --- a/src/test/ui/const-generics/issues/issue-64519.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-64519.rs:3:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-66205.full.stderr b/src/test/ui/const-generics/issues/issue-66205.full.stderr deleted file mode 100644 index 7e150f5f6db5a..0000000000000 --- a/src/test/ui/const-generics/issues/issue-66205.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-66205.rs:7:12 - | -LL | fact::<{ N - 1 }>(); - | ^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-66205.min.stderr b/src/test/ui/const-generics/issues/issue-66205.min.stderr deleted file mode 100644 index b41793b62d2dc..0000000000000 --- a/src/test/ui/const-generics/issues/issue-66205.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-66205.rs:7:14 - | -LL | fact::<{ N - 1 }>(); - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-66205.rs b/src/test/ui/const-generics/issues/issue-66205.rs deleted file mode 100644 index 14249b62ceed8..0000000000000 --- a/src/test/ui/const-generics/issues/issue-66205.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] -#![allow(dead_code, unconditional_recursion)] - -fn fact() { - fact::<{ N - 1 }>(); - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr deleted file mode 100644 index e96b9e7035264..0000000000000 --- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/issue-66596-impl-trait-for-str-const-arg.rs:8:25 - | -LL | trait Trait { - | ^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs index 2a741ba87a980..091419f0c52ec 100644 --- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs +++ b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs @@ -1,12 +1,9 @@ -//[full] check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +// check-pass +#![feature(adt_const_params)] +#![allow(incomplete_features)] trait Trait { -//[min]~^ ERROR `&'static str` is forbidden type Assoc; } diff --git a/src/test/ui/const-generics/issues/issue-66906.rs b/src/test/ui/const-generics/issues/issue-66906.rs index a871b118dcc52..a0b3f91220710 100644 --- a/src/test/ui/const-generics/issues/issue-66906.rs +++ b/src/test/ui/const-generics/issues/issue-66906.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] pub struct Tuple; diff --git a/src/test/ui/const-generics/issues/issue-67185-1.rs b/src/test/ui/const-generics/issues/issue-67185-1.rs index ed35a5f7c0a87..69425b25eaee4 100644 --- a/src/test/ui/const-generics/issues/issue-67185-1.rs +++ b/src/test/ui/const-generics/issues/issue-67185-1.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait Baz { type Quaks; diff --git a/src/test/ui/const-generics/issues/issue-67185-2.min.stderr b/src/test/ui/const-generics/issues/issue-67185-2.min.stderr deleted file mode 100644 index 19f419c82fdf6..0000000000000 --- a/src/test/ui/const-generics/issues/issue-67185-2.min.stderr +++ /dev/null @@ -1,111 +0,0 @@ -error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:16:1 - | -LL | / trait Foo -LL | | -LL | | where -LL | | [::Quaks; 2]: Bar, -LL | | ::Quaks: Bar, -LL | | { -LL | | } - | |_^ the trait `Bar` is not implemented for `[u16; 3]` - | - = help: the following implementations were found: - <[[u16; 3]; 3] as Bar> - <[u16; 4] as Bar> - = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable - -error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:16:1 - | -LL | / trait Foo -LL | | -LL | | where -LL | | [::Quaks; 2]: Bar, -LL | | ::Quaks: Bar, -LL | | { -LL | | } - | |_^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` - | - = help: the following implementations were found: - <[[u16; 3]; 3] as Bar> - <[u16; 4] as Bar> - = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable - -error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:26:6 - | -LL | impl Foo for FooImpl {} - | ^^^ the trait `Bar` is not implemented for `[u16; 3]` - | - = help: the following implementations were found: - <[[u16; 3]; 3] as Bar> - <[u16; 4] as Bar> -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:20:29 - | -LL | trait Foo - | --- required by a bound in this -... -LL | ::Quaks: Bar, - | ^^^ required by this bound in `Foo` - -error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:26:6 - | -LL | impl Foo for FooImpl {} - | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` - | - = help: the following implementations were found: - <[[u16; 3]; 3] as Bar> - <[u16; 4] as Bar> -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:19:34 - | -LL | trait Foo - | --- required by a bound in this -... -LL | [::Quaks; 2]: Bar, - | ^^^ required by this bound in `Foo` - -error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:30:14 - | -LL | fn f(_: impl Foo) {} - | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` - | - = help: the following implementations were found: - <[[u16; 3]; 3] as Bar> - <[u16; 4] as Bar> -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:19:34 - | -LL | trait Foo - | --- required by a bound in this -... -LL | [::Quaks; 2]: Bar, - | ^^^ required by this bound in `Foo` - -error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:30:14 - | -LL | fn f(_: impl Foo) {} - | ^^^ the trait `Bar` is not implemented for `[u16; 3]` - | - = help: the following implementations were found: - <[[u16; 3]; 3] as Bar> - <[u16; 4] as Bar> -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:20:29 - | -LL | trait Foo - | --- required by a bound in this -... -LL | ::Quaks: Bar, - | ^^^ required by this bound in `Foo` - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/issues/issue-67185-2.rs b/src/test/ui/const-generics/issues/issue-67185-2.rs index 94a713d7cf95e..c1a04e2014749 100644 --- a/src/test/ui/const-generics/issues/issue-67185-2.rs +++ b/src/test/ui/const-generics/issues/issue-67185-2.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - trait Baz { type Quaks; } diff --git a/src/test/ui/const-generics/issues/issue-67185-2.full.stderr b/src/test/ui/const-generics/issues/issue-67185-2.stderr similarity index 90% rename from src/test/ui/const-generics/issues/issue-67185-2.full.stderr rename to src/test/ui/const-generics/issues/issue-67185-2.stderr index 19f419c82fdf6..7167bea94bbb6 100644 --- a/src/test/ui/const-generics/issues/issue-67185-2.full.stderr +++ b/src/test/ui/const-generics/issues/issue-67185-2.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:16:1 + --> $DIR/issue-67185-2.rs:12:1 | LL | / trait Foo LL | | @@ -17,7 +17,7 @@ LL | | } = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:16:1 + --> $DIR/issue-67185-2.rs:12:1 | LL | / trait Foo LL | | @@ -35,7 +35,7 @@ LL | | } = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:26:6 + --> $DIR/issue-67185-2.rs:22:6 | LL | impl Foo for FooImpl {} | ^^^ the trait `Bar` is not implemented for `[u16; 3]` @@ -44,7 +44,7 @@ LL | impl Foo for FooImpl {} <[[u16; 3]; 3] as Bar> <[u16; 4] as Bar> note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:20:29 + --> $DIR/issue-67185-2.rs:16:29 | LL | trait Foo | --- required by a bound in this @@ -53,7 +53,7 @@ LL | ::Quaks: Bar, | ^^^ required by this bound in `Foo` error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:26:6 + --> $DIR/issue-67185-2.rs:22:6 | LL | impl Foo for FooImpl {} | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` @@ -62,7 +62,7 @@ LL | impl Foo for FooImpl {} <[[u16; 3]; 3] as Bar> <[u16; 4] as Bar> note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:19:34 + --> $DIR/issue-67185-2.rs:15:34 | LL | trait Foo | --- required by a bound in this @@ -71,7 +71,7 @@ LL | [::Quaks; 2]: Bar, | ^^^ required by this bound in `Foo` error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:30:14 + --> $DIR/issue-67185-2.rs:26:14 | LL | fn f(_: impl Foo) {} | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` @@ -80,7 +80,7 @@ LL | fn f(_: impl Foo) {} <[[u16; 3]; 3] as Bar> <[u16; 4] as Bar> note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:19:34 + --> $DIR/issue-67185-2.rs:15:34 | LL | trait Foo | --- required by a bound in this @@ -89,7 +89,7 @@ LL | [::Quaks; 2]: Bar, | ^^^ required by this bound in `Foo` error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:30:14 + --> $DIR/issue-67185-2.rs:26:14 | LL | fn f(_: impl Foo) {} | ^^^ the trait `Bar` is not implemented for `[u16; 3]` @@ -98,7 +98,7 @@ LL | fn f(_: impl Foo) {} <[[u16; 3]; 3] as Bar> <[u16; 4] as Bar> note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:20:29 + --> $DIR/issue-67185-2.rs:16:29 | LL | trait Foo | --- required by a bound in this diff --git a/src/test/ui/const-generics/issues/issue-67375.full.stderr b/src/test/ui/const-generics/issues/issue-67375.full.stderr index 0fe65272f1b78..5386ef56a245a 100644 --- a/src/test/ui/const-generics/issues/issue-67375.full.stderr +++ b/src/test/ui/const-generics/issues/issue-67375.full.stderr @@ -1,15 +1,15 @@ -warning: cannot use constants which depend on generic parameters in types - --> $DIR/issue-67375.rs:8:12 +error: overly complex generic constant + --> $DIR/issue-67375.rs:7:17 | LL | inner: [(); { [|_: &T| {}; 0].len() }], - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^----------^^^^^^^^^^^^ + | | + | unsupported rvalue | - = note: `#[warn(const_evaluatable_unchecked)]` on by default - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #76200 + = help: consider moving this anonymous constant into a `const` function error[E0392]: parameter `T` is never used - --> $DIR/issue-67375.rs:6:12 + --> $DIR/issue-67375.rs:5:12 | LL | struct Bug { | ^ unused parameter @@ -17,6 +17,6 @@ LL | struct Bug { = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` = help: if you intended `T` to be a const parameter, use `const T: usize` instead -error: aborting due to previous error; 1 warning emitted +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issues/issue-67375.min.stderr b/src/test/ui/const-generics/issues/issue-67375.min.stderr index be81fa921297b..5256d96c87694 100644 --- a/src/test/ui/const-generics/issues/issue-67375.min.stderr +++ b/src/test/ui/const-generics/issues/issue-67375.min.stderr @@ -1,14 +1,14 @@ error: generic parameters may not be used in const operations - --> $DIR/issue-67375.rs:8:25 + --> $DIR/issue-67375.rs:7:25 | LL | inner: [(); { [|_: &T| {}; 0].len() }], | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0392]: parameter `T` is never used - --> $DIR/issue-67375.rs:6:12 + --> $DIR/issue-67375.rs:5:12 | LL | struct Bug { | ^ unused parameter diff --git a/src/test/ui/const-generics/issues/issue-67375.rs b/src/test/ui/const-generics/issues/issue-67375.rs index a8875b8b6bfca..b5b842a15ae0c 100644 --- a/src/test/ui/const-generics/issues/issue-67375.rs +++ b/src/test/ui/const-generics/issues/issue-67375.rs @@ -1,14 +1,12 @@ // revisions: full min - #![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] struct Bug { //~^ ERROR parameter `T` is never used inner: [(); { [|_: &T| {}; 0].len() }], //[min]~^ ERROR generic parameters may not be used in const operations - //[full]~^^ WARN cannot use constants which depend on generic parameters in types - //[full]~^^^ WARN this was previously accepted by the compiler + //[full]~^^ ERROR overly complex generic constant } fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-67739.full.stderr b/src/test/ui/const-generics/issues/issue-67739.full.stderr index dcbe5b94a6281..f1a426c3c5861 100644 --- a/src/test/ui/const-generics/issues/issue-67739.full.stderr +++ b/src/test/ui/const-generics/issues/issue-67739.full.stderr @@ -1,10 +1,10 @@ -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/issue-67739.rs:11:15 | LL | [0u8; mem::size_of::()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this may fail depending on what value the parameter takes + = help: try adding a `where` bound using this expression: `where [(); mem::size_of::()]:` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-67739.rs b/src/test/ui/const-generics/issues/issue-67739.rs index e4960e56c9e4e..de0eb7f509ae5 100644 --- a/src/test/ui/const-generics/issues/issue-67739.rs +++ b/src/test/ui/const-generics/issues/issue-67739.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] use std::mem; @@ -9,7 +9,8 @@ pub trait Trait { fn associated_size(&self) -> usize { [0u8; mem::size_of::()]; - //~^ ERROR constant expression depends on a generic parameter + //[min]~^ ERROR constant expression depends on a generic parameter + //[full]~^^ ERROR unconstrained generic constant 0 } } diff --git a/src/test/ui/const-generics/issues/issue-67945-1.full.stderr b/src/test/ui/const-generics/issues/issue-67945-1.full.stderr index 63c50b5ca5423..1edc7828caad2 100644 --- a/src/test/ui/const-generics/issues/issue-67945-1.full.stderr +++ b/src/test/ui/const-generics/issues/issue-67945-1.full.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-67945-1.rs:13:20 + --> $DIR/issue-67945-1.rs:10:20 | LL | struct Bug { | - this type parameter @@ -13,7 +13,7 @@ LL | let x: S = MaybeUninit::uninit(); found union `MaybeUninit<_>` error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-1.rs:10:12 + --> $DIR/issue-67945-1.rs:7:12 | LL | struct Bug { | ^ unused parameter diff --git a/src/test/ui/const-generics/issues/issue-67945-1.min.stderr b/src/test/ui/const-generics/issues/issue-67945-1.min.stderr index 074d36c8ef3ed..eee04eb75a258 100644 --- a/src/test/ui/const-generics/issues/issue-67945-1.min.stderr +++ b/src/test/ui/const-generics/issues/issue-67945-1.min.stderr @@ -1,23 +1,23 @@ error: generic parameters may not be used in const operations - --> $DIR/issue-67945-1.rs:13:16 + --> $DIR/issue-67945-1.rs:10:16 | LL | let x: S = MaybeUninit::uninit(); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/issue-67945-1.rs:16:45 + --> $DIR/issue-67945-1.rs:13:45 | LL | let b = &*(&x as *const _ as *const S); | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-1.rs:10:12 + --> $DIR/issue-67945-1.rs:7:12 | LL | struct Bug { | ^ unused parameter diff --git a/src/test/ui/const-generics/issues/issue-67945-1.rs b/src/test/ui/const-generics/issues/issue-67945-1.rs index 84737e4e98578..7b7e8428639c7 100644 --- a/src/test/ui/const-generics/issues/issue-67945-1.rs +++ b/src/test/ui/const-generics/issues/issue-67945-1.rs @@ -1,11 +1,8 @@ // revisions: full min - #![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - -use std::marker::PhantomData; +#![cfg_attr(full, feature(generic_const_exprs))] -use std::mem::{self, MaybeUninit}; +use std::mem::MaybeUninit; struct Bug { //~^ ERROR parameter `S` is never used diff --git a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr index b900406023117..118cf447c01e2 100644 --- a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr +++ b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr @@ -1,27 +1,17 @@ -error[E0308]: mismatched types - --> $DIR/issue-67945-2.rs:11:20 +error: overly complex generic constant + --> $DIR/issue-67945-2.rs:7:13 | -LL | struct Bug { - | - this type parameter -... -LL | let x: S = MaybeUninit::uninit(); - | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit` - | | - | expected due to this +LL | A: [(); { + | _____________^ +LL | | +LL | | let x: Option> = None; + | | ---- unsupported rvalue +LL | | +LL | | 0 +LL | | }], + | |_____^ | - = note: expected type parameter `S` - found union `MaybeUninit<_>` + = help: consider moving this anonymous constant into a `const` function -error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-2.rs:8:12 - | -LL | struct Bug { - | ^ unused parameter - | - = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `S` to be a const parameter, use `const S: usize` instead - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0308, E0392. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-67945-2.min.stderr b/src/test/ui/const-generics/issues/issue-67945-2.min.stderr index c06df79f8428c..6e07af1e672a8 100644 --- a/src/test/ui/const-generics/issues/issue-67945-2.min.stderr +++ b/src/test/ui/const-generics/issues/issue-67945-2.min.stderr @@ -1,30 +1,8 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-67945-2.rs:11:16 +error: generic `Self` types are currently not permitted in anonymous constants + --> $DIR/issue-67945-2.rs:9:27 | -LL | let x: S = MaybeUninit::uninit(); - | ^ cannot perform const operation using `S` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/issue-67945-2.rs:14:45 - | -LL | let b = &*(&x as *const _ as *const S); - | ^ cannot perform const operation using `S` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-2.rs:8:12 - | -LL | struct Bug { - | ^ unused parameter - | - = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `S` to be a const parameter, use `const S: usize` instead +LL | let x: Option> = None; + | ^^^^ -error: aborting due to 3 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issues/issue-67945-2.rs b/src/test/ui/const-generics/issues/issue-67945-2.rs index 4a46786e9a9bf..cbb4e14eccf72 100644 --- a/src/test/ui/const-generics/issues/issue-67945-2.rs +++ b/src/test/ui/const-generics/issues/issue-67945-2.rs @@ -1,20 +1,16 @@ // revisions: full min #![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] -use std::mem::MaybeUninit; - -struct Bug { - //~^ ERROR parameter `S` is never used +struct Bug { A: [(); { - let x: S = MaybeUninit::uninit(); - //[min]~^ ERROR generic parameters may not be used in const operations - //[full]~^^ ERROR mismatched types - let b = &*(&x as *const _ as *const S); - //[min]~^ ERROR generic parameters may not be used in const operations + //[full]~^ ERROR overly complex generic constant + let x: Option> = None; + //[min]~^ ERROR generic `Self` types are currently not permitted in anonymous constants 0 }], + B: S } fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-67945-3.full.stderr b/src/test/ui/const-generics/issues/issue-67945-3.full.stderr deleted file mode 100644 index fa66252bd6946..0000000000000 --- a/src/test/ui/const-generics/issues/issue-67945-3.full.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-67945-3.rs:7:8 - | -LL | A: [(); { - | ________^ -LL | | -LL | | let x: Option> = None; -LL | | -LL | | 0 -LL | | }], - | |______^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-67945-3.min.stderr b/src/test/ui/const-generics/issues/issue-67945-3.min.stderr deleted file mode 100644 index 5c30429c89581..0000000000000 --- a/src/test/ui/const-generics/issues/issue-67945-3.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/issue-67945-3.rs:9:27 - | -LL | let x: Option> = None; - | ^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-67945-3.rs b/src/test/ui/const-generics/issues/issue-67945-3.rs deleted file mode 100644 index 5bad61cfc7638..0000000000000 --- a/src/test/ui/const-generics/issues/issue-67945-3.rs +++ /dev/null @@ -1,16 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - -struct Bug { - A: [(); { - //[full]~^ ERROR constant expression depends on a generic parameter - let x: Option> = None; - //[min]~^ ERROR generic `Self` types are currently not permitted in anonymous constants - 0 - }], - B: S -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs b/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs index 43c3999133c65..ad5710baae2bf 100644 --- a/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs +++ b/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs @@ -1,9 +1,7 @@ // aux-build:impl-const.rs // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] extern crate impl_const; diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr index da4cbd3081f89..9f370b0f510f4 100644 --- a/src/test/ui/const-generics/issues/issue-68366.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68366.min.stderr @@ -5,7 +5,7 @@ LL | impl Collatz<{Some(N)}> {} | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-68366.rs:11:13 diff --git a/src/test/ui/const-generics/issues/issue-68366.rs b/src/test/ui/const-generics/issues/issue-68366.rs index 37afed62327d6..4c2741ab43371 100644 --- a/src/test/ui/const-generics/issues/issue-68366.rs +++ b/src/test/ui/const-generics/issues/issue-68366.rs @@ -3,7 +3,7 @@ // type. // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] struct Collatz>; diff --git a/src/test/ui/const-generics/issues/issue-68596.rs b/src/test/ui/const-generics/issues/issue-68596.rs index 0bb23be1eb4ea..c3c9141e424d4 100644 --- a/src/test/ui/const-generics/issues/issue-68596.rs +++ b/src/test/ui/const-generics/issues/issue-68596.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - pub struct S(u8); impl S { diff --git a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr b/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr index 4782b1d98eba3..df04c4896b45a 100644 --- a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr @@ -5,7 +5,7 @@ LL | struct Const {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68615-adt.rs b/src/test/ui/const-generics/issues/issue-68615-adt.rs index ddea3e8ab6587..3ef1ad45edfd4 100644 --- a/src/test/ui/const-generics/issues/issue-68615-adt.rs +++ b/src/test/ui/const-generics/issues/issue-68615-adt.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Const {} diff --git a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr b/src/test/ui/const-generics/issues/issue-68615-array.min.stderr index d0c190b91b040..1b4517087e223 100644 --- a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr +++ b/src/test/ui/const-generics/issues/issue-68615-array.min.stderr @@ -5,7 +5,7 @@ LL | struct Foo {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-68615-array.rs b/src/test/ui/const-generics/issues/issue-68615-array.rs index 56afd9b2a154a..93477be41b590 100644 --- a/src/test/ui/const-generics/issues/issue-68615-array.rs +++ b/src/test/ui/const-generics/issues/issue-68615-array.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Foo {} diff --git a/src/test/ui/const-generics/issues/issue-68977.full.stderr b/src/test/ui/const-generics/issues/issue-68977.full.stderr deleted file mode 100644 index 25dcd88a4afcd..0000000000000 --- a/src/test/ui/const-generics/issues/issue-68977.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-68977.rs:34:44 - | -LL | FxpStorageHelper: FxpStorage, - | ^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-68977.min.stderr b/src/test/ui/const-generics/issues/issue-68977.min.stderr deleted file mode 100644 index 0b3d5b9a760f7..0000000000000 --- a/src/test/ui/const-generics/issues/issue-68977.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-68977.rs:28:17 - | -LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; - | ^^^^^^^^ cannot perform const operation using `INT_BITS` - | - = help: const parameters may only be used as standalone arguments, i.e. `INT_BITS` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/issue-68977.rs:28:28 - | -LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; - | ^^^^^^^^^ cannot perform const operation using `FRAC_BITS` - | - = help: const parameters may only be used as standalone arguments, i.e. `FRAC_BITS` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/issues/issue-68977.rs b/src/test/ui/const-generics/issues/issue-68977.rs deleted file mode 100644 index a0ffcc84c7a37..0000000000000 --- a/src/test/ui/const-generics/issues/issue-68977.rs +++ /dev/null @@ -1,43 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -struct PhantomU8; - -trait FxpStorage { - type SInt; // Add arithmetic traits as needed. -} - -macro_rules! fxp_storage_impls { - ($($($n:literal)|+ => $sint:ty),* $(,)?) => { - $($(impl FxpStorage for PhantomU8<$n> { - type SInt = $sint; - })*)* - } -} - -fxp_storage_impls! { - 1 => i8, - 2 => i16, - 3 | 4 => i32, - 5 | 6 | 7 | 8 => i64, - 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 => i128, -} - -type FxpStorageHelper = - PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>; - //[min]~^ ERROR generic parameters may not be used in const operations - //[min]~| ERROR generic parameters may not be used in const operations - -struct Fxp -where - FxpStorageHelper: FxpStorage, - //[full]~^ ERROR constant expression depends on a generic parameter -{ - storage: as FxpStorage>::SInt, -} - -fn main() { - Fxp::<1, 15> { storage: 0i16 }; - Fxp::<2, 15> { storage: 0i32 }; -} diff --git a/src/test/ui/const-generics/issues/issue-69654-run-pass.rs b/src/test/ui/const-generics/issues/issue-69654-run-pass.rs index 45318ca68fcc5..63d7fde78ac8a 100644 --- a/src/test/ui/const-generics/issues/issue-69654-run-pass.rs +++ b/src/test/ui/const-generics/issues/issue-69654-run-pass.rs @@ -1,8 +1,6 @@ -#![feature(const_generics)] -#![allow(incomplete_features, unused_braces)] - +// run-pass trait Bar {} -impl Bar for [u8; {7}] {} +impl Bar for [u8; 7] {} struct Foo {} impl Foo @@ -14,5 +12,4 @@ where fn main() { Foo::foo(); - //~^ ERROR the function or associated item } diff --git a/src/test/ui/const-generics/issues/issue-69654-run-pass.stderr b/src/test/ui/const-generics/issues/issue-69654-run-pass.stderr deleted file mode 100644 index a82a60696b36b..0000000000000 --- a/src/test/ui/const-generics/issues/issue-69654-run-pass.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0599]: the function or associated item `foo` exists for struct `Foo<{_: usize}>`, but its trait bounds were not satisfied - --> $DIR/issue-69654-run-pass.rs:16:10 - | -LL | struct Foo {} - | -------------------------- function or associated item `foo` not found for this -... -LL | Foo::foo(); - | ^^^ function or associated item cannot be called on `Foo<{_: usize}>` due to unsatisfied trait bounds - | - = note: the following trait bounds were not satisfied: - `[u8; _]: Bar<[(); _]>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/const-generics/issues/issue-70125-1.rs b/src/test/ui/const-generics/issues/issue-70125-1.rs index 5c118d245a1ec..0027cd46a519f 100644 --- a/src/test/ui/const-generics/issues/issue-70125-1.rs +++ b/src/test/ui/const-generics/issues/issue-70125-1.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] const L: usize = 4; diff --git a/src/test/ui/const-generics/issues/issue-70125-2.rs b/src/test/ui/const-generics/issues/issue-70125-2.rs index f82131262d6e3..cfd5e784ec404 100644 --- a/src/test/ui/const-generics/issues/issue-70125-2.rs +++ b/src/test/ui/const-generics/issues/issue-70125-2.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn main() { <()>::foo(); } diff --git a/src/test/ui/const-generics/issues/issue-70167.rs b/src/test/ui/const-generics/issues/issue-70167.rs index 9e912b691773b..3961941f81fa9 100644 --- a/src/test/ui/const-generics/issues/issue-70167.rs +++ b/src/test/ui/const-generics/issues/issue-70167.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - pub trait Trait: From<>::Item> { type Item; } diff --git a/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs b/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs index f0554823273a8..2ec37cc3a1be5 100644 --- a/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs +++ b/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs @@ -1,8 +1,4 @@ // build-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] pub fn works() { let array/*: [_; _]*/ = default_array(); diff --git a/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs b/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs index 21cefc09c253a..95e548428747f 100644 --- a/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs +++ b/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs @@ -1,8 +1,4 @@ // build-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] fn works() { let array/*: [u8; _]*/ = default_byte_array(); diff --git a/src/test/ui/const-generics/issues/issue-70225.rs b/src/test/ui/const-generics/issues/issue-70225.rs index 8f8d753d0a75f..d458d7b2e8713 100644 --- a/src/test/ui/const-generics/issues/issue-70225.rs +++ b/src/test/ui/const-generics/issues/issue-70225.rs @@ -1,6 +1,4 @@ // check-pass -#![feature(const_generics)] -#![allow(incomplete_features)] #![deny(dead_code)] // We previously incorrectly linted `L` as unused here. diff --git a/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs b/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs index 189a32570f76b..a76488249173a 100644 --- a/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs +++ b/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait T { fn f(); diff --git a/src/test/ui/const-generics/issues/issue-71169.full.stderr b/src/test/ui/const-generics/issues/issue-71169.full.stderr index 7b1a2f98dfeba..1f5880f368ee2 100644 --- a/src/test/ui/const-generics/issues/issue-71169.full.stderr +++ b/src/test/ui/const-generics/issues/issue-71169.full.stderr @@ -4,14 +4,6 @@ error[E0770]: the type of const parameters must not depend on other generic para LL | fn foo() {} | ^^^ the type must not depend on the parameter `LEN` -error: constant expression depends on a generic parameter - --> $DIR/issue-71169.rs:10:14 - | -LL | foo::<4, DATA>(); - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/issues/issue-71169.min.stderr b/src/test/ui/const-generics/issues/issue-71169.min.stderr index 1c6e08adffdff..87ed2d4f8da8c 100644 --- a/src/test/ui/const-generics/issues/issue-71169.min.stderr +++ b/src/test/ui/const-generics/issues/issue-71169.min.stderr @@ -11,7 +11,7 @@ LL | fn foo() {} | ^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-71169.rs b/src/test/ui/const-generics/issues/issue-71169.rs index a574da4b6b31d..617149a841893 100644 --- a/src/test/ui/const-generics/issues/issue-71169.rs +++ b/src/test/ui/const-generics/issues/issue-71169.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] fn foo() {} @@ -8,5 +8,4 @@ fn foo() {} fn main() { const DATA: [u8; 4] = *b"ABCD"; foo::<4, DATA>(); - //[full]~^ ERROR constant expression depends on } diff --git a/src/test/ui/const-generics/issues/issue-71202.rs b/src/test/ui/const-generics/issues/issue-71202.rs index 78dee1717f1fa..57fd72b12846e 100644 --- a/src/test/ui/const-generics/issues/issue-71202.rs +++ b/src/test/ui/const-generics/issues/issue-71202.rs @@ -1,6 +1,4 @@ -// check-pass - -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features, const_evaluatable_unchecked)] use std::marker::PhantomData; @@ -10,7 +8,7 @@ struct DataHolder { } impl DataHolder { - const ITEM_IS_COPY: [(); 1 - { + const ITEM_IS_COPY: [(); 1 - { //~ ERROR unconstrained generic constant trait NotCopy { const VALUE: bool = false; } diff --git a/src/test/ui/const-generics/issues/issue-71202.stderr b/src/test/ui/const-generics/issues/issue-71202.stderr new file mode 100644 index 0000000000000..277540610864b --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-71202.stderr @@ -0,0 +1,33 @@ +error: unconstrained generic constant + --> $DIR/issue-71202.rs:11:5 + | +LL | / const ITEM_IS_COPY: [(); 1 - { +LL | | trait NotCopy { +LL | | const VALUE: bool = false; +LL | | } +... | +LL | | >::VALUE +LL | | } as usize] = []; + | |_____________________^ + | + = help: try adding a `where` bound using this expression: `where [(); 1 - { + trait NotCopy { + const VALUE: bool = false; + } + + impl<__Type: ?Sized> NotCopy for __Type {} + + struct IsCopy<__Type: ?Sized>(PhantomData<__Type>); + + impl<__Type> IsCopy<__Type> + where + __Type: Sized + Copy, + { + const VALUE: bool = true; + } + + >::VALUE + } as usize]:` + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/issues/issue-71381.rs b/src/test/ui/const-generics/issues/issue-71381.rs index f015d6946954f..66f819dbe06e2 100644 --- a/src/test/ui/const-generics/issues/issue-71381.rs +++ b/src/test/ui/const-generics/issues/issue-71381.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Test(*const usize); diff --git a/src/test/ui/const-generics/issues/issue-71382.rs b/src/test/ui/const-generics/issues/issue-71382.rs index 3a56db937de09..4392d72e5668e 100644 --- a/src/test/ui/const-generics/issues/issue-71382.rs +++ b/src/test/ui/const-generics/issues/issue-71382.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Test(); diff --git a/src/test/ui/const-generics/issues/issue-71611.rs b/src/test/ui/const-generics/issues/issue-71611.rs index 6468d0b6bdae3..fbb91ca18aa4f 100644 --- a/src/test/ui/const-generics/issues/issue-71611.rs +++ b/src/test/ui/const-generics/issues/issue-71611.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] fn func(outer: A) { diff --git a/src/test/ui/const-generics/issues/issue-71986.rs b/src/test/ui/const-generics/issues/issue-71986.rs index 6bfdba5711ef6..6f0a98ead8870 100644 --- a/src/test/ui/const-generics/issues/issue-71986.rs +++ b/src/test/ui/const-generics/issues/issue-71986.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] pub trait Foo {} pub fn bar>() {} diff --git a/src/test/ui/const-generics/issues/issue-72352.rs b/src/test/ui/const-generics/issues/issue-72352.rs index 9cd95c11026d7..2fa1d7a533783 100644 --- a/src/test/ui/const-generics/issues/issue-72352.rs +++ b/src/test/ui/const-generics/issues/issue-72352.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] use std::ffi::{CStr, CString}; diff --git a/src/test/ui/const-generics/issues/issue-72787.full.stderr b/src/test/ui/const-generics/issues/issue-72787.full.stderr deleted file mode 100644 index fbb7ae59bef71..0000000000000 --- a/src/test/ui/const-generics/issues/issue-72787.full.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-72787.rs:10:32 - | -LL | Condition<{ LHS <= RHS }>: True - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-72787.rs:25:42 - | -LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-72787.rs:25:42 - | -LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-72787.rs:25:42 - | -LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-72787.rs:25:42 - | -LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, - | ^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 5 previous errors - diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr deleted file mode 100644 index 82f9b9d346dd8..0000000000000 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-72819-generic-in-const-eval.rs:8:39 - | -LL | where Assert::<{N < usize::MAX / 2}>: IsTrue, - | ^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-73120.rs b/src/test/ui/const-generics/issues/issue-73120.rs index c153a93cdef4f..050dc9bde64b0 100644 --- a/src/test/ui/const-generics/issues/issue-73120.rs +++ b/src/test/ui/const-generics/issues/issue-73120.rs @@ -1,6 +1,7 @@ -// revisions: full min // check-pass // aux-build:const_generic_issues_lib.rs +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] extern crate const_generic_issues_lib as lib2; fn unused_function( _: as lib2::TypeFn>::Output diff --git a/src/test/ui/const-generics/issues/issue-73260.rs b/src/test/ui/const-generics/issues/issue-73260.rs index 04e4e9cd52b00..d762f9c8b2620 100644 --- a/src/test/ui/const-generics/issues/issue-73260.rs +++ b/src/test/ui/const-generics/issues/issue-73260.rs @@ -1,11 +1,10 @@ // compile-flags: -Zsave-analysis - -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Arr -where Assert::<{N < usize::MAX / 2}>: IsTrue, //~ ERROR constant expression -{ -} +where + Assert::<{N < usize::MAX / 2}>: IsTrue, +{} enum Assert {} diff --git a/src/test/ui/const-generics/issues/issue-73260.stderr b/src/test/ui/const-generics/issues/issue-73260.stderr index 6a912ffc3c01b..f1fc50e6e5914 100644 --- a/src/test/ui/const-generics/issues/issue-73260.stderr +++ b/src/test/ui/const-generics/issues/issue-73260.stderr @@ -1,13 +1,5 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-73260.rs:6:39 - | -LL | where Assert::<{N < usize::MAX / 2}>: IsTrue, - | ^^^^^^ - | - = note: this may fail depending on what value the parameter takes - error[E0308]: mismatched types - --> $DIR/issue-73260.rs:17:12 + --> $DIR/issue-73260.rs:16:12 | LL | let x: Arr<{usize::MAX}> = Arr {}; | ^^^^^^^^^^^^^^^^^ expected `false`, found `true` @@ -16,7 +8,7 @@ LL | let x: Arr<{usize::MAX}> = Arr {}; found type `true` error[E0308]: mismatched types - --> $DIR/issue-73260.rs:17:32 + --> $DIR/issue-73260.rs:16:32 | LL | let x: Arr<{usize::MAX}> = Arr {}; | ^^^ expected `false`, found `true` @@ -24,6 +16,6 @@ LL | let x: Arr<{usize::MAX}> = Arr {}; = note: expected type `false` found type `true` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-73491.min.stderr b/src/test/ui/const-generics/issues/issue-73491.min.stderr index c8f2e0dadc1a7..f2b58e59f731f 100644 --- a/src/test/ui/const-generics/issues/issue-73491.min.stderr +++ b/src/test/ui/const-generics/issues/issue-73491.min.stderr @@ -5,7 +5,7 @@ LL | fn hoge() {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-73491.rs b/src/test/ui/const-generics/issues/issue-73491.rs index c7cb92baf30aa..f15c1f2d45521 100644 --- a/src/test/ui/const-generics/issues/issue-73491.rs +++ b/src/test/ui/const-generics/issues/issue-73491.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] const LEN: usize = 1024; diff --git a/src/test/ui/const-generics/issues/issue-73508.full.stderr b/src/test/ui/const-generics/issues/issue-73508.full.stderr deleted file mode 100644 index 81691a14ef67e..0000000000000 --- a/src/test/ui/const-generics/issues/issue-73508.full.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: using raw pointers as const generic parameters is forbidden - --> $DIR/issue-73508.rs:5:33 - | -LL | pub const fn func_name() {} - | ^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-73508.min.stderr b/src/test/ui/const-generics/issues/issue-73508.min.stderr deleted file mode 100644 index 81691a14ef67e..0000000000000 --- a/src/test/ui/const-generics/issues/issue-73508.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: using raw pointers as const generic parameters is forbidden - --> $DIR/issue-73508.rs:5:33 - | -LL | pub const fn func_name() {} - | ^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-73508.rs b/src/test/ui/const-generics/issues/issue-73508.rs deleted file mode 100644 index f02c4161dc109..0000000000000 --- a/src/test/ui/const-generics/issues/issue-73508.rs +++ /dev/null @@ -1,8 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -pub const fn func_name() {} -//~^ ERROR using raw pointers - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-74101.min.stderr b/src/test/ui/const-generics/issues/issue-74101.min.stderr index a7f0ecf0a2692..82ffb23324044 100644 --- a/src/test/ui/const-generics/issues/issue-74101.min.stderr +++ b/src/test/ui/const-generics/issues/issue-74101.min.stderr @@ -5,7 +5,7 @@ LL | fn test() {} | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `[u8; _]` is forbidden as the type of a const generic parameter --> $DIR/issue-74101.rs:9:21 @@ -14,7 +14,7 @@ LL | struct Foo; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-74101.rs b/src/test/ui/const-generics/issues/issue-74101.rs index d4fd72eb6daa3..6b606b9460fe2 100644 --- a/src/test/ui/const-generics/issues/issue-74101.rs +++ b/src/test/ui/const-generics/issues/issue-74101.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] fn test() {} diff --git a/src/test/ui/const-generics/issues/issue-74255.min.stderr b/src/test/ui/const-generics/issues/issue-74255.min.stderr index 62ad43974f4d8..b462d84487ee8 100644 --- a/src/test/ui/const-generics/issues/issue-74255.min.stderr +++ b/src/test/ui/const-generics/issues/issue-74255.min.stderr @@ -5,7 +5,7 @@ LL | fn ice_struct_fn() {} | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-74255.rs b/src/test/ui/const-generics/issues/issue-74255.rs index 75a876c27e59d..0e523926fb0b1 100644 --- a/src/test/ui/const-generics/issues/issue-74255.rs +++ b/src/test/ui/const-generics/issues/issue-74255.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] #[derive(PartialEq, Eq)] diff --git a/src/test/ui/const-generics/issues/issue-74634.stderr b/src/test/ui/const-generics/issues/issue-74634.stderr deleted file mode 100644 index 091a1ac7b9981..0000000000000 --- a/src/test/ui/const-generics/issues/issue-74634.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-74634.rs:15:11 - | -LL | where (): If<{N == 0}> { - | ^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-74906.rs b/src/test/ui/const-generics/issues/issue-74906.rs index dc3c33736dabf..cc1f2853fb2af 100644 --- a/src/test/ui/const-generics/issues/issue-74906.rs +++ b/src/test/ui/const-generics/issues/issue-74906.rs @@ -1,8 +1,6 @@ // edition:2018 // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] + const SIZE: usize = 16; diff --git a/src/test/ui/const-generics/issues/issue-74950.min.stderr b/src/test/ui/const-generics/issues/issue-74950.min.stderr index 4e640ff857eae..729ecc2022c99 100644 --- a/src/test/ui/const-generics/issues/issue-74950.min.stderr +++ b/src/test/ui/const-generics/issues/issue-74950.min.stderr @@ -5,7 +5,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:17:23 @@ -14,7 +14,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:17:23 @@ -23,7 +23,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:17:23 @@ -32,7 +32,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:17:23 @@ -41,7 +41,7 @@ LL | struct Outer; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 5 previous errors diff --git a/src/test/ui/const-generics/issues/issue-74950.rs b/src/test/ui/const-generics/issues/issue-74950.rs index 91e5cc776facf..3e1ca4735db61 100644 --- a/src/test/ui/const-generics/issues/issue-74950.rs +++ b/src/test/ui/const-generics/issues/issue-74950.rs @@ -1,6 +1,6 @@ // [full] build-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] diff --git a/src/test/ui/const-generics/issues/issue-75047.min.stderr b/src/test/ui/const-generics/issues/issue-75047.min.stderr index 3c1c3ea97b540..7798ae7962983 100644 --- a/src/test/ui/const-generics/issues/issue-75047.min.stderr +++ b/src/test/ui/const-generics/issues/issue-75047.min.stderr @@ -5,7 +5,7 @@ LL | struct Foo::value()]>; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-75047.rs b/src/test/ui/const-generics/issues/issue-75047.rs index 97437748177e4..ee3dcf9ecec50 100644 --- a/src/test/ui/const-generics/issues/issue-75047.rs +++ b/src/test/ui/const-generics/issues/issue-75047.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Bar(T); diff --git a/src/test/ui/const-generics/issues/issue-75299.rs b/src/test/ui/const-generics/issues/issue-75299.rs index 9d3f25b3b47f8..83ef09af88e3b 100644 --- a/src/test/ui/const-generics/issues/issue-75299.rs +++ b/src/test/ui/const-generics/issues/issue-75299.rs @@ -1,8 +1,5 @@ // compile-flags: -Zmir-opt-level=4 // run-pass - -#![feature(const_generics)] -#![allow(incomplete_features)] fn main() { fn foo() -> [u8; N] { [0; N] diff --git a/src/test/ui/const-generics/issues/issue-75763.rs b/src/test/ui/const-generics/issues/issue-75763.rs index c311de05a1cff..214a04b8a6bed 100644 --- a/src/test/ui/const-generics/issues/issue-75763.rs +++ b/src/test/ui/const-generics/issues/issue-75763.rs @@ -1,15 +1,15 @@ // ignore-test // FIXME(const_generics): This test causes an ICE after reverting #76030. - +#![feature(adt_const_params)] #![allow(incomplete_features)] -#![feature(const_generics)] + struct Bug; fn main() { let b: Bug::<{ unsafe { - // FIXME(const_generics): Decide on how to deal with invalid values as const params. + // FIXME(adt_const_params): Decide on how to deal with invalid values as const params. std::mem::transmute::<&[u8], &str>(&[0xC0, 0xC1, 0xF5]) } }>; diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr deleted file mode 100644 index 88b8ff89ffe10..0000000000000 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-76701-ty-param-in-const.rs:5:21 - | -LL | fn ty_param() -> [u8; std::mem::size_of::()] { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/issue-76701-ty-param-in-const.rs:11:37 - | -LL | fn const_param() -> [u8; N + 1] { - | ^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs index 9948982656357..2e6b0223656a7 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs @@ -1,16 +1,10 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn ty_param() -> [u8; std::mem::size_of::()] { - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations todo!() } fn const_param() -> [u8; N + 1] { - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations todo!() } diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr similarity index 64% rename from src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr rename to src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr index 32f70fa300727..3b53e18e6f56c 100644 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr @@ -1,20 +1,20 @@ error: generic parameters may not be used in const operations - --> $DIR/issue-76701-ty-param-in-const.rs:5:46 + --> $DIR/issue-76701-ty-param-in-const.rs:1:46 | LL | fn ty_param() -> [u8; std::mem::size_of::()] { | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations - --> $DIR/issue-76701-ty-param-in-const.rs:11:42 + --> $DIR/issue-76701-ty-param-in-const.rs:6:42 | LL | fn const_param() -> [u8; N + 1] { | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/issues/issue-80062.stderr b/src/test/ui/const-generics/issues/issue-80062.stderr index aad8907bda2d0..754f18d5cc420 100644 --- a/src/test/ui/const-generics/issues/issue-80062.stderr +++ b/src/test/ui/const-generics/issues/issue-80062.stderr @@ -5,7 +5,7 @@ LL | let _: [u8; sof::()]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-80375.stderr b/src/test/ui/const-generics/issues/issue-80375.stderr index 9765a639a48d0..5409002a9fdeb 100644 --- a/src/test/ui/const-generics/issues/issue-80375.stderr +++ b/src/test/ui/const-generics/issues/issue-80375.stderr @@ -5,7 +5,7 @@ LL | struct MyArray([u8; COUNT + 1]); | ^^^^^ cannot perform const operation using `COUNT` | = help: const parameters may only be used as standalone arguments, i.e. `COUNT` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-87076.rs b/src/test/ui/const-generics/issues/issue-87076.rs index 5dfda943bf69c..8a567678b824e 100644 --- a/src/test/ui/const-generics/issues/issue-87076.rs +++ b/src/test/ui/const-generics/issues/issue-87076.rs @@ -1,6 +1,6 @@ // build-pass -#![feature(const_generics)] +#![feature(adt_const_params)] #![allow(incomplete_features)] #[derive(PartialEq, Eq)] diff --git a/src/test/ui/const-generics/late-bound-vars/in_closure.rs b/src/test/ui/const-generics/late-bound-vars/in_closure.rs index 0aaeaffb4cb9d..5294cc3b5f42e 100644 --- a/src/test/ui/const-generics/late-bound-vars/in_closure.rs +++ b/src/test/ui/const-generics/late-bound-vars/in_closure.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] const fn inner<'a>() -> usize where &'a (): Sized { diff --git a/src/test/ui/const-generics/late-bound-vars/simple.rs b/src/test/ui/const-generics/late-bound-vars/simple.rs index 2c411a3bdc5f3..6da5395ef83ce 100644 --- a/src/test/ui/const-generics/late-bound-vars/simple.rs +++ b/src/test/ui/const-generics/late-bound-vars/simple.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] const fn inner<'a>() -> usize where &'a (): Sized { diff --git a/src/test/ui/const-generics/macro_rules-braces.full.stderr b/src/test/ui/const-generics/macro_rules-braces.full.stderr deleted file mode 100644 index b29e853510b1a..0000000000000 --- a/src/test/ui/const-generics/macro_rules-braces.full.stderr +++ /dev/null @@ -1,72 +0,0 @@ -error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/macro_rules-braces.rs:48:17 - | -LL | let _: baz!(m::P); - | ^^^^ - | -help: enclose the `const` expression in braces - | -LL | let _: baz!({ m::P }); - | + + - -error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/macro_rules-braces.rs:68:17 - | -LL | let _: baz!(10 + 7); - | ^^^^^^ - | -help: enclose the `const` expression in braces - | -LL | let _: baz!({ 10 + 7 }); - | + + - -error: constant expression depends on a generic parameter - --> $DIR/macro_rules-braces.rs:15:13 - | -LL | [u8; $x] - | ^^^^^^^^ -... -LL | let _: foo!({{ N }}); - | ------------- in this macro invocation - | - = note: this may fail depending on what value the parameter takes - = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: constant expression depends on a generic parameter - --> $DIR/macro_rules-braces.rs:20:13 - | -LL | [u8; { $x }] - | ^^^^^^^^^^^^ -... -LL | let _: bar!({ N }); - | ----------- in this macro invocation - | - = note: this may fail depending on what value the parameter takes - = note: this error originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: constant expression depends on a generic parameter - --> $DIR/macro_rules-braces.rs:25:13 - | -LL | Foo<$x> - | ^^^^^^^ -... -LL | let _: baz!({{ N }}); - | ------------- in this macro invocation - | - = note: this may fail depending on what value the parameter takes - = note: this error originates in the macro `baz` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: constant expression depends on a generic parameter - --> $DIR/macro_rules-braces.rs:30:13 - | -LL | Foo<{ $x }> - | ^^^^^^^^^^^ -... -LL | let _: biz!({ N }); - | ----------- in this macro invocation - | - = note: this may fail depending on what value the parameter takes - = note: this error originates in the macro `biz` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 6 previous errors - diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr index 176692448491a..bf0d0f352ebc4 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr @@ -5,7 +5,7 @@ LL | struct Break0([u8; { N + 1 }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:12:40 @@ -14,7 +14,7 @@ LL | struct Break1([u8; { { N } }]); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:16:17 @@ -23,7 +23,7 @@ LL | let _: [u8; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:21:17 @@ -32,7 +32,7 @@ LL | let _ = [0; N + 1]; | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:25:45 @@ -41,7 +41,7 @@ LL | struct BreakTy0(T, [u8; { size_of::<*mut T>() }]); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:28:47 @@ -50,7 +50,7 @@ LL | struct BreakTy1(T, [u8; { { size_of::<*mut T>() } }]); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic parameters may not be used in const operations --> $DIR/complex-expression.rs:32:32 @@ -59,7 +59,7 @@ LL | let _: [u8; size_of::<*mut T>() + 1]; | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions warning: cannot use constants which depend on generic parameters in types --> $DIR/complex-expression.rs:37:17 diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.stderr b/src/test/ui/const-generics/min_const_generics/complex-types.stderr index a658a7b395689..4ddbadb54661b 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-types.stderr +++ b/src/test/ui/const-generics/min_const_generics/complex-types.stderr @@ -5,7 +5,7 @@ LL | struct Foo; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:6:21 @@ -14,7 +14,7 @@ LL | struct Bar; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `No` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:11:21 @@ -23,7 +23,7 @@ LL | struct Fez; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:14:21 @@ -32,7 +32,7 @@ LL | struct Faz; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `!` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:17:21 @@ -41,7 +41,7 @@ LL | struct Fiz; | ^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:20:19 @@ -50,7 +50,7 @@ LL | enum Goo { A, B } | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:23:20 @@ -59,7 +59,7 @@ LL | union Boo { a: () } | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 7 previous errors diff --git a/src/test/ui/const-generics/min_const_generics/const_default_first.rs b/src/test/ui/const-generics/min_const_generics/const_default_first.rs index ae82c85eb7e4b..bba4e68d4cce5 100644 --- a/src/test/ui/const-generics/min_const_generics/const_default_first.rs +++ b/src/test/ui/const-generics/min_const_generics/const_default_first.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(const_generics)] #![feature(const_generics_defaults)] #![allow(incomplete_features, dead_code)] diff --git a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr b/src/test/ui/const-generics/min_const_generics/const_default_first.stderr index f7a2e484fc61b..1a333642f0c3c 100644 --- a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr +++ b/src/test/ui/const-generics/min_const_generics/const_default_first.stderr @@ -1,5 +1,5 @@ error: generic parameters with a default must be trailing - --> $DIR/const_default_first.rs:6:19 + --> $DIR/const_default_first.rs:5:19 | LL | struct Both { | ^ diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs index 881f8b98aad08..6215b7d936cfd 100644 --- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs +++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs @@ -1,5 +1,5 @@ // This test checks that non-static lifetimes are prohibited under `min_const_generics`. It -// currently emits an error with `min_const_generics`. This will ICE under `const_generics`. +// currently emits an error with `min_const_generics`. fn test() {} diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr index 5def54ca26d97..5f641b0709518 100644 --- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr +++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr @@ -4,8 +4,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | test::<{ let _: &'a (); 3 },>(); | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error[E0658]: a non-static lifetime is not allowed in a `const` --> $DIR/forbid-non-static-lifetimes.rs:21:16 @@ -13,8 +13,8 @@ error[E0658]: a non-static lifetime is not allowed in a `const` LL | [(); (|_: &'a u8| (), 0).1]; | ^^ | - = note: see issue #44580 for more information - = help: add `#![feature(const_generics)]` to the crate attributes to enable + = note: see issue #76560 for more information + = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr index 4fdfb5fbcb1a7..16a7687c00b54 100644 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr +++ b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr @@ -5,7 +5,7 @@ LL | fn t1() -> [u8; std::mem::size_of::()]; | ^^^^ cannot perform const operation using `Self` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: generic `Self` types are currently not permitted in anonymous constants --> $DIR/self-ty-in-const-1.rs:12:41 diff --git a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr index 647ef5400cb29..f30693221a513 100644 --- a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr +++ b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr @@ -5,7 +5,7 @@ LL | fn a() {} | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs b/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs index 435a63a528345..2adfa9a8c4be2 100644 --- a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs +++ b/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs @@ -1,7 +1,6 @@ // run-pass -#![feature(const_generics)] #![feature(const_generics_defaults)] -#![allow(incomplete_features, dead_code)] +#![allow(dead_code)] struct Both { arr: [T; N] diff --git a/src/test/ui/const-generics/mut-ref-const-param-array.rs b/src/test/ui/const-generics/mut-ref-const-param-array.rs deleted file mode 100644 index 6a5739db3aefb..0000000000000 --- a/src/test/ui/const-generics/mut-ref-const-param-array.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - - -use std::ops::AddAssign; - -fn inc(v: &mut [T; N]) -> &mut [T; N] { - for x in v.iter_mut() { - *x += x.clone(); - } - v -} - -fn main() { - let mut v = [1, 2, 3]; - inc(&mut v); - assert_eq!(v, [2, 4, 6]); -} diff --git a/src/test/ui/const-generics/nested-type.min.stderr b/src/test/ui/const-generics/nested-type.min.stderr index 6defd393ba068..4f32284ecb1e0 100644 --- a/src/test/ui/const-generics/nested-type.min.stderr +++ b/src/test/ui/const-generics/nested-type.min.stderr @@ -12,7 +12,7 @@ LL | | }]>; | |__^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants --> $DIR/nested-type.rs:15:5 diff --git a/src/test/ui/const-generics/nested-type.rs b/src/test/ui/const-generics/nested-type.rs index be8ebb7f401f2..039f996de96db 100644 --- a/src/test/ui/const-generics/nested-type.rs +++ b/src/test/ui/const-generics/nested-type.rs @@ -1,6 +1,6 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Foo(value: [u8; N + 2]) -> [u8; N * 2] { - //~^ ERROR constant expression depends on a generic parameter - //~| ERROR constant expression depends on a generic parameter todo!() } diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr index 671f1103dccad..f9b56bd387ae3 100644 --- a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr +++ b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr @@ -1,27 +1,11 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/unify-fixpoint.rs:1:12 +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/unify-fixpoint.rs:2:12 | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ +LL | #![feature(generic_const_exprs)] + | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information + = note: see issue #76560 for more information -error: constant expression depends on a generic parameter - --> $DIR/unify-fixpoint.rs:9:32 - | -LL | fn bind(value: [u8; N + 2]) -> [u8; N * 2] { - | ^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/unify-fixpoint.rs:9:48 - | -LL | fn bind(value: [u8; N + 2]) -> [u8; N * 2] { - | ^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors; 1 warning emitted +warning: 1 warning emitted diff --git a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs index 552b1b2a66ac5..c6324bca124cd 100644 --- a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs +++ b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs @@ -1,10 +1,9 @@ -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] -// This test would try to unify `N` with `N + 1` which must fail the occurs check. +// This test would tries to unify `N` with `N + 1` which must fail the occurs check. fn bind(value: [u8; N]) -> [u8; N + 1] { - //~^ ERROR constant expression depends on a generic parameter todo!() } @@ -12,6 +11,6 @@ fn sink(_: [u8; 5]) {} fn main() { let mut arr = Default::default(); - arr = bind(arr); + arr = bind(arr); //~ ERROR mismatched types sink(arr); } diff --git a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr index c1ac7eec1e7d8..6b8e688fba8d1 100644 --- a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr +++ b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr @@ -1,10 +1,9 @@ -error: constant expression depends on a generic parameter - --> $DIR/unify-n-nplusone.rs:6:44 +error[E0308]: mismatched types + --> $DIR/unify-n-nplusone.rs:14:11 | -LL | fn bind(value: [u8; N]) -> [u8; N + 1] { - | ^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes +LL | arr = bind(arr); + | ^^^^^^^^^ encountered a self-referencing constant error: aborting due to previous error +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-1.rs b/src/test/ui/const-generics/occurs-check/unused-substs-1.rs index 6ded9f13bc4fa..9d12250c91433 100644 --- a/src/test/ui/const-generics/occurs-check/unused-substs-1.rs +++ b/src/test/ui/const-generics/occurs-check/unused-substs-1.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Bar {} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs index 2d00141fbf70b..9a73f1a53e52f 100644 --- a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs +++ b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst. diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs index 2e306f8c4c88f..0d38bd3935194 100644 --- a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs +++ b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst. diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-4.rs b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs index 9c7f5ab91edb1..03c2f54861b43 100644 --- a/src/test/ui/const-generics/occurs-check/unused-substs-4.rs +++ b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs @@ -1,4 +1,4 @@ -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn bind(value: [u8; N]) -> [u8; 3 + 4] { diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-5.rs b/src/test/ui/const-generics/occurs-check/unused-substs-5.rs index e5d487d89b9f3..383ab4cd8c928 100644 --- a/src/test/ui/const-generics/occurs-check/unused-substs-5.rs +++ b/src/test/ui/const-generics/occurs-check/unused-substs-5.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // `N + 1` also depends on `T` here even if it doesn't use it. diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr index e8fd9e7769b79..9f0b2efae96ce 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr @@ -3,8 +3,6 @@ error: generic parameters with a default must be trailing | LL | struct Bar(T); | ^ - | - = note: using type defaults and const parameters in the same parameter list is currently not permitted error[E0128]: generic parameters with a default cannot use forward declared identifiers --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21 diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr index 5fa6423306c5a..17defbe86aa65 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr @@ -13,7 +13,7 @@ LL | struct Foo()]>(T, U); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0128]: generic parameters with a default cannot use forward declared identifiers --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21 diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs index 76c1b84aef557..b24a7afabd90f 100644 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs +++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] struct Foo()]>(T, U); diff --git a/src/test/ui/const-generics/parent_generics_of_encoding.rs b/src/test/ui/const-generics/parent_generics_of_encoding.rs index 31be8e7d111c7..b87e3960fc92c 100644 --- a/src/test/ui/const-generics/parent_generics_of_encoding.rs +++ b/src/test/ui/const-generics/parent_generics_of_encoding.rs @@ -1,6 +1,6 @@ // aux-build:generics_of_parent.rs // check-pass -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] extern crate generics_of_parent; diff --git a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs index 988777b1c90c1..ed81c01bb1726 100644 --- a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs +++ b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs @@ -1,5 +1,5 @@ // aux-build:generics_of_parent_impl_trait.rs -#![feature(const_generics, const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] extern crate generics_of_parent_impl_trait; diff --git a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs b/src/test/ui/const-generics/raw-ptr-const-param-deref.rs index ca7d33c0eb984..65595f07dab3c 100644 --- a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs +++ b/src/test/ui/const-generics/raw-ptr-const-param-deref.rs @@ -1,7 +1,7 @@ // Checks that pointers must not be used as the type of const params. // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] const A: u32 = 3; diff --git a/src/test/ui/const-generics/raw-ptr-const-param.rs b/src/test/ui/const-generics/raw-ptr-const-param.rs index a04c6d5e64e19..27ef9e7d96c9f 100644 --- a/src/test/ui/const-generics/raw-ptr-const-param.rs +++ b/src/test/ui/const-generics/raw-ptr-const-param.rs @@ -1,6 +1,6 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Const; //~ ERROR: using raw pointers as const generic parameters diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr index 166a35ee4556e..fed802f6adc6b 100644 --- a/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr +++ b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr @@ -5,7 +5,7 @@ LL | struct ConstString; | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static [u8]` is forbidden as the type of a const generic parameter --> $DIR/slice-const-param-mismatch.rs:9:28 @@ -14,7 +14,7 @@ LL | struct ConstBytes; | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.rs b/src/test/ui/const-generics/slice-const-param-mismatch.rs index f020e2bf66fb0..7127323e5babe 100644 --- a/src/test/ui/const-generics/slice-const-param-mismatch.rs +++ b/src/test/ui/const-generics/slice-const-param-mismatch.rs @@ -1,6 +1,6 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] diff --git a/src/test/ui/const-generics/slice-const-param.min.stderr b/src/test/ui/const-generics/slice-const-param.min.stderr deleted file mode 100644 index ed39a0c56b48d..0000000000000 --- a/src/test/ui/const-generics/slice-const-param.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/slice-const-param.rs:7:40 - | -LL | pub fn function_with_str() -> &'static str { - | ^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: `&'static [u8]` is forbidden as the type of a const generic parameter - --> $DIR/slice-const-param.rs:12:41 - | -LL | pub fn function_with_bytes() -> &'static [u8] { - | ^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/slice-const-param.rs b/src/test/ui/const-generics/slice-const-param.rs index bf1bf8af9222c..05d21e08d7453 100644 --- a/src/test/ui/const-generics/slice-const-param.rs +++ b/src/test/ui/const-generics/slice-const-param.rs @@ -1,16 +1,13 @@ -//[full] run-pass -// revisions: min full +// run-pass -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] +#![feature(adt_const_params)] +#![allow(incomplete_features)] pub fn function_with_str() -> &'static str { - //[min]~^ ERROR `&'static str` is forbidden STRING } pub fn function_with_bytes() -> &'static [u8] { - //[min]~^ ERROR `&'static [u8]` is forbidden BYTES } diff --git a/src/test/ui/const-generics/std/const-generics-range.min.stderr b/src/test/ui/const-generics/std/const-generics-range.min.stderr index 86e6159fdb577..d4b2ad6fd0c7b 100644 --- a/src/test/ui/const-generics/std/const-generics-range.min.stderr +++ b/src/test/ui/const-generics/std/const-generics-range.min.stderr @@ -5,7 +5,7 @@ LL | struct _Range>; | ^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `RangeFrom` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:12:28 @@ -14,7 +14,7 @@ LL | struct _RangeFrom>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `RangeFull` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:17:28 @@ -23,7 +23,7 @@ LL | struct _RangeFull; | ^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `RangeInclusive` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:23:33 @@ -32,7 +32,7 @@ LL | struct _RangeInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `RangeTo` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:28:26 @@ -41,7 +41,7 @@ LL | struct _RangeTo>; | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `RangeToInclusive` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:33:35 @@ -50,7 +50,7 @@ LL | struct _RangeToInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 6 previous errors diff --git a/src/test/ui/const-generics/std/const-generics-range.rs b/src/test/ui/const-generics/std/const-generics-range.rs index deaab830e91d3..46c06f312b98f 100644 --- a/src/test/ui/const-generics/std/const-generics-range.rs +++ b/src/test/ui/const-generics/std/const-generics-range.rs @@ -1,6 +1,6 @@ // [full] check-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] // `Range` should be usable within const generics: diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr deleted file mode 100644 index db998033c0a2f..0000000000000 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0573]: expected type, found const parameter `C` - --> $DIR/struct-with-invalid-const-param.rs:7:23 - | -LL | struct S(C); - | ^ not a type - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr deleted file mode 100644 index db998033c0a2f..0000000000000 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0573]: expected type, found const parameter `C` - --> $DIR/struct-with-invalid-const-param.rs:7:23 - | -LL | struct S(C); - | ^ not a type - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.rs b/src/test/ui/const-generics/struct-with-invalid-const-param.rs index 32970ccaa5dbc..be1c4b0e8e80e 100644 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.rs +++ b/src/test/ui/const-generics/struct-with-invalid-const-param.rs @@ -1,8 +1,4 @@ // Checks that a const param cannot be stored in a struct. -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct S(C); //~ ERROR expected type, found const parameter diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.stderr index 47617c7849f4a..67f497af50503 100644 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr +++ b/src/test/ui/const-generics/struct-with-invalid-const-param.stderr @@ -1,18 +1,9 @@ error[E0573]: expected type, found const parameter `C` - --> $DIR/struct-with-invalid-const-param.rs:4:23 + --> $DIR/struct-with-invalid-const-param.rs:3:23 | LL | struct S(C); | ^ not a type -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/struct-with-invalid-const-param.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/ui/const-generics/trait-const-args.rs b/src/test/ui/const-generics/trait-const-args.rs index 30d05c708e14f..2cdef3fb452c8 100644 --- a/src/test/ui/const-generics/trait-const-args.rs +++ b/src/test/ui/const-generics/trait-const-args.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct Const; trait Foo {} diff --git a/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr b/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr index f735be9c24e08..039c4276c8b77 100644 --- a/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr +++ b/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr @@ -5,7 +5,7 @@ LL | struct Const; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/transmute-const-param-static-reference.rs b/src/test/ui/const-generics/transmute-const-param-static-reference.rs index 3147d61ec9bd9..6b443c8bd907a 100644 --- a/src/test/ui/const-generics/transmute-const-param-static-reference.rs +++ b/src/test/ui/const-generics/transmute-const-param-static-reference.rs @@ -1,7 +1,7 @@ // revisions: full min //[full] check-pass -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Const; diff --git a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs index bf855d4dcaac8..926e807feb0b4 100644 --- a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs +++ b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs @@ -1,7 +1,7 @@ // run-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] use std::mem::MaybeUninit; diff --git a/src/test/ui/const-generics/type-after-const-ok.rs b/src/test/ui/const-generics/type-after-const-ok.rs index 920c067dc1a72..68d1940160c45 100644 --- a/src/test/ui/const-generics/type-after-const-ok.rs +++ b/src/test/ui/const-generics/type-after-const-ok.rs @@ -1,7 +1,7 @@ // [full] run-pass // revisions: full min // Verifies that having generic parameters after constants is permitted -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(const_generics_defaults))] #![cfg_attr(full, allow(incomplete_features))] #[allow(dead_code)] diff --git a/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs b/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs index cd9c3ae7bbc09..5dfcbba0e5959 100644 --- a/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs +++ b/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs @@ -1,6 +1,3 @@ -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - pub struct Struct(()); impl Struct { diff --git a/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs b/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs index 4997d493bbb4a..e844148346fb4 100644 --- a/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs +++ b/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs @@ -1,6 +1,6 @@ // run-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/type-dependent/issue-61936.rs b/src/test/ui/const-generics/type-dependent/issue-61936.rs index 417fe2501ae3e..7216b25f0df81 100644 --- a/src/test/ui/const-generics/type-dependent/issue-61936.rs +++ b/src/test/ui/const-generics/type-dependent/issue-61936.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait SliceExt { fn array_windows_example<'a, const N: usize>(&'a self) -> ArrayWindowsExample<'a, T, N>; diff --git a/src/test/ui/const-generics/type-dependent/issue-63695.rs b/src/test/ui/const-generics/type-dependent/issue-63695.rs index 2ece25bb41b2c..08b6d4bf554ad 100644 --- a/src/test/ui/const-generics/type-dependent/issue-63695.rs +++ b/src/test/ui/const-generics/type-dependent/issue-63695.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait T { fn test(&self) -> i32 { A } diff --git a/src/test/ui/const-generics/type-dependent/issue-67144-1.rs b/src/test/ui/const-generics/type-dependent/issue-67144-1.rs index 4a2c303095e55..27dd51de24171 100644 --- a/src/test/ui/const-generics/type-dependent/issue-67144-1.rs +++ b/src/test/ui/const-generics/type-dependent/issue-67144-1.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct X; impl X { diff --git a/src/test/ui/const-generics/type-dependent/issue-67144-2.rs b/src/test/ui/const-generics/type-dependent/issue-67144-2.rs index a1163fca8d4e2..b26f551eb8678 100644 --- a/src/test/ui/const-generics/type-dependent/issue-67144-2.rs +++ b/src/test/ui/const-generics/type-dependent/issue-67144-2.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct A; struct X; diff --git a/src/test/ui/const-generics/type-dependent/issue-69816.rs b/src/test/ui/const-generics/type-dependent/issue-69816.rs index 75ddd839f664d..cbb6b398e015b 100644 --- a/src/test/ui/const-generics/type-dependent/issue-69816.rs +++ b/src/test/ui/const-generics/type-dependent/issue-69816.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - trait IterExt: Sized + Iterator { fn default_for_size(self) -> [Self::Item; N] where diff --git a/src/test/ui/const-generics/type-dependent/issue-70217.rs b/src/test/ui/const-generics/type-dependent/issue-70217.rs index b3585d5fc1075..933ca0276098f 100644 --- a/src/test/ui/const-generics/type-dependent/issue-70217.rs +++ b/src/test/ui/const-generics/type-dependent/issue-70217.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct Struct; diff --git a/src/test/ui/const-generics/type-dependent/issue-70507.rs b/src/test/ui/const-generics/type-dependent/issue-70507.rs index df7c277f605ba..c72d9fbec2d8a 100644 --- a/src/test/ui/const-generics/type-dependent/issue-70507.rs +++ b/src/test/ui/const-generics/type-dependent/issue-70507.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] trait ConstChunksExactTrait { fn const_chunks_exact(&self) -> ConstChunksExact<'_, T, {N}>; diff --git a/src/test/ui/const-generics/type-dependent/issue-70586.rs b/src/test/ui/const-generics/type-dependent/issue-70586.rs index 5fb571f2394df..346ac4b72cc74 100644 --- a/src/test/ui/const-generics/type-dependent/issue-70586.rs +++ b/src/test/ui/const-generics/type-dependent/issue-70586.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - use std::marker::PhantomData; // This namespace is necessary for the ICE to trigger diff --git a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr b/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr index f3516d1de96bf..b8fbb3979799d 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr +++ b/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr @@ -5,7 +5,7 @@ LL | trait Get<'a, const N: &'static str> { | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: `&'static str` is forbidden as the type of a const generic parameter --> $DIR/issue-71348.rs:18:25 @@ -14,7 +14,7 @@ LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a >::Ta | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` + = help: more complex types are supported with `#![feature(adt_const_params)]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/type-dependent/issue-71348.rs b/src/test/ui/const-generics/type-dependent/issue-71348.rs index 33735ef87c5a3..2ef2f066a6f6d 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71348.rs +++ b/src/test/ui/const-generics/type-dependent/issue-71348.rs @@ -1,6 +1,6 @@ // [full] run-pass // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(adt_const_params))] #![cfg_attr(full, allow(incomplete_features))] struct Foo { diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr deleted file mode 100644 index 8ac9bab63208f..0000000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71382.rs:16:23 - | -LL | fn test u8>(&self) -> u8 { - | ^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.rs b/src/test/ui/const-generics/type-dependent/issue-71382.rs index b3677613dbc8c..1c4073e366833 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71382.rs +++ b/src/test/ui/const-generics/type-dependent/issue-71382.rs @@ -1,7 +1,3 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct Test; fn pass() -> u8 { diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.full.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.stderr similarity index 86% rename from src/test/ui/const-generics/type-dependent/issue-71382.full.stderr rename to src/test/ui/const-generics/type-dependent/issue-71382.stderr index 8ac9bab63208f..ad522aead9050 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71382.full.stderr +++ b/src/test/ui/const-generics/type-dependent/issue-71382.stderr @@ -1,5 +1,5 @@ error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71382.rs:16:23 + --> $DIR/issue-71382.rs:12:23 | LL | fn test u8>(&self) -> u8 { | ^^^^^^^^^^ diff --git a/src/test/ui/const-generics/type-dependent/issue-71805.rs b/src/test/ui/const-generics/type-dependent/issue-71805.rs index 3701e14eadcfc..060b899648e65 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71805.rs +++ b/src/test/ui/const-generics/type-dependent/issue-71805.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - use std::mem::MaybeUninit; trait CollectSlice<'a>: Iterator { diff --git a/src/test/ui/const-generics/type-dependent/issue-73730.rs b/src/test/ui/const-generics/type-dependent/issue-73730.rs index 5d7dcb9c458ab..5e1b8c6353723 100644 --- a/src/test/ui/const-generics/type-dependent/issue-73730.rs +++ b/src/test/ui/const-generics/type-dependent/issue-73730.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - trait Foo<'a, A>: Iterator { fn bar(&mut self) -> *const [A; N]; } diff --git a/src/test/ui/const-generics/type-dependent/non-local.rs b/src/test/ui/const-generics/type-dependent/non-local.rs index 9e4afba311403..b755de30b9ce9 100644 --- a/src/test/ui/const-generics/type-dependent/non-local.rs +++ b/src/test/ui/const-generics/type-dependent/non-local.rs @@ -1,9 +1,5 @@ // aux-build:type_dependent_lib.rs // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - extern crate type_dependent_lib; use type_dependent_lib::*; diff --git a/src/test/ui/const-generics/type-dependent/qpath.rs b/src/test/ui/const-generics/type-dependent/qpath.rs index b61e970cfb370..2d678d0acd3f7 100644 --- a/src/test/ui/const-generics/type-dependent/qpath.rs +++ b/src/test/ui/const-generics/type-dependent/qpath.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct A; impl A { fn foo() -> usize { N + 1 } diff --git a/src/test/ui/const-generics/type-dependent/simple.rs b/src/test/ui/const-generics/type-dependent/simple.rs index a4776a43b2116..1b13133b5b970 100644 --- a/src/test/ui/const-generics/type-dependent/simple.rs +++ b/src/test/ui/const-generics/type-dependent/simple.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct R; impl R { diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr b/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr index a0a14558490da..02108d8596037 100644 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr +++ b/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:11:27 + --> $DIR/type-mismatch.rs:8:27 | LL | assert_eq!(R.method::<1u16>(), 1); | ^^^^ expected `u8`, found `u16` diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr b/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr index a0a14558490da..02108d8596037 100644 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr +++ b/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:11:27 + --> $DIR/type-mismatch.rs:8:27 | LL | assert_eq!(R.method::<1u16>(), 1); | ^^^^ expected `u8`, found `u16` diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.rs b/src/test/ui/const-generics/type-dependent/type-mismatch.rs index 7fba1afe9189f..3335ab870f49f 100644 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.rs +++ b/src/test/ui/const-generics/type-dependent/type-mismatch.rs @@ -1,7 +1,4 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - struct R; impl R { diff --git a/src/test/ui/const-generics/type_of_anon_const.rs b/src/test/ui/const-generics/type_of_anon_const.rs index 9a2e9f09319d8..fb0d688a8abf5 100644 --- a/src/test/ui/const-generics/type_of_anon_const.rs +++ b/src/test/ui/const-generics/type_of_anon_const.rs @@ -1,9 +1,4 @@ // run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - trait T { fn l() -> usize; fn r() -> bool; diff --git a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr index 480ecdb387346..565c9ba1ff1f6 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr +++ b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:14:41 | -LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32` +LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32` | = note: expected type `2_u32` found type `4_u32` diff --git a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr index c19c8db737a19..ec9221d2486ae 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr +++ b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:14:41 | -LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32` +LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData }; + | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32` | | | expected due to this | diff --git a/src/test/ui/const-generics/types-mismatch-const-args.rs b/src/test/ui/const-generics/types-mismatch-const-args.rs index 14cef083d8373..c2092c4268e80 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.rs +++ b/src/test/ui/const-generics/types-mismatch-const-args.rs @@ -1,5 +1,5 @@ // revisions: full min -#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] // tests the diagnostic output of type mismatches for types that have const generics arguments. @@ -11,7 +11,7 @@ struct A<'a, T, const X: u32, const Y: u32> { } fn a<'a, 'b>() { - let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; + let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData }; //~^ ERROR mismatched types let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; //~^ ERROR mismatched types diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs index 9592f26623070..c7270e835c5a8 100644 --- a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs +++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] use std::fmt; diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs b/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs index 4bab2bb5a77f5..191caa78f9e37 100644 --- a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs +++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] use std::fmt; diff --git a/src/test/ui/const-generics/unknown_adt.min.stderr b/src/test/ui/const-generics/unknown_adt.min.stderr deleted file mode 100644 index b8b2e90aa66c6..0000000000000 --- a/src/test/ui/const-generics/unknown_adt.min.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `UnknownStruct` in this scope - --> $DIR/unknown_adt.rs:7:12 - | -LL | let _: UnknownStruct<7>; - | ^^^^^^^^^^^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/const-generics/unknown_adt.rs b/src/test/ui/const-generics/unknown_adt.rs index 977f90aad116d..8cdd28a8c6092 100644 --- a/src/test/ui/const-generics/unknown_adt.rs +++ b/src/test/ui/const-generics/unknown_adt.rs @@ -1,8 +1,3 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - fn main() { let _: UnknownStruct<7>; //~^ ERROR cannot find type `UnknownStruct` diff --git a/src/test/ui/const-generics/unknown_adt.full.stderr b/src/test/ui/const-generics/unknown_adt.stderr similarity index 89% rename from src/test/ui/const-generics/unknown_adt.full.stderr rename to src/test/ui/const-generics/unknown_adt.stderr index b8b2e90aa66c6..0f462dd4728f0 100644 --- a/src/test/ui/const-generics/unknown_adt.full.stderr +++ b/src/test/ui/const-generics/unknown_adt.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `UnknownStruct` in this scope - --> $DIR/unknown_adt.rs:7:12 + --> $DIR/unknown_adt.rs:2:12 | LL | let _: UnknownStruct<7>; | ^^^^^^^^^^^^^ not found in this scope diff --git a/src/test/ui/const-generics/unused-const-param.rs b/src/test/ui/const-generics/unused-const-param.rs index 2918e399dc8ee..c7f74cfac7d64 100644 --- a/src/test/ui/const-generics/unused-const-param.rs +++ b/src/test/ui/const-generics/unused-const-param.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] struct A; // ok diff --git a/src/test/ui/const-generics/unused_braces.fixed b/src/test/ui/const-generics/unused_braces.fixed index 836f26efc9601..d080c210e6bd2 100644 --- a/src/test/ui/const-generics/unused_braces.fixed +++ b/src/test/ui/const-generics/unused_braces.fixed @@ -1,11 +1,7 @@ // check-pass // run-rustfix - -#![allow(incomplete_features)] #![warn(unused_braces)] -#![feature(const_generics)] - struct A; fn main() { diff --git a/src/test/ui/const-generics/unused_braces.full.stderr b/src/test/ui/const-generics/unused_braces.full.stderr deleted file mode 100644 index 8899139aa6bb7..0000000000000 --- a/src/test/ui/const-generics/unused_braces.full.stderr +++ /dev/null @@ -1,14 +0,0 @@ -warning: unnecessary braces around const expression - --> $DIR/unused_braces.rs:14:14 - | -LL | let _: A<{ 7 }>; - | ^^^^^ help: remove these braces - | -note: the lint level is defined here - --> $DIR/unused_braces.rs:7:9 - | -LL | #![warn(unused_braces)] - | ^^^^^^^^^^^^^ - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/unused_braces.rs b/src/test/ui/const-generics/unused_braces.rs index 0348bbacaabd2..47f0f8c1c96c9 100644 --- a/src/test/ui/const-generics/unused_braces.rs +++ b/src/test/ui/const-generics/unused_braces.rs @@ -1,12 +1,7 @@ // check-pass // run-rustfix -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] #![warn(unused_braces)] - struct A; fn main() { diff --git a/src/test/ui/const-generics/unused_braces.min.stderr b/src/test/ui/const-generics/unused_braces.stderr similarity index 80% rename from src/test/ui/const-generics/unused_braces.min.stderr rename to src/test/ui/const-generics/unused_braces.stderr index 8899139aa6bb7..5e1bace549241 100644 --- a/src/test/ui/const-generics/unused_braces.min.stderr +++ b/src/test/ui/const-generics/unused_braces.stderr @@ -1,11 +1,11 @@ warning: unnecessary braces around const expression - --> $DIR/unused_braces.rs:14:14 + --> $DIR/unused_braces.rs:9:14 | LL | let _: A<{ 7 }>; | ^^^^^ help: remove these braces | note: the lint level is defined here - --> $DIR/unused_braces.rs:7:9 + --> $DIR/unused_braces.rs:3:9 | LL | #![warn(unused_braces)] | ^^^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/wf-misc.full.stderr b/src/test/ui/const-generics/wf-misc.full.stderr deleted file mode 100644 index dfb593a9507d5..0000000000000 --- a/src/test/ui/const-generics/wf-misc.full.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/wf-misc.rs:8:12 - | -LL | let _: [u8; N + 1]; - | ^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/wf-misc.rs:16:12 - | -LL | let _: Const::<{N + 1}>; - | ^^^^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/wf-misc.min.stderr b/src/test/ui/const-generics/wf-misc.min.stderr deleted file mode 100644 index 9967a2218f6ec..0000000000000 --- a/src/test/ui/const-generics/wf-misc.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/wf-misc.rs:8:17 - | -LL | let _: [u8; N + 1]; - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/wf-misc.rs:16:21 - | -LL | let _: Const::<{N + 1}>; - | ^ cannot perform const operation using `N` - | - = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/wf-misc.rs b/src/test/ui/const-generics/wf-misc.rs deleted file mode 100644 index 8a5b6ddfe2668..0000000000000 --- a/src/test/ui/const-generics/wf-misc.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Tests miscellaneous well-formedness examples. -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -pub fn arr_len() { - let _: [u8; N + 1]; - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations -} - -struct Const; - -pub fn func_call() { - let _: Const::<{N + 1}>; - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/where-clauses.rs b/src/test/ui/const-generics/where-clauses.rs index dc09cad3180bf..aa3ca1cf6de73 100644 --- a/src/test/ui/const-generics/where-clauses.rs +++ b/src/test/ui/const-generics/where-clauses.rs @@ -1,8 +1,4 @@ // check-pass -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - trait Bar { fn bar() {} } trait Foo: Bar {} diff --git a/src/test/ui/consts/const-needs_drop-monomorphic.rs b/src/test/ui/consts/const-needs_drop-monomorphic.rs index 9f66e3cfa23c0..7402c680985b0 100644 --- a/src/test/ui/consts/const-needs_drop-monomorphic.rs +++ b/src/test/ui/consts/const-needs_drop-monomorphic.rs @@ -1,5 +1,5 @@ // Check that evaluation of needs_drop fails when T is not monomorphic. -#![feature(const_generics)] +#![feature(generic_const_exprs)] #![allow(const_evaluatable_unchecked)] #![allow(incomplete_features)] @@ -10,7 +10,7 @@ impl Bool { fn f() { Bool::<{ std::mem::needs_drop::() }>::assert(); //~^ ERROR no function or associated item named `assert` found - //~| ERROR constant expression depends on a generic parameter + //~| ERROR unconstrained generic constant } fn main() { f::(); diff --git a/src/test/ui/consts/const-needs_drop-monomorphic.stderr b/src/test/ui/consts/const-needs_drop-monomorphic.stderr index 0770d06e15be8..6e56d20c39d7f 100644 --- a/src/test/ui/consts/const-needs_drop-monomorphic.stderr +++ b/src/test/ui/consts/const-needs_drop-monomorphic.stderr @@ -7,13 +7,13 @@ LL | struct Bool {} LL | Bool::<{ std::mem::needs_drop::() }>::assert(); | ^^^^^^ function or associated item cannot be called on `Bool<{ std::mem::needs_drop::() }>` due to unsatisfied trait bounds -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/const-needs_drop-monomorphic.rs:11:5 | LL | Bool::<{ std::mem::needs_drop::() }>::assert(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this may fail depending on what value the parameter takes + = help: try adding a `where` bound using this expression: `where [(); { std::mem::needs_drop::() }]:` error: aborting due to 2 previous errors diff --git a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr index 4d57765e13f5a..e4e10468d5348 100644 --- a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr +++ b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr @@ -5,7 +5,7 @@ LL | Some(T) = std::mem::size_of::(), | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr index f89be630eeb30..7ea8a39129ead 100644 --- a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr +++ b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr @@ -5,7 +5,7 @@ LL | Some = std::mem::size_of::(), | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0392]: parameter `T` is never used --> $DIR/issue-70453-generics-in-discr-ice.rs:7:20 diff --git a/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr b/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr index 8c97af263b287..0a7a631606ee4 100644 --- a/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr +++ b/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr @@ -5,7 +5,7 @@ LL | Some(T) = core::mem::size_of::<*mut T>(), | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/enum/issue-67945-1.stderr b/src/test/ui/enum/issue-67945-1.stderr index 227899e75350f..8f1b5b38e4c35 100644 --- a/src/test/ui/enum/issue-67945-1.stderr +++ b/src/test/ui/enum/issue-67945-1.stderr @@ -5,7 +5,7 @@ LL | let x: S = 0; | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0392]: parameter `S` is never used --> $DIR/issue-67945-1.rs:1:10 diff --git a/src/test/ui/enum/issue-67945-2.stderr b/src/test/ui/enum/issue-67945-2.stderr index 5a90f00c346d0..4f5e236a37b45 100644 --- a/src/test/ui/enum/issue-67945-2.stderr +++ b/src/test/ui/enum/issue-67945-2.stderr @@ -5,7 +5,7 @@ LL | Var = 0: S, | ^ cannot perform const operation using `S` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error[E0392]: parameter `S` is never used --> $DIR/issue-67945-2.rs:3:10 diff --git a/src/test/ui/error-codes/E0730.rs b/src/test/ui/error-codes/E0730.rs index 30745814b4a74..04f5e5d425745 100644 --- a/src/test/ui/error-codes/E0730.rs +++ b/src/test/ui/error-codes/E0730.rs @@ -1,6 +1,3 @@ -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete - fn is_123(x: [u32; N]) -> bool { match x { [1, 2, ..] => true, //~ ERROR cannot pattern-match on an array without a fixed length diff --git a/src/test/ui/error-codes/E0730.stderr b/src/test/ui/error-codes/E0730.stderr index f915f6edef52b..067e8c57cd63b 100644 --- a/src/test/ui/error-codes/E0730.stderr +++ b/src/test/ui/error-codes/E0730.stderr @@ -1,18 +1,9 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/E0730.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - error[E0730]: cannot pattern-match on an array without a fixed length - --> $DIR/E0730.rs:6:9 + --> $DIR/E0730.rs:3:9 | LL | [1, 2, ..] => true, | ^^^^^^^^^^ -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error For more information about this error, try `rustc --explain E0730`. diff --git a/src/test/ui/error-codes/E0771.rs b/src/test/ui/error-codes/E0771.rs index ba3592719408c..67e7d106a1fce 100644 --- a/src/test/ui/error-codes/E0771.rs +++ b/src/test/ui/error-codes/E0771.rs @@ -1,5 +1,5 @@ -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete +#![feature(adt_const_params)] +//~^ WARN the feature `adt_const_params` is incomplete fn function_with_str<'a, const STRING: &'a str>() {} //~ ERROR E0771 diff --git a/src/test/ui/error-codes/E0771.stderr b/src/test/ui/error-codes/E0771.stderr index 60220be6b57ba..730a7ef1284b6 100644 --- a/src/test/ui/error-codes/E0771.stderr +++ b/src/test/ui/error-codes/E0771.stderr @@ -1,8 +1,8 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes +warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/E0771.rs:1:12 | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ +LL | #![feature(adt_const_params)] + | ^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #44580 for more information diff --git a/src/test/ui/feature-gates/feature-gate-adt_const_params.rs b/src/test/ui/feature-gates/feature-gate-adt_const_params.rs new file mode 100644 index 0000000000000..8a3bcf25963f1 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-adt_const_params.rs @@ -0,0 +1,2 @@ +struct Foo; //~ ERROR `&'static str` is forbidden +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-adt_const_params.stderr b/src/test/ui/feature-gates/feature-gate-adt_const_params.stderr new file mode 100644 index 0000000000000..d8f089a28b7e1 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-adt_const_params.stderr @@ -0,0 +1,11 @@ +error: `&'static str` is forbidden as the type of a const generic parameter + --> $DIR/feature-gate-adt_const_params.rs:1:24 + | +LL | struct Foo; + | ^^^^^^^^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + = help: more complex types are supported with `#![feature(adt_const_params)]` + +error: aborting due to previous error + diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.rs b/src/test/ui/feature-gates/feature-gate-const_generics.rs deleted file mode 100644 index 06364eebef91c..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-const_generics.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn foo() {} //~ ERROR `()` is forbidden as the type of a const generic parameter - -struct Foo([(); X]); - -fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.stderr b/src/test/ui/feature-gates/feature-gate-const_generics.stderr deleted file mode 100644 index ed19109b38b41..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-const_generics.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `()` is forbidden as the type of a const generic parameter - --> $DIR/feature-gate-const_generics.rs:1:17 - | -LL | fn foo() {} - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to previous error - diff --git a/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr b/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr index 41a0a03ff6688..ab09ebcae7197 100644 --- a/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr +++ b/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr @@ -5,7 +5,7 @@ LL | struct Foo()]>(T, U); | ^ cannot perform const operation using `T` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/hygiene/generic_params.rs b/src/test/ui/hygiene/generic_params.rs index d319ae6403fc5..3b6216c3e6372 100644 --- a/src/test/ui/hygiene/generic_params.rs +++ b/src/test/ui/hygiene/generic_params.rs @@ -3,8 +3,7 @@ // check-pass // ignore-pretty pretty-printing is unhygienic -#![feature(decl_macro, rustc_attrs, const_generics)] -//~^ WARNING the feature `const_generics` is incomplete +#![feature(decl_macro, rustc_attrs)] mod type_params { macro m($T:ident) { diff --git a/src/test/ui/hygiene/generic_params.stderr b/src/test/ui/hygiene/generic_params.stderr deleted file mode 100644 index 4ca6d1998353f..0000000000000 --- a/src/test/ui/hygiene/generic_params.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_params.rs:6:37 - | -LL | #![feature(decl_macro, rustc_attrs, const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/hygiene/issue-61574-const-parameters.rs b/src/test/ui/hygiene/issue-61574-const-parameters.rs index 81e9b1b36e064..3634ee004f7f7 100644 --- a/src/test/ui/hygiene/issue-61574-const-parameters.rs +++ b/src/test/ui/hygiene/issue-61574-const-parameters.rs @@ -3,8 +3,6 @@ // check-pass -#![feature(const_generics)] //~ WARNING `const_generics` is incomplete - use std::ops::Add; struct VectorLike([T; {SIZE}]); diff --git a/src/test/ui/hygiene/issue-61574-const-parameters.stderr b/src/test/ui/hygiene/issue-61574-const-parameters.stderr deleted file mode 100644 index b351b8b73a0e5..0000000000000 --- a/src/test/ui/hygiene/issue-61574-const-parameters.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-61574-const-parameters.rs:6:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr b/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr deleted file mode 100644 index 50eab7dcc9789..0000000000000 --- a/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr +++ /dev/null @@ -1,57 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-55872-1.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error[E0276]: impl has stricter requirements than trait - --> $DIR/issue-55872-1.rs:17:5 - | -LL | fn foo() -> Self::E; - | ----------------------- definition of `foo` from trait -... -LL | fn foo() -> Self::E { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default` - -error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)` - --> $DIR/issue-55872-1.rs:13:14 - | -LL | type E = impl Copy; - | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S` - | - = note: required because it appears within the type `(S, T)` -help: consider further restricting this bound - | -LL | impl Bar for S { - | +++++++++++++++++++ - -error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` - --> $DIR/issue-55872-1.rs:13:14 - | -LL | type E = impl Copy; - | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T` - | - = note: required because it appears within the type `(S, T)` -help: consider further restricting this bound - | -LL | fn foo() -> Self::E { - | +++++++++++++++++++ - -error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - --> $DIR/issue-55872-1.rs:17:37 - | -LL | fn foo() -> Self::E { - | _____________________________________^ -LL | | -LL | | -LL | | (S::default(), T::default()) -LL | | } - | |_____^ - -error: aborting due to 4 previous errors; 1 warning emitted - -Some errors have detailed explanations: E0276, E0277. -For more information about an error, try `rustc --explain E0276`. diff --git a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr deleted file mode 100644 index 4de872e8441ef..0000000000000 --- a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/inverse-bounds.rs:16:70 - | -LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e> - | ^^^^^^^^^^^^^^^^^^ - | - = note: hidden type `Invert<'_>` captures lifetime '_#8r - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - -warning: the feature `pin` has been stable since 1.33.0 and no longer requires an attribute to enable - --> $DIR/inverse-bounds.rs:4:60 - | -LL | #![feature(arbitrary_self_types, async_await, await_macro, pin)] - | ^^^ - | - = note: #[warn(stable_features)] on by default - diff --git a/src/test/ui/issues/issue-39559.stderr b/src/test/ui/issues/issue-39559.stderr index 91e31ca0bd8b1..7626f827fc5eb 100644 --- a/src/test/ui/issues/issue-39559.stderr +++ b/src/test/ui/issues/issue-39559.stderr @@ -5,7 +5,7 @@ LL | entries: [T; D::dim()], | ^^^^^^ cannot perform const operation using `D` | = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to previous error diff --git a/src/test/ui/issues/issue-59508-1.rs b/src/test/ui/issues/issue-59508-1.rs index a687a9e3be12c..6376c429b287b 100644 --- a/src/test/ui/issues/issue-59508-1.rs +++ b/src/test/ui/issues/issue-59508-1.rs @@ -1,9 +1,8 @@ #![allow(dead_code)] -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete +#![feature(const_generics_defaults)] // This test checks that generic parameter re-ordering diagnostic suggestions mention that -// consts come after types and lifetimes when the `const_generics` feature is enabled. +// consts come after types and lifetimes when the `const_generics_defaults` feature is enabled. // We cannot run rustfix on this test because of the above const generics warning. struct A; diff --git a/src/test/ui/issues/issue-59508-1.stderr b/src/test/ui/issues/issue-59508-1.stderr index 5e97339f148c5..df244f02dce68 100644 --- a/src/test/ui/issues/issue-59508-1.stderr +++ b/src/test/ui/issues/issue-59508-1.stderr @@ -1,17 +1,8 @@ error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-59508-1.rs:12:25 + --> $DIR/issue-59508-1.rs:11:25 | LL | pub fn do_things() { | ----^^--^^----- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b: 'a, T>` -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-59508-1.rs:2:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error diff --git a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs b/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs deleted file mode 100644 index 46ae9403c03ce..0000000000000 --- a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub const fn sof() -> usize { - 10 -} - -fn test() { - let _: [u8; sof::()]; - //~^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr b/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr deleted file mode 100644 index 5c167ea083423..0000000000000 --- a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/feature-gate-lazy_normalization_consts.rs:6:23 - | -LL | let _: [u8; sof::()]; - | ^ cannot perform const operation using `T` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/lazy_normalization_consts/issue-47814.rs b/src/test/ui/lazy_normalization_consts/issue-47814.rs deleted file mode 100644 index 1fd0c45841b0d..0000000000000 --- a/src/test/ui/lazy_normalization_consts/issue-47814.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check-pass -#![feature(lazy_normalization_consts)] -#![allow(incomplete_features)] -pub struct ArpIPv4<'a> { - _s: &'a u8 -} - -impl<'a> ArpIPv4<'a> { - const LENGTH: usize = 20; - - pub fn to_buffer() -> [u8; Self::LENGTH] { - unimplemented!() - } -} - -fn main() {} diff --git a/src/test/ui/lazy_normalization_consts/issue-57739.rs b/src/test/ui/lazy_normalization_consts/issue-57739.rs deleted file mode 100644 index 4607f3e99b51f..0000000000000 --- a/src/test/ui/lazy_normalization_consts/issue-57739.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(lazy_normalization_consts)] -//~^ WARN the feature `lazy_normalization_consts` is incomplete -trait ArraySizeTrait { - const SIZE: usize = 0; -} - -impl ArraySizeTrait for T { - const SIZE: usize = 1; -} - -struct SomeArray { - array: [u8; T::SIZE], - //~^ ERROR constant expression depends on a generic parameter - phantom: std::marker::PhantomData, -} - -fn main() {} diff --git a/src/test/ui/lazy_normalization_consts/issue-57739.stderr b/src/test/ui/lazy_normalization_consts/issue-57739.stderr deleted file mode 100644 index ce0495dd8b0cb..0000000000000 --- a/src/test/ui/lazy_normalization_consts/issue-57739.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: the feature `lazy_normalization_consts` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-57739.rs:1:12 - | -LL | #![feature(lazy_normalization_consts)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #72219 for more information - -error: constant expression depends on a generic parameter - --> $DIR/issue-57739.rs:12:12 - | -LL | array: [u8; T::SIZE], - | ^^^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: aborting due to previous error; 1 warning emitted - diff --git a/src/test/ui/lazy_normalization_consts/issue-73980.rs b/src/test/ui/lazy_normalization_consts/issue-73980.rs deleted file mode 100644 index e10040652c78d..0000000000000 --- a/src/test/ui/lazy_normalization_consts/issue-73980.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check-pass -#![feature(lazy_normalization_consts)] -#![allow(incomplete_features)] - -pub struct X(P, Q); -pub struct L(T); - -impl L { - const S: usize = 1; -} - -impl X::S]> {} -//~^ WARN cannot use constants which depend on generic parameters -//~| WARN this was previously accepted by the compiler but is being phased out - -fn main() {} diff --git a/src/test/ui/lazy_normalization_consts/issue-73980.stderr b/src/test/ui/lazy_normalization_consts/issue-73980.stderr deleted file mode 100644 index 5ed1ca362f411..0000000000000 --- a/src/test/ui/lazy_normalization_consts/issue-73980.stderr +++ /dev/null @@ -1,12 +0,0 @@ -warning: cannot use constants which depend on generic parameters in types - --> $DIR/issue-73980.rs:12:9 - | -LL | impl X::S]> {} - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(const_evaluatable_unchecked)]` on by default - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #76200 - -warning: 1 warning emitted - diff --git a/src/test/ui/legacy-const-generics-bad.stderr b/src/test/ui/legacy-const-generics-bad.stderr index 5a44b8e706553..3c78dd6c78023 100644 --- a/src/test/ui/legacy-const-generics-bad.stderr +++ b/src/test/ui/legacy-const-generics-bad.stderr @@ -13,7 +13,7 @@ LL | legacy_const_generics::foo(0, N + 1, 2); | ^ cannot perform const operation using `N` | = help: const parameters may only be used as standalone arguments, i.e. `N` - = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions + = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions error: aborting due to 2 previous errors diff --git a/src/test/ui/mir/issue-75053.in_bindings.stderr b/src/test/ui/mir/issue-75053.in_bindings.stderr deleted file mode 100644 index d75996bf0b3ae..0000000000000 --- a/src/test/ui/mir/issue-75053.in_bindings.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0557]: feature has been removed - --> $DIR/issue-75053.rs:7:34 - | -LL | #![cfg_attr(in_bindings, feature(impl_trait_in_bindings))] - | ^^^^^^^^^^^^^^^^^^^^^^ feature has been removed - | - = note: removed due to being incomplete and unstable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0557`. diff --git a/src/test/ui/obsolete-in-place/bad.bad.stderr b/src/test/ui/obsolete-in-place/bad.bad.stderr deleted file mode 100644 index d895981050ae9..0000000000000 --- a/src/test/ui/obsolete-in-place/bad.bad.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error: expected expression, found keyword `in` - --> $DIR/bad.rs:10:5 - | -LL | in(foo) { bar }; - | ^^ expected expression - -error[E0282]: type annotations needed - --> $DIR/bad.rs:9:8 - | -LL | let (x, y, foo, bar); - | ---------------- consider giving the pattern a type -LL | x <- y; - | ^^^ cannot infer type - | - = note: type must be known at this point - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/polymorphization/const_parameters/closures.rs b/src/test/ui/polymorphization/const_parameters/closures.rs index f20605e1b9a61..2f41beeb9691a 100644 --- a/src/test/ui/polymorphization/const_parameters/closures.rs +++ b/src/test/ui/polymorphization/const_parameters/closures.rs @@ -1,7 +1,7 @@ // build-fail // compile-flags:-Zpolymorphize=on -#![feature(const_generics, rustc_attrs)] -//~^ WARN the feature `const_generics` is incomplete +#![feature(generic_const_exprs, rustc_attrs)] +//~^ WARN the feature `generic_const_exprs` is incomplete // This test checks that the polymorphization analysis correctly detects unused const // parameters in closures. diff --git a/src/test/ui/polymorphization/const_parameters/closures.stderr b/src/test/ui/polymorphization/const_parameters/closures.stderr index 266b6e62afd0b..d0ee893299652 100644 --- a/src/test/ui/polymorphization/const_parameters/closures.stderr +++ b/src/test/ui/polymorphization/const_parameters/closures.stderr @@ -1,11 +1,11 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/closures.rs:3:12 | -LL | #![feature(const_generics, rustc_attrs)] - | ^^^^^^^^^^^^^^ +LL | #![feature(generic_const_exprs, rustc_attrs)] + | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information + = note: see issue #76560 for more information error: item has unused generic parameters --> $DIR/closures.rs:19:19 diff --git a/src/test/ui/polymorphization/const_parameters/functions.rs b/src/test/ui/polymorphization/const_parameters/functions.rs index 04c279de29e6a..cbc1b63fbc4e6 100644 --- a/src/test/ui/polymorphization/const_parameters/functions.rs +++ b/src/test/ui/polymorphization/const_parameters/functions.rs @@ -1,7 +1,7 @@ // build-fail // compile-flags:-Zpolymorphize=on -#![feature(const_generics, rustc_attrs)] -//~^ WARN the feature `const_generics` is incomplete +#![feature(generic_const_exprs, rustc_attrs)] +//~^ WARN the feature `generic_const_exprs` is incomplete // This test checks that the polymorphization analysis correctly detects unused const // parameters in functions. diff --git a/src/test/ui/polymorphization/const_parameters/functions.stderr b/src/test/ui/polymorphization/const_parameters/functions.stderr index e379e32c1fceb..03d0bbb6afe60 100644 --- a/src/test/ui/polymorphization/const_parameters/functions.stderr +++ b/src/test/ui/polymorphization/const_parameters/functions.stderr @@ -1,11 +1,11 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/functions.rs:3:12 | -LL | #![feature(const_generics, rustc_attrs)] - | ^^^^^^^^^^^^^^ +LL | #![feature(generic_const_exprs, rustc_attrs)] + | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information + = note: see issue #76560 for more information error: item has unused generic parameters --> $DIR/functions.rs:15:8 diff --git a/src/test/ui/polymorphization/generators.rs b/src/test/ui/polymorphization/generators.rs index 9eb34fb73490b..f295cf15d08c6 100644 --- a/src/test/ui/polymorphization/generators.rs +++ b/src/test/ui/polymorphization/generators.rs @@ -1,7 +1,7 @@ // build-fail // compile-flags:-Zpolymorphize=on -#![feature(const_generics, generators, generator_trait, rustc_attrs)] -//~^ WARN the feature `const_generics` is incomplete +#![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)] +//~^ WARN the feature `generic_const_exprs` is incomplete use std::marker::Unpin; use std::ops::{Generator, GeneratorState}; diff --git a/src/test/ui/polymorphization/generators.stderr b/src/test/ui/polymorphization/generators.stderr index c59055ba9d654..c4e566a42d0cf 100644 --- a/src/test/ui/polymorphization/generators.stderr +++ b/src/test/ui/polymorphization/generators.stderr @@ -1,11 +1,11 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/generators.rs:3:12 | -LL | #![feature(const_generics, generators, generator_trait, rustc_attrs)] - | ^^^^^^^^^^^^^^ +LL | #![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)] + | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information + = note: see issue #76560 for more information error: item has unused generic parameters --> $DIR/generators.rs:36:5 diff --git a/src/test/ui/polymorphization/promoted-function-2.rs b/src/test/ui/polymorphization/promoted-function-2.rs index 2831f861f5561..d2d0f33681244 100644 --- a/src/test/ui/polymorphization/promoted-function-2.rs +++ b/src/test/ui/polymorphization/promoted-function-2.rs @@ -1,8 +1,8 @@ // build-fail // compile-flags:-Zpolymorphize=on #![crate_type = "lib"] -#![feature(lazy_normalization_consts, rustc_attrs)] -//~^ WARN the feature `lazy_normalization_consts` is incomplete +#![feature(generic_const_exprs, rustc_attrs)] +//~^ WARN the feature `generic_const_exprs` is incomplete #[rustc_polymorphize_error] fn test() { diff --git a/src/test/ui/polymorphization/promoted-function-2.stderr b/src/test/ui/polymorphization/promoted-function-2.stderr index 38d4808c48c03..4d7bab6aaa0c6 100644 --- a/src/test/ui/polymorphization/promoted-function-2.stderr +++ b/src/test/ui/polymorphization/promoted-function-2.stderr @@ -1,11 +1,11 @@ -warning: the feature `lazy_normalization_consts` is incomplete and may not be safe to use and/or cause compiler crashes +warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/promoted-function-2.rs:4:12 | -LL | #![feature(lazy_normalization_consts, rustc_attrs)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![feature(generic_const_exprs, rustc_attrs)] + | ^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default - = note: see issue #72219 for more information + = note: see issue #76560 for more information error: item has unused generic parameters --> $DIR/promoted-function-2.rs:8:4 diff --git a/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs b/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs index f09ab3bf91988..f96c04841dd28 100644 --- a/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs +++ b/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs @@ -1,6 +1,3 @@ -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete - fn f() { extern "C" { static a: *const T; diff --git a/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr b/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr index 7f8151db06f5b..7ed572f80b896 100644 --- a/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr +++ b/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr @@ -1,5 +1,5 @@ error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:6:26 + --> $DIR/issue-65035-static-with-parent-generics.rs:3:26 | LL | fn f() { | - type parameter from outer function @@ -8,7 +8,7 @@ LL | static a: *const T; | ^ use of generic parameter from outer function error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:12:22 + --> $DIR/issue-65035-static-with-parent-generics.rs:9:22 | LL | fn g() { | - type parameter from outer function @@ -16,7 +16,7 @@ LL | static a: *const T = Default::default(); | ^ use of generic parameter from outer function error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:18:24 + --> $DIR/issue-65035-static-with-parent-generics.rs:15:24 | LL | fn h() { | - const parameter from outer function @@ -25,7 +25,7 @@ LL | static a: [u8; N]; | ^ use of generic parameter from outer function error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:24:20 + --> $DIR/issue-65035-static-with-parent-generics.rs:21:20 | LL | fn i() { | - const parameter from outer function @@ -33,22 +33,13 @@ LL | static a: [u8; N] = [0; N]; | ^ use of generic parameter from outer function error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:24:29 + --> $DIR/issue-65035-static-with-parent-generics.rs:21:29 | LL | fn i() { | - const parameter from outer function LL | static a: [u8; N] = [0; N]; | ^ use of generic parameter from outer function -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-65035-static-with-parent-generics.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -error: aborting due to 5 previous errors; 1 warning emitted +error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs index b3c9246486ebb..b0b3464c61017 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs @@ -17,8 +17,6 @@ // // To that end, we check some positions which is not part of the language above. -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test. //~^ WARN the feature `let_chains` is incomplete diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index b48915adc683b..5ec4352919ea0 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -1,5 +1,5 @@ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/disallowed-positions.rs:235:9 + --> $DIR/disallowed-positions.rs:233:9 | LL | true && let 1 = 1 | ^^^^^^^^^^^^^^^^^ @@ -10,7 +10,7 @@ LL | { true && let 1 = 1 } | + + error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:32:9 + --> $DIR/disallowed-positions.rs:30:9 | LL | if &let 0 = 0 {} | ^^^^^^^^^ @@ -19,7 +19,7 @@ LL | if &let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:35:9 + --> $DIR/disallowed-positions.rs:33:9 | LL | if !let 0 = 0 {} | ^^^^^^^^^ @@ -28,7 +28,7 @@ LL | if !let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:36:9 + --> $DIR/disallowed-positions.rs:34:9 | LL | if *let 0 = 0 {} | ^^^^^^^^^ @@ -37,7 +37,7 @@ LL | if *let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:38:9 + --> $DIR/disallowed-positions.rs:36:9 | LL | if -let 0 = 0 {} | ^^^^^^^^^ @@ -46,7 +46,7 @@ LL | if -let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:46:9 + --> $DIR/disallowed-positions.rs:44:9 | LL | if (let 0 = 0)? {} | ^^^^^^^^^ @@ -55,7 +55,7 @@ LL | if (let 0 = 0)? {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:50:16 + --> $DIR/disallowed-positions.rs:48:16 | LL | if true || let 0 = 0 {} | ^^^^^^^^^ @@ -64,7 +64,7 @@ LL | if true || let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:51:17 + --> $DIR/disallowed-positions.rs:49:17 | LL | if (true || let 0 = 0) {} | ^^^^^^^^^ @@ -73,7 +73,7 @@ LL | if (true || let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:52:25 + --> $DIR/disallowed-positions.rs:50:25 | LL | if true && (true || let 0 = 0) {} | ^^^^^^^^^ @@ -82,7 +82,7 @@ LL | if true && (true || let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:53:25 + --> $DIR/disallowed-positions.rs:51:25 | LL | if true || (true && let 0 = 0) {} | ^^^^^^^^^ @@ -91,7 +91,7 @@ LL | if true || (true && let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:56:12 + --> $DIR/disallowed-positions.rs:54:12 | LL | if x = let 0 = 0 {} | ^^^^^^^^^ @@ -100,7 +100,7 @@ LL | if x = let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:59:15 + --> $DIR/disallowed-positions.rs:57:15 | LL | if true..(let 0 = 0) {} | ^^^^^^^^^ @@ -109,7 +109,7 @@ LL | if true..(let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:61:11 + --> $DIR/disallowed-positions.rs:59:11 | LL | if ..(let 0 = 0) {} | ^^^^^^^^^ @@ -118,7 +118,7 @@ LL | if ..(let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:63:9 + --> $DIR/disallowed-positions.rs:61:9 | LL | if (let 0 = 0).. {} | ^^^^^^^^^ @@ -127,7 +127,7 @@ LL | if (let 0 = 0).. {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:67:8 + --> $DIR/disallowed-positions.rs:65:8 | LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -136,7 +136,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:71:8 + --> $DIR/disallowed-positions.rs:69:8 | LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -145,7 +145,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:78:8 + --> $DIR/disallowed-positions.rs:76:8 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -154,7 +154,7 @@ LL | if let Range { start: F, end } = F..|| true {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:86:8 + --> $DIR/disallowed-positions.rs:84:8 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -163,7 +163,7 @@ LL | if let Range { start: true, end } = t..&&false {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:92:19 + --> $DIR/disallowed-positions.rs:90:19 | LL | if let true = let true = true {} | ^^^^^^^^^^^^^^^ @@ -172,7 +172,7 @@ LL | if let true = let true = true {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:96:12 + --> $DIR/disallowed-positions.rs:94:12 | LL | while &let 0 = 0 {} | ^^^^^^^^^ @@ -181,7 +181,7 @@ LL | while &let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:99:12 + --> $DIR/disallowed-positions.rs:97:12 | LL | while !let 0 = 0 {} | ^^^^^^^^^ @@ -190,7 +190,7 @@ LL | while !let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:100:12 + --> $DIR/disallowed-positions.rs:98:12 | LL | while *let 0 = 0 {} | ^^^^^^^^^ @@ -199,7 +199,7 @@ LL | while *let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:102:12 + --> $DIR/disallowed-positions.rs:100:12 | LL | while -let 0 = 0 {} | ^^^^^^^^^ @@ -208,7 +208,7 @@ LL | while -let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:110:12 + --> $DIR/disallowed-positions.rs:108:12 | LL | while (let 0 = 0)? {} | ^^^^^^^^^ @@ -217,7 +217,7 @@ LL | while (let 0 = 0)? {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:114:19 + --> $DIR/disallowed-positions.rs:112:19 | LL | while true || let 0 = 0 {} | ^^^^^^^^^ @@ -226,7 +226,7 @@ LL | while true || let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:115:20 + --> $DIR/disallowed-positions.rs:113:20 | LL | while (true || let 0 = 0) {} | ^^^^^^^^^ @@ -235,7 +235,7 @@ LL | while (true || let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:116:28 + --> $DIR/disallowed-positions.rs:114:28 | LL | while true && (true || let 0 = 0) {} | ^^^^^^^^^ @@ -244,7 +244,7 @@ LL | while true && (true || let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:117:28 + --> $DIR/disallowed-positions.rs:115:28 | LL | while true || (true && let 0 = 0) {} | ^^^^^^^^^ @@ -253,7 +253,7 @@ LL | while true || (true && let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:120:15 + --> $DIR/disallowed-positions.rs:118:15 | LL | while x = let 0 = 0 {} | ^^^^^^^^^ @@ -262,7 +262,7 @@ LL | while x = let 0 = 0 {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:123:18 + --> $DIR/disallowed-positions.rs:121:18 | LL | while true..(let 0 = 0) {} | ^^^^^^^^^ @@ -271,7 +271,7 @@ LL | while true..(let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:125:14 + --> $DIR/disallowed-positions.rs:123:14 | LL | while ..(let 0 = 0) {} | ^^^^^^^^^ @@ -280,7 +280,7 @@ LL | while ..(let 0 = 0) {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:127:12 + --> $DIR/disallowed-positions.rs:125:12 | LL | while (let 0 = 0).. {} | ^^^^^^^^^ @@ -289,7 +289,7 @@ LL | while (let 0 = 0).. {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:131:11 + --> $DIR/disallowed-positions.rs:129:11 | LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -298,7 +298,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:135:11 + --> $DIR/disallowed-positions.rs:133:11 | LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -307,7 +307,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:142:11 + --> $DIR/disallowed-positions.rs:140:11 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -316,7 +316,7 @@ LL | while let Range { start: F, end } = F..|| true {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:150:11 + --> $DIR/disallowed-positions.rs:148:11 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -325,7 +325,7 @@ LL | while let Range { start: true, end } = t..&&false {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:156:22 + --> $DIR/disallowed-positions.rs:154:22 | LL | while let true = let true = true {} | ^^^^^^^^^^^^^^^ @@ -334,7 +334,7 @@ LL | while let true = let true = true {} = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:170:6 + --> $DIR/disallowed-positions.rs:168:6 | LL | &let 0 = 0; | ^^^^^^^^^ @@ -343,7 +343,7 @@ LL | &let 0 = 0; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:172:6 + --> $DIR/disallowed-positions.rs:170:6 | LL | !let 0 = 0; | ^^^^^^^^^ @@ -352,7 +352,7 @@ LL | !let 0 = 0; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:173:6 + --> $DIR/disallowed-positions.rs:171:6 | LL | *let 0 = 0; | ^^^^^^^^^ @@ -361,7 +361,7 @@ LL | *let 0 = 0; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:175:6 + --> $DIR/disallowed-positions.rs:173:6 | LL | -let 0 = 0; | ^^^^^^^^^ @@ -370,7 +370,7 @@ LL | -let 0 = 0; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:183:6 + --> $DIR/disallowed-positions.rs:181:6 | LL | (let 0 = 0)?; | ^^^^^^^^^ @@ -379,7 +379,7 @@ LL | (let 0 = 0)?; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:187:13 + --> $DIR/disallowed-positions.rs:185:13 | LL | true || let 0 = 0; | ^^^^^^^^^ @@ -388,7 +388,7 @@ LL | true || let 0 = 0; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:188:14 + --> $DIR/disallowed-positions.rs:186:14 | LL | (true || let 0 = 0); | ^^^^^^^^^ @@ -397,7 +397,7 @@ LL | (true || let 0 = 0); = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:189:22 + --> $DIR/disallowed-positions.rs:187:22 | LL | true && (true || let 0 = 0); | ^^^^^^^^^ @@ -406,7 +406,7 @@ LL | true && (true || let 0 = 0); = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:192:9 + --> $DIR/disallowed-positions.rs:190:9 | LL | x = let 0 = 0; | ^^^^^^^^^ @@ -415,7 +415,7 @@ LL | x = let 0 = 0; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:194:12 + --> $DIR/disallowed-positions.rs:192:12 | LL | true..(let 0 = 0); | ^^^^^^^^^ @@ -424,7 +424,7 @@ LL | true..(let 0 = 0); = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:195:8 + --> $DIR/disallowed-positions.rs:193:8 | LL | ..(let 0 = 0); | ^^^^^^^^^ @@ -433,7 +433,7 @@ LL | ..(let 0 = 0); = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:196:6 + --> $DIR/disallowed-positions.rs:194:6 | LL | (let 0 = 0)..; | ^^^^^^^^^ @@ -442,7 +442,7 @@ LL | (let 0 = 0)..; = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:198:6 + --> $DIR/disallowed-positions.rs:196:6 | LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -451,7 +451,7 @@ LL | (let Range { start: _, end: _ } = true..true || false); = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:202:6 + --> $DIR/disallowed-positions.rs:200:6 | LL | (let true = let true = true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -460,7 +460,7 @@ LL | (let true = let true = true); = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:206:6 + --> $DIR/disallowed-positions.rs:204:6 | LL | &let 0 = 0 | ^^^^^^^^^ @@ -469,7 +469,7 @@ LL | &let 0 = 0 = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:217:17 + --> $DIR/disallowed-positions.rs:215:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -478,7 +478,7 @@ LL | true && let 1 = 1 = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:221:17 + --> $DIR/disallowed-positions.rs:219:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -487,7 +487,7 @@ LL | true && let 1 = 1 = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:225:17 + --> $DIR/disallowed-positions.rs:223:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -496,7 +496,7 @@ LL | true && let 1 = 1 = note: as well as when nested within `&&` and parenthesis in those conditions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:235:17 + --> $DIR/disallowed-positions.rs:233:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -504,25 +504,17 @@ LL | true && let 1 = 1 = note: only supported directly in conditions of `if`- and `while`-expressions = note: as well as when nested within `&&` and parenthesis in those conditions -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/disallowed-positions.rs:20:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/disallowed-positions.rs:22:12 + --> $DIR/disallowed-positions.rs:20:12 | LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test. | ^^^^^^^^^^ | + = note: `#[warn(incomplete_features)]` on by default = note: see issue #53667 for more information error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:32:8 + --> $DIR/disallowed-positions.rs:30:8 | LL | if &let 0 = 0 {} | ^^^^^^^^^^ expected `bool`, found `&bool` @@ -534,19 +526,19 @@ LL + if let 0 = 0 {} | error[E0614]: type `bool` cannot be dereferenced - --> $DIR/disallowed-positions.rs:36:8 + --> $DIR/disallowed-positions.rs:34:8 | LL | if *let 0 = 0 {} | ^^^^^^^^^^ error[E0600]: cannot apply unary operator `-` to type `bool` - --> $DIR/disallowed-positions.rs:38:8 + --> $DIR/disallowed-positions.rs:36:8 | LL | if -let 0 = 0 {} | ^^^^^^^^^^ cannot apply unary operator `-` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:46:8 + --> $DIR/disallowed-positions.rs:44:8 | LL | if (let 0 = 0)? {} | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` @@ -559,7 +551,7 @@ LL | fn branch(self) -> ControlFlow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/disallowed-positions.rs:46:19 + --> $DIR/disallowed-positions.rs:44:19 | LL | / fn nested_within_if_expr() { LL | | if &let 0 = 0 {} @@ -581,7 +573,7 @@ LL | fn from_residual(residual: R) -> Self; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:56:8 + --> $DIR/disallowed-positions.rs:54:8 | LL | if x = let 0 = 0 {} | ^^^^^^^^^^^^^ expected `bool`, found `()` @@ -592,7 +584,7 @@ LL | if x == let 0 = 0 {} | ~~ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:59:8 + --> $DIR/disallowed-positions.rs:57:8 | LL | if true..(let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -601,7 +593,7 @@ LL | if true..(let 0 = 0) {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:61:8 + --> $DIR/disallowed-positions.rs:59:8 | LL | if ..(let 0 = 0) {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` @@ -610,7 +602,7 @@ LL | if ..(let 0 = 0) {} found struct `RangeTo` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:63:8 + --> $DIR/disallowed-positions.rs:61:8 | LL | if (let 0 = 0).. {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` @@ -619,7 +611,7 @@ LL | if (let 0 = 0).. {} found struct `RangeFrom` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:67:12 + --> $DIR/disallowed-positions.rs:65:12 | LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -630,7 +622,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:67:8 + --> $DIR/disallowed-positions.rs:65:8 | LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -639,7 +631,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:71:12 + --> $DIR/disallowed-positions.rs:69:12 | LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -650,7 +642,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:71:8 + --> $DIR/disallowed-positions.rs:69:8 | LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -659,7 +651,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:78:12 + --> $DIR/disallowed-positions.rs:76:12 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range` @@ -668,16 +660,16 @@ LL | if let Range { start: F, end } = F..|| true {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:78:41 + --> $DIR/disallowed-positions.rs:76:41 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^ expected `bool`, found closure | = note: expected type `bool` - found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]` + found closure `[closure@$DIR/disallowed-positions.rs:76:41: 76:48]` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:78:8 + --> $DIR/disallowed-positions.rs:76:8 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -686,7 +678,7 @@ LL | if let Range { start: F, end } = F..|| true {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:86:12 + --> $DIR/disallowed-positions.rs:84:12 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` @@ -697,13 +689,13 @@ LL | if let Range { start: true, end } = t..&&false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:86:44 + --> $DIR/disallowed-positions.rs:84:44 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected `bool`, found `&&bool` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:86:8 + --> $DIR/disallowed-positions.rs:84:8 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -712,7 +704,7 @@ LL | if let Range { start: true, end } = t..&&false {} found struct `std::ops::Range` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:42:20 + --> $DIR/disallowed-positions.rs:40:20 | LL | if let 0 = 0? {} | ^^ the `?` operator cannot be applied to type `{integer}` @@ -725,7 +717,7 @@ LL | fn branch(self) -> ControlFlow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:96:11 + --> $DIR/disallowed-positions.rs:94:11 | LL | while &let 0 = 0 {} | ^^^^^^^^^^ expected `bool`, found `&bool` @@ -737,19 +729,19 @@ LL + while let 0 = 0 {} | error[E0614]: type `bool` cannot be dereferenced - --> $DIR/disallowed-positions.rs:100:11 + --> $DIR/disallowed-positions.rs:98:11 | LL | while *let 0 = 0 {} | ^^^^^^^^^^ error[E0600]: cannot apply unary operator `-` to type `bool` - --> $DIR/disallowed-positions.rs:102:11 + --> $DIR/disallowed-positions.rs:100:11 | LL | while -let 0 = 0 {} | ^^^^^^^^^^ cannot apply unary operator `-` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:110:11 + --> $DIR/disallowed-positions.rs:108:11 | LL | while (let 0 = 0)? {} | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` @@ -762,7 +754,7 @@ LL | fn branch(self) -> ControlFlow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/disallowed-positions.rs:110:22 + --> $DIR/disallowed-positions.rs:108:22 | LL | / fn nested_within_while_expr() { LL | | while &let 0 = 0 {} @@ -784,7 +776,7 @@ LL | fn from_residual(residual: R) -> Self; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:120:11 + --> $DIR/disallowed-positions.rs:118:11 | LL | while x = let 0 = 0 {} | ^^^^^^^^^^^^^ expected `bool`, found `()` @@ -795,7 +787,7 @@ LL | while x == let 0 = 0 {} | ~~ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:123:11 + --> $DIR/disallowed-positions.rs:121:11 | LL | while true..(let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -804,7 +796,7 @@ LL | while true..(let 0 = 0) {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:125:11 + --> $DIR/disallowed-positions.rs:123:11 | LL | while ..(let 0 = 0) {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` @@ -813,7 +805,7 @@ LL | while ..(let 0 = 0) {} found struct `RangeTo` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:127:11 + --> $DIR/disallowed-positions.rs:125:11 | LL | while (let 0 = 0).. {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` @@ -822,7 +814,7 @@ LL | while (let 0 = 0).. {} found struct `RangeFrom` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:131:15 + --> $DIR/disallowed-positions.rs:129:15 | LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -833,7 +825,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:131:11 + --> $DIR/disallowed-positions.rs:129:11 | LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -842,7 +834,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:135:15 + --> $DIR/disallowed-positions.rs:133:15 | LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -853,7 +845,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:135:11 + --> $DIR/disallowed-positions.rs:133:11 | LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -862,7 +854,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:142:15 + --> $DIR/disallowed-positions.rs:140:15 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range` @@ -871,16 +863,16 @@ LL | while let Range { start: F, end } = F..|| true {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:142:44 + --> $DIR/disallowed-positions.rs:140:44 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^ expected `bool`, found closure | = note: expected type `bool` - found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]` + found closure `[closure@$DIR/disallowed-positions.rs:140:44: 140:51]` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:142:11 + --> $DIR/disallowed-positions.rs:140:11 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -889,7 +881,7 @@ LL | while let Range { start: F, end } = F..|| true {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:150:15 + --> $DIR/disallowed-positions.rs:148:15 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` @@ -900,13 +892,13 @@ LL | while let Range { start: true, end } = t..&&false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:150:47 + --> $DIR/disallowed-positions.rs:148:47 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected `bool`, found `&&bool` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:150:11 + --> $DIR/disallowed-positions.rs:148:11 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -915,7 +907,7 @@ LL | while let Range { start: true, end } = t..&&false {} found struct `std::ops::Range` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:106:23 + --> $DIR/disallowed-positions.rs:104:23 | LL | while let 0 = 0? {} | ^^ the `?` operator cannot be applied to type `{integer}` @@ -928,19 +920,19 @@ LL | fn branch(self) -> ControlFlow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0614]: type `bool` cannot be dereferenced - --> $DIR/disallowed-positions.rs:173:5 + --> $DIR/disallowed-positions.rs:171:5 | LL | *let 0 = 0; | ^^^^^^^^^^ error[E0600]: cannot apply unary operator `-` to type `bool` - --> $DIR/disallowed-positions.rs:175:5 + --> $DIR/disallowed-positions.rs:173:5 | LL | -let 0 = 0; | ^^^^^^^^^^ cannot apply unary operator `-` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:183:5 + --> $DIR/disallowed-positions.rs:181:5 | LL | (let 0 = 0)?; | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` @@ -953,7 +945,7 @@ LL | fn branch(self) -> ControlFlow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/disallowed-positions.rs:183:16 + --> $DIR/disallowed-positions.rs:181:16 | LL | / fn outside_if_and_while_expr() { LL | | &let 0 = 0; @@ -975,7 +967,7 @@ LL | fn from_residual(residual: R) -> Self; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:198:10 + --> $DIR/disallowed-positions.rs:196:10 | LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -986,7 +978,7 @@ LL | (let Range { start: _, end: _ } = true..true || false); found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:206:5 + --> $DIR/disallowed-positions.rs:204:5 | LL | fn outside_if_and_while_expr() { | - help: try adding a return type: `-> &bool` @@ -995,7 +987,7 @@ LL | &let 0 = 0 | ^^^^^^^^^^ expected `()`, found `&bool` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:179:17 + --> $DIR/disallowed-positions.rs:177:17 | LL | let 0 = 0?; | ^^ the `?` operator cannot be applied to type `{integer}` @@ -1007,7 +999,7 @@ note: required by `branch` LL | fn branch(self) -> ControlFlow; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 103 previous errors; 2 warnings emitted +error: aborting due to 103 previous errors; 1 warning emitted Some errors have detailed explanations: E0277, E0308, E0600, E0614. For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr deleted file mode 100644 index 353da8fd20b22..0000000000000 --- a/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:29:32 - | -LL | fn foo(self: &Rc) -> usize; - | --- method `foo`'s `self` parameter cannot be dispatched on -... -LL | let x = Rc::new(5usize) as Rc; - | ^^^^^^^^^^^ the trait `Foo` cannot be made into an object - -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/arbitrary-self-types-not-object-safe.rs:29:13 - | -LL | fn foo(self: &Rc) -> usize; - | --- method `foo`'s `self` parameter cannot be dispatched on -... -LL | let x = Rc::new(5usize) as Rc; - | ^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object - | - = note: required because of the requirements on the impl of `std::ops::CoerceUnsized>` for `std::rc::Rc` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/simd/simd-array-trait.rs b/src/test/ui/simd/simd-array-trait.rs index d6ed5f61a000e..45c10b3781604 100644 --- a/src/test/ui/simd/simd-array-trait.rs +++ b/src/test/ui/simd/simd-array-trait.rs @@ -4,7 +4,7 @@ // pretty-expanded FIXME #23616 -#![feature(repr_simd, platform_intrinsics, const_generics)] +#![feature(repr_simd, platform_intrinsics, generic_const_exprs)] #![allow(non_camel_case_types, incomplete_features)] pub trait Simd { @@ -21,7 +21,7 @@ impl Simd for i32x4 { #[repr(simd)] #[derive(Copy, Clone)] pub struct T([S::Lane; S::SIZE]); -//~^ ERROR constant expression depends on a generic parameter +//~^ ERROR unconstrained generic constant extern "platform-intrinsic" { fn simd_insert(x: T, idx: u32, y: E) -> T; diff --git a/src/test/ui/simd/simd-array-trait.stderr b/src/test/ui/simd/simd-array-trait.stderr index c100e020c5490..0e02883f67a40 100644 --- a/src/test/ui/simd/simd-array-trait.stderr +++ b/src/test/ui/simd/simd-array-trait.stderr @@ -1,10 +1,10 @@ -error: constant expression depends on a generic parameter +error: unconstrained generic constant --> $DIR/simd-array-trait.rs:23:23 | LL | pub struct T([S::Lane; S::SIZE]); | ^^^^^^^^^^^^^^^^^^ | - = note: this may fail depending on what value the parameter takes + = help: try adding a `where` bound using this expression: `where [(); S::SIZE]:` error: aborting due to previous error diff --git a/src/test/ui/specialization/issue-51892.rs b/src/test/ui/specialization/issue-51892.rs index 3cd0711ae42c6..5c06254143d04 100644 --- a/src/test/ui/specialization/issue-51892.rs +++ b/src/test/ui/specialization/issue-51892.rs @@ -1,6 +1,5 @@ #![allow(incomplete_features)] -#![feature(const_generics)] -#![feature(const_evaluatable_checked)] +#![feature(generic_const_exprs)] #![feature(specialization)] pub trait Trait { diff --git a/src/test/ui/specialization/issue-51892.stderr b/src/test/ui/specialization/issue-51892.stderr index 10a39a4914770..cb46db83606b2 100644 --- a/src/test/ui/specialization/issue-51892.stderr +++ b/src/test/ui/specialization/issue-51892.stderr @@ -1,5 +1,5 @@ error: unconstrained generic constant - --> $DIR/issue-51892.rs:15:17 + --> $DIR/issue-51892.rs:14:17 | LL | type Type = [u8; std::mem::size_of::<::Type>()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/symbol-names/basic.stderr b/src/test/ui/symbol-names/basic.stderr deleted file mode 100644 index 7539cbada8b7b..0000000000000 --- a/src/test/ui/symbol-names/basic.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: symbol-name(_ZN5basic4main17hd72940ef9669d526E) - --> $DIR/basic.rs:3:1 - | -LL | #[rustc_symbol_name] - | ^^^^^^^^^^^^^^^^^^^^ - -error: def-path(main) - --> $DIR/basic.rs:4:1 - | -LL | #[rustc_def_path] - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/symbol-names/const-generics-str-demangling.rs b/src/test/ui/symbol-names/const-generics-str-demangling.rs index af111dd39face..f450dfef575bc 100644 --- a/src/test/ui/symbol-names/const-generics-str-demangling.rs +++ b/src/test/ui/symbol-names/const-generics-str-demangling.rs @@ -1,6 +1,6 @@ // build-fail // compile-flags: -Z symbol-mangling-version=v0 --crate-name=c -#![feature(const_generics, rustc_attrs)] +#![feature(adt_const_params, rustc_attrs)] #![allow(incomplete_features)] pub struct Str; diff --git a/src/test/ui/symbol-names/const-generics-structural-demangling.rs b/src/test/ui/symbol-names/const-generics-structural-demangling.rs index 9da6a0f18e696..fa3884860c33d 100644 --- a/src/test/ui/symbol-names/const-generics-structural-demangling.rs +++ b/src/test/ui/symbol-names/const-generics-structural-demangling.rs @@ -6,7 +6,7 @@ // normalize-stderr-test: "Cs[0-9a-zA-Z]+_4core" -> "Cs$$HASH_4core" // normalize-stderr-test: "core\[[0-9a-f]+\]" -> "core[$$HASH_HEX]" -#![feature(const_generics, decl_macro, rustc_attrs)] +#![feature(adt_const_params, decl_macro, rustc_attrs)] #![allow(incomplete_features)] pub struct RefByte; diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.rs b/src/test/ui/type-alias-impl-trait/assoc-type-const.rs index d53f562e99f4b..0ade36dafa4f3 100644 --- a/src/test/ui/type-alias-impl-trait/assoc-type-const.rs +++ b/src/test/ui/type-alias-impl-trait/assoc-type-const.rs @@ -3,8 +3,6 @@ // check-pass #![feature(type_alias_impl_trait)] -#![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete trait UnwrapItemsExt<'a, const C: usize> { type Iter; diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-const.stderr deleted file mode 100644 index e0c1b02386127..0000000000000 --- a/src/test/ui/type-alias-impl-trait/assoc-type-const.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/assoc-type-const.rs:6:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 for more information - -warning: 1 warning emitted - diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr deleted file mode 100644 index 3ba04af9046dc..0000000000000 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr +++ /dev/null @@ -1,23 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/bounds-are-checked-2.rs:6:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error[E0277]: the trait bound `T: Clone` is not satisfied - --> $DIR/bounds-are-checked-2.rs:9:13 - | -LL | type X = impl Clone; - | ^^^^^^^^^^ the trait `Clone` is not implemented for `T` - | -help: consider restricting type parameter `T` - | -LL | type X = impl Clone; - | +++++++++++++++++++ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs index e45950c4926b1..a4e40f516dcef 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs @@ -1,6 +1,4 @@ -#![feature(const_generics)] #![feature(type_alias_impl_trait)] -#![allow(incomplete_features)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr index 7ea5efd4e6b02..641cce26d9944 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr @@ -1,35 +1,35 @@ error: non-defining opaque type use in defining scope - --> $DIR/generic_duplicate_param_use.rs:14:30 + --> $DIR/generic_duplicate_param_use.rs:12:30 | LL | fn one_ty(t: T) -> TwoTys { | ^^^^^^^^^^^^ | note: type used multiple times - --> $DIR/generic_duplicate_param_use.rs:10:13 + --> $DIR/generic_duplicate_param_use.rs:8:13 | LL | type TwoTys = impl Debug; | ^ ^ error: non-defining opaque type use in defining scope - --> $DIR/generic_duplicate_param_use.rs:19:36 + --> $DIR/generic_duplicate_param_use.rs:17:36 | LL | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> { | ^^^^^^^^^^^^^^^^^^^^ | note: lifetime used multiple times - --> $DIR/generic_duplicate_param_use.rs:11:19 + --> $DIR/generic_duplicate_param_use.rs:9:19 | LL | type TwoLifetimes<'a, 'b> = impl Debug; | ^^ ^^ error: non-defining opaque type use in defining scope - --> $DIR/generic_duplicate_param_use.rs:24:50 + --> $DIR/generic_duplicate_param_use.rs:22:50 | LL | fn one_const(t: *mut [u8; N]) -> TwoConsts { | ^^^^^^^^^^^^^^^ | note: constant used multiple times - --> $DIR/generic_duplicate_param_use.rs:12:22 + --> $DIR/generic_duplicate_param_use.rs:10:22 | LL | type TwoConsts = impl Debug; | ^ ^ diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr deleted file mode 100644 index 918121cce9dbf..0000000000000 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr +++ /dev/null @@ -1,48 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_duplicate_param_use5.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error: concrete type differs from previous defining opaque type use - --> $DIR/generic_duplicate_param_use5.rs:19:1 - | -LL | fn three(t: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, U)`, got `(U, T)` - | -note: previous use here - --> $DIR/generic_duplicate_param_use5.rs:15:1 - | -LL | fn two(t: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: `T` doesn't implement `Debug` - --> $DIR/generic_duplicate_param_use5.rs:11:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = note: required because of the requirements on the impl of `Debug` for `(T, U)` -help: consider restricting type parameter `T` - | -LL | type Two = impl Debug; - | +++++++++++++++++ - -error[E0277]: `U` doesn't implement `Debug` - --> $DIR/generic_duplicate_param_use5.rs:11:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = note: required because of the requirements on the impl of `Debug` for `(T, U)` -help: consider restricting type parameter `U` - | -LL | type Two = impl Debug; - | +++++++++++++++++ - -error: aborting due to 3 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr deleted file mode 100644 index 394b4280ab958..0000000000000 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr +++ /dev/null @@ -1,36 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_duplicate_param_use6.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error: concrete type differs from previous defining opaque type use - --> $DIR/generic_duplicate_param_use6.rs:18:1 - | -LL | fn three(t: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, T)`, got `(U, T)` - | -note: previous use here - --> $DIR/generic_duplicate_param_use6.rs:14:1 - | -LL | fn two(t: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: `T` doesn't implement `Debug` - --> $DIR/generic_duplicate_param_use6.rs:11:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = note: required because of the requirements on the impl of `Debug` for `(T, T)` -help: consider restricting type parameter `T` - | -LL | type Two = impl Debug; - | +++++++++++++++++ - -error: aborting due to 2 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr deleted file mode 100644 index 8c6ea3b342199..0000000000000 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr +++ /dev/null @@ -1,36 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_duplicate_param_use8.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error: concrete type differs from previous defining opaque type use - --> $DIR/generic_duplicate_param_use8.rs:17:1 - | -LL | fn three(_: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, u32)`, got `(U, u32)` - | -note: previous use here - --> $DIR/generic_duplicate_param_use8.rs:13:1 - | -LL | fn two(t: T, _: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: `T` doesn't implement `Debug` - --> $DIR/generic_duplicate_param_use8.rs:10:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = note: required because of the requirements on the impl of `Debug` for `(T, u32)` -help: consider restricting type parameter `T` - | -LL | type Two = impl Debug; - | +++++++++++++++++ - -error: aborting due to 2 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr deleted file mode 100644 index d0176b1e36d7a..0000000000000 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr +++ /dev/null @@ -1,60 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_duplicate_param_use9.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error: concrete type differs from previous defining opaque type use - --> $DIR/generic_duplicate_param_use9.rs:24:1 - | -LL | fn three(t: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(A, B, ::Bar)`, got `(A, B, i32)` - | -note: previous use here - --> $DIR/generic_duplicate_param_use9.rs:20:1 - | -LL | fn two(t: T, u: U) -> Two { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, ::Bar)` - --> $DIR/generic_duplicate_param_use9.rs:10:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ within `(A, B, ::Bar)`, the trait `Foo` is not implemented for `A` - | - = note: required because it appears within the type `(A, B, ::Bar)` -help: consider restricting type parameter `A` - | -LL | type Two = impl Debug; - | +++++ - -error[E0277]: `A` doesn't implement `Debug` - --> $DIR/generic_duplicate_param_use9.rs:10:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` -help: consider restricting type parameter `A` - | -LL | type Two = impl Debug; - | +++++++++++++++++ - -error[E0277]: `B` doesn't implement `Debug` - --> $DIR/generic_duplicate_param_use9.rs:10:18 - | -LL | type Two = impl Debug; - | ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | - = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` -help: consider restricting type parameter `B` - | -LL | type Two = impl Debug; - | +++++++++++++++++ - -error: aborting due to 4 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs index 9f1bffff77c97..7ee5f7b068f45 100644 --- a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs +++ b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs @@ -1,6 +1,4 @@ -#![feature(const_generics)] #![feature(type_alias_impl_trait)] -#![allow(incomplete_features)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr index eb0c296bb626a..5b42f10a6ee34 100644 --- a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr @@ -1,17 +1,17 @@ error: non-defining opaque type use in defining scope - --> $DIR/generic_nondefining_use.rs:15:21 + --> $DIR/generic_nondefining_use.rs:13:21 | LL | fn concrete_ty() -> OneTy { | ^^^^^^^^^^ | note: used non-generic type `u32` for generic parameter - --> $DIR/generic_nondefining_use.rs:9:12 + --> $DIR/generic_nondefining_use.rs:7:12 | LL | type OneTy = impl Debug; | ^ error: non-defining opaque type use in defining scope - --> $DIR/generic_nondefining_use.rs:20:27 + --> $DIR/generic_nondefining_use.rs:18:27 | LL | type OneLifetime<'a> = impl Debug; | -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type @@ -20,13 +20,13 @@ LL | fn concrete_lifetime() -> OneLifetime<'static> { | ^^^^^^^^^^^^^^^^^^^^ error: non-defining opaque type use in defining scope - --> $DIR/generic_nondefining_use.rs:25:24 + --> $DIR/generic_nondefining_use.rs:23:24 | LL | fn concrete_const() -> OneConst<{ 123 }> { | ^^^^^^^^^^^^^^^^^ | -note: used non-generic constant `{ 123 }` for generic parameter - --> $DIR/generic_nondefining_use.rs:11:21 +note: used non-generic constant `123_usize` for generic parameter + --> $DIR/generic_nondefining_use.rs:9:21 | LL | type OneConst = impl Debug; | ^ diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr deleted file mode 100644 index 74d5c0c968860..0000000000000 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error: at least one trait must be specified - --> $DIR/generic_underconstrained.rs:9:35 - | -LL | type Underconstrained = impl 'static; - | ^^^^^^^^^^^^ - -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_underconstrained.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error[E0277]: the trait bound `T: Trait` is not satisfied - --> $DIR/generic_underconstrained.rs:13:31 - | -LL | type Underconstrained = impl 'static; - | ----- required by this bound in `Underconstrained` -... -LL | fn underconstrain(_: T) -> Underconstrained { - | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` - | -help: consider restricting type parameter `T` - | -LL | fn underconstrain(_: T) -> Underconstrained { - | +++++++ - -error: aborting due to 2 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr deleted file mode 100644 index 348563b94de15..0000000000000 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr +++ /dev/null @@ -1,52 +0,0 @@ -error: at least one trait must be specified - --> $DIR/generic_underconstrained2.rs:8:45 - | -LL | type Underconstrained = impl 'static; - | ^^^^^^^^^^^^ - -error: at least one trait must be specified - --> $DIR/generic_underconstrained2.rs:17:46 - | -LL | type Underconstrained2 = impl 'static; - | ^^^^^^^^^^^^ - -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/generic_underconstrained2.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error[E0277]: `U` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:12:33 - | -LL | type Underconstrained = impl 'static; - | --------------- required by this bound in `Underconstrained` -... -LL | fn underconstrained(_: U) -> Underconstrained { - | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | -help: consider restricting type parameter `U` - | -LL | fn underconstrained(_: U) -> Underconstrained { - | +++++++++++++++++ - -error[E0277]: `V` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:21:43 - | -LL | type Underconstrained2 = impl 'static; - | --------------- required by this bound in `Underconstrained2` -... -LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { - | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | -help: consider restricting type parameter `V` - | -LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { - | +++++++++++++++++ - -error: aborting due to 4 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr deleted file mode 100644 index 16b1830e9851c..0000000000000 --- a/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr +++ /dev/null @@ -1,23 +0,0 @@ -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-52843.rs:3:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error[E0277]: the trait bound `T: Default` is not satisfied - --> $DIR/issue-52843.rs:6:15 - | -LL | type Foo = impl Default; - | ^^^^^^^^^^^^ the trait `Default` is not implemented for `T` - | -help: consider restricting type parameter `T` - | -LL | type Foo = impl Default; - | +++++++++++++++++++++++ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr deleted file mode 100644 index 6ba28c3463add..0000000000000 --- a/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr +++ /dev/null @@ -1,647 +0,0 @@ -error: expected identifier, found reserved identifier `_` - --> $DIR/typeck_type_placeholder_item.rs:157:18 - | -LL | struct BadStruct<_>(_); - | ^ expected identifier, found reserved identifier - -error: expected identifier, found reserved identifier `_` - --> $DIR/typeck_type_placeholder_item.rs:160:16 - | -LL | trait BadTrait<_> {} - | ^ expected identifier, found reserved identifier - -error: expected identifier, found reserved identifier `_` - --> $DIR/typeck_type_placeholder_item.rs:170:19 - | -LL | struct BadStruct1<_, _>(_); - | ^ expected identifier, found reserved identifier - -error: expected identifier, found reserved identifier `_` - --> $DIR/typeck_type_placeholder_item.rs:170:22 - | -LL | struct BadStruct1<_, _>(_); - | ^ expected identifier, found reserved identifier - -error: expected identifier, found reserved identifier `_` - --> $DIR/typeck_type_placeholder_item.rs:175:19 - | -LL | struct BadStruct2<_, T>(_, T); - | ^ expected identifier, found reserved identifier - -error: associated constant in `impl` without body - --> $DIR/typeck_type_placeholder_item.rs:208:5 - | -LL | const C: _; - | ^^^^^^^^^^- - | | - | help: provide a definition for the constant: `= ;` - -error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters - --> $DIR/typeck_type_placeholder_item.rs:170:22 - | -LL | struct BadStruct1<_, _>(_); - | - ^ already used - | | - | first use of `_` - -warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/typeck_type_placeholder_item.rs:5:32 - | -LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #63063 for more information - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:10:14 - | -LL | fn test() -> _ { 5 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:13:16 - | -LL | fn test2() -> (_, _) { (5, 5) } - | -^--^- - | || | - | || not allowed in type signatures - | |not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:16:15 - | -LL | static TEST3: _ = "test"; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `&str` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:19:15 - | -LL | static TEST4: _ = 145; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:22:15 - | -LL | static TEST5: (_, _) = (1, 2); - | ^^^^^^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:25:13 - | -LL | fn test6(_: _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn test6(_: T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:28:18 - | -LL | fn test6_b(_: _, _: T) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn test6_b(_: U, _: T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:31:30 - | -LL | fn test6_c(_: _, _: (T, K, L, A, B)) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn test6_c(_: U, _: (T, K, L, A, B)) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:34:13 - | -LL | fn test7(x: _) { let _x: usize = x; } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn test7(x: T) { let _x: usize = x; } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:37:22 - | -LL | fn test8(_f: fn() -> _) { } - | ^ - | | - | not allowed in type signatures - | help: use type parameters instead: `T` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:37:22 - | -LL | fn test8(_f: fn() -> _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn test8(_f: fn() -> T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:51:26 - | -LL | fn test11(x: &usize) -> &_ { - | -^ - | || - | |not allowed in type signatures - | help: replace with the correct return type: `&'static &'static usize` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:56:52 - | -LL | unsafe fn test12(x: *const usize) -> *const *const _ { - | --------------^ - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `*const *const usize` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs - --> $DIR/typeck_type_placeholder_item.rs:70:8 - | -LL | a: _, - | ^ not allowed in type signatures -LL | -LL | b: (_, _), - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL ~ struct Test10 { -LL ~ a: T, -LL | -LL ~ b: (T, T), - | - -error: missing type for `static` item - --> $DIR/typeck_type_placeholder_item.rs:76:12 - | -LL | static A = 42; - | ^ help: provide a type for the static variable: `A: i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:78:15 - | -LL | static B: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:80:15 - | -LL | static C: Option<_> = Some(42); - | ^^^^^^^^^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:82:21 - | -LL | fn fn_test() -> _ { 5 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:85:23 - | -LL | fn fn_test2() -> (_, _) { (5, 5) } - | -^--^- - | || | - | || not allowed in type signatures - | |not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:88:22 - | -LL | static FN_TEST3: _ = "test"; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `&str` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:91:22 - | -LL | static FN_TEST4: _ = 145; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/typeck_type_placeholder_item.rs:94:22 - | -LL | static FN_TEST5: (_, _) = (1, 2); - | ^^^^^^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:97:20 - | -LL | fn fn_test6(_: _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn fn_test6(_: T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:100:20 - | -LL | fn fn_test7(x: _) { let _x: usize = x; } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn fn_test7(x: T) { let _x: usize = x; } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:103:29 - | -LL | fn fn_test8(_f: fn() -> _) { } - | ^ - | | - | not allowed in type signatures - | help: use type parameters instead: `T` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:103:29 - | -LL | fn fn_test8(_f: fn() -> _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn fn_test8(_f: fn() -> T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs - --> $DIR/typeck_type_placeholder_item.rs:126:12 - | -LL | a: _, - | ^ not allowed in type signatures -LL | -LL | b: (_, _), - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL ~ struct FnTest10 { -LL ~ a: T, -LL | -LL ~ b: (T, T), - | - -error[E0282]: type annotations needed - --> $DIR/typeck_type_placeholder_item.rs:131:18 - | -LL | fn fn_test11(_: _) -> (_, _) { panic!() } - | ^ cannot infer type - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:131:28 - | -LL | fn fn_test11(_: _) -> (_, _) { panic!() } - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:135:30 - | -LL | fn fn_test12(x: i32) -> (_, _) { (x, x) } - | -^--^- - | || | - | || not allowed in type signatures - | |not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:138:33 - | -LL | fn fn_test13(x: _) -> (i32, _) { (x, x) } - | ------^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs - --> $DIR/typeck_type_placeholder_item.rs:157:21 - | -LL | struct BadStruct<_>(_); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | struct BadStruct(T); - | ~ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations - --> $DIR/typeck_type_placeholder_item.rs:162:15 - | -LL | impl BadTrait<_> for BadStruct<_> {} - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL | impl BadTrait for BadStruct {} - | +++ ~ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types - --> $DIR/typeck_type_placeholder_item.rs:165:34 - | -LL | fn impl_trait() -> impl BadTrait<_> { - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs - --> $DIR/typeck_type_placeholder_item.rs:170:25 - | -LL | struct BadStruct1<_, _>(_); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | struct BadStruct1(T); - | ~ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs - --> $DIR/typeck_type_placeholder_item.rs:175:25 - | -LL | struct BadStruct2<_, T>(_, T); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | struct BadStruct2(U, T); - | ~ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases - --> $DIR/typeck_type_placeholder_item.rs:179:14 - | -LL | type X = Box<_>; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types - --> $DIR/typeck_type_placeholder_item.rs:185:21 - | -LL | type Y = impl Trait<_>; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:219:31 - | -LL | fn value() -> Option<&'static _> { - | ----------------^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `Option<&'static u8>` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/typeck_type_placeholder_item.rs:224:10 - | -LL | const _: Option<_> = map(value); - | ^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Option` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:143:31 - | -LL | fn method_test1(&self, x: _); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn method_test1(&self, x: T); - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:145:31 - | -LL | fn method_test2(&self, x: _) -> _; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL | fn method_test2(&self, x: T) -> T; - | +++ ~ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:147:31 - | -LL | fn method_test3(&self) -> _; - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn method_test3(&self) -> T; - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:149:26 - | -LL | fn assoc_fn_test1(x: _); - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn assoc_fn_test1(x: T); - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:151:26 - | -LL | fn assoc_fn_test2(x: _) -> _; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - | -help: use type parameters instead - | -LL | fn assoc_fn_test2(x: T) -> T; - | +++ ~ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:153:28 - | -LL | fn assoc_fn_test3() -> _; - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn assoc_fn_test3() -> T; - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/typeck_type_placeholder_item.rs:193:14 - | -LL | type B = _; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/typeck_type_placeholder_item.rs:195:14 - | -LL | const C: _; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/typeck_type_placeholder_item.rs:197:14 - | -LL | const D: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/typeck_type_placeholder_item.rs:200:26 - | -LL | type F: std::ops::Fn(_); - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:44:24 - | -LL | fn test9(&self) -> _ { () } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `()` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:47:27 - | -LL | fn test10(&self, _x : _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn test10(&self, _x : T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:62:24 - | -LL | fn clone(&self) -> _ { Test9 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `Test9` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:65:37 - | -LL | fn clone_from(&mut self, other: _) { *self = Test9; } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn clone_from(&mut self, other: T) { *self = Test9; } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:110:31 - | -LL | fn fn_test9(&self) -> _ { () } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `()` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:113:34 - | -LL | fn fn_test10(&self, _x : _) { } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn fn_test10(&self, _x : T) { } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/typeck_type_placeholder_item.rs:118:28 - | -LL | fn clone(&self) -> _ { FnTest9 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `FnTest9` - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions - --> $DIR/typeck_type_placeholder_item.rs:121:41 - | -LL | fn clone_from(&mut self, other: _) { *self = FnTest9; } - | ^ not allowed in type signatures - | -help: use type parameters instead - | -LL | fn clone_from(&mut self, other: T) { *self = FnTest9; } - | +++ ~ - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/typeck_type_placeholder_item.rs:204:14 - | -LL | type A = _; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/typeck_type_placeholder_item.rs:206:14 - | -LL | type B = _; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/typeck_type_placeholder_item.rs:208:14 - | -LL | const C: _; - | ^ not allowed in type signatures - -error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/typeck_type_placeholder_item.rs:211:14 - | -LL | const D: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` - -error: aborting due to 69 previous errors; 1 warning emitted - -Some errors have detailed explanations: E0121, E0282, E0403. -For more information about an error, try `rustc --explain E0121`. diff --git a/src/tools/clippy/tests/ui/crashes/ice-4775.rs b/src/tools/clippy/tests/ui/crashes/ice-4775.rs index 31e53e846d54d..405e3039e7d0c 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-4775.rs +++ b/src/tools/clippy/tests/ui/crashes/ice-4775.rs @@ -1,6 +1,3 @@ -#![feature(const_generics)] -#![allow(incomplete_features)] - pub struct ArrayWrapper([usize; N]); impl ArrayWrapper<{ N }> { diff --git a/src/tools/clippy/tests/ui/crashes/ice-5223.rs b/src/tools/clippy/tests/ui/crashes/ice-5223.rs index 9bb2e227fc12e..e3b3b27a6fc38 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-5223.rs +++ b/src/tools/clippy/tests/ui/crashes/ice-5223.rs @@ -1,7 +1,4 @@ // Regression test for #5233 - -#![feature(const_generics)] -#![allow(incomplete_features)] #![warn(clippy::indexing_slicing, clippy::iter_cloned_collect)] pub struct KotomineArray { diff --git a/src/tools/clippy/tests/ui/doc/doc.rs b/src/tools/clippy/tests/ui/doc/doc.rs index 8afef6b23d476..8b0c0f304fce0 100644 --- a/src/tools/clippy/tests/ui/doc/doc.rs +++ b/src/tools/clippy/tests/ui/doc/doc.rs @@ -2,7 +2,7 @@ #![allow(dead_code, incomplete_features)] #![warn(clippy::doc_markdown)] -#![feature(custom_inner_attributes, const_generics, const_evaluatable_checked, const_option)] +#![feature(custom_inner_attributes, generic_const_exprs, const_option)] #![rustfmt::skip] /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) @@ -203,7 +203,7 @@ fn issue_2343() {} /// __|_ _|__||_| fn pulldown_cmark_crash() {} -// issue #7033 - const_evaluatable_checked ICE +// issue #7033 - generic_const_exprs ICE struct S where [(); N.checked_next_power_of_two().unwrap()]: { arr: [T; N.checked_next_power_of_two().unwrap()], diff --git a/src/tools/clippy/tests/ui/missing_const_for_fn/cant_be_const.rs b/src/tools/clippy/tests/ui/missing_const_for_fn/cant_be_const.rs index 6d2cbb6ad96fa..aa60d0504e5e6 100644 --- a/src/tools/clippy/tests/ui/missing_const_for_fn/cant_be_const.rs +++ b/src/tools/clippy/tests/ui/missing_const_for_fn/cant_be_const.rs @@ -5,8 +5,7 @@ // aux-build:helper.rs #![warn(clippy::missing_const_for_fn)] -#![allow(incomplete_features)] -#![feature(start, const_generics)] +#![feature(start)] #![feature(custom_inner_attributes)] extern crate helper; diff --git a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs index 0accb516f5f6b..baa7eec05462e 100644 --- a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs +++ b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs @@ -1,6 +1,5 @@ #![warn(clippy::missing_const_for_fn)] #![allow(incomplete_features, clippy::let_and_return)] -#![feature(const_generics)] #![feature(custom_inner_attributes)] use std::mem::transmute; diff --git a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr index 63c211f39fa1e..b89cc6451bb59 100644 --- a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr +++ b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr @@ -1,5 +1,5 @@ error: this could be a `const fn` - --> $DIR/could_be_const.rs:14:5 + --> $DIR/could_be_const.rs:13:5 | LL | / pub fn new() -> Self { LL | | Self { guess: 42 } @@ -9,7 +9,7 @@ LL | | } = note: `-D clippy::missing-const-for-fn` implied by `-D warnings` error: this could be a `const fn` - --> $DIR/could_be_const.rs:18:5 + --> $DIR/could_be_const.rs:17:5 | LL | / fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] { LL | | b @@ -17,7 +17,7 @@ LL | | } | |_____^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:24:1 + --> $DIR/could_be_const.rs:23:1 | LL | / fn one() -> i32 { LL | | 1 @@ -25,7 +25,7 @@ LL | | } | |_^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:29:1 + --> $DIR/could_be_const.rs:28:1 | LL | / fn two() -> i32 { LL | | let abc = 2; @@ -34,7 +34,7 @@ LL | | } | |_^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:35:1 + --> $DIR/could_be_const.rs:34:1 | LL | / fn string() -> String { LL | | String::new() @@ -42,7 +42,7 @@ LL | | } | |_^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:40:1 + --> $DIR/could_be_const.rs:39:1 | LL | / unsafe fn four() -> i32 { LL | | 4 @@ -50,7 +50,7 @@ LL | | } | |_^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:45:1 + --> $DIR/could_be_const.rs:44:1 | LL | / fn generic(t: T) -> T { LL | | t @@ -58,7 +58,7 @@ LL | | } | |_^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:68:9 + --> $DIR/could_be_const.rs:67:9 | LL | / pub fn b(self, a: &A) -> B { LL | | B @@ -66,7 +66,7 @@ LL | | } | |_________^ error: this could be a `const fn` - --> $DIR/could_be_const.rs:78:5 + --> $DIR/could_be_const.rs:77:5 | LL | / fn const_fn_stabilized_before_msrv(byte: u8) { LL | | byte.is_ascii_digit();