diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 2b86128b3f79..d0a95ea130a4 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -332,7 +332,7 @@ pub type GenericBounds = Vec; pub enum ParamKindOrd { Lifetime, Type, - // `unordered` is only `true` if `sess.has_features().const_generics` + // `unordered` is only `true` if `sess.has_features().const_generics_defaults` // is active. Specifically, if it's only `min_const_generics`, it will still require // ordering consts after types. Const { unordered: bool }, diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 557271e32adb..1defb65ed879 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 a993ce826a73..d4dbfb7a5d8e 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 91379bfe05c6..510075dc779c 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(const_param_types)] 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(const_param_types)] #[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 b39163a9de3f..cd8fc481bf0c 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 824a955f6b3f..c1e133673cad 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(const_param_types)] 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(const_param_types)] fn function_with_str() {} // ok! ``` diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 18294dfad240..725f8b8763af 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 222b17615e2d..e2c88835f524 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 } /// 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), @@ -676,6 +673,9 @@ declare_features! ( /// 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, const_param_types, "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 326daf21e40e..dd17b8ab22b4 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(const_param_types]` 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")), diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs index 32308910aa7d..a0ee212bed0c 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 a5b4fa15921b..88b9e92119f6 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 a9ee921399ab..de7c6d9e0953 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.generic_const_exprs + // Note: We only use lazy normalization for generic const expressions. + features.generic_const_exprs } #[inline] diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index a4f754942381..0b1687d1bd8c 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(generic_const_exprs)]` \ - 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 b3601ecf1d3a..45657f2d0f22 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 bc2c46ec0aa7..e901d4c00ab7 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 fc8fcf759adb..da3beac08196 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -2734,8 +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.generic_const_exprs) - { + 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. @@ -2807,8 +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.generic_const_exprs) - { + 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 417d38e9f593..9968cd62d95f 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -451,6 +451,7 @@ symbols! { const_mut_refs, const_panic, const_panic_fmt, + const_param_types, const_precise_live_drops, const_ptr, const_raw_ptr_deref, diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index 5ade3828b726..761ea6df2e1e 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().const_param_types { 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(const_param_types)]`", ); } err.emit() diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index ff0b47abca9f..b8e8854847fb 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 diff --git a/src/test/debuginfo/function-names.rs b/src/test/debuginfo/function-names.rs index b9e59f8e8297..e962c18d8ec7 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(const_param_types, 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 4fe9dfc35bfd..7696bb7d331a 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, generic_const_exprs)] +#![feature(generic_const_exprs, const_param_types)] #![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 cb8ca3abd7f9..000000000000 --- 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 32dbf0b45b9b..71d504d26a75 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, generic_const_exprs)] +#![feature(generic_const_exprs, const_param_types, 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 0e6040ef02e7..000000000000 --- 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 9097d1e98f80..61f568f79ef9 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, generic_const_exprs)] +#![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 555d46756dcb..000000000000 --- 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 9cfc0012576d..12e8ac7abadc 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, generic_const_exprs)] +#![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 c9a6715e571c..000000000000 --- 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 00b3b29698be..e9d67fee2969 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 a193bf998dc7..c781484d1e2e 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 0eaeb910be64..93c1dbf44e93 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 6b10c5404944..81c813531bd5 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 353e323e67b4..22bbcbcabed1 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 925931bc4a63..9e35cf93d091 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 af77b1cedade..8262a2a211b7 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, generic_const_exprs)] +#![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 46f18ce2309c..92bbcba4b38a 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, generic_const_exprs)] +#![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 b01f31b91602..baca4562adef 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, generic_const_exprs)] +#![feature(generic_const_exprs, const_param_types)] #![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 81b71cdf8813..c05d8355c280 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, generic_const_exprs)] +#![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 b468fd071fe1..8886a556dbb2 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, generic_const_exprs)] +#![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 7c7d14a30c97..db1e2fc2af48 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, generic_const_exprs)] +#![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 b86ad01d99d8..5b2f5edc8500 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, generic_const_exprs)] +#![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 487154e7aba3..d659c5676336 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, generic_const_exprs)] +#![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 c28f6e17bef4..5f5435ba9f28 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, generic_const_exprs)] +#![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 123dbaa406b8..7e38eb8369a8 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 626a9e2b2109..b20663c6d68a 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 7ddcb3a29f28..f0bc9bf7bdd7 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(const_param_types)] #![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 86% rename from src/test/rustdoc/const-generics/const-evaluatable-checked.rs rename to src/test/rustdoc/const-generics/generic_const_exprs.rs index d435082e759f..35036a89360e 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(generic_const_exprs, 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 3345c8a3fe9c..4eac8e31e452 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(const_generics, generic_const_exprs)] +#![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 45b2889f1ca4..d190d7054fee 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 0ad05b3adeb8..1a14ab40b1f8 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 3f97474d65f0..46a54a12d624 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(generic_const_exprs)]` 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 bffdeb9a336a..f2e4ca524a43 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(generic_const_exprs)]` 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 37ebb4ecac8b..24103390e090 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(const_param_types))] #![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 0200c6def246..000000000000 --- 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 4aec801cb155..2d051808fe0b 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 0200c6def246..adda80810ead 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 3bc62141927a..2a04dc313e9b 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 e533d4f7fb83..9762748f441f 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 f23bc6d6a2bf..afd9ed1a7235 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 95eaeea58184..97dd0f143522 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 0fb23e41b013..000000000000 --- 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 732a18714566..a712f691dbe2 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 7ab430ba830b..000000000000 --- 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 83b267008057..937b8bcb6305 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 7ab430ba830b..60e624fc6a8c 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 02f77396c0b6..3044736b47e0 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 8d4cd9c0d6b7..922f92d9feb7 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 d9baab956c9f..19a8bb0f4eb2 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 ff686c5e767d..5c2b1f4bddf8 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, generic_const_exprs)] +#![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 bc3c304cfd88..cd5b8161d08b 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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] // library portion of testing that `impl Trait<{ expr }>` doesnt diff --git a/src/test/ui/const-generics/broken-mir-1.rs b/src/test/ui/const-generics/broken-mir-1.rs index 34255fa9f588..6b6140e3a730 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 ac358b01672b..f9e03151374a 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 44aef859f2de..a6e767489b79 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 f4bb1e422076..000000000000 --- 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 8e20df281039..ffd5eb9d462e 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 8c31c8651a2b..372f0433e951 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 3d3bd2664c8b..53c9c0ead0f9 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 ad40b48afe5e..6f85237cf0aa 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 f01bda84bf51..aa0f9131aa7f 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, generic_const_exprs)] +#![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 c48830f01a96..d0864414cc1f 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, generic_const_exprs)] +#![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 6805b4a187e2..ac693426fbd9 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 8279f4a3f61e..39f0b2373302 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 43ed12efb895..9b225b18d730 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 d0ea51ea4173..000000000000 --- 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 5415791d21bb..8ee17e637aa3 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 d7b7df0eb55b..104ee9b48b43 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 6ef698bd6a04..000000000000 --- 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 a8f533eceaa6..d863d097d5ca 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 6ef698bd6a04..aefd514f7a68 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 8e62147eb7e3..8c5c3b17b5c4 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 ef6bb69e9973..b123036bf250 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(generic_const_exprs)]` 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 67ed85f96afd..db1eafca2c72 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 dc34621b9050..2aca7bdeb9a1 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 4ce0ecdf3aab..000000000000 --- 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 5c1ee4e0d5a9..161bfaab48ad 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 224fc794e327..000000000000 --- 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 95632f798969..bb16be9c58c3 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 6c2b14f2770d..d8a0e076e0a4 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 09a4f66de39c..982417eb3c61 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 a9349ce43c94..f439cd9d69fc 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 508bb3e6a689..0a7b57fe626b 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 119f932745b3..d6753a74f857 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 613918f78f36..0f98adf2a6bc 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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 89715a7b8e9d..345e192f8db4 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(const_param_types))] #![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 c2ec7359c9f7..000000000000 --- 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 9dc9c80241d5..f823431e69b9 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 79b3ae2037ed..000000000000 --- 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 9804363f39a9..db3a04b8235d 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(const_param_types)]` 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(const_param_types)]` 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 62b146e016a1..07c86d2cf8ce 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(const_param_types))] #![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 910a96435022..6eb4b3735ffe 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(const_param_types))] #![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 923964a4070a..000000000000 --- 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 5d97907c2e7f..b08d62ccc7b1 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 923964a4070a..efaa182852ac 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 fb150f892edc..000000000000 --- 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/core-types.rs b/src/test/ui/const-generics/core-types.rs index b6fa478f48df..5e975c170431 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(const_param_types))] #![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 1d495c9562de..ebde155f7765 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 6514409698e3..5c548740af23 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 25004faee6f9..aa289ec07783 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 d3558007977e..814c996fbad6 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 d24e403e017e..c27ed298afd1 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 4fa21b8b1fb7..e7cbf01a3017 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 8eb8f368b12f..2b41dbb58873 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 c417a26842ed..000000000000 --- 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 735549defeaf..280d92f839f4 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 c417a26842ed..0f85ceccc8a8 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 32acf567cf2b..276e74355c25 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 77% 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 80359476d6cc..52cea51aae15 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, generic_const_exprs, 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 090e507b7f34..905a285370a0 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 82% 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 eb4a0cec0a6a..3a11631fc47f 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, generic_const_exprs, 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 f97fc26a0732..d5a3071b77d1 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 89% 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 02f21adb0d59..0adbd5cdf317 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(generic_const_exprs, 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 0234ea8b9a4a..ada1498d1c80 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 29d835e36c6e..725cc36b428c 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 29d835e36c6e..725cc36b428c 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 307e3aaf1fbf..cc215ab0c251 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 4aa8401ab221..000000000000 --- 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 9d9a8793aaac..4ae93a9166d3 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 4aa8401ab221..3c7f4fe3b28f 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 a4006203e4a2..158fa2ec1c8f 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 a4006203e4a2..000000000000 --- 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 b58dee0712a7..9ba8184e0585 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 c003cb2c5a6e..bc01fe2656c9 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 e68075ee3c62..8b35c5860d94 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 eb0bcb282155..000000000000 --- 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 88e9e96ba43f..33564a48448a 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 eb0bcb282155..47a2c6f3f419 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 ce1481d97e9b..000000000000 --- 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 93874fb1f5fe..000000000000 --- 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 7977560ecbcf..000000000000 --- 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 027e282c398d..a2dcc033627c 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 027e282c398d..a2dcc033627c 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 b48189fc2cba..9ee0e0747c4c 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 000000000000..cfe3a0a075a9 --- /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(const_param_types)] +#![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 d6b32323e2d0..c0709a996ce3 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 eb272e3c9b49..6c4ee1af210b 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, generic_const_exprs)] +#![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 73ed23521c30..3dee326a186e 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 a9b552ebed7a..cb4d6299ed65 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 f4bb1e422076..58fff3a85afe 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 cb609a564161..4cf7ba86921c 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 4ce0ecdf3aab..4ce1be25edb9 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 27b9ca9c291e..c3b418ee3f8a 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 c2ec7359c9f7..a9f9787d8759 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 9cafb05fbcb6..fd4e5b409eef 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 1581af5ab275..6619c9758859 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 dd37d4e7a85a..b46e7e24f492 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 605a10880bbb..0ae914635995 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 f6d8020f3fbb..49382dbf0bd5 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 4e89e4a3b17e..000000000000 --- 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 921f9a467078..778d498343e0 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 4e89e4a3b17e..0c6aced4bc22 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 70a104e22227..5cd18f6d3598 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(const_param_types))] #![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 d090479d4c30..596101596952 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(const_param_types))] #![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 58c1b95893e7..000000000000 --- 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 80eac994d55c..000000000000 --- 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 0fdb3ed4a5a7..7884008b858b 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(const_param_types)] +#![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 5c0f17537fa5..81b9bdfbd602 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.min.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr deleted file mode 100644 index b827e482977b..000000000000 --- a/src/test/ui/const-generics/foreign-item-const-parameter.min.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 83caa89f0330..4fe377b5964f 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.full.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.full.stderr rename to src/test/ui/const-generics/foreign-item-const-parameter.stderr index b827e482977b..b02db8700cff 100644 --- a/src/test/ui/const-generics/foreign-item-const-parameter.full.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 2d19a58a1457..000000000000 --- 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 dd4de9bc1b7a..000000000000 --- 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 a6d2bbd17eaa..000000000000 --- 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 aff8780fb0d1..000000000000 --- 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 22fffe47dcc2..2e201e50a64e 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 aff8780fb0d1..d0776d49d71b 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 c13882e7fe11..000000000000 --- 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 d80d38cf8b10..000000000000 --- 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 7ee0394ba14c..000000000000 --- 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/generic_const_exprs/abstract-const-as-cast-1.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs index 4d7c4e003d00..06f00de13a30 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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(generic_const_exprs, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo([u8; N as usize]) diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs index 08b46c4c4a35..3b5b87b2b3d6 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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(generic_const_exprs, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Evaluatable {} diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs index 0cb5410ed26e..7561ae2febbd 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Trait {} diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs index 66afe517835d..184263f899ab 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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(generic_const_exprs, 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 000000000000..deb6f3bd12c1 --- /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 80% 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 5312a22c2289..22e7ab1f7b12 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(const_param_types)]` 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 cd0a9742cd1a..68201b77dbf1 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, const_param_types))] #![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/generic_const_exprs/associated-consts.rs b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs index 967d1b0f2acb..4d89f188ad77 100644 --- a/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs +++ b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub trait BlockCipher { diff --git a/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs b/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs index ce92f908e067..15d618caef4b 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub fn test1() -> [u8; std::mem::size_of::() - 1] diff --git a/src/test/ui/const-generics/generic_const_exprs/closures.rs b/src/test/ui/const-generics/generic_const_exprs/closures.rs index c682fee4fab6..847843fe1a63 100644 --- a/src/test/ui/const-generics/generic_const_exprs/closures.rs +++ b/src/test/ui/const-generics/generic_const_exprs/closures.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, generic_const_exprs)] +#![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/generic_const_exprs/cross_crate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs index a8388fc541ca..dfc69e0b0689 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] extern crate const_evaluatable_lib; diff --git a/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs index 4e3aeec9c5de..b08fffd6922b 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] extern crate const_evaluatable_lib; diff --git a/src/test/ui/const-generics/generic_const_exprs/different-fn.rs b/src/test/ui/const-generics/generic_const_exprs/different-fn.rs index 0dcafc6a789c..e8bc703bda61 100644 --- a/src/test/ui/const-generics/generic_const_exprs/different-fn.rs +++ b/src/test/ui/const-generics/generic_const_exprs/different-fn.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; diff --git a/src/test/ui/const-generics/generic_const_exprs/division.rs b/src/test/ui/const-generics/generic_const_exprs/division.rs index c10ed834f0f7..098fa9e0447a 100644 --- a/src/test/ui/const-generics/generic_const_exprs/division.rs +++ b/src/test/ui/const-generics/generic_const_exprs/division.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn with_bound() where [u8; N / 2]: Sized { diff --git a/src/test/ui/const-generics/generic_const_exprs/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 index c99cfa6f52ff..3543960c3ebd 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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,5 +1,4 @@ // run-pass -#![feature(const_generics)] #![feature(generic_const_exprs)] #![allow(incomplete_features)] diff --git a/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs b/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs index 45f63bad6fee..077f77aa0f40 100644 --- a/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs +++ b/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs @@ -1,5 +1,5 @@ //check-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo diff --git a/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs b/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs index 3c6f01b6160e..e4111157ecdb 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs index f9d78fd708c8..80d0662f1f49 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] pub struct Const; diff --git a/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs b/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs index 8acb7aaf34ee..340e35e1c65d 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] enum Assert {} trait IsTrue {} diff --git a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.full.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.full.stderr deleted file mode 100644 index 26dfcff5d3e3..000000000000 --- a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/feature-gate-generic_const_exprs.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/generic_const_exprs/feature-gate-generic_const_exprs.rs b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs index f49ca0251aa9..10ab2fd867cf 100644 --- 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 @@ -1,12 +1,7 @@ -// 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 +//~^ ERROR generic parameters may not be used in const operations fn test() -> Arr where Arr: Default { - //[full]~^ ERROR constant expression depends Default::default() } diff --git a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.min.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr similarity index 64% rename from src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.min.stderr rename to src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr index fccd6ea144b0..2d60ebaa83a1 100644 --- a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.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-generic_const_exprs.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(generic_const_exprs)]` 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/generic_const_exprs/fn_call.rs b/src/test/ui/const-generics/generic_const_exprs/fn_call.rs index a1b2a52a5a12..cbe4277df568 100644 --- a/src/test/ui/const-generics/generic_const_exprs/fn_call.rs +++ b/src/test/ui/const-generics/generic_const_exprs/fn_call.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] const fn test_me(a: usize, b: usize) -> usize { diff --git a/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs index db097567a152..90953145944f 100644 --- a/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs +++ b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn test() -> [u8; N - 1] { diff --git a/src/test/ui/const-generics/generic_const_exprs/from-sig.rs b/src/test/ui/const-generics/generic_const_exprs/from-sig.rs index d2e672bae4d8..28de4f864671 100644 --- a/src/test/ui/const-generics/generic_const_exprs/from-sig.rs +++ b/src/test/ui/const-generics/generic_const_exprs/from-sig.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, generic_const_exprs)] +#![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/generic_const_exprs/impl-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs index d3f140755f7a..7120d6ee2518 100644 --- a/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs +++ b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; diff --git a/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs b/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs index 4c8fc7a3554c..b8058c252e77 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![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 efbcdc3d2b78..f2ae361dc81d 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 1b70cd1c3766..a97f4b8ff313 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 b1214b12a144..9b36699bbf11 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 77% 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 6314650e0d8b..3c7a740e8434 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 16bc9470470f..77ad57f0640f 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 000000000000..d536f6fd1d55 --- /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 75% 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 70adabea5610..42671412fa77 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(generic_const_exprs)]` 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 f612d8bd3f6b..7a5aa9e47d49 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 93% 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 ece8eb2c9ec9..d1ab1be04733 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(generic_const_exprs)] -#![feature(const_generics)] #![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 0f23fa92c367..cd1f7a9da687 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 85% 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 6e9af5bbb305..faa8b3d10de4 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, generic_const_exprs)] +#![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 91% 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 b0bd3d8a2c93..2fa9a71fbb33 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, generic_const_exprs)] +#![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 89% 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 1b9967a7b49b..77d3c98dab92 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, generic_const_exprs)] +#![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 95% rename from src/test/ui/mir/issue-80742.rs rename to src/test/ui/const-generics/generic_const_exprs/issue-80742.rs index cfd87bd9769b..275f69953024 100644 --- a/src/test/ui/mir/issue-80742.rs +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs @@ -4,7 +4,6 @@ #![allow(incomplete_features)] #![feature(generic_const_exprs)] -#![feature(const_generics)] 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 b2b40bea7082..56cb11bacbe6 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 e2b859c0f859..fac811d1302f 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, generic_const_exprs)] +#![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 93% 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 fb49cba2a34c..fb2e5590d216 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, generic_const_exprs)] +#![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 90% 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 4d75fdb7d1df..771e68b0db58 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, generic_const_exprs)] +#![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/generic_const_exprs/less_than.rs b/src/test/ui/const-generics/generic_const_exprs/less_than.rs index 31fe9a53f034..2e9af1bf4f0b 100644 --- a/src/test/ui/const-generics/generic_const_exprs/less_than.rs +++ b/src/test/ui/const-generics/generic_const_exprs/less_than.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs b/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs index ea5c95a74446..cd5d76dd949d 100644 --- a/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs +++ b/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, generic_const_exprs)] +#![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_evaluatable/needs_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs similarity index 83% 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 e8a625101d6b..2bd3c801fbf4 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, generic_const_exprs)] +#![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/generic_const_exprs/nested-abstract-consts-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs index e70bdad90847..7e5022817e41 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn callee() -> usize diff --git a/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs index aed3f476f1df..769e3ae6895f 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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(generic_const_exprs, const_generics)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Generic; diff --git a/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs index a86918adfa76..316887e5e7fa 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn zero_init() -> Substs1 diff --git a/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs index 72fd39b96f88..d45a6465b765 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![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 90% 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 6ae517af0d5b..9c5de03170b1 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, generic_const_exprs)] +#![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/generic_const_exprs/object-safety-err-ret.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs index 81a634a41738..24d333aba0fd 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs index 22ff9f41276b..42c1cc507b5c 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] #![deny(where_clauses_object_safety)] diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs index e421c43dd948..c6c196db6f2a 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Foo { diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs index 0ab8be80f373..f4c89f6235a0 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] trait Foo { diff --git a/src/test/ui/const-generics/generic_const_exprs/simple_fail.min.stderr b/src/test/ui/const-generics/generic_const_exprs/simple_fail.min.stderr deleted file mode 100644 index f6192bbe9caf..000000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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(generic_const_exprs)]` 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(generic_const_exprs)]` to allow generic const expressions - -error: aborting due to 2 previous errors - 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 index db2f94b7fce1..c47a350c7fb4 100644 --- a/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs +++ b/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs @@ -1,15 +1,11 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, feature(generic_const_exprs))] +#![feature(generic_const_exprs)] #![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 +//~^ 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 +//~^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed todo!() } diff --git a/src/test/ui/const-generics/generic_const_exprs/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/generic_const_exprs/simple_fail.full.stderr rename to src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr index 1f2313a6028d..99fc92fb4f0a 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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/generic_const_exprs/subexprs_are_const_evalutable.rs b/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs index 71c594657e03..d6574a3aa2f8 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn make_array() -> [(); M + 1] { diff --git a/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs b/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs index abb9df162884..d058b3638509 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] type Alias = [T; N + 1]; diff --git a/src/test/ui/const-generics/generic_const_exprs/unop.rs b/src/test/ui/const-generics/generic_const_exprs/unop.rs index e0e373b62f94..c12fef083cc7 100644 --- a/src/test/ui/const-generics/generic_const_exprs/unop.rs +++ b/src/test/ui/const-generics/generic_const_exprs/unop.rs @@ -1,5 +1,5 @@ // run-pass -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] struct Foo; diff --git a/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs b/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs index c0da46d6d5f7..67fefd07ec0c 100644 --- a/src/test/ui/const-generics/generic_const_exprs/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, generic_const_exprs, 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/generic_const_exprs/unused_expr.rs b/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs index 44b6530f22e8..c1bf19e0f8d4 100644 --- a/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs +++ b/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs @@ -1,4 +1,4 @@ -#![feature(const_generics, generic_const_exprs)] +#![feature(generic_const_exprs)] #![allow(incomplete_features)] fn add() -> [u8; { N + 1; 5 }] { 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 1aa22698b640..7eb2c6a51fcf 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 ebc8f458f79c..000000000000 --- 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 2e6e49b9c0aa..24ba393c17f2 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 ebc8f458f79c..6268a564b06b 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 7a12f3bdec27..000000000000 --- 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 305559d93fda..de2d126afd75 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 7a12f3bdec27..bf873dacd98e 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 01fb137dd6af..000000000000 --- 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 cc52892bd04b..f85a72910aff 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 01fb137dd6af..828f49724039 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 979d50b85f14..000000000000 --- 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 8ac6a7d6267b..0c5eed4894cb 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 979d50b85f14..53d92e5ae725 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 31b7fc7ccf5a..000000000000 --- 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 0e947131f4cd..d6018650f533 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 31b7fc7ccf5a..acf59170c369 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 bee4b693825f..000000000000 --- 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 bcd9aadb78af..657f4b513042 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 bee4b693825f..a6c79fc058a4 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 5e2a3eaff543..10317a1b98fc 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 0273383856fd..40f6f5b8d55c 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 96e5976e44b3..2b8731ba7096 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 3e90dbeece95..000000000000 --- 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 f1ea52825e03..604b4e8bddbf 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(generic_const_exprs)]` 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(const_param_types)]` 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 f24dd42eb2da..eedc619e8054 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(const_param_types, 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 32939dcd2861..65741d07d907 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(const_param_types, 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 f59eb60cb38f..6a10ee267df9 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 4a6b57842217..de3a40860252 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 8416d64e1c2d..179643a75529 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 f7056f27cb37..179643a75529 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 bc9e1dee853e..7cd8e13c8f5f 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(const_param_types))] +#![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 c03b7252a3c8..000000000000 --- 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 6e64c78cd8c9..0066490dfa37 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 f18728eabbb4..000000000000 --- 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 c93b296dbb55..beb37e63b5e5 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 8f07d208091a..000000000000 --- 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 a1cf641ff749..b7cd29f89323 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 9b62ffc93494..48aaaf5e5440 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 4883463c2e67..000000000000 --- 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 c0106ee38c20..80be1d8e5e54 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 dc891842e138..665a1a677a1a 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 ac6c378295d3..000000000000 --- 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 421f696f3fd8..0b9cf40d8555 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 82b36de45a2a..000000000000 --- 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 97ab07daccef..6192af82afb2 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 56deec16548f..000000000000 --- 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 6d6bca4255ac..000000000000 --- 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(generic_const_exprs)]` 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(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-61522-array-len-succ.rs b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs deleted file mode 100644 index d4a948b92597..000000000000 --- 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 b7f66345c4aa..000000000000 --- 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 cc8c4db9c396..000000000000 --- 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(generic_const_exprs)]` 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 3aa2e6a5c31d..000000000000 --- 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 b970f4e4c8e3..000000000000 --- 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 a635d5e84a2e..000000000000 --- 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(generic_const_exprs)]` 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 ed861c63bf1e..000000000000 --- 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 1a0e46e599d9..fa76aeae901d 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 373360c7ced6..000000000000 --- 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 54a93733f322..000000000000 --- 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(generic_const_exprs)]` 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 c26784c9813c..000000000000 --- 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 833e70ca6d38..000000000000 --- 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 1e90d0b3f502..000000000000 --- 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(generic_const_exprs)]` 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 e24cf36c8ce4..000000000000 --- 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 5c9387d4012d..000000000000 --- 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 46813f5256e5..000000000000 --- 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 08f6454fa2df..f074a65313f1 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 e4a71fe06186..af3bd4124335 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(const_param_types)]` 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 fb6257696b96..8eaa31249aa9 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(const_param_types, 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 2fb38addb2d8..dcb4c703895b 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(const_param_types)]` 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 334e2aac02a4..076a16821e54 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(const_param_types))] #![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 abb26d6cf175..000000000000 --- 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 8cb9981a534c..000000000000 --- 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 96d19203109a..000000000000 --- 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 8c603b74b907..969289b26e80 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 6552aea4ad1f..000000000000 --- 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 7e150f5f6db5..000000000000 --- 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 1dd4baaa5b57..000000000000 --- 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(generic_const_exprs)]` 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 14249b62ceed..000000000000 --- 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.rs b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs index 2a741ba87a98..a506fceb4eff 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(const_param_types)] +#![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 a871b118dcc5..a0b3f9122071 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 ed35a5f7c0a8..69425b25eaee 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 19f419c82fdf..000000000000 --- 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 94a713d7cf95..c1a04e201474 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 19f419c82fdf..7167bea94bbb 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 0fe65272f1b7..5386ef56a245 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 c005e03f20c3..5256d96c8769 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(generic_const_exprs)]` 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 a8875b8b6bfc..b5b842a15ae0 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 dcbe5b94a628..f1a426c3c586 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 e4960e56c9e4..de0eb7f509ae 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 63c50b5ca542..1edc7828caad 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 70e2518ca2af..eee04eb75a25 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 84737e4e9857..7b7e8428639c 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))] +#![cfg_attr(full, feature(generic_const_exprs))] -use std::marker::PhantomData; - -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 b90040602311..118cf447c01e 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 previous error -error: aborting due to 2 previous errors - -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 24476d4fac8f..6e07af1e672a 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(generic_const_exprs)]` to allow generic const expressions +LL | let x: Option> = None; + | ^^^^ -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(generic_const_exprs)]` to allow generic const expressions +error: aborting due to previous error -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 3 previous errors - -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 4a46786e9a9b..cbb4e14eccf7 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 fa66252bd694..000000000000 --- 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 5c30429c8958..000000000000 --- 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 5bad61cfc763..000000000000 --- 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 43c3999133c6..ad5710baae2b 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 9519b23b4844..9f370b0f510f 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(generic_const_exprs)]` 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 37afed62327d..4c2741ab4337 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 0bb23be1eb4e..c3c9141e424d 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 4782b1d98eba..040f65a8edaf 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(const_param_types)]` 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 ddea3e8ab658..5d0f9ae0b1dc 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(const_param_types))] #![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 d0c190b91b04..3f4153f3f351 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(const_param_types)]` 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 56afd9b2a154..4dbc56b4bd2b 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(const_param_types))] #![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 25dcd88a4afc..000000000000 --- 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 78da8412cdfb..000000000000 --- 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(generic_const_exprs)]` 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(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-68977.rs b/src/test/ui/const-generics/issues/issue-68977.rs deleted file mode 100644 index a0ffcc84c7a3..000000000000 --- 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 45318ca68fcc..63d7fde78ac8 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 a82a60696b36..000000000000 --- 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 5c118d245a1e..0027cd46a519 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 f82131262d6e..cfd5e784ec40 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 9e912b691773..3961941f81fa 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 f0554823273a..2ec37cc3a1be 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 21cefc09c253..95e548428747 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 8f8d753d0a75..d458d7b2e871 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 189a32570f76..a76488249173 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 7b1a2f98dfeb..1f5880f368ee 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 1c6e08adffdf..ed360c96f289 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(const_param_types)]` 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 a574da4b6b31..f949bc979ba6 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(const_param_types))] #![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 78dee1717f1f..57fd72b12846 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 000000000000..277540610864 --- /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 f015d6946954..b24bc241d42c 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(const_param_types))] #![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 3a56db937de0..5663012dc637 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(const_param_types))] #![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 6468d0b6bdae..c82916e85a28 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(const_param_types))] #![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 6bfdba5711ef..6f0a98ead887 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 9cd95c11026d..8e292356f7e2 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(const_param_types))] #![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 fbb7ae59bef7..000000000000 --- 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 82f9b9d346dd..000000000000 --- 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 c153a93cdef4..050dc9bde64b 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 04e4e9cd52b0..d762f9c8b262 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 6a912ffc3c01..f1fc50e6e591 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 c8f2e0dadc1a..2b470f5eaecd 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(const_param_types)]` 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 c7cb92baf30a..2108661ab251 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(const_param_types))] #![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 81691a14ef67..000000000000 --- 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 81691a14ef67..000000000000 --- 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 f02c4161dc10..000000000000 --- 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 a7f0ecf0a269..b8fe9736ba5b 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(const_param_types)]` 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(const_param_types)]` 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 d4fd72eb6daa..f976912e11cf 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(const_param_types))] #![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 62ad43974f4d..9099b61e63bd 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(const_param_types)]` 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 75a876c27e59..cfb2b703ddce 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(const_param_types))] #![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 091a1ac7b998..000000000000 --- 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 dc3c33736dab..cc1f2853fb2a 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 4e640ff857ea..eaf02e1bd471 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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 91e5cc776fac..941335518a8b 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(const_param_types))] #![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 3c1c3ea97b54..7a8c817c0d6a 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(const_param_types)]` 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 97437748177e..e8be1e300516 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(const_param_types))] #![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 9d3f25b3b47f..83ef09af88e3 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 c311de05a1cf..400c034a9276 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(const_param_types)] #![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(const_param_types): 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 88b8ff89ffe1..000000000000 --- 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 994898265635..2e6b0223656a 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 65% 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 efff3f42a3e5..3b53e18e6f56 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 c714253b909d..754f18d5cc42 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(generic_const_exprs)]` 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 f80029680ff9..5409002a9fde 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(generic_const_exprs)]` 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 5dfda943bf69..05ba266d2d87 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(const_param_types)] #![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 0aaeaffb4cb9..5294cc3b5f42 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 2c411a3bdc5f..6da5395ef83c 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 b29e853510b1..000000000000 --- 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 8d9246fe56f4..bf0d0f352ebc 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 a658a7b39568..12ffbd53ab0a 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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 ae82c85eb7e4..bba4e68d4cce 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 f7a2e484fc61..1a333642f0c3 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 881f8b98aad0..6215b7d936cf 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 5def54ca26d9..5f641b070951 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 cc114f702392..16a7687c00b5 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(generic_const_exprs)]` 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 647ef5400cb2..13e1a232b3aa 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(const_param_types)]` 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 435a63a52834..2adfa9a8c4be 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 6a5739db3aef..000000000000 --- 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 6defd393ba06..c435344580a7 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(const_param_types)]` 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 be8ebb7f401f..b3d62d64f3b4 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(const_param_types))] #![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 671f1103dcca..f9b56bd387ae 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 552b1b2a66ac..c6324bca124c 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 c1ac7eec1e7d..6b8e688fba8d 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 6ded9f13bc4f..9d12250c9143 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 2d00141fbf70..9a73f1a53e52 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 2e306f8c4c88..0d38bd393519 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 9c7f5ab91edb..03c2f54861b4 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 961aeefd5505..383ab4cd8c92 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, generic_const_exprs)] +#![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.min.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr index 1c5ff9175f37..17defbe86aa6 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(generic_const_exprs)]` 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 76c1b84aef55..b24a7afabd90 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 4d94b789a6c9..b87e3960fc92 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, generic_const_exprs)] +#![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 5ac5161ca8f7..ed81c01bb172 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, generic_const_exprs)] +#![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 ca7d33c0eb98..302dd47e9b7f 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(const_param_types))] #![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 a04c6d5e64e1..35ff7768a910 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(const_param_types))] #![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 166a35ee4556..0a4581afc29f 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(const_param_types)]` 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(const_param_types)]` 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 f020e2bf66fb..7f740005e04e 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(const_param_types))] #![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 ed39a0c56b48..000000000000 --- 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 bf1bf8af9222..3a7eb4646309 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(const_param_types)] +#![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 86e6159fdb57..1af866694ab3 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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(const_param_types)]` 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 deaab830e91d..21e0bb48cd87 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(const_param_types))] #![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 db998033c0a2..000000000000 --- 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 db998033c0a2..000000000000 --- 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 32970ccaa5db..be1c4b0e8e80 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 47617c7849f4..67f497af5050 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 30d05c708e14..2cdef3fb452c 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 f735be9c24e0..14af8d77a5f9 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(const_param_types)]` 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 3147d61ec9bd..1a63bec7b6f0 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(const_param_types))] #![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 bf855d4dcaac..8c990577f3dc 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(const_param_types))] #![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 920c067dc1a7..68d1940160c4 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 cd9c3ae7bbc0..5dfcbba0e595 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 4997d493bbb4..e844148346fb 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 417fe2501ae3..7216b25f0df8 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 2ece25bb41b2..08b6d4bf554a 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 4a2c303095e5..27dd51de2417 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 a1163fca8d4e..b26f551eb867 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 75ddd839f664..cbb6b398e015 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 b3585d5fc107..933ca0276098 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 df7c277f605b..c72d9fbec2d8 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 5fb571f2394d..346ac4b72cc7 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 f3516d1de96b..d845bc610cfa 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(const_param_types)]` 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(const_param_types)]` 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 33735ef87c5a..638e7a88d678 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(const_param_types))] #![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 8ac9bab63208..000000000000 --- 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 b3677613dbc8..1c4073e36683 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 8ac9bab63208..ad522aead905 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 3701e14eadcf..060b899648e6 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 5d7dcb9c458a..5e1b8c635372 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 9e4afba31140..b755de30b9ce 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 b61e970cfb37..2d678d0acd3f 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 a4776a43b211..1b13133b5b97 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 a0a14558490d..02108d859603 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 a0a14558490d..02108d859603 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 7fba1afe9189..3335ab870f49 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 9a2e9f09319d..fb0d688a8abf 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 480ecdb38734..565c9ba1ff1f 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 c19c8db737a1..ec9221d2486a 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 14cef083d837..c2092c4268e8 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 9592f2662307..c7270e835c5a 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 4bab2bb5a77f..191caa78f9e3 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 b8b2e90aa66c..000000000000 --- 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 977f90aad116..8cdd28a8c609 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 b8b2e90aa66c..0f462dd4728f 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 2918e399dc8e..c7f74cfac7d6 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 836f26efc960..d080c210e6bd 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 8899139aa6bb..000000000000 --- 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 0348bbacaabd..47f0f8c1c96c 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 8899139aa6bb..5e1bace54924 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 dfb593a9507d..000000000000 --- 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 bc4c3f01ea9c..000000000000 --- 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(generic_const_exprs)]` 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(generic_const_exprs)]` 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 8a5b6ddfe266..000000000000 --- 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 dc09cad3180b..aa3ca1cf6de7 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 9f66e3cfa23c..7402c680985b 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 0770d06e15be..6e56d20c39d7 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 c7677f81b5fa..e4e10468d534 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(generic_const_exprs)]` 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 c3735658aa7d..7ea8a39129ea 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(generic_const_exprs)]` 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 ee0c3525b62d..0a7a631606ee 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(generic_const_exprs)]` 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 21f005aa49f0..8f1b5b38e4c3 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(generic_const_exprs)]` 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 8996df8ae10e..4f5e236a37b4 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(generic_const_exprs)]` 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 30745814b4a7..04f5e5d42574 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 f915f6edef52..067e8c57cd63 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 ba3592719408..75c9fa6c98d1 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(const_param_types)] +//~^ WARN the feature `const_param_types` 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 60220be6b57b..9860df3352ad 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 `const_param_types` 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(const_param_types)] + | ^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #44580 for more information 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 06364eebef91..000000000000 --- 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 ed19109b38b4..000000000000 --- 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/feature-gates/feature-gate-const_param_types.rs b/src/test/ui/feature-gates/feature-gate-const_param_types.rs new file mode 100644 index 000000000000..8a3bcf25963f --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-const_param_types.rs @@ -0,0 +1,2 @@ +struct Foo; //~ ERROR `&'static str` is forbidden +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/feature-gates/feature-gate-const_param_types.stderr similarity index 61% rename from src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr rename to src/test/ui/feature-gates/feature-gate-const_param_types.stderr index e96b9e703526..5452186a3aeb 100644 --- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr +++ b/src/test/ui/feature-gates/feature-gate-const_param_types.stderr @@ -1,11 +1,11 @@ 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 + --> $DIR/feature-gate-const_param_types.rs:1:24 | -LL | trait Trait { - | ^^^^^^^^^^^^ +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(const_param_types)]` 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 7ea12e74e1ed..ab09ebcae719 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(generic_const_exprs)]` 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 d319ae6403fc..3b6216c3e637 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 4ca6d1998353..000000000000 --- 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 81e9b1b36e06..3634ee004f7f 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 b351b8b73a0e..000000000000 --- 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 50eab7dcc978..000000000000 --- 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 4de872e8441e..000000000000 --- 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 d71844eafde2..7626f827fc5e 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(generic_const_exprs)]` 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 a687a9e3be12..6376c429b287 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 5e97339f148c..df244f02dce6 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/legacy-const-generics-bad.stderr b/src/test/ui/legacy-const-generics-bad.stderr index d65e9f05904b..3c78dd6c7802 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(generic_const_exprs)]` 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 d75996bf0b3a..000000000000 --- 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 d895981050ae..000000000000 --- 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 f20605e1b9a6..2f41beeb9691 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 266b6e62afd0..d0ee89329965 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 04c279de29e6..cbc1b63fbc4e 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 e379e32c1fce..03d0bbb6afe6 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 9eb34fb73490..f295cf15d08c 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 c59055ba9d65..c4e566a42d0c 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/resolve/issue-65035-static-with-parent-generics.rs b/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs index f09ab3bf9198..f96c04841dd2 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 7f8151db06f5..7ed572f80b89 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 b3c9246486eb..b0b3464c6101 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 b48915adc683..5ec4352919ea 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 353da8fd20b2..000000000000 --- 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 d6ed5f61a000..45c10b378160 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 c100e020c549..0e02883f67a4 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 e82d40d33cd7..5c06254143d0 100644 --- a/src/test/ui/specialization/issue-51892.rs +++ b/src/test/ui/specialization/issue-51892.rs @@ -1,5 +1,4 @@ #![allow(incomplete_features)] -#![feature(const_generics)] #![feature(generic_const_exprs)] #![feature(specialization)] diff --git a/src/test/ui/specialization/issue-51892.stderr b/src/test/ui/specialization/issue-51892.stderr index 10a39a491477..cb46db83606b 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 7539cbada8b7..000000000000 --- 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 af111dd39fac..906350f51036 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(const_param_types, 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 9da6a0f18e69..ec677e46b55d 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(const_param_types, 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 d53f562e99f4..0ade36dafa4f 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 e0c1b0238612..000000000000 --- 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 3ba04af9046d..000000000000 --- 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 e45950c4926b..a4e40f516dce 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 7ea5efd4e6b0..641cce26d994 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 918121cce9db..000000000000 --- 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 394b4280ab95..000000000000 --- 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 8c6ea3b34219..000000000000 --- 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 d0176b1e36d7..000000000000 --- 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 9f1bffff77c9..7ee5f7b068f4 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 eb0c296bb626..5b42f10a6ee3 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 74d5c0c96886..000000000000 --- 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 348563b94de1..000000000000 --- 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 16b1830e9851..000000000000 --- 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 6ba28c3463ad..000000000000 --- 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 31e53e846d54..405e3039e7d0 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 9bb2e227fc12..e3b3b27a6fc3 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 8b20997fdf8d..8b0c0f304fce 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, generic_const_exprs, 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) 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 6d2cbb6ad96f..aa60d0504e5e 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 0accb516f5f6..baa7eec05462 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 63c211f39fa1..b89cc6451bb5 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();