From 0c28e028b6f45f33447f24de7dd762b8599b7a4e Mon Sep 17 00:00:00 2001 From: lcnr Date: Fri, 27 Aug 2021 18:04:57 +0200 Subject: `feature(const_generics)` -> `feature(const_param_types)` --- src/test/debuginfo/function-names.rs | 4 +- .../const-generics/hash-tyvid-regression-1.rs | 2 +- .../const-generics/hash-tyvid-regression-1.stderr | 35 -- .../const-generics/hash-tyvid-regression-2.rs | 2 +- .../const-generics/hash-tyvid-regression-2.stderr | 11 - .../const-generics/hash-tyvid-regression-3.rs | 2 +- .../const-generics/hash-tyvid-regression-3.stderr | 12 - .../const-generics/hash-tyvid-regression-4.rs | 2 +- .../const-generics/hash-tyvid-regression-4.stderr | 12 - src/test/incremental/const-generics/issue-61338.rs | 2 - src/test/incremental/const-generics/issue-61516.rs | 2 - src/test/incremental/const-generics/issue-62536.rs | 3 - src/test/incremental/const-generics/issue-64087.rs | 2 - src/test/incremental/const-generics/issue-65623.rs | 2 - src/test/incremental/const-generics/issue-68477.rs | 4 +- .../issue-77708-1.rs | 2 +- .../issue-77708-2.rs | 2 +- .../issue-77708-3.rs | 2 +- .../issue-82034.rs | 2 +- .../issue-85031-1.rs | 2 +- .../issue-85031-2.rs | 2 +- .../issue-85031-3.rs | 2 +- .../issue-86953.rs | 2 +- .../issue-88022.rs | 2 +- src/test/rustdoc/const-generics/add-impl.rs | 1 - .../const-generics/const-evaluatable-checked.rs | 7 - .../rustdoc/const-generics/const-generic-slice.rs | 1 - src/test/rustdoc/const-generics/const-impl.rs | 2 +- .../rustdoc/const-generics/generic_const_exprs.rs | 7 + .../lazy_normalization_consts/const-equate-pred.rs | 2 +- .../ui/array-slice-vec/match_arr_unknown_len.rs | 3 - .../array-slice-vec/match_arr_unknown_len.stderr | 13 +- .../associated-const-type-parameter-arrays.stderr | 2 +- .../associated-item-duplicate-bounds.stderr | 2 +- src/test/ui/async-await/issues/issue-78654.rs | 2 +- src/test/ui/binding/const-param.full.stderr | 9 - src/test/ui/binding/const-param.min.stderr | 9 - src/test/ui/binding/const-param.rs | 3 - src/test/ui/binding/const-param.stderr | 9 + .../ui/const-generics/apit-with-const-param.rs | 4 - .../ui/const-generics/argument_order.full.stderr | 4 +- .../ui/const-generics/argument_order.min.stderr | 8 +- src/test/ui/const-generics/argument_order.rs | 3 +- .../array-size-in-generic-struct-param.full.stderr | 18 - .../array-size-in-generic-struct-param.min.stderr | 29 - .../array-size-in-generic-struct-param.rs | 29 - .../ui/const-generics/array-wrapper-struct-ctor.rs | 3 - .../associated-type-bound-fail.full.stderr | 17 - .../associated-type-bound-fail.min.stderr | 17 - .../const-generics/associated-type-bound-fail.rs | 4 - .../associated-type-bound-fail.stderr | 17 + .../ui/const-generics/associated-type-bound.rs | 4 - .../const-generics/auxiliary/const_generic_lib.rs | 3 - src/test/ui/const-generics/auxiliary/crayte.rs | 2 - .../const-generics/auxiliary/generics_of_parent.rs | 2 +- .../auxiliary/generics_of_parent_impl_trait.rs | 2 +- src/test/ui/const-generics/broken-mir-1.rs | 5 - src/test/ui/const-generics/broken-mir-2.rs | 5 - .../cannot-infer-type-for-const-param.rs | 3 - .../const-generics/closing-args-token.full.stderr | 52 -- .../const-generics/closing-args-token.min.stderr | 52 -- src/test/ui/const-generics/closing-args-token.rs | 31 - src/test/ui/const-generics/coerce_unsized_array.rs | 5 - .../ui/const-generics/concrete-const-as-fn-arg.rs | 4 - .../const-generics/concrete-const-impl-method.rs | 4 - .../const-generics/condition-in-trait-const-arg.rs | 2 +- ...ivately_uninhabited_uses_correct_param_env-1.rs | 2 +- ...ivately_uninhabited_uses_correct_param_env-2.rs | 2 +- .../const-arg-in-const-arg.min.stderr | 78 +-- .../ui/const-generics/const-arg-in-const-arg.rs | 2 +- src/test/ui/const-generics/const-arg-in-fn.rs | 5 - .../const-arg-type-arg-misordered.full.stderr | 9 - .../const-arg-type-arg-misordered.min.stderr | 12 - .../const-arg-type-arg-misordered.rs | 4 - .../const-arg-type-arg-misordered.stderr | 12 + ...const-argument-cross-crate-mismatch.full.stderr | 15 - .../const-argument-cross-crate-mismatch.min.stderr | 15 - .../const-argument-cross-crate-mismatch.rs | 3 - .../const-argument-cross-crate-mismatch.stderr | 15 + .../const-argument-if-length.full.stderr | 29 +- .../const-argument-if-length.min.stderr | 6 +- .../ui/const-generics/const-argument-if-length.rs | 4 +- .../const-argument-non-static-lifetime.rs | 2 +- .../const-expression-parameter.full.stderr | 13 - .../const-expression-parameter.min.stderr | 13 - .../const-generics/const-expression-parameter.rs | 24 - .../ui/const-generics/const-fn-with-const-param.rs | 4 - .../const-generics/const-generic-array-wrapper.rs | 19 - .../ui/const-generics/const-generic-type_name.rs | 4 - .../const-param-after-const-literal-arg.rs | 4 - .../const-param-before-other-params.full.stderr | 4 +- .../const-param-before-other-params.min.stderr | 30 +- .../const-param-before-other-params.rs | 8 +- .../const-param-elided-lifetime.full.stderr | 10 +- .../const-param-elided-lifetime.min.stderr | 30 +- .../const-generics/const-param-elided-lifetime.rs | 3 +- .../const-param-from-outer-fn.full.stderr | 13 - .../const-param-from-outer-fn.min.stderr | 13 - .../ui/const-generics/const-param-from-outer-fn.rs | 12 - src/test/ui/const-generics/const-param-hygiene.rs | 21 - src/test/ui/const-generics/const-param-in-async.rs | 3 - src/test/ui/const-generics/const-param-in-trait.rs | 11 - .../ui/const-generics/const-param-shadowing.rs | 7 - .../ui/const-generics/const-param-shadowing.stderr | 14 - ...st-param-type-depends-on-const-param.min.stderr | 4 +- .../const-param-type-depends-on-const-param.rs | 2 +- .../const-param-type-depends-on-type-param.rs | 2 +- .../const-parameter-uppercase-lint.full.stderr | 14 - .../const-parameter-uppercase-lint.min.stderr | 14 - .../const-parameter-uppercase-lint.rs | 5 - .../const-parameter-uppercase-lint.stderr | 14 + src/test/ui/const-generics/const-types.rs | 18 - src/test/ui/const-generics/core-types.rs | 2 +- src/test/ui/const-generics/cross_crate_complex.rs | 4 - .../defaults/auxiliary/const_defaulty.rs | 2 - .../defaults/cec-concrete-default.rs | 14 - .../defaults/cec-concrete-default.stderr | 12 - .../cec-generic-default-mismatched-types.rs | 16 - .../cec-generic-default-mismatched-types.stderr | 12 - .../const-generics/defaults/cec-generic-default.rs | 24 - .../defaults/cec-generic-default.stderr | 18 - .../complex-generic-default-expr.min.stderr | 4 +- .../defaults/complex-generic-default-expr.rs | 2 +- .../const-generics/defaults/complex-unord-param.rs | 2 +- .../ui/const-generics/defaults/const-default.rs | 4 - .../const-generics/defaults/default-annotation.rs | 7 +- .../defaults/default-on-impl.full.stderr | 8 - .../defaults/default-on-impl.min.stderr | 8 - .../ui/const-generics/defaults/default-on-impl.rs | 3 - .../const-generics/defaults/default-on-impl.stderr | 8 + src/test/ui/const-generics/defaults/external.rs | 3 - .../defaults/generic-expr-default-concrete.rs | 14 + .../defaults/generic-expr-default-concrete.stderr | 12 + .../generic-expr-default-mismatched-types.rs | 16 + .../generic-expr-default-mismatched-types.stderr | 12 + .../defaults/generic-expr-default.rs | 24 + .../defaults/generic-expr-default.stderr | 18 + .../defaults/intermixed-lifetime.full.stderr | 4 +- .../defaults/intermixed-lifetime.min.stderr | 4 +- .../const-generics/defaults/intermixed-lifetime.rs | 2 - .../const-generics/defaults/mismatch.full.stderr | 58 -- .../ui/const-generics/defaults/mismatch.min.stderr | 58 -- src/test/ui/const-generics/defaults/mismatch.rs | 3 - .../ui/const-generics/defaults/mismatch.stderr | 58 ++ .../defaults/needs-feature.min.stderr | 2 +- .../defaults/needs-feature.none.stderr | 8 - .../ui/const-generics/defaults/needs-feature.rs | 6 +- .../ui/const-generics/defaults/simple-defaults.rs | 3 - .../defaults/type-default-const-param-name.rs | 3 - .../defaults/wrong-order.full.stderr | 8 - .../const-generics/defaults/wrong-order.min.stderr | 8 - src/test/ui/const-generics/defaults/wrong-order.rs | 3 - .../ui/const-generics/defaults/wrong-order.stderr | 8 + .../const-generics/derive-debug-array-wrapper.rs | 13 - src/test/ui/const-generics/diagnostics.rs | 18 - src/test/ui/const-generics/diagnostics.stderr | 73 --- .../ui/const-generics/different_byref.full.stderr | 12 - .../ui/const-generics/different_byref.min.stderr | 11 - src/test/ui/const-generics/different_byref.rs | 14 - .../different_byref_simple.full.stderr | 12 - .../different_byref_simple.min.stderr | 12 - .../ui/const-generics/different_byref_simple.rs | 13 - .../different_generic_args.full.stderr | 12 + .../different_generic_args.min.stderr | 12 + .../ui/const-generics/different_generic_args.rs | 13 + .../const-generics/different_generic_args_array.rs | 11 + .../different_generic_args_array.stderr | 12 + .../dont-evaluate-array-len-on-err-1.rs | 2 +- src/test/ui/const-generics/dyn-supertraits.rs | 4 - .../ui/const-generics/early/closing-args-token.rs | 26 + .../const-generics/early/closing-args-token.stderr | 52 ++ .../early/const-expression-parameter.rs | 19 + .../early/const-expression-parameter.stderr | 13 + .../early/const-param-from-outer-fn.rs | 7 + .../early/const-param-from-outer-fn.stderr | 13 + .../ui/const-generics/early/const-param-hygiene.rs | 17 + .../const-generics/early/const-param-shadowing.rs | 7 + .../early/const-param-shadowing.stderr | 14 + .../early/invalid-const-arguments.rs | 16 + .../early/invalid-const-arguments.stderr | 73 +++ .../ui/const-generics/early/macro_rules-braces.rs | 73 +++ .../const-generics/early/macro_rules-braces.stderr | 60 ++ .../ui/const-generics/exhaustive-value.full.stderr | 21 - .../ui/const-generics/exhaustive-value.min.stderr | 21 - src/test/ui/const-generics/exhaustive-value.rs | 4 - src/test/ui/const-generics/exhaustive-value.stderr | 21 + src/test/ui/const-generics/fn-const-param-call.rs | 2 +- src/test/ui/const-generics/fn-const-param-infer.rs | 2 +- .../fn-taking-const-generic-array.rs | 17 - .../forbid-non-structural_match-types.full.stderr | 9 - .../forbid-non-structural_match-types.min.stderr | 27 - .../forbid-non-structural_match-types.rs | 8 +- .../forbid-non-structural_match-types.stderr | 9 + .../foreign-item-const-parameter.full.stderr | 19 - .../foreign-item-const-parameter.min.stderr | 19 - .../const-generics/foreign-item-const-parameter.rs | 5 - .../foreign-item-const-parameter.stderr | 19 + ...neric-function-call-in-array-length.full.stderr | 10 - ...eneric-function-call-in-array-length.min.stderr | 20 - .../generic-function-call-in-array-length.rs | 15 - .../generic-param-mismatch.full.stderr | 14 - .../generic-param-mismatch.min.stderr | 14 - .../ui/const-generics/generic-param-mismatch.rs | 4 - .../const-generics/generic-param-mismatch.stderr | 14 + .../generic-sum-in-array-length.full.stderr | 10 - .../generic-sum-in-array-length.min.stderr | 20 - .../const-generics/generic-sum-in-array-length.rs | 11 - .../abstract-const-as-cast-1.rs | 2 +- .../abstract-const-as-cast-2.rs | 2 +- .../abstract-const-as-cast-3.rs | 2 +- .../abstract-const-as-cast-4.rs | 2 +- .../array-size-in-generic-struct-param.full.stderr | 18 + .../array-size-in-generic-struct-param.min.stderr | 29 + .../array-size-in-generic-struct-param.rs | 29 + .../generic_const_exprs/associated-const.rs | 11 + .../generic_const_exprs/associated-consts.rs | 2 +- .../auxiliary/const_evaluatable_lib.rs | 2 +- .../const-generics/generic_const_exprs/closures.rs | 2 +- .../generic_const_exprs/cross_crate.rs | 2 +- .../generic_const_exprs/cross_crate_predicate.rs | 2 +- .../generic_const_exprs/different-fn.rs | 2 +- .../const-generics/generic_const_exprs/division.rs | 2 +- .../dont-eagerly-error-in-is-const-evaluatable.rs | 1 - .../generic_const_exprs/drop_impl.rs | 2 +- .../generic_const_exprs/elaborate-trait-pred.rs | 2 +- .../generic_const_exprs/eval-privacy.rs | 2 +- .../generic_const_exprs/evaluated-to-ambig.rs | 2 +- .../feature-gate-generic_const_exprs.full.stderr | 10 - .../feature-gate-generic_const_exprs.min.stderr | 11 - .../feature-gate-generic_const_exprs.rs | 7 +- .../feature-gate-generic_const_exprs.stderr | 11 + .../const-generics/generic_const_exprs/fn_call.rs | 2 +- .../generic_const_exprs/from-sig-fail.rs | 2 +- .../const-generics/generic_const_exprs/from-sig.rs | 2 +- .../generic_const_exprs/function-call.rs | 19 + .../generic_const_exprs/function-call.stderr | 12 + .../generic_const_exprs/impl-bounds.rs | 2 +- .../generic_const_exprs/infer-too-generic.rs | 2 +- .../generic_const_exprs/issue-62504.full.stderr | 20 + .../generic_const_exprs/issue-62504.min.stderr | 20 + .../generic_const_exprs/issue-62504.rs | 27 + .../generic_const_exprs/issue-69654.rs | 19 + .../generic_const_exprs/issue-69654.stderr | 22 + .../generic_const_exprs/issue-72787.min.stderr | 65 +++ .../generic_const_exprs/issue-72787.rs | 35 ++ .../issue-72819-generic-in-const-eval.full.stderr | 21 + .../issue-72819-generic-in-const-eval.min.stderr | 11 + .../issue-72819-generic-in-const-eval.rs | 23 + .../generic_const_exprs/issue-73899.rs | 20 + .../generic_const_exprs/issue-74634.rs | 28 + .../generic_const_exprs/issue-76595.rs | 17 + .../generic_const_exprs/issue-76595.stderr | 21 + ...sue-79518-default_trait_method_normalization.rs | 21 + ...79518-default_trait_method_normalization.stderr | 14 + .../issue-80561-incorrect-param-env.rs | 24 + .../generic_const_exprs/issue-80742.rs | 32 + .../generic_const_exprs/issue-80742.stderr | 72 +++ .../generic_const_exprs/issue-83765.rs | 38 ++ .../generic_const_exprs/issue-83765.stderr | 29 + .../generic_const_exprs/issue-84408.rs | 38 ++ .../generic_const_exprs/issue-85848.rs | 31 + .../generic_const_exprs/issue-85848.stderr | 48 ++ .../generic_const_exprs/less_than.rs | 2 +- .../generic_const_exprs/let-bindings.rs | 2 +- .../generic_const_exprs/needs_where_clause.rs | 14 + .../generic_const_exprs/needs_where_clause.stderr | 10 + .../nested-abstract-consts-1.rs | 2 +- .../nested-abstract-consts-2.rs | 2 +- .../nested_uneval_unification-1.rs | 2 +- .../nested_uneval_unification-2.rs | 2 +- .../generic_const_exprs/no_where_clause.rs | 29 + .../generic_const_exprs/no_where_clause.stderr | 10 + .../generic_const_exprs/object-safety-err-ret.rs | 2 +- .../object-safety-err-where-bounds.rs | 2 +- .../object-safety-ok-infer-err.rs | 2 +- .../generic_const_exprs/object-safety-ok.rs | 2 +- .../generic_const_exprs/simple_fail.full.stderr | 15 - .../generic_const_exprs/simple_fail.min.stderr | 20 - .../generic_const_exprs/simple_fail.rs | 10 +- .../generic_const_exprs/simple_fail.stderr | 15 + .../subexprs_are_const_evalutable.rs | 2 +- .../generic_const_exprs/ty-alias-substitution.rs | 2 +- .../ui/const-generics/generic_const_exprs/unop.rs | 2 +- .../unused-complex-default-expr.rs | 2 +- .../generic_const_exprs/unused_expr.rs | 2 +- .../ui/const-generics/impl-const-generic-struct.rs | 5 - .../impl-trait-with-const-arguments.full.stderr | 9 - .../impl-trait-with-const-arguments.min.stderr | 9 - .../impl-trait-with-const-arguments.rs | 5 - .../impl-trait-with-const-arguments.stderr | 9 + .../incorrect-number-of-const-args.full.stderr | 35 -- .../incorrect-number-of-const-args.min.stderr | 35 -- .../incorrect-number-of-const-args.rs | 5 - .../incorrect-number-of-const-args.stderr | 35 ++ .../infer/cannot-infer-const-args.full.stderr | 14 - .../infer/cannot-infer-const-args.min.stderr | 14 - .../infer/cannot-infer-const-args.rs | 5 - .../infer/cannot-infer-const-args.stderr | 14 + .../const-generics/infer/method-chain.full.stderr | 14 - .../const-generics/infer/method-chain.min.stderr | 14 - src/test/ui/const-generics/infer/method-chain.rs | 5 - .../ui/const-generics/infer/method-chain.stderr | 14 + .../infer/one-param-uninferred.full.stderr | 14 - .../infer/one-param-uninferred.min.stderr | 14 - .../const-generics/infer/one-param-uninferred.rs | 6 - .../infer/one-param-uninferred.stderr | 14 + .../infer/uninferred-consts.full.stderr | 14 - .../infer/uninferred-consts.min.stderr | 14 - .../ui/const-generics/infer/uninferred-consts.rs | 4 - .../const-generics/infer/uninferred-consts.stderr | 14 + src/test/ui/const-generics/infer_arg_from_pat.rs | 4 - .../ui/const-generics/infer_arr_len_from_pat.rs | 4 - .../integer-literal-generic-arg-in-where-clause.rs | 4 - ...rinsics-type_name-as-const-argument.full.stderr | 10 - ...trinsics-type_name-as-const-argument.min.stderr | 8 +- .../intrinsics-type_name-as-const-argument.rs | 4 +- src/test/ui/const-generics/invalid-enum.rs | 2 +- .../issues/auxiliary/const_generic_issues_lib.rs | 6 +- .../const-generics/issues/auxiliary/impl-const.rs | 3 +- .../issues/issue-56445-1.full.stderr | 13 +- .../const-generics/issues/issue-56445-1.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-56445-1.rs | 3 +- .../issue-60818-struct-constructors.full.stderr | 11 - .../issues/issue-60818-struct-constructors.rs | 2 - .../issues/issue-61336-1.full.stderr | 11 - src/test/ui/const-generics/issues/issue-61336-1.rs | 3 - .../issues/issue-61336-2.full.stderr | 24 - .../const-generics/issues/issue-61336-2.min.stderr | 15 - src/test/ui/const-generics/issues/issue-61336-2.rs | 3 - .../ui/const-generics/issues/issue-61336-2.stderr | 15 + .../const-generics/issues/issue-61336.full.stderr | 24 - .../const-generics/issues/issue-61336.min.stderr | 15 - src/test/ui/const-generics/issues/issue-61336.rs | 3 - .../ui/const-generics/issues/issue-61336.stderr | 15 + .../const-generics/issues/issue-61422.full.stderr | 11 - src/test/ui/const-generics/issues/issue-61422.rs | 3 - .../const-generics/issues/issue-61432.full.stderr | 11 - src/test/ui/const-generics/issues/issue-61432.rs | 7 - .../issues/issue-61522-array-len-succ.full.stderr | 18 - .../issues/issue-61522-array-len-succ.min.stderr | 20 - .../issues/issue-61522-array-len-succ.rs | 18 - .../const-generics/issues/issue-61747.full.stderr | 19 - .../const-generics/issues/issue-61747.min.stderr | 11 - src/test/ui/const-generics/issues/issue-61747.rs | 16 - .../const-generics/issues/issue-61935.full.stderr | 10 - .../const-generics/issues/issue-61935.min.stderr | 11 - src/test/ui/const-generics/issues/issue-61935.rs | 25 - .../issue-62187-encountered-polymorphic-const.rs | 5 - .../const-generics/issues/issue-62220.full.stderr | 10 - .../const-generics/issues/issue-62220.min.stderr | 11 - src/test/ui/const-generics/issues/issue-62220.rs | 24 - .../const-generics/issues/issue-62456.full.stderr | 10 - .../const-generics/issues/issue-62456.min.stderr | 11 - src/test/ui/const-generics/issues/issue-62456.rs | 11 - .../const-generics/issues/issue-62504.full.stderr | 20 - .../const-generics/issues/issue-62504.min.stderr | 20 - src/test/ui/const-generics/issues/issue-62504.rs | 26 - .../issues/issue-62579-no-match.min.stderr | 11 - .../const-generics/issues/issue-62579-no-match.rs | 16 - .../const-generics/issues/issue-62878.full.stderr | 10 +- .../const-generics/issues/issue-62878.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-62878.rs | 3 +- .../issues/issue-63322-forbid-dyn.min.stderr | 2 +- .../issues/issue-63322-forbid-dyn.rs | 2 +- .../const-generics/issues/issue-64494.full.stderr | 18 - .../const-generics/issues/issue-64494.min.stderr | 30 - src/test/ui/const-generics/issues/issue-64494.rs | 23 - src/test/ui/const-generics/issues/issue-64519.rs | 4 - .../ui/const-generics/issues/issue-64519.stderr | 11 - .../const-generics/issues/issue-66205.full.stderr | 10 - .../const-generics/issues/issue-66205.min.stderr | 11 - src/test/ui/const-generics/issues/issue-66205.rs | 12 - ...e-66596-impl-trait-for-str-const-arg.min.stderr | 11 - .../issue-66596-impl-trait-for-str-const-arg.rs | 9 +- src/test/ui/const-generics/issues/issue-66906.rs | 3 - src/test/ui/const-generics/issues/issue-67185-1.rs | 3 - .../issues/issue-67185-2.full.stderr | 111 ---- .../const-generics/issues/issue-67185-2.min.stderr | 111 ---- src/test/ui/const-generics/issues/issue-67185-2.rs | 4 - .../ui/const-generics/issues/issue-67185-2.stderr | 111 ++++ .../const-generics/issues/issue-67375.full.stderr | 16 +- .../const-generics/issues/issue-67375.min.stderr | 6 +- src/test/ui/const-generics/issues/issue-67375.rs | 6 +- .../const-generics/issues/issue-67739.full.stderr | 4 +- src/test/ui/const-generics/issues/issue-67739.rs | 5 +- .../issues/issue-67945-1.full.stderr | 4 +- .../const-generics/issues/issue-67945-1.min.stderr | 10 +- src/test/ui/const-generics/issues/issue-67945-1.rs | 7 +- .../issues/issue-67945-2.full.stderr | 36 +- .../const-generics/issues/issue-67945-2.min.stderr | 32 +- src/test/ui/const-generics/issues/issue-67945-2.rs | 16 +- .../issues/issue-67945-3.full.stderr | 16 - .../const-generics/issues/issue-67945-3.min.stderr | 8 - src/test/ui/const-generics/issues/issue-67945-3.rs | 16 - .../issues/issue-68104-print-stack-overflow.rs | 6 +- .../const-generics/issues/issue-68366.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-68366.rs | 2 +- src/test/ui/const-generics/issues/issue-68596.rs | 4 - .../issues/issue-68615-adt.min.stderr | 2 +- .../ui/const-generics/issues/issue-68615-adt.rs | 2 +- .../issues/issue-68615-array.min.stderr | 2 +- .../ui/const-generics/issues/issue-68615-array.rs | 2 +- .../const-generics/issues/issue-68977.full.stderr | 10 - .../const-generics/issues/issue-68977.min.stderr | 20 - src/test/ui/const-generics/issues/issue-68977.rs | 43 -- .../const-generics/issues/issue-69654-run-pass.rs | 7 +- .../issues/issue-69654-run-pass.stderr | 15 - src/test/ui/const-generics/issues/issue-69654.rs | 19 - .../ui/const-generics/issues/issue-69654.stderr | 22 - src/test/ui/const-generics/issues/issue-70125-1.rs | 3 - src/test/ui/const-generics/issues/issue-70125-2.rs | 4 - src/test/ui/const-generics/issues/issue-70167.rs | 4 - .../issues/issue-70180-1-stalled_on.rs | 4 - .../issues/issue-70180-2-stalled_on.rs | 4 - src/test/ui/const-generics/issues/issue-70225.rs | 2 - .../const-generics/issues/issue-70273-assoc-fn.rs | 3 - .../const-generics/issues/issue-71169.full.stderr | 10 +- .../const-generics/issues/issue-71169.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-71169.rs | 3 +- src/test/ui/const-generics/issues/issue-71202.rs | 6 +- .../ui/const-generics/issues/issue-71202.stderr | 33 ++ src/test/ui/const-generics/issues/issue-71381.rs | 2 +- src/test/ui/const-generics/issues/issue-71382.rs | 2 +- src/test/ui/const-generics/issues/issue-71611.rs | 2 +- src/test/ui/const-generics/issues/issue-71986.rs | 4 - src/test/ui/const-generics/issues/issue-72352.rs | 2 +- .../const-generics/issues/issue-72787.full.stderr | 42 -- .../const-generics/issues/issue-72787.min.stderr | 65 --- src/test/ui/const-generics/issues/issue-72787.rs | 39 -- .../issue-72819-generic-in-const-eval.full.stderr | 10 - .../issue-72819-generic-in-const-eval.min.stderr | 11 - .../issues/issue-72819-generic-in-const-eval.rs | 22 - src/test/ui/const-generics/issues/issue-73120.rs | 3 +- src/test/ui/const-generics/issues/issue-73260.rs | 9 +- .../ui/const-generics/issues/issue-73260.stderr | 14 +- .../const-generics/issues/issue-73491.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-73491.rs | 2 +- .../const-generics/issues/issue-73508.full.stderr | 8 - .../const-generics/issues/issue-73508.min.stderr | 8 - src/test/ui/const-generics/issues/issue-73508.rs | 8 - src/test/ui/const-generics/issues/issue-73899.rs | 21 - .../const-generics/issues/issue-74101.min.stderr | 4 +- src/test/ui/const-generics/issues/issue-74101.rs | 2 +- .../const-generics/issues/issue-74255.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-74255.rs | 2 +- src/test/ui/const-generics/issues/issue-74634.rs | 27 - .../ui/const-generics/issues/issue-74634.stderr | 10 - src/test/ui/const-generics/issues/issue-74906.rs | 4 +- .../const-generics/issues/issue-74950.min.stderr | 10 +- src/test/ui/const-generics/issues/issue-74950.rs | 2 +- .../const-generics/issues/issue-75047.min.stderr | 2 +- src/test/ui/const-generics/issues/issue-75047.rs | 2 +- src/test/ui/const-generics/issues/issue-75299.rs | 3 - src/test/ui/const-generics/issues/issue-75763.rs | 6 +- src/test/ui/const-generics/issues/issue-76595.rs | 17 - .../ui/const-generics/issues/issue-76595.stderr | 21 - .../issue-76701-ty-param-in-const.full.stderr | 18 - .../issue-76701-ty-param-in-const.min.stderr | 20 - .../issues/issue-76701-ty-param-in-const.rs | 10 +- .../issues/issue-76701-ty-param-in-const.stderr | 20 + ...sue-79518-default_trait_method_normalization.rs | 21 - ...79518-default_trait_method_normalization.stderr | 14 - .../ui/const-generics/issues/issue-80062.stderr | 2 +- .../ui/const-generics/issues/issue-80375.stderr | 2 +- .../issues/issue-80561-incorrect-param-env.rs | 24 - src/test/ui/const-generics/issues/issue-83765.rs | 38 -- .../ui/const-generics/issues/issue-83765.stderr | 29 - src/test/ui/const-generics/issues/issue-84408.rs | 38 -- src/test/ui/const-generics/issues/issue-85848.rs | 31 - .../ui/const-generics/issues/issue-85848.stderr | 48 -- src/test/ui/const-generics/issues/issue-87076.rs | 2 +- .../const-generics/late-bound-vars/in_closure.rs | 2 +- .../ui/const-generics/late-bound-vars/simple.rs | 2 +- .../const-generics/macro_rules-braces.full.stderr | 72 --- .../const-generics/macro_rules-braces.min.stderr | 60 -- src/test/ui/const-generics/macro_rules-braces.rs | 77 --- .../min_const_generics/complex-expression.stderr | 14 +- .../min_const_generics/complex-types.stderr | 14 +- .../min_const_generics/const_default_first.rs | 1 - .../min_const_generics/const_default_first.stderr | 2 +- .../forbid-non-static-lifetimes.rs | 2 +- .../forbid-non-static-lifetimes.stderr | 8 +- .../min_const_generics/self-ty-in-const-1.stderr | 2 +- .../static-reference-array-const-param.stderr | 2 +- .../min_const_generics/type_and_const_defaults.rs | 3 +- .../ui/const-generics/mut-ref-const-param-array.rs | 21 - src/test/ui/const-generics/nested-type.min.stderr | 2 +- src/test/ui/const-generics/nested-type.rs | 2 +- .../ui/const-generics/occurs-check/bind-param.rs | 2 +- .../const-generics/occurs-check/unify-fixpoint.rs | 10 +- .../occurs-check/unify-fixpoint.stderr | 28 +- .../occurs-check/unify-n-nplusone.rs | 7 +- .../occurs-check/unify-n-nplusone.stderr | 11 +- .../const-generics/occurs-check/unused-substs-1.rs | 2 +- .../const-generics/occurs-check/unused-substs-2.rs | 2 +- .../const-generics/occurs-check/unused-substs-3.rs | 2 +- .../const-generics/occurs-check/unused-substs-4.rs | 2 +- .../const-generics/occurs-check/unused-substs-5.rs | 2 +- .../params-in-ct-in-ty-param-lazy-norm.min.stderr | 2 +- .../params-in-ct-in-ty-param-lazy-norm.rs | 2 +- .../const-generics/parent_generics_of_encoding.rs | 2 +- .../parent_generics_of_encoding_impl_trait.rs | 2 +- .../ui/const-generics/raw-ptr-const-param-deref.rs | 2 +- src/test/ui/const-generics/raw-ptr-const-param.rs | 2 +- .../slice-const-param-mismatch.min.stderr | 4 +- .../const-generics/slice-const-param-mismatch.rs | 2 +- .../ui/const-generics/slice-const-param.min.stderr | 20 - src/test/ui/const-generics/slice-const-param.rs | 9 +- .../std/const-generics-range.min.stderr | 12 +- .../ui/const-generics/std/const-generics-range.rs | 2 +- .../struct-with-invalid-const-param.full.stderr | 9 - .../struct-with-invalid-const-param.min.stderr | 9 - .../struct-with-invalid-const-param.rs | 4 - .../struct-with-invalid-const-param.stderr | 13 +- src/test/ui/const-generics/trait-const-args.rs | 4 - ...ansmute-const-param-static-reference.min.stderr | 2 +- .../transmute-const-param-static-reference.rs | 2 +- .../transparent-maybeunit-array-wrapper.rs | 2 +- src/test/ui/const-generics/type-after-const-ok.rs | 2 +- .../type-dependent/auxiliary/type_dependent_lib.rs | 3 - .../type-dependent/const-arg-in-const-arg.rs | 2 +- .../const-generics/type-dependent/issue-61936.rs | 3 - .../const-generics/type-dependent/issue-63695.rs | 3 - .../const-generics/type-dependent/issue-67144-1.rs | 4 - .../const-generics/type-dependent/issue-67144-2.rs | 4 - .../const-generics/type-dependent/issue-69816.rs | 4 - .../const-generics/type-dependent/issue-70217.rs | 4 - .../const-generics/type-dependent/issue-70507.rs | 3 - .../const-generics/type-dependent/issue-70586.rs | 4 - .../type-dependent/issue-71348.min.stderr | 4 +- .../const-generics/type-dependent/issue-71348.rs | 2 +- .../type-dependent/issue-71382.full.stderr | 8 - .../type-dependent/issue-71382.min.stderr | 8 - .../const-generics/type-dependent/issue-71382.rs | 4 - .../type-dependent/issue-71382.stderr | 8 + .../const-generics/type-dependent/issue-71805.rs | 4 - .../const-generics/type-dependent/issue-73730.rs | 4 - .../ui/const-generics/type-dependent/non-local.rs | 4 - src/test/ui/const-generics/type-dependent/qpath.rs | 4 - .../ui/const-generics/type-dependent/simple.rs | 4 - .../type-dependent/type-mismatch.full.stderr | 2 +- .../type-dependent/type-mismatch.min.stderr | 2 +- .../const-generics/type-dependent/type-mismatch.rs | 3 - src/test/ui/const-generics/type_of_anon_const.rs | 5 - .../types-mismatch-const-args.full.stderr | 4 +- .../types-mismatch-const-args.min.stderr | 4 +- .../ui/const-generics/types-mismatch-const-args.rs | 4 +- .../uninferred-consts-during-codegen-1.rs | 3 - .../uninferred-consts-during-codegen-2.rs | 3 - src/test/ui/const-generics/unknown_adt.full.stderr | 9 - src/test/ui/const-generics/unknown_adt.min.stderr | 9 - src/test/ui/const-generics/unknown_adt.rs | 5 - src/test/ui/const-generics/unknown_adt.stderr | 9 + src/test/ui/const-generics/unused-const-param.rs | 4 - src/test/ui/const-generics/unused_braces.fixed | 4 - .../ui/const-generics/unused_braces.full.stderr | 14 - .../ui/const-generics/unused_braces.min.stderr | 14 - src/test/ui/const-generics/unused_braces.rs | 5 - src/test/ui/const-generics/unused_braces.stderr | 14 + src/test/ui/const-generics/wf-misc.full.stderr | 18 - src/test/ui/const-generics/wf-misc.min.stderr | 20 - src/test/ui/const-generics/wf-misc.rs | 21 - src/test/ui/const-generics/where-clauses.rs | 4 - src/test/ui/const_evaluatable/associated-const.rs | 11 - src/test/ui/const_evaluatable/function-call.rs | 19 - src/test/ui/const_evaluatable/function-call.stderr | 12 - .../ui/const_evaluatable/needs_where_clause.rs | 14 - .../ui/const_evaluatable/needs_where_clause.stderr | 10 - src/test/ui/const_evaluatable/no_where_clause.rs | 29 - .../ui/const_evaluatable/no_where_clause.stderr | 10 - src/test/ui/consts/const-needs_drop-monomorphic.rs | 4 +- .../ui/consts/const-needs_drop-monomorphic.stderr | 4 +- .../issue-70453-generics-in-discr-ice-2.stderr | 2 +- .../issue-70453-generics-in-discr-ice.stderr | 2 +- .../issue-70453-polymorphic-ctfe.stderr | 2 +- src/test/ui/enum/issue-67945-1.stderr | 2 +- src/test/ui/enum/issue-67945-2.stderr | 2 +- src/test/ui/error-codes/E0730.rs | 3 - src/test/ui/error-codes/E0730.stderr | 13 +- src/test/ui/error-codes/E0771.rs | 4 +- src/test/ui/error-codes/E0771.stderr | 6 +- .../feature-gates/feature-gate-const_generics.rs | 5 - .../feature-gate-const_generics.stderr | 11 - .../feature-gate-const_param_types.rs | 2 + .../feature-gate-const_param_types.stderr | 11 + .../param-in-ct-in-ty-param-default.stderr | 2 +- src/test/ui/hygiene/generic_params.rs | 3 +- src/test/ui/hygiene/generic_params.stderr | 11 - .../ui/hygiene/issue-61574-const-parameters.rs | 2 - .../ui/hygiene/issue-61574-const-parameters.stderr | 11 - .../ui/impl-trait/issue-55872-1.full_tait.stderr | 57 -- .../multiple-lifetimes/inverse-bounds.stderr | 19 - src/test/ui/issues/issue-39559.stderr | 2 +- src/test/ui/issues/issue-59508-1.rs | 5 +- src/test/ui/issues/issue-59508-1.stderr | 13 +- src/test/ui/legacy-const-generics-bad.stderr | 2 +- src/test/ui/mir/issue-75053.in_bindings.stderr | 11 - src/test/ui/mir/issue-80742.rs | 33 -- src/test/ui/mir/issue-80742.stderr | 72 --- src/test/ui/obsolete-in-place/bad.bad.stderr | 19 - .../polymorphization/const_parameters/closures.rs | 4 +- .../const_parameters/closures.stderr | 8 +- .../polymorphization/const_parameters/functions.rs | 4 +- .../const_parameters/functions.stderr | 8 +- src/test/ui/polymorphization/generators.rs | 4 +- src/test/ui/polymorphization/generators.stderr | 8 +- .../issue-65035-static-with-parent-generics.rs | 3 - .../issue-65035-static-with-parent-generics.stderr | 21 +- .../rfc-2497-if-let-chains/disallowed-positions.rs | 2 - .../disallowed-positions.stderr | 224 ++++--- .../arbitrary-self-types-not-object-safe.stderr | 23 - src/test/ui/simd/simd-array-trait.rs | 4 +- src/test/ui/simd/simd-array-trait.stderr | 4 +- src/test/ui/specialization/issue-51892.rs | 1 - src/test/ui/specialization/issue-51892.stderr | 2 +- src/test/ui/symbol-names/basic.stderr | 14 - .../symbol-names/const-generics-str-demangling.rs | 2 +- .../const-generics-structural-demangling.rs | 2 +- .../ui/type-alias-impl-trait/assoc-type-const.rs | 2 - .../type-alias-impl-trait/assoc-type-const.stderr | 11 - .../bounds-are-checked-2.full_tait.stderr | 23 - .../generic_duplicate_param_use.rs | 2 - .../generic_duplicate_param_use.stderr | 12 +- .../generic_duplicate_param_use5.full_tait.stderr | 48 -- .../generic_duplicate_param_use6.full_tait.stderr | 36 -- .../generic_duplicate_param_use8.full_tait.stderr | 36 -- .../generic_duplicate_param_use9.full_tait.stderr | 60 -- .../generic_nondefining_use.rs | 2 - .../generic_nondefining_use.stderr | 12 +- .../generic_underconstrained.full_tait.stderr | 32 - .../generic_underconstrained2.full_tait.stderr | 52 -- .../issue-52843.full_tait.stderr | 23 - .../typeck_type_placeholder_item.full_tait.stderr | 647 --------------------- src/tools/clippy/tests/ui/crashes/ice-4775.rs | 3 - src/tools/clippy/tests/ui/crashes/ice-5223.rs | 3 - src/tools/clippy/tests/ui/doc/doc.rs | 2 +- .../tests/ui/missing_const_for_fn/cant_be_const.rs | 3 +- .../ui/missing_const_for_fn/could_be_const.rs | 1 - .../ui/missing_const_for_fn/could_be_const.stderr | 18 +- 639 files changed, 2584 insertions(+), 6037 deletions(-) delete mode 100644 src/test/incremental/const-generics/hash-tyvid-regression-1.stderr delete mode 100644 src/test/incremental/const-generics/hash-tyvid-regression-2.stderr delete mode 100644 src/test/incremental/const-generics/hash-tyvid-regression-3.stderr delete mode 100644 src/test/incremental/const-generics/hash-tyvid-regression-4.stderr delete mode 100644 src/test/rustdoc/const-generics/const-evaluatable-checked.rs create mode 100644 src/test/rustdoc/const-generics/generic_const_exprs.rs delete mode 100644 src/test/ui/binding/const-param.full.stderr delete mode 100644 src/test/ui/binding/const-param.min.stderr create mode 100644 src/test/ui/binding/const-param.stderr delete mode 100644 src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr delete mode 100644 src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr delete mode 100644 src/test/ui/const-generics/array-size-in-generic-struct-param.rs delete mode 100644 src/test/ui/const-generics/associated-type-bound-fail.full.stderr delete mode 100644 src/test/ui/const-generics/associated-type-bound-fail.min.stderr create mode 100644 src/test/ui/const-generics/associated-type-bound-fail.stderr delete mode 100644 src/test/ui/const-generics/closing-args-token.full.stderr delete mode 100644 src/test/ui/const-generics/closing-args-token.min.stderr delete mode 100644 src/test/ui/const-generics/closing-args-token.rs delete mode 100644 src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr delete mode 100644 src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr create mode 100644 src/test/ui/const-generics/const-arg-type-arg-misordered.stderr delete mode 100644 src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr delete mode 100644 src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr create mode 100644 src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr delete mode 100644 src/test/ui/const-generics/const-expression-parameter.full.stderr delete mode 100644 src/test/ui/const-generics/const-expression-parameter.min.stderr delete mode 100644 src/test/ui/const-generics/const-expression-parameter.rs delete mode 100644 src/test/ui/const-generics/const-generic-array-wrapper.rs delete mode 100644 src/test/ui/const-generics/const-param-from-outer-fn.full.stderr delete mode 100644 src/test/ui/const-generics/const-param-from-outer-fn.min.stderr delete mode 100644 src/test/ui/const-generics/const-param-from-outer-fn.rs delete mode 100644 src/test/ui/const-generics/const-param-hygiene.rs delete mode 100644 src/test/ui/const-generics/const-param-in-trait.rs delete mode 100644 src/test/ui/const-generics/const-param-shadowing.rs delete mode 100644 src/test/ui/const-generics/const-param-shadowing.stderr delete mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr delete mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr create mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.stderr delete mode 100644 src/test/ui/const-generics/const-types.rs delete mode 100644 src/test/ui/const-generics/defaults/cec-concrete-default.rs delete mode 100644 src/test/ui/const-generics/defaults/cec-concrete-default.stderr delete mode 100644 src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs delete mode 100644 src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr delete mode 100644 src/test/ui/const-generics/defaults/cec-generic-default.rs delete mode 100644 src/test/ui/const-generics/defaults/cec-generic-default.stderr delete mode 100644 src/test/ui/const-generics/defaults/default-on-impl.full.stderr delete mode 100644 src/test/ui/const-generics/defaults/default-on-impl.min.stderr create mode 100644 src/test/ui/const-generics/defaults/default-on-impl.stderr create mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs create mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr create mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs create mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr create mode 100644 src/test/ui/const-generics/defaults/generic-expr-default.rs create mode 100644 src/test/ui/const-generics/defaults/generic-expr-default.stderr delete mode 100644 src/test/ui/const-generics/defaults/mismatch.full.stderr delete mode 100644 src/test/ui/const-generics/defaults/mismatch.min.stderr create mode 100644 src/test/ui/const-generics/defaults/mismatch.stderr delete mode 100644 src/test/ui/const-generics/defaults/needs-feature.none.stderr delete mode 100644 src/test/ui/const-generics/defaults/wrong-order.full.stderr delete mode 100644 src/test/ui/const-generics/defaults/wrong-order.min.stderr create mode 100644 src/test/ui/const-generics/defaults/wrong-order.stderr delete mode 100644 src/test/ui/const-generics/derive-debug-array-wrapper.rs delete mode 100644 src/test/ui/const-generics/diagnostics.rs delete mode 100644 src/test/ui/const-generics/diagnostics.stderr delete mode 100644 src/test/ui/const-generics/different_byref.full.stderr delete mode 100644 src/test/ui/const-generics/different_byref.min.stderr delete mode 100644 src/test/ui/const-generics/different_byref.rs delete mode 100644 src/test/ui/const-generics/different_byref_simple.full.stderr delete mode 100644 src/test/ui/const-generics/different_byref_simple.min.stderr delete mode 100644 src/test/ui/const-generics/different_byref_simple.rs create mode 100644 src/test/ui/const-generics/different_generic_args.full.stderr create mode 100644 src/test/ui/const-generics/different_generic_args.min.stderr create mode 100644 src/test/ui/const-generics/different_generic_args.rs create mode 100644 src/test/ui/const-generics/different_generic_args_array.rs create mode 100644 src/test/ui/const-generics/different_generic_args_array.stderr create mode 100644 src/test/ui/const-generics/early/closing-args-token.rs create mode 100644 src/test/ui/const-generics/early/closing-args-token.stderr create mode 100644 src/test/ui/const-generics/early/const-expression-parameter.rs create mode 100644 src/test/ui/const-generics/early/const-expression-parameter.stderr create mode 100644 src/test/ui/const-generics/early/const-param-from-outer-fn.rs create mode 100644 src/test/ui/const-generics/early/const-param-from-outer-fn.stderr create mode 100644 src/test/ui/const-generics/early/const-param-hygiene.rs create mode 100644 src/test/ui/const-generics/early/const-param-shadowing.rs create mode 100644 src/test/ui/const-generics/early/const-param-shadowing.stderr create mode 100644 src/test/ui/const-generics/early/invalid-const-arguments.rs create mode 100644 src/test/ui/const-generics/early/invalid-const-arguments.stderr create mode 100644 src/test/ui/const-generics/early/macro_rules-braces.rs create mode 100644 src/test/ui/const-generics/early/macro_rules-braces.stderr delete mode 100644 src/test/ui/const-generics/exhaustive-value.full.stderr delete mode 100644 src/test/ui/const-generics/exhaustive-value.min.stderr create mode 100644 src/test/ui/const-generics/exhaustive-value.stderr delete mode 100644 src/test/ui/const-generics/fn-taking-const-generic-array.rs delete mode 100644 src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr delete mode 100644 src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr create mode 100644 src/test/ui/const-generics/forbid-non-structural_match-types.stderr delete mode 100644 src/test/ui/const-generics/foreign-item-const-parameter.full.stderr delete mode 100644 src/test/ui/const-generics/foreign-item-const-parameter.min.stderr create mode 100644 src/test/ui/const-generics/foreign-item-const-parameter.stderr delete mode 100644 src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr delete mode 100644 src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr delete mode 100644 src/test/ui/const-generics/generic-function-call-in-array-length.rs delete mode 100644 src/test/ui/const-generics/generic-param-mismatch.full.stderr delete mode 100644 src/test/ui/const-generics/generic-param-mismatch.min.stderr create mode 100644 src/test/ui/const-generics/generic-param-mismatch.stderr delete mode 100644 src/test/ui/const-generics/generic-sum-in-array-length.full.stderr delete mode 100644 src/test/ui/const-generics/generic-sum-in-array-length.min.stderr delete mode 100644 src/test/ui/const-generics/generic-sum-in-array-length.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/associated-const.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.full.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.min.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/function-call.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/function-call.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-62504.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-69654.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72787.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-73899.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-74634.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-76595.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-80742.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-83765.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-84408.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-85848.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs create mode 100644 src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/simple_fail.full.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/simple_fail.min.stderr create mode 100644 src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr delete mode 100644 src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr delete mode 100644 src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr create mode 100644 src/test/ui/const-generics/impl-trait-with-const-arguments.stderr delete mode 100644 src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr delete mode 100644 src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr create mode 100644 src/test/ui/const-generics/incorrect-number-of-const-args.stderr delete mode 100644 src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr delete mode 100644 src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr create mode 100644 src/test/ui/const-generics/infer/cannot-infer-const-args.stderr delete mode 100644 src/test/ui/const-generics/infer/method-chain.full.stderr delete mode 100644 src/test/ui/const-generics/infer/method-chain.min.stderr create mode 100644 src/test/ui/const-generics/infer/method-chain.stderr delete mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.full.stderr delete mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.min.stderr create mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.stderr delete mode 100644 src/test/ui/const-generics/infer/uninferred-consts.full.stderr delete mode 100644 src/test/ui/const-generics/infer/uninferred-consts.min.stderr create mode 100644 src/test/ui/const-generics/infer/uninferred-consts.stderr delete mode 100644 src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61336-1.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61336-2.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61336-2.min.stderr create mode 100644 src/test/ui/const-generics/issues/issue-61336-2.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61336.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61336.min.stderr create mode 100644 src/test/ui/const-generics/issues/issue-61336.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61422.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61432.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61747.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61747.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61747.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61935.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61935.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61935.rs delete mode 100644 src/test/ui/const-generics/issues/issue-62220.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62220.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62220.rs delete mode 100644 src/test/ui/const-generics/issues/issue-62456.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62456.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62456.rs delete mode 100644 src/test/ui/const-generics/issues/issue-62504.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62504.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62504.rs delete mode 100644 src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62579-no-match.rs delete mode 100644 src/test/ui/const-generics/issues/issue-64494.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-64494.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-64494.rs delete mode 100644 src/test/ui/const-generics/issues/issue-64519.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-66205.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-66205.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-66205.rs delete mode 100644 src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67185-2.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67185-2.min.stderr create mode 100644 src/test/ui/const-generics/issues/issue-67185-2.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-3.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-3.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-3.rs delete mode 100644 src/test/ui/const-generics/issues/issue-68977.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-68977.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-68977.rs delete mode 100644 src/test/ui/const-generics/issues/issue-69654-run-pass.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-69654.rs delete mode 100644 src/test/ui/const-generics/issues/issue-69654.stderr create mode 100644 src/test/ui/const-generics/issues/issue-71202.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72787.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72787.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72787.rs delete mode 100644 src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs delete mode 100644 src/test/ui/const-generics/issues/issue-73508.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-73508.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-73508.rs delete mode 100644 src/test/ui/const-generics/issues/issue-73899.rs delete mode 100644 src/test/ui/const-generics/issues/issue-74634.rs delete mode 100644 src/test/ui/const-generics/issues/issue-74634.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-76595.rs delete mode 100644 src/test/ui/const-generics/issues/issue-76595.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr create mode 100644 src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs delete mode 100644 src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs delete mode 100644 src/test/ui/const-generics/issues/issue-83765.rs delete mode 100644 src/test/ui/const-generics/issues/issue-83765.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-84408.rs delete mode 100644 src/test/ui/const-generics/issues/issue-85848.rs delete mode 100644 src/test/ui/const-generics/issues/issue-85848.stderr delete mode 100644 src/test/ui/const-generics/macro_rules-braces.full.stderr delete mode 100644 src/test/ui/const-generics/macro_rules-braces.min.stderr delete mode 100644 src/test/ui/const-generics/macro_rules-braces.rs delete mode 100644 src/test/ui/const-generics/mut-ref-const-param-array.rs delete mode 100644 src/test/ui/const-generics/slice-const-param.min.stderr delete mode 100644 src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr delete mode 100644 src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71382.full.stderr delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71382.min.stderr create mode 100644 src/test/ui/const-generics/type-dependent/issue-71382.stderr delete mode 100644 src/test/ui/const-generics/unknown_adt.full.stderr delete mode 100644 src/test/ui/const-generics/unknown_adt.min.stderr create mode 100644 src/test/ui/const-generics/unknown_adt.stderr delete mode 100644 src/test/ui/const-generics/unused_braces.full.stderr delete mode 100644 src/test/ui/const-generics/unused_braces.min.stderr create mode 100644 src/test/ui/const-generics/unused_braces.stderr delete mode 100644 src/test/ui/const-generics/wf-misc.full.stderr delete mode 100644 src/test/ui/const-generics/wf-misc.min.stderr delete mode 100644 src/test/ui/const-generics/wf-misc.rs delete mode 100644 src/test/ui/const_evaluatable/associated-const.rs delete mode 100644 src/test/ui/const_evaluatable/function-call.rs delete mode 100644 src/test/ui/const_evaluatable/function-call.stderr delete mode 100644 src/test/ui/const_evaluatable/needs_where_clause.rs delete mode 100644 src/test/ui/const_evaluatable/needs_where_clause.stderr delete mode 100644 src/test/ui/const_evaluatable/no_where_clause.rs delete mode 100644 src/test/ui/const_evaluatable/no_where_clause.stderr delete mode 100644 src/test/ui/feature-gates/feature-gate-const_generics.rs delete mode 100644 src/test/ui/feature-gates/feature-gate-const_generics.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-const_param_types.rs create mode 100644 src/test/ui/feature-gates/feature-gate-const_param_types.stderr delete mode 100644 src/test/ui/hygiene/generic_params.stderr delete mode 100644 src/test/ui/hygiene/issue-61574-const-parameters.stderr delete mode 100644 src/test/ui/impl-trait/issue-55872-1.full_tait.stderr delete mode 100644 src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr delete mode 100644 src/test/ui/mir/issue-75053.in_bindings.stderr delete mode 100644 src/test/ui/mir/issue-80742.rs delete mode 100644 src/test/ui/mir/issue-80742.stderr delete mode 100644 src/test/ui/obsolete-in-place/bad.bad.stderr delete mode 100644 src/test/ui/self/arbitrary-self-types-not-object-safe.stderr delete mode 100644 src/test/ui/symbol-names/basic.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/assoc-type-const.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr delete mode 100644 src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr delete mode 100644 src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr (limited to 'src') diff --git a/src/test/debuginfo/function-names.rs b/src/test/debuginfo/function-names.rs index b9e59f8e829..e962c18d8ec 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 4fe9dfc35bf..7696bb7d331 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 cb8ca3abd7f..00000000000 --- 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 32dbf0b45b9..71d504d26a7 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 0e6040ef02e..00000000000 --- 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 9097d1e98f8..61f568f79ef 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 555d46756dc..00000000000 --- 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 9cfc0012576..12e8ac7abad 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 c9a6715e571..00000000000 --- 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 00b3b29698b..e9d67fee296 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 a193bf998dc..c781484d1e2 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 0eaeb910be6..93c1dbf44e9 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 6b10c540494..81c813531bd 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 353e323e67b..22bbcbcabed 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 925931bc4a6..9e35cf93d09 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 af77b1cedad..8262a2a211b 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 46f18ce2309..92bbcba4b38 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 b01f31b9160..baca4562ade 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 81b71cdf881..c05d8355c28 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 b468fd071fe..8886a556dbb 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 7c7d14a30c9..db1e2fc2af4 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 b86ad01d99d..5b2f5edc850 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 487154e7aba..d659c567633 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 c28f6e17bef..5f5435ba9f2 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 123dbaa406b..7e38eb8369a 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-evaluatable-checked.rs b/src/test/rustdoc/const-generics/const-evaluatable-checked.rs deleted file mode 100644 index d435082e759..00000000000 --- a/src/test/rustdoc/const-generics/const-evaluatable-checked.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_name = "foo"] -#![feature(generic_const_exprs, const_generics)] -#![allow(incomplete_features)] -// make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 -// @has foo/struct.Ice.html '//pre[@class="rust struct"]' \ -// 'pub struct Ice where [(); N + 1]: ;' -pub struct Ice where [(); N + 1]:; diff --git a/src/test/rustdoc/const-generics/const-generic-slice.rs b/src/test/rustdoc/const-generics/const-generic-slice.rs index 626a9e2b210..b20663c6d68 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 7ddcb3a29f2..f0bc9bf7bdd 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/generic_const_exprs.rs b/src/test/rustdoc/const-generics/generic_const_exprs.rs new file mode 100644 index 00000000000..35036a89360 --- /dev/null +++ b/src/test/rustdoc/const-generics/generic_const_exprs.rs @@ -0,0 +1,7 @@ +#![crate_name = "foo"] +#![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"]' \ +// 'pub struct Ice where [(); N + 1]: ;' +pub struct Ice where [(); N + 1]:; 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 3345c8a3fe9..4eac8e31e45 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 45b2889f1ca..d190d7054fe 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 0ad05b3adeb..1a14ab40b1f 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 3f97474d65f..46a54a12d62 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 bffdeb9a336..f2e4ca524a4 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 37ebb4ecac8..24103390e09 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.full.stderr b/src/test/ui/binding/const-param.full.stderr deleted file mode 100644 index 0200c6def24..00000000000 --- a/src/test/ui/binding/const-param.full.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.min.stderr b/src/test/ui/binding/const-param.min.stderr deleted file mode 100644 index 0200c6def24..00000000000 --- 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 4aec801cb15..2d051808fe0 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.stderr b/src/test/ui/binding/const-param.stderr new file mode 100644 index 00000000000..adda80810ea --- /dev/null +++ b/src/test/ui/binding/const-param.stderr @@ -0,0 +1,9 @@ +error[E0158]: const parameters cannot be referenced in patterns + --> $DIR/const-param.rs:5: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/const-generics/apit-with-const-param.rs b/src/test/ui/const-generics/apit-with-const-param.rs index 3bc62141927..2a04dc313e9 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 e533d4f7fb8..9762748f441 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 f23bc6d6a2b..afd9ed1a723 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 95eaeea5818..97dd0f14352 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 0fb23e41b01..00000000000 --- 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-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr deleted file mode 100644 index 5312a22c228..00000000000 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/array-size-in-generic-struct-param.rs:8:48 - | -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 - -error: generic parameters may not be used in const operations - --> $DIR/array-size-in-generic-struct-param.rs:19:15 - | -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 - -error: `Config` is forbidden as the type of a const generic parameter - --> $DIR/array-size-in-generic-struct-param.rs:17:21 - | -LL | struct B { - | ^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -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/array-size-in-generic-struct-param.rs deleted file mode 100644 index cd0a9742cd1..00000000000 --- a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs +++ /dev/null @@ -1,29 +0,0 @@ -// 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, allow(incomplete_features))] - -#[allow(dead_code)] -struct ArithArrayLen([u32; 0 + N]); -//[full]~^ ERROR constant expression depends on a generic parameter -//[min]~^^ ERROR generic parameters may not be used in const operations - -#[derive(PartialEq, Eq)] -struct Config { - arr_size: usize, -} - -struct B { - //[min]~^ ERROR `Config` is forbidden - arr: [u8; CFG.arr_size], - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations -} - -const C: Config = Config { arr_size: 5 }; - -fn main() { - let b = B:: { arr: [1, 2, 3, 4, 5] }; - assert_eq!(b.arr.len(), 5); -} 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 732a1871456..a712f691dbe 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.full.stderr b/src/test/ui/const-generics/associated-type-bound-fail.full.stderr deleted file mode 100644 index 7ab430ba830..00000000000 --- a/src/test/ui/const-generics/associated-type-bound-fail.full.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.min.stderr b/src/test/ui/const-generics/associated-type-bound-fail.min.stderr deleted file mode 100644 index 7ab430ba830..00000000000 --- 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 83b26700805..937b8bcb630 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.stderr b/src/test/ui/const-generics/associated-type-bound-fail.stderr new file mode 100644 index 00000000000..60e624fc6a8 --- /dev/null +++ b/src/test/ui/const-generics/associated-type-bound-fail.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `u16: Bar` is not satisfied + --> $DIR/associated-type-bound-fail.rs:9: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:4: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.rs b/src/test/ui/const-generics/associated-type-bound.rs index 02f77396c0b..3044736b47e 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 8d4cd9c0d6b..922f92d9feb 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 d9baab956c9..19a8bb0f4eb 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 ff686c5e767..5c2b1f4bddf 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 bc3c304cfd8..cd5b8161d08 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 34255fa9f58..6b6140e3a73 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 ac358b01672..f9e03151374 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 44aef859f2d..a6e767489b7 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.full.stderr b/src/test/ui/const-generics/closing-args-token.full.stderr deleted file mode 100644 index f4bb1e42207..00000000000 --- a/src/test/ui/const-generics/closing-args-token.full.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/closing-args-token.min.stderr b/src/test/ui/const-generics/closing-args-token.min.stderr deleted file mode 100644 index f4bb1e42207..00000000000 --- 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/closing-args-token.rs b/src/test/ui/const-generics/closing-args-token.rs deleted file mode 100644 index a9b552ebed7..00000000000 --- a/src/test/ui/const-generics/closing-args-token.rs +++ /dev/null @@ -1,31 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -struct S; -struct T; - -fn bad_args_1() { - S::<5 + 2 >> 7>; - //~^ ERROR expressions must be enclosed in braces to be used as const generic arguments - //~| ERROR comparison operators cannot be chained -} - -fn bad_args_2() { - S::<{ 5 + 2 } >> 7>; - //~^ ERROR comparison operators cannot be chained -} - -fn bad_args_3() { - T::<0 >= 3>; - //~^ ERROR expected expression, found `;` -} - -fn bad_args_4() { - let mut x = 0; - T::>= 2 > 0>; - //~^ ERROR comparison operators cannot be chained -} - -fn main() {} diff --git a/src/test/ui/const-generics/coerce_unsized_array.rs b/src/test/ui/const-generics/coerce_unsized_array.rs index 8e20df28103..ffd5eb9d462 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 8c31c8651a2..372f0433e95 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 3d3bd2664c8..53c9c0ead0f 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 ad40b48afe5..6f85237cf0a 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 f01bda84bf5..aa0f9131aa7 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 c48830f01a9..d0864414cc1 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 6805b4a187e..ac693426fbd 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 8279f4a3f61..39f0b237330 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 43ed12efb89..9b225b18d73 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 d0ea51ea417..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr deleted file mode 100644 index d7b7df0eb55..00000000000 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0747]: constant provided when a type was expected - --> $DIR/const-arg-type-arg-misordered.rs:7:35 - | -LL | fn foo() -> Array { - | ^ - | - = note: type arguments must be provided before constant arguments - = help: reorder the arguments: types, then consts: `` - -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 5415791d21b..8ee17e637aa 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.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr new file mode 100644 index 00000000000..104ee9b48b4 --- /dev/null +++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr @@ -0,0 +1,12 @@ +error[E0747]: constant provided when a type was expected + --> $DIR/const-arg-type-arg-misordered.rs:3:35 + | +LL | fn foo() -> Array { + | ^ + | + = note: type arguments must be provided before constant arguments + = help: reorder the arguments: types, then consts: `` + +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-argument-cross-crate-mismatch.full.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr deleted file mode 100644 index 6ef698bd6a0..00000000000 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.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.min.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr deleted file mode 100644 index 6ef698bd6a0..00000000000 --- 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 a8f533eceaa..d863d097d5c 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.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr new file mode 100644 index 00000000000..aefd514f7a6 --- /dev/null +++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $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: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 + +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-if-length.full.stderr b/src/test/ui/const-generics/const-argument-if-length.full.stderr index 8e62147eb7e..8c5c3b17b5c 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 ef6bb69e997..b123036bf25 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 67ed85f96af..db1eafca2c7 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 dc34621b905..2aca7bdeb9a 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.full.stderr b/src/test/ui/const-generics/const-expression-parameter.full.stderr deleted file mode 100644 index 4ce0ecdf3aa..00000000000 --- a/src/test/ui/const-generics/const-expression-parameter.full.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-expression-parameter.min.stderr b/src/test/ui/const-generics/const-expression-parameter.min.stderr deleted file mode 100644 index 4ce0ecdf3aa..00000000000 --- 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-expression-parameter.rs b/src/test/ui/const-generics/const-expression-parameter.rs deleted file mode 100644 index cb609a56416..00000000000 --- a/src/test/ui/const-generics/const-expression-parameter.rs +++ /dev/null @@ -1,24 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -fn i32_identity() -> i32 { - 5 -} - -fn foo_a() { - i32_identity::<-1>(); // ok -} - -fn foo_b() { - i32_identity::<1 + 2>(); //~ ERROR expressions must be enclosed in braces -} - -fn foo_c() { - i32_identity::< -1 >(); // ok -} - -fn main() { - i32_identity::<5>(); // ok -} 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 5c1ee4e0d5a..161bfaab48a 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 224fc794e32..00000000000 --- 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 95632f79896..bb16be9c58c 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 6c2b14f2770..d8a0e076e0a 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 09a4f66de39..982417eb3c6 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 a9349ce43c9..f439cd9d69f 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 508bb3e6a68..0a7b57fe626 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 119f932745b..d6753a74f85 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 613918f78f3..0f98adf2a6b 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 89715a7b8e9..345e192f8db 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.full.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.full.stderr deleted file mode 100644 index c2ec7359c9f..00000000000 --- a/src/test/ui/const-generics/const-param-from-outer-fn.full.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-from-outer-fn.min.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr deleted file mode 100644 index c2ec7359c9f..00000000000 --- 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-from-outer-fn.rs b/src/test/ui/const-generics/const-param-from-outer-fn.rs deleted file mode 100644 index 27b9ca9c291..00000000000 --- a/src/test/ui/const-generics/const-param-from-outer-fn.rs +++ /dev/null @@ -1,12 +0,0 @@ -// 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 - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-hygiene.rs b/src/test/ui/const-generics/const-param-hygiene.rs deleted file mode 100644 index 9cafb05fbcb..00000000000 --- a/src/test/ui/const-generics/const-param-hygiene.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -macro_rules! bar { - ($($t:tt)*) => { impl $($t)* }; -} - -macro_rules! baz { - ($t:tt) => { fn test(&self) -> usize { $t } }; -} - -struct Foo; - -bar!(Foo { baz!{ M } }); - -fn main() { - assert_eq!(Foo::<7>.test::<3>(), 3); -} 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 9dc9c80241d..f823431e69b 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 79b3ae2037e..00000000000 --- 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-shadowing.rs b/src/test/ui/const-generics/const-param-shadowing.rs deleted file mode 100644 index ddd15dbc41b..00000000000 --- a/src/test/ui/const-generics/const-param-shadowing.rs +++ /dev/null @@ -1,7 +0,0 @@ -type N = u32; -struct Foo; -fn test() -> Foo { //~ ERROR type provided when - Foo -} - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-shadowing.stderr b/src/test/ui/const-generics/const-param-shadowing.stderr deleted file mode 100644 index 625338bd9b4..00000000000 --- a/src/test/ui/const-generics/const-param-shadowing.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0747]: type provided when a constant was expected - --> $DIR/const-param-shadowing.rs:3:34 - | -LL | fn test() -> Foo { - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | fn test() -> Foo<{ N }> { - | + + - -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-param-type-depends-on-const-param.min.stderr b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr index 9804363f39a..db3a04b8235 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 62b146e016a..07c86d2cf8c 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 910a9643502..6eb4b3735ff 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.full.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr deleted file mode 100644 index 923964a4070..00000000000 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.full.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.min.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr deleted file mode 100644 index 923964a4070..00000000000 --- 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 5d97907c2e7..b08d62ccc7b 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.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr new file mode 100644 index 00000000000..efaa182852a --- /dev/null +++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr @@ -0,0 +1,14 @@ +error: const parameter `x` should have an upper case name + --> $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:1:9 + | +LL | #![deny(non_upper_case_globals)] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + 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 fb150f892ed..00000000000 --- 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 b6fa478f48d..5e975c17043 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 1d495c9562d..ebde155f776 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 6514409698e..5c548740af2 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/cec-concrete-default.rs b/src/test/ui/const-generics/defaults/cec-concrete-default.rs deleted file mode 100644 index 80359476d6c..00000000000 --- a/src/test/ui/const-generics/defaults/cec-concrete-default.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(const_generics, generic_const_exprs, const_generics_defaults)] -#![allow(incomplete_features)] - -struct Foo; -fn no_constraining() -> Foo<10> { - Foo::<10, 11> -} - -pub fn different_than_default() -> Foo<10> { - Foo::<10, 12> - //~^ error: mismatched types -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/cec-concrete-default.stderr b/src/test/ui/const-generics/defaults/cec-concrete-default.stderr deleted file mode 100644 index 090e507b7f3..00000000000 --- a/src/test/ui/const-generics/defaults/cec-concrete-default.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/cec-concrete-default.rs:10:5 - | -LL | Foo::<10, 12> - | ^^^^^^^^^^^^^ expected `11_usize`, found `12_usize` - | - = note: expected type `11_usize` - found type `12_usize` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs b/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs deleted file mode 100644 index eb4a0cec0a6..00000000000 --- a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(const_generics, generic_const_exprs, const_generics_defaults)] -#![allow(incomplete_features)] - -struct Foo; -fn should_unify() -> Foo where [(); { N + 1 }]: { - Foo:: -} -pub fn shouldnt_unify() -> Foo -where - [(); { N + 1 }]:, - [(); { N + 2 }]:, { - Foo:: - //~^ error: mismatched types -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr b/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr deleted file mode 100644 index f97fc26a073..00000000000 --- a/src/test/ui/const-generics/defaults/cec-generic-default-mismatched-types.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/cec-generic-default-mismatched-types.rs:12:5 - | -LL | Foo:: - | ^^^^^^^^^^^^^^^^^^^ expected `{ N + 1 }`, found `{ N + 2 }` - | - = note: expected type `{ N + 1 }` - found type `{ N + 2 }` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/defaults/cec-generic-default.rs b/src/test/ui/const-generics/defaults/cec-generic-default.rs deleted file mode 100644 index 02f21adb0d5..00000000000 --- a/src/test/ui/const-generics/defaults/cec-generic-default.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![feature(generic_const_exprs, const_generics, const_generics_defaults)] -#![allow(incomplete_features)] - -pub struct Foo; -pub fn needs_evaluatable_bound() -> Foo { - //~^ error: unconstrained generic constant - loop {} -} -pub fn has_evaluatable_bound() -> Foo where [(); N1 + 1]: { - loop {} -} - -type FooAlias = [(); NP]; -fn needs_evaluatable_bound_alias() -> FooAlias -{ - //~^^ error: unconstrained generic constant - todo!() -} -fn has_evaluatable_bound_alias() -> FooAlias -where [(); N + 1]: { - todo!() -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/cec-generic-default.stderr b/src/test/ui/const-generics/defaults/cec-generic-default.stderr deleted file mode 100644 index 0234ea8b9a4..00000000000 --- a/src/test/ui/const-generics/defaults/cec-generic-default.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: unconstrained generic constant - --> $DIR/cec-generic-default.rs:5:54 - | -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 - | -LL | fn needs_evaluatable_bound_alias() -> FooAlias - | ^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { N + 1 }]:` - -error: aborting due to 2 previous errors - 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 25004faee6f..aa289ec0778 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 d3558007977..814c996fbad 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 d24e403e017..c27ed298afd 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 4fa21b8b1fb..e7cbf01a301 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 8eb8f368b12..2b41dbb5887 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.full.stderr b/src/test/ui/const-generics/defaults/default-on-impl.full.stderr deleted file mode 100644 index c417a26842e..00000000000 --- a/src/test/ui/const-generics/defaults/default-on-impl.full.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.min.stderr b/src/test/ui/const-generics/defaults/default-on-impl.min.stderr deleted file mode 100644 index c417a26842e..00000000000 --- 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 735549defea..280d92f839f 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.stderr b/src/test/ui/const-generics/defaults/default-on-impl.stderr new file mode 100644 index 00000000000..0f85ceccc8a --- /dev/null +++ b/src/test/ui/const-generics/defaults/default-on-impl.stderr @@ -0,0 +1,8 @@ +error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions + --> $DIR/default-on-impl.rs:5:12 + | +LL | impl Foo {} + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/defaults/external.rs b/src/test/ui/const-generics/defaults/external.rs index 32acf567cf2..276e74355c2 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/generic-expr-default-concrete.rs b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs new file mode 100644 index 00000000000..52cea51aae1 --- /dev/null +++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs @@ -0,0 +1,14 @@ +#![feature(generic_const_exprs, const_generics_defaults)] +#![allow(incomplete_features)] + +struct Foo; +fn no_constraining() -> Foo<10> { + Foo::<10, 11> +} + +pub fn different_than_default() -> Foo<10> { + Foo::<10, 12> + //~^ error: mismatched types +} + +fn main() {} diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr new file mode 100644 index 00000000000..905a285370a --- /dev/null +++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/generic-expr-default-concrete.rs:10:5 + | +LL | Foo::<10, 12> + | ^^^^^^^^^^^^^ expected `11_usize`, found `12_usize` + | + = note: expected type `11_usize` + found type `12_usize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs new file mode 100644 index 00000000000..3a11631fc47 --- /dev/null +++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs @@ -0,0 +1,16 @@ +#![feature(generic_const_exprs, const_generics_defaults)] +#![allow(incomplete_features)] + +struct Foo; +fn should_unify() -> Foo where [(); { N + 1 }]: { + Foo:: +} +pub fn shouldnt_unify() -> Foo +where + [(); { N + 1 }]:, + [(); { N + 2 }]:, { + Foo:: + //~^ error: mismatched types +} + +fn main() {} diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr new file mode 100644 index 00000000000..d5a3071b77d --- /dev/null +++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/generic-expr-default-mismatched-types.rs:12:5 + | +LL | Foo:: + | ^^^^^^^^^^^^^^^^^^^ expected `{ N + 1 }`, found `{ N + 2 }` + | + = note: expected type `{ N + 1 }` + found type `{ N + 2 }` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/defaults/generic-expr-default.rs b/src/test/ui/const-generics/defaults/generic-expr-default.rs new file mode 100644 index 00000000000..0adbd5cdf31 --- /dev/null +++ b/src/test/ui/const-generics/defaults/generic-expr-default.rs @@ -0,0 +1,24 @@ +#![feature(generic_const_exprs, const_generics_defaults)] +#![allow(incomplete_features)] + +pub struct Foo; +pub fn needs_evaluatable_bound() -> Foo { + //~^ error: unconstrained generic constant + loop {} +} +pub fn has_evaluatable_bound() -> Foo where [(); N1 + 1]: { + loop {} +} + +type FooAlias = [(); NP]; +fn needs_evaluatable_bound_alias() -> FooAlias +{ + //~^^ error: unconstrained generic constant + todo!() +} +fn has_evaluatable_bound_alias() -> FooAlias +where [(); N + 1]: { + todo!() +} + +fn main() {} diff --git a/src/test/ui/const-generics/defaults/generic-expr-default.stderr b/src/test/ui/const-generics/defaults/generic-expr-default.stderr new file mode 100644 index 00000000000..ada1498d1c8 --- /dev/null +++ b/src/test/ui/const-generics/defaults/generic-expr-default.stderr @@ -0,0 +1,18 @@ +error: unconstrained generic constant + --> $DIR/generic-expr-default.rs:5:54 + | +LL | pub fn needs_evaluatable_bound() -> Foo { + | ^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); { N + 1 }]:` + +error: unconstrained generic constant + --> $DIR/generic-expr-default.rs:14:58 + | +LL | fn needs_evaluatable_bound_alias() -> FooAlias + | ^^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); { N + 1 }]:` + +error: aborting due to 2 previous errors + 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 29d835e36c6..725cc36b428 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 29d835e36c6..725cc36b428 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 307e3aaf1fb..cc215ab0c25 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 4aa8401ab22..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/defaults/mismatch.min.stderr deleted file mode 100644 index 4aa8401ab22..00000000000 --- a/src/test/ui/const-generics/defaults/mismatch.min.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 9d9a8793aaa..4ae93a9166d 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.stderr b/src/test/ui/const-generics/defaults/mismatch.stderr new file mode 100644 index 00000000000..3c7f4fe3b28 --- /dev/null +++ b/src/test/ui/const-generics/defaults/mismatch.stderr @@ -0,0 +1,58 @@ +error[E0308]: mismatched types + --> $DIR/mismatch.rs:9: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:12: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:15: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:18: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:21: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/needs-feature.min.stderr b/src/test/ui/const-generics/defaults/needs-feature.min.stderr index a4006203e4a..158fa2ec1c8 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 a4006203e4a..00000000000 --- 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 b58dee0712a..9ba8184e058 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 c003cb2c5a6..bc01fe2656c 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 e68075ee3c6..8b35c5860d9 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.full.stderr b/src/test/ui/const-generics/defaults/wrong-order.full.stderr deleted file mode 100644 index eb0bcb28215..00000000000 --- a/src/test/ui/const-generics/defaults/wrong-order.full.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.min.stderr b/src/test/ui/const-generics/defaults/wrong-order.min.stderr deleted file mode 100644 index eb0bcb28215..00000000000 --- 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 88e9e96ba43..33564a48448 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.stderr b/src/test/ui/const-generics/defaults/wrong-order.stderr new file mode 100644 index 00000000000..47a2c6f3f41 --- /dev/null +++ b/src/test/ui/const-generics/defaults/wrong-order.stderr @@ -0,0 +1,8 @@ +error: generic parameters with a default must be trailing + --> $DIR/wrong-order.rs:3:10 + | +LL | struct A { + | ^ + +error: aborting due to previous error + 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 ce1481d97e9..00000000000 --- 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/diagnostics.rs b/src/test/ui/const-generics/diagnostics.rs deleted file mode 100644 index 1581af5ab27..00000000000 --- a/src/test/ui/const-generics/diagnostics.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![crate_type="lib"] -#![feature(min_const_generics)] -#![allow(incomplete_features)] - -struct A; -trait Foo {} -impl Foo for A {} -//~^ ERROR cannot find type -//~| unresolved item provided when a constant - -struct B; -impl Foo for B {} -//~^ ERROR type provided when a constant - -struct C; -impl Foo for C {} -//~^ ERROR cannot find type -//~| unresolved item provided when a constant diff --git a/src/test/ui/const-generics/diagnostics.stderr b/src/test/ui/const-generics/diagnostics.stderr deleted file mode 100644 index dd37d4e7a85..00000000000 --- a/src/test/ui/const-generics/diagnostics.stderr +++ /dev/null @@ -1,73 +0,0 @@ -error[E0412]: cannot find type `N` in this scope - --> $DIR/diagnostics.rs:7:16 - | -LL | struct A; - | ---------------------- similarly named struct `A` defined here -LL | trait Foo {} -LL | impl Foo for A {} - | ^ - | -help: a struct with a similar name exists - | -LL | impl Foo for A {} - | ~ -help: you might be missing a type parameter - | -LL | impl Foo for A {} - | +++ - -error[E0412]: cannot find type `T` in this scope - --> $DIR/diagnostics.rs:16:32 - | -LL | struct A; - | ---------------------- similarly named struct `A` defined here -... -LL | impl Foo for C {} - | ^ - | -help: a struct with a similar name exists - | -LL | impl Foo for C {} - | ~ -help: you might be missing a type parameter - | -LL | impl Foo for C {} - | +++ - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/diagnostics.rs:7:16 - | -LL | impl Foo for A {} - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | impl Foo for A<{ N }> {} - | + + - -error[E0747]: type provided when a constant was expected - --> $DIR/diagnostics.rs:12:19 - | -LL | impl Foo for B {} - | ^ - | -help: consider changing this type parameter to be a `const` generic - | -LL | impl Foo for B {} - | ~~~~~~~~~~~ - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/diagnostics.rs:16:32 - | -LL | impl Foo for C {} - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | impl Foo for C {} - | + + - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0412, E0747. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/const-generics/different_byref.full.stderr b/src/test/ui/const-generics/different_byref.full.stderr deleted file mode 100644 index d6b32323e2d..00000000000 --- a/src/test/ui/const-generics/different_byref.full.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different_byref.rs:12:9 - | -LL | x = Const::<{ [4] }> {}; - | ^^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` - | - = note: expected type `[3_usize]` - found type `[4_usize]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. 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 93874fb1f5f..00000000000 --- 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 7977560ecbc..00000000000 --- 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.full.stderr b/src/test/ui/const-generics/different_byref_simple.full.stderr deleted file mode 100644 index 027e282c398..00000000000 --- a/src/test/ui/const-generics/different_byref_simple.full.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different_byref_simple.rs:11:9 - | -LL | u = ConstUsize::<4> {}; - | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` - | - = note: expected struct `ConstUsize<3_usize>` - found struct `ConstUsize<4_usize>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/different_byref_simple.min.stderr b/src/test/ui/const-generics/different_byref_simple.min.stderr deleted file mode 100644 index 027e282c398..00000000000 --- a/src/test/ui/const-generics/different_byref_simple.min.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different_byref_simple.rs:11:9 - | -LL | u = ConstUsize::<4> {}; - | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` - | - = note: expected struct `ConstUsize<3_usize>` - found struct `ConstUsize<4_usize>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/different_byref_simple.rs b/src/test/ui/const-generics/different_byref_simple.rs deleted file mode 100644 index b48189fc2cb..00000000000 --- a/src/test/ui/const-generics/different_byref_simple.rs +++ /dev/null @@ -1,13 +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 ConstUsize {} - -fn main() { - let mut u = ConstUsize::<3> {}; - u = ConstUsize::<4> {}; - //~^ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/different_generic_args.full.stderr b/src/test/ui/const-generics/different_generic_args.full.stderr new file mode 100644 index 00000000000..a2dcc033627 --- /dev/null +++ b/src/test/ui/const-generics/different_generic_args.full.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/different_generic_args.rs:11:9 + | +LL | u = ConstUsize::<4> {}; + | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` + | + = note: expected struct `ConstUsize<3_usize>` + found struct `ConstUsize<4_usize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/different_generic_args.min.stderr b/src/test/ui/const-generics/different_generic_args.min.stderr new file mode 100644 index 00000000000..a2dcc033627 --- /dev/null +++ b/src/test/ui/const-generics/different_generic_args.min.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/different_generic_args.rs:11:9 + | +LL | u = ConstUsize::<4> {}; + | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` + | + = note: expected struct `ConstUsize<3_usize>` + found struct `ConstUsize<4_usize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/different_generic_args.rs b/src/test/ui/const-generics/different_generic_args.rs new file mode 100644 index 00000000000..9ee0e0747c4 --- /dev/null +++ b/src/test/ui/const-generics/different_generic_args.rs @@ -0,0 +1,13 @@ +// Check that types with different const arguments are different. +// revisions: full min + +#![cfg_attr(full, feature(generic_const_exprs))] +#![cfg_attr(full, allow(incomplete_features))] + +struct ConstUsize {} + +fn main() { + let mut u = ConstUsize::<3> {}; + u = ConstUsize::<4> {}; + //~^ ERROR mismatched types +} 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 00000000000..cfe3a0a075a --- /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_generic_args_array.stderr b/src/test/ui/const-generics/different_generic_args_array.stderr new file mode 100644 index 00000000000..c0709a996ce --- /dev/null +++ b/src/test/ui/const-generics/different_generic_args_array.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/different_generic_args_array.rs:9:9 + | +LL | x = Const::<{ [4] }> {}; + | ^^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize` + | + = note: expected struct `Const<[3_usize]>` + found struct `Const<[4_usize]>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. 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 eb272e3c9b4..6c4ee1af210 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 73ed23521c3..3dee326a186 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/early/closing-args-token.rs b/src/test/ui/const-generics/early/closing-args-token.rs new file mode 100644 index 00000000000..cb4d6299ed6 --- /dev/null +++ b/src/test/ui/const-generics/early/closing-args-token.rs @@ -0,0 +1,26 @@ +struct S; +struct T; + +fn bad_args_1() { + S::<5 + 2 >> 7>; + //~^ ERROR expressions must be enclosed in braces to be used as const generic arguments + //~| ERROR comparison operators cannot be chained +} + +fn bad_args_2() { + S::<{ 5 + 2 } >> 7>; + //~^ ERROR comparison operators cannot be chained +} + +fn bad_args_3() { + T::<0 >= 3>; + //~^ ERROR expected expression, found `;` +} + +fn bad_args_4() { + let mut x = 0; + T::>= 2 > 0>; + //~^ ERROR comparison operators cannot be chained +} + +fn main() {} diff --git a/src/test/ui/const-generics/early/closing-args-token.stderr b/src/test/ui/const-generics/early/closing-args-token.stderr new file mode 100644 index 00000000000..58fff3a85af --- /dev/null +++ b/src/test/ui/const-generics/early/closing-args-token.stderr @@ -0,0 +1,52 @@ +error: expressions must be enclosed in braces to be used as const generic arguments + --> $DIR/closing-args-token.rs:5: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:5: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:11: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:16:16 + | +LL | T::<0 >= 3>; + | ^ expected expression + +error: comparison operators cannot be chained + --> $DIR/closing-args-token.rs:22: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/early/const-expression-parameter.rs b/src/test/ui/const-generics/early/const-expression-parameter.rs new file mode 100644 index 00000000000..4cf7ba86921 --- /dev/null +++ b/src/test/ui/const-generics/early/const-expression-parameter.rs @@ -0,0 +1,19 @@ +fn i32_identity() -> i32 { + 5 +} + +fn foo_a() { + i32_identity::<-1>(); // ok +} + +fn foo_b() { + i32_identity::<1 + 2>(); //~ ERROR expressions must be enclosed in braces +} + +fn foo_c() { + i32_identity::< -1 >(); // ok +} + +fn main() { + i32_identity::<5>(); // ok +} diff --git a/src/test/ui/const-generics/early/const-expression-parameter.stderr b/src/test/ui/const-generics/early/const-expression-parameter.stderr new file mode 100644 index 00000000000..4ce1be25edb --- /dev/null +++ b/src/test/ui/const-generics/early/const-expression-parameter.stderr @@ -0,0 +1,13 @@ +error: expressions must be enclosed in braces to be used as const generic arguments + --> $DIR/const-expression-parameter.rs:10: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/early/const-param-from-outer-fn.rs b/src/test/ui/const-generics/early/const-param-from-outer-fn.rs new file mode 100644 index 00000000000..c3b418ee3f8 --- /dev/null +++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.rs @@ -0,0 +1,7 @@ +fn foo() { + fn bar() -> u32 { + X //~ ERROR can't use generic parameters from outer function + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr new file mode 100644 index 00000000000..a9f9787d875 --- /dev/null +++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr @@ -0,0 +1,13 @@ +error[E0401]: can't use generic parameters from outer function + --> $DIR/const-param-from-outer-fn.rs:3: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/early/const-param-hygiene.rs b/src/test/ui/const-generics/early/const-param-hygiene.rs new file mode 100644 index 00000000000..fd4e5b409ee --- /dev/null +++ b/src/test/ui/const-generics/early/const-param-hygiene.rs @@ -0,0 +1,17 @@ +// run-pass + +macro_rules! bar { + ($($t:tt)*) => { impl $($t)* }; +} + +macro_rules! baz { + ($t:tt) => { fn test(&self) -> usize { $t } }; +} + +struct Foo; + +bar!(Foo { baz!{ M } }); + +fn main() { + assert_eq!(Foo::<7>.test::<3>(), 3); +} diff --git a/src/test/ui/const-generics/early/const-param-shadowing.rs b/src/test/ui/const-generics/early/const-param-shadowing.rs new file mode 100644 index 00000000000..ddd15dbc41b --- /dev/null +++ b/src/test/ui/const-generics/early/const-param-shadowing.rs @@ -0,0 +1,7 @@ +type N = u32; +struct Foo; +fn test() -> Foo { //~ ERROR type provided when + Foo +} + +fn main() {} diff --git a/src/test/ui/const-generics/early/const-param-shadowing.stderr b/src/test/ui/const-generics/early/const-param-shadowing.stderr new file mode 100644 index 00000000000..625338bd9b4 --- /dev/null +++ b/src/test/ui/const-generics/early/const-param-shadowing.stderr @@ -0,0 +1,14 @@ +error[E0747]: type provided when a constant was expected + --> $DIR/const-param-shadowing.rs:3:34 + | +LL | fn test() -> Foo { + | ^ + | +help: if this generic argument was intended as a const parameter, surround it with braces + | +LL | fn test() -> Foo<{ N }> { + | + + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/early/invalid-const-arguments.rs b/src/test/ui/const-generics/early/invalid-const-arguments.rs new file mode 100644 index 00000000000..6619c975885 --- /dev/null +++ b/src/test/ui/const-generics/early/invalid-const-arguments.rs @@ -0,0 +1,16 @@ +#![crate_type="lib"] + +struct A; +trait Foo {} +impl Foo for A {} +//~^ ERROR cannot find type +//~| unresolved item provided when a constant + +struct B; +impl Foo for B {} +//~^ ERROR type provided when a constant + +struct C; +impl Foo for C {} +//~^ ERROR cannot find type +//~| unresolved item provided when a constant diff --git a/src/test/ui/const-generics/early/invalid-const-arguments.stderr b/src/test/ui/const-generics/early/invalid-const-arguments.stderr new file mode 100644 index 00000000000..b46e7e24f49 --- /dev/null +++ b/src/test/ui/const-generics/early/invalid-const-arguments.stderr @@ -0,0 +1,73 @@ +error[E0412]: cannot find type `N` in this scope + --> $DIR/invalid-const-arguments.rs:5:16 + | +LL | struct A; + | ---------------------- similarly named struct `A` defined here +LL | trait Foo {} +LL | impl Foo for A {} + | ^ + | +help: a struct with a similar name exists + | +LL | impl Foo for A {} + | ~ +help: you might be missing a type parameter + | +LL | impl Foo for A {} + | +++ + +error[E0412]: cannot find type `T` in this scope + --> $DIR/invalid-const-arguments.rs:14:32 + | +LL | struct A; + | ---------------------- similarly named struct `A` defined here +... +LL | impl Foo for C {} + | ^ + | +help: a struct with a similar name exists + | +LL | impl Foo for C {} + | ~ +help: you might be missing a type parameter + | +LL | impl Foo for C {} + | +++ + +error[E0747]: unresolved item provided when a constant was expected + --> $DIR/invalid-const-arguments.rs:5:16 + | +LL | impl Foo for A {} + | ^ + | +help: if this generic argument was intended as a const parameter, surround it with braces + | +LL | impl Foo for A<{ N }> {} + | + + + +error[E0747]: type provided when a constant was expected + --> $DIR/invalid-const-arguments.rs:10:19 + | +LL | impl Foo for B {} + | ^ + | +help: consider changing this type parameter to be a `const` generic + | +LL | impl Foo for B {} + | ~~~~~~~~~~~ + +error[E0747]: unresolved item provided when a constant was expected + --> $DIR/invalid-const-arguments.rs:14:32 + | +LL | impl Foo for C {} + | ^ + | +help: if this generic argument was intended as a const parameter, surround it with braces + | +LL | impl Foo for C {} + | + + + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0412, E0747. +For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/const-generics/early/macro_rules-braces.rs b/src/test/ui/const-generics/early/macro_rules-braces.rs new file mode 100644 index 00000000000..0ae91463599 --- /dev/null +++ b/src/test/ui/const-generics/early/macro_rules-braces.rs @@ -0,0 +1,73 @@ +mod m { + pub const P: usize = 0; +} + +const Q: usize = 0; + +fn test() { + struct Foo; + macro_rules! foo { + ($x:expr) => { + [u8; $x] + } + } + macro_rules! bar { + ($x:expr) => { + [u8; { $x }] + } + } + macro_rules! baz { + ( $x:expr) => { + Foo<$x> + } + } + macro_rules! biz { + ($x:expr) => { + Foo<{ $x }> + }; + } + + let _: foo!(N); + let _: foo!({ N }); + let _: foo!({{ N }}); //~ ERROR generic parameters may not + let _: foo!(Q); + let _: foo!(m::P); + let _: bar!(N); + let _: bar!({ N }); //~ ERROR generic parameters may not + let _: bar!(Q); + let _: bar!(m::P); + let _: baz!(N); + let _: baz!({ N }); + 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 }); //~ ERROR generic parameters may not + let _: biz!(Q); + let _: biz!(m::P); + let _: foo!(3); + let _: foo!({ 3 }); + let _: foo!({{ 3 }}); + let _: bar!(3); + let _: bar!({ 3 }); + let _: baz!(3); + let _: baz!({ 3 }); + let _: baz!({{ 3 }}); + let _: biz!(3); + let _: biz!({ 3 }); + let _: foo!(10 + 7); + let _: foo!({ 10 + 7 }); + let _: foo!({{ 10 + 7 }}); + let _: bar!(10 + 7); + let _: bar!({ 10 + 7 }); + let _: baz!(10 + 7); //~ ERROR expressions must be enclosed in braces + let _: baz!({ 10 + 7 }); + let _: baz!({{ 10 + 7 }}); + let _: biz!(10 + 7); + let _: biz!({ 10 + 7 }); +} + +fn main() { + test::<3>(); +} diff --git a/src/test/ui/const-generics/early/macro_rules-braces.stderr b/src/test/ui/const-generics/early/macro_rules-braces.stderr new file mode 100644 index 00000000000..49382dbf0bd --- /dev/null +++ b/src/test/ui/const-generics/early/macro_rules-braces.stderr @@ -0,0 +1,60 @@ +error: expressions must be enclosed in braces to be used as const generic arguments + --> $DIR/macro_rules-braces.rs:44: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:64:17 + | +LL | let _: baz!(10 + 7); + | ^^^^^^ + | +help: enclose the `const` expression in braces + | +LL | let _: baz!({ 10 + 7 }); + | + + + +error: generic parameters may not be used in const operations + --> $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(generic_const_exprs)]` to allow generic const expressions + +error: generic parameters may not be used in const operations + --> $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(generic_const_exprs)]` to allow generic const expressions + +error: generic parameters may not be used in const operations + --> $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(generic_const_exprs)]` to allow generic const expressions + +error: generic parameters may not be used in const operations + --> $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(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 4e89e4a3b17..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/exhaustive-value.min.stderr deleted file mode 100644 index 4e89e4a3b17..00000000000 --- a/src/test/ui/const-generics/exhaustive-value.min.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 921f9a46707..778d498343e 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.stderr b/src/test/ui/const-generics/exhaustive-value.stderr new file mode 100644 index 00000000000..0c6aced4bc2 --- /dev/null +++ b/src/test/ui/const-generics/exhaustive-value.stderr @@ -0,0 +1,21 @@ +error[E0277]: the trait bound `(): Foo` is not satisfied + --> $DIR/exhaustive-value.rs:262: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:2: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/fn-const-param-call.rs b/src/test/ui/const-generics/fn-const-param-call.rs index 70a104e2222..5cd18f6d359 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 d090479d4c3..59610159695 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 58c1b95893e..00000000000 --- 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.full.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr deleted file mode 100644 index 5c0f17537fa..00000000000 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -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 previous error - -For more information about this error, try `rustc --explain E0741`. 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 80eac994d55..00000000000 --- 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 0fdb3ed4a5a..7884008b858 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.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.stderr new file mode 100644 index 00000000000..81b9bdfbd60 --- /dev/null +++ b/src/test/ui/const-generics/forbid-non-structural_match-types.stderr @@ -0,0 +1,9 @@ +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:11:19 + | +LL | struct D; + | ^ `C` doesn't derive both `PartialEq` and `Eq` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr deleted file mode 100644 index b827e482977..00000000000 --- a/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0044]: foreign items may not have const parameters - --> $DIR/foreign-item-const-parameter.rs:7:5 - | -LL | fn foo(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters - | - = help: replace the const parameters with concrete consts - -error[E0044]: foreign items may not have type or const parameters - --> $DIR/foreign-item-const-parameter.rs:9:5 - | -LL | fn bar(_: T); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have type or const parameters - | - = help: replace the type or const parameters with concrete types or consts - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0044`. diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr deleted file mode 100644 index b827e482977..00000000000 --- 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 83caa89f033..4fe377b5964 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.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.stderr new file mode 100644 index 00000000000..b02db8700cf --- /dev/null +++ b/src/test/ui/const-generics/foreign-item-const-parameter.stderr @@ -0,0 +1,19 @@ +error[E0044]: foreign items may not have const parameters + --> $DIR/foreign-item-const-parameter.rs:2: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:4: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/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 2d19a58a145..00000000000 --- 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 dd4de9bc1b7..00000000000 --- 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 a6d2bbd17ea..00000000000 --- 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.full.stderr b/src/test/ui/const-generics/generic-param-mismatch.full.stderr deleted file mode 100644 index aff8780fb0d..00000000000 --- a/src/test/ui/const-generics/generic-param-mismatch.full.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.min.stderr b/src/test/ui/const-generics/generic-param-mismatch.min.stderr deleted file mode 100644 index aff8780fb0d..00000000000 --- 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 22fffe47dcc..2e201e50a64 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.stderr b/src/test/ui/const-generics/generic-param-mismatch.stderr new file mode 100644 index 00000000000..d0776d49d71 --- /dev/null +++ b/src/test/ui/const-generics/generic-param-mismatch.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/generic-param-mismatch.rs:2: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-sum-in-array-length.full.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr deleted file mode 100644 index c13882e7fe1..00000000000 --- 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 d80d38cf8b1..00000000000 --- 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 7ee0394ba14..00000000000 --- 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 4d7c4e003d0..06f00de13a3 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 08b46c4c4a3..3b5b87b2b3d 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 0cb5410ed26..7561ae2febb 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 66afe517835..184263f899a 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 00000000000..deb6f3bd12c --- /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/generic_const_exprs/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 new file mode 100644 index 00000000000..22e7ab1f7b1 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr @@ -0,0 +1,29 @@ +error: generic parameters may not be used in const operations + --> $DIR/array-size-in-generic-struct-param.rs:8:48 + | +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(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 + | +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(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 + | +LL | struct B { + | ^^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + = 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/generic_const_exprs/array-size-in-generic-struct-param.rs b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs new file mode 100644 index 00000000000..68201b77dbf --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs @@ -0,0 +1,29 @@ +// Tests that array sizes that depend on const-params are checked using `ConstEvaluatable`. +// revisions: full min + +#![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 unconstrained generic constant +//[min]~^^ ERROR generic parameters may not be used in const operations + +#[derive(PartialEq, Eq)] +struct Config { + arr_size: usize, +} + +struct B { + //[min]~^ ERROR `Config` is forbidden + arr: [u8; CFG.arr_size], + //[full]~^ ERROR overly complex generic constant + //[min]~^^ ERROR generic parameters may not be used in const operations +} + +const C: Config = Config { arr_size: 5 }; + +fn main() { + let b = B:: { arr: [1, 2, 3, 4, 5] }; + assert_eq!(b.arr.len(), 5); +} diff --git a/src/test/ui/const-generics/generic_const_exprs/associated-const.rs b/src/test/ui/const-generics/generic_const_exprs/associated-const.rs new file mode 100644 index 00000000000..a6777632254 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/associated-const.rs @@ -0,0 +1,11 @@ +// check-pass +struct Foo(T); +impl Foo { + const VALUE: usize = std::mem::size_of::(); +} + +fn test() { + let _ = [0; Foo::::VALUE]; +} + +fn main() {} 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 967d1b0f2ac..4d89f188ad7 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 ce92f908e06..15d618caef4 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 c682fee4fab..847843fe1a6 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 a8388fc541c..dfc69e0b068 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 4e3aeec9c5d..b08fffd6922 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 0dcafc6a789..e8bc703bda6 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 c10ed834f0f..098fa9e0447 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 c99cfa6f52f..3543960c3eb 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 45f63bad6fe..077f77aa0f4 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 3c6f01b6160..e4111157ecd 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 f9d78fd708c..80d0662f1f4 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 8acb7aaf34e..340e35e1c65 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 26dfcff5d3e..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.min.stderr deleted file mode 100644 index fccd6ea144b..00000000000 --- a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/feature-gate-generic_const_exprs.rs:5: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: 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 f49ca0251aa..10ab2fd867c 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.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr new file mode 100644 index 00000000000..2d60ebaa83a --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr @@ -0,0 +1,11 @@ +error: generic parameters may not be used in const operations + --> $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(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 a1b2a52a5a1..cbe4277df56 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 db097567a15..90953145944 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 d2e672bae4d..28de4f86467 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-generics/generic_const_exprs/function-call.rs b/src/test/ui/const-generics/generic_const_exprs/function-call.rs new file mode 100644 index 00000000000..b5de66621c5 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/function-call.rs @@ -0,0 +1,19 @@ +// check-pass + +const fn foo() -> usize { + // We might instead branch on `std::mem::size_of::<*mut T>() < 8` here, + // which would cause this function to fail on 32 bit systems. + if false { + std::mem::size_of::() + } else { + 8 + } +} + +fn test() { + let _ = [0; foo::()]; + //~^ WARN cannot use constants which depend on generic parameters in types + //~| WARN this was previously accepted by the compiler but is being phased out +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/function-call.stderr b/src/test/ui/const-generics/generic_const_exprs/function-call.stderr new file mode 100644 index 00000000000..0d8463714e8 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/function-call.stderr @@ -0,0 +1,12 @@ +warning: cannot use constants which depend on generic parameters in types + --> $DIR/function-call.rs:14:17 + | +LL | let _ = [0; foo::()]; + | ^^^^^^^^^^ + | + = note: `#[warn(const_evaluatable_unchecked)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #76200 + +warning: 1 warning emitted + diff --git a/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs index d3f140755f7..7120d6ee251 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 4c8fc7a3554..b8058c252e7 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/generic_const_exprs/issue-62504.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr new file mode 100644 index 00000000000..f2ae361dc81 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr @@ -0,0 +1,20 @@ +error[E0308]: mismatched types + --> $DIR/issue-62504.rs:18:21 + | +LL | ArrayHolder([0; Self::SIZE]) + | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` + | + = note: expected type `X` + found type `Self::SIZE` + +error: unconstrained generic constant + --> $DIR/issue-62504.rs:18:25 + | +LL | ArrayHolder([0; Self::SIZE]) + | ^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); Self::SIZE]:` + +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/generic_const_exprs/issue-62504.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr new file mode 100644 index 00000000000..5d45e302888 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr @@ -0,0 +1,20 @@ +error[E0308]: mismatched types + --> $DIR/issue-62504.rs:18:21 + | +LL | ArrayHolder([0; Self::SIZE]) + | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` + | + = note: expected array `[u32; X]` + found array `[u32; _]` + +error: constant expression depends on a generic parameter + --> $DIR/issue-62504.rs:18:25 + | +LL | ArrayHolder([0; Self::SIZE]) + | ^^^^^^^^^^ + | + = note: this may fail depending on what value the parameter takes + +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/generic_const_exprs/issue-62504.rs b/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs new file mode 100644 index 00000000000..a97f4b8ff31 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs @@ -0,0 +1,27 @@ +// revisions: full min +#![allow(incomplete_features)] +#![cfg_attr(full, feature(generic_const_exprs))] +#![cfg_attr(full, allow(incomplete_features))] + +trait HasSize { + const SIZE: usize; +} + +impl HasSize for ArrayHolder { + const SIZE: usize = X; +} + +struct ArrayHolder([u32; X]); + +impl ArrayHolder { + pub const fn new() -> Self { + ArrayHolder([0; Self::SIZE]) + //~^ ERROR mismatched types + //[full]~^^ ERROR unconstrained generic constant + //[min]~^^^ ERROR constant expression depends on a generic parameter + } +} + +fn main() { + let mut array = ArrayHolder::new(); +} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs b/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs new file mode 100644 index 00000000000..9b36699bbf1 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs @@ -0,0 +1,19 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +trait Bar {} +impl Bar for [u8; T] {} +//~^ ERROR expected value, found type parameter `T` + +struct Foo {} +impl Foo +where + [u8; N]: Bar<[(); N]>, +{ + fn foo() {} +} + +fn main() { + Foo::foo(); + //~^ ERROR the function or associated item +} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr new file mode 100644 index 00000000000..0ce7640f685 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr @@ -0,0 +1,22 @@ +error[E0423]: expected value, found type parameter `T` + --> $DIR/issue-69654.rs:5:25 + | +LL | impl Bar for [u8; T] {} + | ^ not a value + +error[E0599]: the function or associated item `foo` exists for struct `Foo<{_: usize}>`, but its trait bounds were not satisfied + --> $DIR/issue-69654.rs:17: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 2 previous errors + +Some errors have detailed explanations: E0423, E0599. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr new file mode 100644 index 00000000000..3c7a740e843 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr @@ -0,0 +1,65 @@ +error: generic parameters may not be used in const operations + --> $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(generic_const_exprs)]` to allow generic const expressions + +error: generic parameters may not be used in const operations + --> $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(generic_const_exprs)]` to allow generic const expressions + +error: generic parameters may not be used in const operations + --> $DIR/issue-72787.rs:25:25 + | +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(generic_const_exprs)]` to allow generic const expressions + +error: generic parameters may not be used in const operations + --> $DIR/issue-72787.rs:25:36 + | +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(generic_const_exprs)]` to allow generic const expressions + +error[E0283]: type annotations needed + --> $DIR/issue-72787.rs:21:26 + | +LL | IsLessOrEqual: True, + | ^^^^ cannot infer type for struct `IsLessOrEqual` + | + = note: cannot satisfy `IsLessOrEqual: True` +note: required by a bound in `True` + --> $DIR/issue-72787.rs:8:1 + | +LL | pub trait True {} + | ^^^^^^^^^^^^^^ required by this bound in `True` + +error[E0283]: type annotations needed + --> $DIR/issue-72787.rs:21:26 + | +LL | IsLessOrEqual: True, + | ^^^^ cannot infer type for struct `IsLessOrEqual` + | + = note: cannot satisfy `IsLessOrEqual: True` +note: required by a bound in `True` + --> $DIR/issue-72787.rs:8:1 + | +LL | pub trait True {} + | ^^^^^^^^^^^^^^ required by this bound in `True` + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs new file mode 100644 index 00000000000..77ad57f0640 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs @@ -0,0 +1,35 @@ +// [full] check-pass +// revisions: full min +#![cfg_attr(full, feature(generic_const_exprs))] +#![cfg_attr(full, allow(incomplete_features))] + +pub struct IsLessOrEqual; +pub struct Condition; +pub trait True {} + +impl True for IsLessOrEqual where + Condition<{ LHS <= RHS }>: True +//[min]~^ Error generic parameters may not be used in const operations +//[min]~| Error generic parameters may not be used in const operations +{ +} +impl True for Condition {} + +struct S; +impl S +where + IsLessOrEqual: True, +//[min]~^ Error type annotations needed [E0283] +//[min]~| Error type annotations needed [E0283] + IsLessOrEqual: True, + IsLessOrEqual<{ 8 - I }, { 8 - J }>: True, +//[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, +{ + fn print() { + println!("I {} J {}", I, J); + } +} + +fn main() {} 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 00000000000..d536f6fd1d5 --- /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/generic_const_exprs/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 new file mode 100644 index 00000000000..42671412fa7 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr @@ -0,0 +1,11 @@ +error: generic parameters may not be used in const operations + --> $DIR/issue-72819-generic-in-const-eval.rs:8:17 + | +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(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/issue-72819-generic-in-const-eval.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs new file mode 100644 index 00000000000..7a5aa9e47d4 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs @@ -0,0 +1,23 @@ +// 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(generic_const_exprs))] +#![cfg_attr(full, allow(incomplete_features))] + +struct Arr +where Assert::<{N < usize::MAX / 2}>: IsTrue, +//[min]~^ ERROR generic parameters may not be used in const operations +{ +} + +enum Assert {} + +trait IsTrue {} + +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/generic_const_exprs/issue-73899.rs b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs new file mode 100644 index 00000000000..d1ab1be0473 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs @@ -0,0 +1,20 @@ +// run-pass +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +trait Foo {} + +impl Foo for [(); N] where Self: FooImpl<{ N == 0 }> {} + +trait FooImpl {} + +impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {} + +impl FooImpl<{ 0u8 != 0u8 }> for [(); N] {} + +fn foo(_v: T) {} + +fn main() { + foo([]); + foo([()]); +} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs b/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs new file mode 100644 index 00000000000..cd1f7a9da68 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs @@ -0,0 +1,28 @@ +// check-pass +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +trait If {} +impl If for () {} + +trait IsZero { + type Answer; +} + +struct True; +struct False; + +impl IsZero for () +where (): If<{N == 0}> { + type Answer = True; +} + +trait Foobar {} + +impl Foobar for () +where (): IsZero {} + +impl Foobar for () +where (): IsZero {} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs new file mode 100644 index 00000000000..faa8b3d10de --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs @@ -0,0 +1,17 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +struct Bool; + +trait True {} + +impl True for Bool {} + +fn test() where Bool<{core::mem::size_of::() > 4}>: True { + todo!() +} + +fn main() { + test::<2>(); + //~^ ERROR this function takes 2 generic arguments +} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr new file mode 100644 index 00000000000..3b69a4066a9 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr @@ -0,0 +1,21 @@ +error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied + --> $DIR/issue-76595.rs:15:5 + | +LL | test::<2>(); + | ^^^^ - supplied 1 generic argument + | | + | expected 2 generic arguments + | +note: function defined here, with 2 generic parameters: `T`, `P` + --> $DIR/issue-76595.rs:10:4 + | +LL | fn test() where Bool<{core::mem::size_of::() > 4}>: True { + | ^^^^ - - +help: add missing generic argument + | +LL | test::<2, P>(); + | +++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs new file mode 100644 index 00000000000..2fa9a71fbb3 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs @@ -0,0 +1,21 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +// This test is a minimized reproduction for #79518 where +// during error handling for the type mismatch we would try +// to evaluate std::mem::size_of:: causing an ICE + +trait Foo { + type Assoc: PartialEq; + const AssocInstance: Self::Assoc; + + fn foo() + where + [(); std::mem::size_of::()]: , + { + Self::AssocInstance == [(); std::mem::size_of::()]; + //~^ Error: mismatched types + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr new file mode 100644 index 00000000000..c90774e944f --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/issue-79518-default_trait_method_normalization.rs:16:32 + | +LL | Self::AssocInstance == [(); std::mem::size_of::()]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); _]` + | + = note: expected associated type `::Assoc` + found array `[(); _]` + = help: consider constraining the associated type `::Assoc` to `[(); _]` or calling a method that returns `::Assoc` + = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html + +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_const_exprs/issue-80561-incorrect-param-env.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs new file mode 100644 index 00000000000..77d3c98dab9 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs @@ -0,0 +1,24 @@ +// check-pass +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +// This tests that the correct `param_env` is used so that +// attempting to normalize `Self::N` does not cause an ICE. + +pub struct Foo; + +impl Foo { + pub fn foo() {} +} + +pub trait Bar { + const N: usize; + fn bar() + where + [(); Self::N]: , + { + Foo::<{ Self::N }>::foo(); + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs new file mode 100644 index 00000000000..275f6995302 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs @@ -0,0 +1,32 @@ +// check-fail + +// This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place + +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] + +use std::fmt::Debug; +use std::marker::PhantomData; +use std::mem::size_of; + +struct Inline +where + [u8; size_of::() + 1]: , +{ + _phantom: PhantomData, + buf: [u8; size_of::() + 1], +} + +impl Inline +where + [u8; size_of::() + 1]: , +{ + pub fn new(val: T) -> Inline { + todo!() + } +} + +fn main() { + let dst = Inline::::new(0); //~ ERROR + //~^ ERROR +} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr new file mode 100644 index 00000000000..56cb11bacbe --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -0,0 +1,72 @@ +error[E0080]: evaluation of `Inline::::{constant#0}` failed + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +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:22:10 + | +LL | [u8; size_of::() + 1]: , + | -------------- 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:30:36 + | +LL | / struct Inline +LL | | where +LL | | [u8; size_of::() + 1]: , +LL | | { +LL | | _phantom: PhantomData, +LL | | buf: [u8; size_of::() + 1], +LL | | } + | |_- function or associated item `new` not found for this +... +LL | let dst = Inline::::new(0); + | ^^^ function or associated item cannot be called on `Inline` due to unsatisfied trait bounds + | + ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL + | +LL | pub trait Debug { + | --------------- doesn't satisfy `dyn Debug: Sized` + | + = note: the following trait bounds were not satisfied: + `dyn Debug: Sized` + +error[E0080]: evaluation of `Inline::::{constant#0}` failed + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +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:14:10 + | +LL | [u8; size_of::() + 1]: , + | -------------- 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: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:12:15 + | +LL | struct Inline + | ^ required by this bound in `Inline` +help: consider relaxing the implicit `Sized` restriction + | +LL | struct Inline + | ++++++++ + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0080, E0277, E0599. +For more information about an error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs b/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs new file mode 100644 index 00000000000..fac811d1302 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs @@ -0,0 +1,38 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +trait TensorDimension { + const DIM: usize; +} + +trait TensorSize: TensorDimension { + fn size(&self) -> [usize; Self::DIM]; +} + +trait Broadcastable: TensorSize + Sized { + type Element; + fn lazy_updim(&self, size: [usize; NEWDIM]) {} +} + +struct BMap<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> { + reference: &'a T, + closure: F, +} + +impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorDimension + for BMap<'a, R, T, F, DIM> +{ + const DIM: usize = DIM; +} +impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSize + for BMap<'a, R, T, F, DIM> +{ + fn size(&self) -> [usize; DIM] { + //~^ ERROR: method not compatible with trait [E0308] + self.reference.size() + //~^ ERROR: unconstrained generic constant + //~| ERROR: mismatched types + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr new file mode 100644 index 00000000000..ef785bf07eb --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr @@ -0,0 +1,29 @@ +error[E0308]: method not compatible with trait + --> $DIR/issue-83765.rs:30:5 + | +LL | fn size(&self) -> [usize; DIM] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM` + | + = note: expected type `Self::DIM` + found type `DIM` + +error: unconstrained generic constant + --> $DIR/issue-83765.rs:32:24 + | +LL | self.reference.size() + | ^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:` + +error[E0308]: mismatched types + --> $DIR/issue-83765.rs:32:9 + | +LL | self.reference.size() + | ^^^^^^^^^^^^^^^^^^^^^ expected `DIM`, found `Self::DIM` + | + = note: expected type `DIM` + found type `Self::DIM` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs b/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs new file mode 100644 index 00000000000..fb2e5590d21 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs @@ -0,0 +1,38 @@ +// Regression test for #84408. +// check-pass + +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +trait Melon { + fn new(arr: [i32; X]) -> Self; + fn change>(self) -> T; +} + +struct Foo([i32; 5]); +struct Bar([i32; A + B]) +where + [(); A + B]: ; + +impl Melon<5> for Foo { + fn new(arr: [i32; 5]) -> Self { + Foo(arr) + } + fn change>(self) -> T { + T::new(self.0) + } +} + +impl Melon<{ A + B }> for Bar +where + [(); A + B]: , +{ + fn new(arr: [i32; A + B]) -> Self { + Bar(arr) + } + fn change>(self) -> T { + T::new(self.0) + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs new file mode 100644 index 00000000000..771e68b0db5 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs @@ -0,0 +1,31 @@ +#![feature(const_fn_trait_bound, generic_const_exprs)] +#![allow(incomplete_features)] + +trait _Contains { + const does_contain: bool; +} + +trait Contains {} + +trait Delegates {} + +impl Delegates for T where T: Contains {} + +const fn contains() -> bool +where + A: _Contains, +{ + A::does_contain +} + +impl Contains() }> for U where T: _Contains {} + +fn writes_to_path(cap: &C) { + writes_to_specific_path(&cap); + //~^ ERROR: the trait bound `(): _Contains<&C>` is not satisfied [E0277] + //~| ERROR: unconstrained generic constant +} + +fn writes_to_specific_path>(cap: &C) {} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr new file mode 100644 index 00000000000..e51db35925e --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr @@ -0,0 +1,48 @@ +error[E0277]: the trait bound `(): _Contains<&C>` is not satisfied + --> $DIR/issue-85848.rs:24:5 + | +LL | writes_to_specific_path(&cap); + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `_Contains<&C>` is not implemented for `()` + | +note: required because of the requirements on the impl of `Contains<(), true>` for `&C` + --> $DIR/issue-85848.rs:21:12 + | +LL | impl Contains() }> for U where T: _Contains {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ +note: required because of the requirements on the impl of `Delegates<()>` for `&C` + --> $DIR/issue-85848.rs:12:12 + | +LL | impl Delegates for T where T: Contains {} + | ^^^^^^^^^^^^ ^ +note: required by a bound in `writes_to_specific_path` + --> $DIR/issue-85848.rs:29:31 + | +LL | fn writes_to_specific_path>(cap: &C) {} + | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` + +error: unconstrained generic constant + --> $DIR/issue-85848.rs:24:5 + | +LL | writes_to_specific_path(&cap); + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); { contains::() }]:` +note: required because of the requirements on the impl of `Contains<(), true>` for `&C` + --> $DIR/issue-85848.rs:21:12 + | +LL | impl Contains() }> for U where T: _Contains {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ +note: required because of the requirements on the impl of `Delegates<()>` for `&C` + --> $DIR/issue-85848.rs:12:12 + | +LL | impl Delegates for T where T: Contains {} + | ^^^^^^^^^^^^ ^ +note: required by a bound in `writes_to_specific_path` + --> $DIR/issue-85848.rs:29:31 + | +LL | fn writes_to_specific_path>(cap: &C) {} + | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` + +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/generic_const_exprs/less_than.rs b/src/test/ui/const-generics/generic_const_exprs/less_than.rs index 31fe9a53f03..2e9af1bf4f0 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 ea5c95a7444..cd5d76dd949 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-generics/generic_const_exprs/needs_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs new file mode 100644 index 00000000000..2bd3c801fbf --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs @@ -0,0 +1,14 @@ +#![crate_type = "lib"] +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +const fn complex_maths(n : usize) -> usize { + 2 * n + 1 +} + +struct Example { + a: [f32; N], + b: [f32; complex_maths::(N)], + //~^ ERROR unconstrained + c: T, +} diff --git a/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr new file mode 100644 index 00000000000..7b41e39b7d7 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr @@ -0,0 +1,10 @@ +error: unconstrained generic constant + --> $DIR/needs_where_clause.rs:11:6 + | +LL | b: [f32; complex_maths::(N)], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); complex_maths::(N)]:` + +error: aborting due to previous error + 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 e70bdad9084..7e5022817e4 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 aed3f476f1d..769e3ae6895 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 a86918adfa7..316887e5e7f 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 72fd39b96f8..d45a6465b76 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-generics/generic_const_exprs/no_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs new file mode 100644 index 00000000000..9c5de03170b --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs @@ -0,0 +1,29 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features, unused)] + +const fn complex_maths(n : usize) -> usize { + 2 * n + 1 +} + +pub struct Example { + a: [f32; N], + b: [f32; complex_maths(N)], + //~^ ERROR unconstrained generic +} + +impl Example { + pub fn new() -> Self { + Self { + a: [0.; N], + b: [0.; complex_maths(N)], + } + } +} + +impl Example<2> { + pub fn sum(&self) -> f32 { + self.a.iter().sum::() + self.b.iter().sum::() + } +} + +fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr new file mode 100644 index 00000000000..3e5c2f5cad1 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr @@ -0,0 +1,10 @@ +error: unconstrained generic constant + --> $DIR/no_where_clause.rs:10:6 + | +LL | b: [f32; complex_maths(N)], + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: try adding a `where` bound using this expression: `where [(); complex_maths(N)]:` + +error: aborting due to previous error + 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 81a634a4173..24d333aba0f 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 22ff9f41276..42c1cc507b5 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 e421c43dd94..c6c196db6f2 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 0ab8be80f37..f4c89f6235a 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.full.stderr b/src/test/ui/const-generics/generic_const_exprs/simple_fail.full.stderr deleted file mode 100644 index 1f2313a6028..00000000000 --- a/src/test/ui/const-generics/generic_const_exprs/simple_fail.full.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed - --> $DIR/simple_fail.rs:10: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 - | -LL | type Arr = [u8; N - 1]; - | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0080`. 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 f6192bbe9ca..00000000000 --- 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 db2f94b7fce..c47a350c7fb 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.stderr b/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr new file mode 100644 index 00000000000..99fc92fb4f0 --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed + --> $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:4:33 + | +LL | type Arr = [u8; N - 1]; + | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. 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 71c594657e0..d6574a3aa2f 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 abb9df16288..d058b363850 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 e0e373b62f9..c12fef083cc 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 c0da46d6d5f..67fefd07ec0 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 44b6530f22e..c1bf19e0f8d 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 1aa22698b64..7eb2c6a51fc 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.full.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr deleted file mode 100644 index ebc8f458f79..00000000000 --- a/src/test/ui/const-generics/impl-trait-with-const-arguments.full.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.min.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr deleted file mode 100644 index ebc8f458f79..00000000000 --- 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 2e6e49b9c0a..24ba393c17f 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.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr new file mode 100644 index 00000000000..6268a564b06 --- /dev/null +++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr @@ -0,0 +1,9 @@ +error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position + --> $DIR/impl-trait-with-const-arguments.rs:18: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/incorrect-number-of-const-args.full.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr deleted file mode 100644 index 7a12f3bdec2..00000000000 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.full.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.min.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr deleted file mode 100644 index 7a12f3bdec2..00000000000 --- 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 305559d93fd..de2d126afd7 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.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr new file mode 100644 index 00000000000..bf873dacd98 --- /dev/null +++ b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr @@ -0,0 +1,35 @@ +error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied + --> $DIR/incorrect-number-of-const-args.rs:6: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:1: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:9: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:1: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/infer/cannot-infer-const-args.full.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr deleted file mode 100644 index 01fb137dd6a..00000000000 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.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.min.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr deleted file mode 100644 index 01fb137dd6a..00000000000 --- 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 cc52892bd04..f85a72910af 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.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr new file mode 100644 index 00000000000..828f4972403 --- /dev/null +++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/cannot-infer-const-args.rs:6: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/method-chain.full.stderr b/src/test/ui/const-generics/infer/method-chain.full.stderr deleted file mode 100644 index 979d50b85f1..00000000000 --- a/src/test/ui/const-generics/infer/method-chain.full.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.min.stderr b/src/test/ui/const-generics/infer/method-chain.min.stderr deleted file mode 100644 index 979d50b85f1..00000000000 --- 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 8ac6a7d6267..0c5eed4894c 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.stderr b/src/test/ui/const-generics/infer/method-chain.stderr new file mode 100644 index 00000000000..53d92e5ae72 --- /dev/null +++ b/src/test/ui/const-generics/infer/method-chain.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $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` + | +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/one-param-uninferred.full.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.full.stderr deleted file mode 100644 index 31b7fc7ccf5..00000000000 --- a/src/test/ui/const-generics/infer/one-param-uninferred.full.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.min.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr deleted file mode 100644 index 31b7fc7ccf5..00000000000 --- 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 0e947131f4c..d6018650f53 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.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.stderr new file mode 100644 index 00000000000..acf59170c36 --- /dev/null +++ b/src/test/ui/const-generics/infer/one-param-uninferred.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $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` + | +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/uninferred-consts.full.stderr b/src/test/ui/const-generics/infer/uninferred-consts.full.stderr deleted file mode 100644 index bee4b693825..00000000000 --- a/src/test/ui/const-generics/infer/uninferred-consts.full.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.min.stderr b/src/test/ui/const-generics/infer/uninferred-consts.min.stderr deleted file mode 100644 index bee4b693825..00000000000 --- 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 bcd9aadb78a..657f4b51304 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.stderr b/src/test/ui/const-generics/infer/uninferred-consts.stderr new file mode 100644 index 00000000000..a6c79fc058a --- /dev/null +++ b/src/test/ui/const-generics/infer/uninferred-consts.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/uninferred-consts.rs:9: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_arg_from_pat.rs b/src/test/ui/const-generics/infer_arg_from_pat.rs index 5e2a3eaff54..10317a1b98f 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 0273383856f..40f6f5b8d55 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 96e5976e44b..2b8731ba709 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 3e90dbeece9..00000000000 --- 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 f1ea52825e0..604b4e8bddb 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 f24dd42eb2d..eedc619e805 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 32939dcd286..65741d07d90 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 f59eb60cb38..6a10ee267df 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 4a6b5784221..de3a4086025 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 8416d64e1c2..179643a7552 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 f7056f27cb3..179643a7552 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 bc9e1dee853..7cd8e13c8f5 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 c03b7252a3c..00000000000 --- 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 6e64c78cd8c..0066490dfa3 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 f18728eabbb..00000000000 --- 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 c93b296dbb5..beb37e63b5e 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 8f07d208091..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/issues/issue-61336-2.min.stderr deleted file mode 100644 index 9b62ffc9349..00000000000 --- a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr +++ /dev/null @@ -1,15 +0,0 @@ -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 - -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 a1cf641ff74..b7cd29f8932 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.stderr b/src/test/ui/const-generics/issues/issue-61336-2.stderr new file mode 100644 index 00000000000..48aaaf5e544 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-61336-2.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `T: Copy` is not satisfied + --> $DIR/issue-61336-2.rs:6: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 + +For more information about this error, try `rustc --explain E0277`. 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 4883463c2e6..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/issues/issue-61336.min.stderr deleted file mode 100644 index dc891842e13..00000000000 --- a/src/test/ui/const-generics/issues/issue-61336.min.stderr +++ /dev/null @@ -1,15 +0,0 @@ -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 - -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 c0106ee38c2..80be1d8e5e5 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.stderr b/src/test/ui/const-generics/issues/issue-61336.stderr new file mode 100644 index 00000000000..665a1a677a1 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-61336.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `T: Copy` is not satisfied + --> $DIR/issue-61336.rs:6: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 + +For more information about this error, try `rustc --explain E0277`. 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 ac6c378295d..00000000000 --- 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 421f696f3fd..0b9cf40d855 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 82b36de45a2..00000000000 --- 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 97ab07dacce..6192af82afb 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 56deec16548..00000000000 --- 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 6d6bca4255a..00000000000 --- 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 d4a948b9259..00000000000 --- 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 b7f66345c4a..00000000000 --- 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 cc8c4db9c39..00000000000 --- 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 3aa2e6a5c31..00000000000 --- 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 b970f4e4c8e..00000000000 --- 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 a635d5e84a2..00000000000 --- 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 ed861c63bf1..00000000000 --- 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 1a0e46e599d..fa76aeae901 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 373360c7ced..00000000000 --- 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 54a93733f32..00000000000 --- 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 c26784c9813..00000000000 --- 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 833e70ca6d3..00000000000 --- 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 1e90d0b3f50..00000000000 --- 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 e24cf36c8ce..00000000000 --- 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-62504.full.stderr b/src/test/ui/const-generics/issues/issue-62504.full.stderr deleted file mode 100644 index efbcdc3d2b7..00000000000 --- a/src/test/ui/const-generics/issues/issue-62504.full.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-62504.rs:18:21 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` - | - = note: expected type `X` - found type `Self::SIZE` - -error: constant expression depends on a generic parameter - --> $DIR/issue-62504.rs:18:25 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -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-62504.min.stderr b/src/test/ui/const-generics/issues/issue-62504.min.stderr deleted file mode 100644 index 5d45e302888..00000000000 --- a/src/test/ui/const-generics/issues/issue-62504.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-62504.rs:18:21 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` - | - = note: expected array `[u32; X]` - found array `[u32; _]` - -error: constant expression depends on a generic parameter - --> $DIR/issue-62504.rs:18:25 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -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-62504.rs b/src/test/ui/const-generics/issues/issue-62504.rs deleted file mode 100644 index 1b70cd1c376..00000000000 --- a/src/test/ui/const-generics/issues/issue-62504.rs +++ /dev/null @@ -1,26 +0,0 @@ -// revisions: full min -#![allow(incomplete_features)] -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -trait HasSize { - const SIZE: usize; -} - -impl HasSize for ArrayHolder { - const SIZE: usize = X; -} - -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 - } -} - -fn main() { - let mut array = ArrayHolder::new(); -} 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 5c9387d4012..00000000000 --- 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 46813f5256e..00000000000 --- 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 08f6454fa2d..f074a65313f 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 e4a71fe0618..af3bd412433 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 fb6257696b9..8eaa31249aa 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 2fb38addb2d..dcb4c703895 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 334e2aac02a..076a16821e5 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 abb26d6cf17..00000000000 --- 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 8cb9981a534..00000000000 --- 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 96d19203109..00000000000 --- 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 8c603b74b90..969289b26e8 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 6552aea4ad1..00000000000 --- 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 7e150f5f6db..00000000000 --- 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 1dd4baaa5b5..00000000000 --- 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 14249b62cee..00000000000 --- a/src/test/ui/const-generics/issues/issue-66205.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] -#![allow(dead_code, unconditional_recursion)] - -fn fact() { - fact::<{ N - 1 }>(); - //[full]~^ ERROR constant expression depends on a generic parameter - //[min]~^^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr deleted file mode 100644 index e96b9e70352..00000000000 --- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/issue-66596-impl-trait-for-str-const-arg.rs:8:25 - | -LL | trait Trait { - | ^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(const_generics)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs index 2a741ba87a9..a506fceb4ef 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 a871b118dcc..a0b3f912207 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 ed35a5f7c0a..69425b25eae 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.full.stderr b/src/test/ui/const-generics/issues/issue-67185-2.full.stderr deleted file mode 100644 index 19f419c82fd..00000000000 --- a/src/test/ui/const-generics/issues/issue-67185-2.full.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.min.stderr b/src/test/ui/const-generics/issues/issue-67185-2.min.stderr deleted file mode 100644 index 19f419c82fd..00000000000 --- 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 94a713d7cf9..c1a04e20147 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.stderr b/src/test/ui/const-generics/issues/issue-67185-2.stderr new file mode 100644 index 00000000000..7167bea94bb --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-67185-2.stderr @@ -0,0 +1,111 @@ +error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied + --> $DIR/issue-67185-2.rs:12: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:12: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:22: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:16: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:22: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:15: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:26: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:15: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:26: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:16: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-67375.full.stderr b/src/test/ui/const-generics/issues/issue-67375.full.stderr index 0fe65272f1b..5386ef56a24 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 c005e03f20c..5256d96c876 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 a8875b8b6bf..b5b842a15ae 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 dcbe5b94a62..f1a426c3c58 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 e4960e56c9e..de0eb7f509a 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 63c50b5ca54..1edc7828caa 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 70e2518ca2a..eee04eb75a2 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 84737e4e985..7b7e8428639 100644 --- a/src/test/ui/const-generics/issues/issue-67945-1.rs +++ b/src/test/ui/const-generics/issues/issue-67945-1.rs @@ -1,11 +1,8 @@ // revisions: full min - #![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - -use std::marker::PhantomData; +#![cfg_attr(full, feature(generic_const_exprs))] -use std::mem::{self, MaybeUninit}; +use std::mem::MaybeUninit; struct Bug { //~^ ERROR parameter `S` is never used diff --git a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr index b9004060231..118cf447c01 100644 --- a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr +++ b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr @@ -1,27 +1,17 @@ -error[E0308]: mismatched types - --> $DIR/issue-67945-2.rs:11:20 +error: overly complex generic constant + --> $DIR/issue-67945-2.rs:7:13 | -LL | struct Bug { - | - this type parameter -... -LL | let x: S = MaybeUninit::uninit(); - | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit` - | | - | expected due to this +LL | A: [(); { + | _____________^ +LL | | +LL | | let x: Option> = None; + | | ---- unsupported rvalue +LL | | +LL | | 0 +LL | | }], + | |_____^ | - = note: expected type parameter `S` - found union `MaybeUninit<_>` + = help: consider moving this anonymous constant into a `const` function -error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-2.rs:8:12 - | -LL | struct Bug { - | ^ unused parameter - | - = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `S` to be a const parameter, use `const S: usize` instead - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0308, E0392. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-67945-2.min.stderr b/src/test/ui/const-generics/issues/issue-67945-2.min.stderr index 24476d4fac8..6e07af1e672 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 - -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[E0392]: parameter `S` is never used - --> $DIR/issue-67945-2.rs:8:12 - | -LL | struct Bug { - | ^ unused parameter - | - = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `S` to be a const parameter, use `const S: usize` instead +LL | let x: Option> = None; + | ^^^^ -error: aborting due to 3 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issues/issue-67945-2.rs b/src/test/ui/const-generics/issues/issue-67945-2.rs index 4a46786e9a9..cbb4e14eccf 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 fa66252bd69..00000000000 --- 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 5c30429c895..00000000000 --- 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 5bad61cfc76..00000000000 --- 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 43c3999133c..ad5710baae2 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 9519b23b484..9f370b0f510 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 37afed62327..4c2741ab433 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 0bb23be1eb4..c3c9141e424 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 4782b1d98eb..040f65a8eda 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 ddea3e8ab65..5d0f9ae0b1d 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 d0c190b91b0..3f4153f3f35 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 56afd9b2a15..4dbc56b4bd2 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 25dcd88a4af..00000000000 --- 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 78da8412cdf..00000000000 --- 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 a0ffcc84c7a..00000000000 --- 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 45318ca68fc..63d7fde78ac 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 a82a60696b3..00000000000 --- 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-69654.rs b/src/test/ui/const-generics/issues/issue-69654.rs deleted file mode 100644 index b1214b12a14..00000000000 --- a/src/test/ui/const-generics/issues/issue-69654.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![feature(const_generics)] -#![allow(incomplete_features)] - -trait Bar {} -impl Bar for [u8; T] {} -//~^ ERROR expected value, found type parameter `T` - -struct Foo {} -impl Foo -where - [u8; N]: Bar<[(); N]>, -{ - fn foo() {} -} - -fn main() { - Foo::foo(); - //~^ ERROR the function or associated item -} diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/issues/issue-69654.stderr deleted file mode 100644 index 0ce7640f685..00000000000 --- a/src/test/ui/const-generics/issues/issue-69654.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0423]: expected value, found type parameter `T` - --> $DIR/issue-69654.rs:5:25 - | -LL | impl Bar for [u8; T] {} - | ^ not a value - -error[E0599]: the function or associated item `foo` exists for struct `Foo<{_: usize}>`, but its trait bounds were not satisfied - --> $DIR/issue-69654.rs:17: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 2 previous errors - -Some errors have detailed explanations: E0423, E0599. -For more information about an error, try `rustc --explain E0423`. 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 5c118d245a1..0027cd46a51 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 f82131262d6..cfd5e784ec4 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 9e912b69177..3961941f81f 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 f0554823273..2ec37cc3a1b 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 21cefc09c25..95e54842874 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 8f8d753d0a7..d458d7b2e87 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 189a32570f7..a7648824917 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 7b1a2f98dfe..1f5880f368e 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 1c6e08adffd..ed360c96f28 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 a574da4b6b3..f949bc979ba 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 78dee1717f1..57fd72b1284 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 00000000000..27754061086 --- /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 f015d694695..b24bc241d42 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 3a56db937de..5663012dc63 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 6468d0b6bda..c82916e85a2 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 6bfdba5711e..6f0a98ead88 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 9cd95c11026..8e292356f7e 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 fbb7ae59bef..00000000000 --- 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-72787.min.stderr b/src/test/ui/const-generics/issues/issue-72787.min.stderr deleted file mode 100644 index 6314650e0d8..00000000000 --- a/src/test/ui/const-generics/issues/issue-72787.min.stderr +++ /dev/null @@ -1,65 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-72787.rs:10: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 - -error: generic parameters may not be used in const operations - --> $DIR/issue-72787.rs:10: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 - -error: generic parameters may not be used in const operations - --> $DIR/issue-72787.rs:25:25 - | -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 - -error: generic parameters may not be used in const operations - --> $DIR/issue-72787.rs:25:36 - | -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 - -error[E0283]: type annotations needed - --> $DIR/issue-72787.rs:21:26 - | -LL | IsLessOrEqual: True, - | ^^^^ cannot infer type for struct `IsLessOrEqual` - | - = note: cannot satisfy `IsLessOrEqual: True` -note: required by a bound in `True` - --> $DIR/issue-72787.rs:7:1 - | -LL | pub trait True {} - | ^^^^^^^^^^^^^^ required by this bound in `True` - -error[E0283]: type annotations needed - --> $DIR/issue-72787.rs:21:26 - | -LL | IsLessOrEqual: True, - | ^^^^ cannot infer type for struct `IsLessOrEqual` - | - = note: cannot satisfy `IsLessOrEqual: True` -note: required by a bound in `True` - --> $DIR/issue-72787.rs:7:1 - | -LL | pub trait True {} - | ^^^^^^^^^^^^^^ required by this bound in `True` - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/const-generics/issues/issue-72787.rs b/src/test/ui/const-generics/issues/issue-72787.rs deleted file mode 100644 index 16bc9470470..00000000000 --- a/src/test/ui/const-generics/issues/issue-72787.rs +++ /dev/null @@ -1,39 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(const_generics))] -#![cfg_attr(full, allow(incomplete_features))] - -pub struct IsLessOrEqual; -pub struct Condition; -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 -{ -} -impl True for Condition {} - -struct S; -impl S -where - IsLessOrEqual: True, -//[min]~^ Error type annotations needed [E0283] -//[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 - // Condition<{ 8 - I <= 8 - J }>: True, -{ - fn print() { - println!("I {} J {}", I, J); - } -} - -fn main() {} 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 82f9b9d346d..00000000000 --- 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-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr deleted file mode 100644 index 70adabea561..00000000000 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-72819-generic-in-const-eval.rs:8:17 - | -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 - -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/issues/issue-72819-generic-in-const-eval.rs deleted file mode 100644 index f612d8bd3f6..00000000000 --- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs +++ /dev/null @@ -1,22 +0,0 @@ -// 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, 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 -{ -} - -enum Assert {} - -trait IsTrue {} - -impl IsTrue for Assert {} - -fn main() { - let x: Arr<{usize::MAX}> = Arr {}; -} diff --git a/src/test/ui/const-generics/issues/issue-73120.rs b/src/test/ui/const-generics/issues/issue-73120.rs index c153a93cdef..050dc9bde64 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 04e4e9cd52b..d762f9c8b26 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 6a912ffc3c0..f1fc50e6e59 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 c8f2e0dadc1..2b470f5eaec 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 c7cb92baf30..2108661ab25 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 81691a14ef6..00000000000 --- 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 81691a14ef6..00000000000 --- 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 f02c4161dc1..00000000000 --- 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-73899.rs b/src/test/ui/const-generics/issues/issue-73899.rs deleted file mode 100644 index ece8eb2c9ec..00000000000 --- a/src/test/ui/const-generics/issues/issue-73899.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![feature(const_generics)] -#![allow(incomplete_features)] - -trait Foo {} - -impl Foo for [(); N] where Self: FooImpl<{ N == 0 }> {} - -trait FooImpl {} - -impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {} - -impl FooImpl<{ 0u8 != 0u8 }> for [(); N] {} - -fn foo(_v: T) {} - -fn main() { - foo([]); - foo([()]); -} 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 a7f0ecf0a26..b8fe9736ba5 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 d4fd72eb6da..f976912e11c 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 62ad43974f4..9099b61e63b 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 75a876c27e5..cfb2b703ddc 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.rs b/src/test/ui/const-generics/issues/issue-74634.rs deleted file mode 100644 index 0f23fa92c36..00000000000 --- a/src/test/ui/const-generics/issues/issue-74634.rs +++ /dev/null @@ -1,27 +0,0 @@ -#![feature(const_generics)] -#![allow(incomplete_features)] - -trait If {} -impl If for () {} - -trait IsZero { - type Answer; -} - -struct True; -struct False; - -impl IsZero for () -where (): If<{N == 0}> { //~ERROR constant expression - type Answer = True; -} - -trait Foobar {} - -impl Foobar for () -where (): IsZero {} - -impl Foobar for () -where (): IsZero {} - -fn main() {} 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 091a1ac7b99..00000000000 --- 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 dc3c33736da..cc1f2853fb2 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 4e640ff857e..eaf02e1bd47 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 91e5cc776fa..941335518a8 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 3c1c3ea97b5..7a8c817c0d6 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 97437748177..e8be1e30051 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 9d3f25b3b47..83ef09af88e 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 c311de05a1c..400c034a927 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-76595.rs b/src/test/ui/const-generics/issues/issue-76595.rs deleted file mode 100644 index 6e9af5bbb30..00000000000 --- a/src/test/ui/const-generics/issues/issue-76595.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features)] - -struct Bool; - -trait True {} - -impl True for Bool {} - -fn test() where Bool<{core::mem::size_of::() > 4}>: True { - todo!() -} - -fn main() { - test::<2>(); - //~^ ERROR this function takes 2 generic arguments -} diff --git a/src/test/ui/const-generics/issues/issue-76595.stderr b/src/test/ui/const-generics/issues/issue-76595.stderr deleted file mode 100644 index 3b69a4066a9..00000000000 --- a/src/test/ui/const-generics/issues/issue-76595.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied - --> $DIR/issue-76595.rs:15:5 - | -LL | test::<2>(); - | ^^^^ - supplied 1 generic argument - | | - | expected 2 generic arguments - | -note: function defined here, with 2 generic parameters: `T`, `P` - --> $DIR/issue-76595.rs:10:4 - | -LL | fn test() where Bool<{core::mem::size_of::() > 4}>: True { - | ^^^^ - - -help: add missing generic argument - | -LL | test::<2, P>(); - | +++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0107`. 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 88b8ff89ffe..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr deleted file mode 100644 index efff3f42a3e..00000000000 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-76701-ty-param-in-const.rs:5: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 - -error: generic parameters may not be used in const operations - --> $DIR/issue-76701-ty-param-in-const.rs:11: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 - -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 99489826563..2e6b0223656 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.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr new file mode 100644 index 00000000000..3b53e18e6f5 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr @@ -0,0 +1,20 @@ +error: generic parameters may not be used in const operations + --> $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(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: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(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-79518-default_trait_method_normalization.rs b/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs deleted file mode 100644 index b0bd3d8a2c9..00000000000 --- a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features)] - -// This test is a minimized reproduction for #79518 where -// during error handling for the type mismatch we would try -// to evaluate std::mem::size_of:: causing an ICE - -trait Foo { - type Assoc: PartialEq; - const AssocInstance: Self::Assoc; - - fn foo() - where - [(); std::mem::size_of::()]: , - { - Self::AssocInstance == [(); std::mem::size_of::()]; - //~^ Error: mismatched types - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr b/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr deleted file mode 100644 index c90774e944f..00000000000 --- a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-79518-default_trait_method_normalization.rs:16:32 - | -LL | Self::AssocInstance == [(); std::mem::size_of::()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); _]` - | - = note: expected associated type `::Assoc` - found array `[(); _]` - = help: consider constraining the associated type `::Assoc` to `[(); _]` or calling a method that returns `::Assoc` - = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-80062.stderr b/src/test/ui/const-generics/issues/issue-80062.stderr index c714253b909..754f18d5cc4 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 f80029680ff..5409002a9fd 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-80561-incorrect-param-env.rs b/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs deleted file mode 100644 index 1b9967a7b49..00000000000 --- a/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs +++ /dev/null @@ -1,24 +0,0 @@ -// check-pass -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features)] - -// This tests that the correct `param_env` is used so that -// attempting to normalize `Self::N` does not cause an ICE. - -pub struct Foo; - -impl Foo { - pub fn foo() {} -} - -pub trait Bar { - const N: usize; - fn bar() - where - [(); Self::N]: , - { - Foo::<{ Self::N }>::foo(); - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-83765.rs b/src/test/ui/const-generics/issues/issue-83765.rs deleted file mode 100644 index e2b859c0f85..00000000000 --- a/src/test/ui/const-generics/issues/issue-83765.rs +++ /dev/null @@ -1,38 +0,0 @@ -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features)] - -trait TensorDimension { - const DIM: usize; -} - -trait TensorSize: TensorDimension { - fn size(&self) -> [usize; Self::DIM]; -} - -trait Broadcastable: TensorSize + Sized { - type Element; - fn lazy_updim(&self, size: [usize; NEWDIM]) {} -} - -struct BMap<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> { - reference: &'a T, - closure: F, -} - -impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorDimension - for BMap<'a, R, T, F, DIM> -{ - const DIM: usize = DIM; -} -impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSize - for BMap<'a, R, T, F, DIM> -{ - fn size(&self) -> [usize; DIM] { - //~^ ERROR: method not compatible with trait [E0308] - self.reference.size() - //~^ ERROR: unconstrained generic constant - //~| ERROR: mismatched types - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/issues/issue-83765.stderr deleted file mode 100644 index ef785bf07eb..00000000000 --- a/src/test/ui/const-generics/issues/issue-83765.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0308]: method not compatible with trait - --> $DIR/issue-83765.rs:30:5 - | -LL | fn size(&self) -> [usize; DIM] { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM` - | - = note: expected type `Self::DIM` - found type `DIM` - -error: unconstrained generic constant - --> $DIR/issue-83765.rs:32:24 - | -LL | self.reference.size() - | ^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:` - -error[E0308]: mismatched types - --> $DIR/issue-83765.rs:32:9 - | -LL | self.reference.size() - | ^^^^^^^^^^^^^^^^^^^^^ expected `DIM`, found `Self::DIM` - | - = note: expected type `DIM` - found type `Self::DIM` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issues/issue-84408.rs b/src/test/ui/const-generics/issues/issue-84408.rs deleted file mode 100644 index fb49cba2a34..00000000000 --- a/src/test/ui/const-generics/issues/issue-84408.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Regression test for #84408. -// check-pass - -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features)] - -trait Melon { - fn new(arr: [i32; X]) -> Self; - fn change>(self) -> T; -} - -struct Foo([i32; 5]); -struct Bar([i32; A + B]) -where - [(); A + B]: ; - -impl Melon<5> for Foo { - fn new(arr: [i32; 5]) -> Self { - Foo(arr) - } - fn change>(self) -> T { - T::new(self.0) - } -} - -impl Melon<{ A + B }> for Bar -where - [(); A + B]: , -{ - fn new(arr: [i32; A + B]) -> Self { - Bar(arr) - } - fn change>(self) -> T { - T::new(self.0) - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-85848.rs b/src/test/ui/const-generics/issues/issue-85848.rs deleted file mode 100644 index 4d75fdb7d1d..00000000000 --- a/src/test/ui/const-generics/issues/issue-85848.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![feature(const_generics, const_fn_trait_bound, generic_const_exprs)] -#![allow(incomplete_features)] - -trait _Contains { - const does_contain: bool; -} - -trait Contains {} - -trait Delegates {} - -impl Delegates for T where T: Contains {} - -const fn contains() -> bool -where - A: _Contains, -{ - A::does_contain -} - -impl Contains() }> for U where T: _Contains {} - -fn writes_to_path(cap: &C) { - writes_to_specific_path(&cap); - //~^ ERROR: the trait bound `(): _Contains<&C>` is not satisfied [E0277] - //~| ERROR: unconstrained generic constant -} - -fn writes_to_specific_path>(cap: &C) {} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-85848.stderr b/src/test/ui/const-generics/issues/issue-85848.stderr deleted file mode 100644 index e51db35925e..00000000000 --- a/src/test/ui/const-generics/issues/issue-85848.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0277]: the trait bound `(): _Contains<&C>` is not satisfied - --> $DIR/issue-85848.rs:24:5 - | -LL | writes_to_specific_path(&cap); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `_Contains<&C>` is not implemented for `()` - | -note: required because of the requirements on the impl of `Contains<(), true>` for `&C` - --> $DIR/issue-85848.rs:21:12 - | -LL | impl Contains() }> for U where T: _Contains {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ -note: required because of the requirements on the impl of `Delegates<()>` for `&C` - --> $DIR/issue-85848.rs:12:12 - | -LL | impl Delegates for T where T: Contains {} - | ^^^^^^^^^^^^ ^ -note: required by a bound in `writes_to_specific_path` - --> $DIR/issue-85848.rs:29:31 - | -LL | fn writes_to_specific_path>(cap: &C) {} - | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` - -error: unconstrained generic constant - --> $DIR/issue-85848.rs:24:5 - | -LL | writes_to_specific_path(&cap); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { contains::() }]:` -note: required because of the requirements on the impl of `Contains<(), true>` for `&C` - --> $DIR/issue-85848.rs:21:12 - | -LL | impl Contains() }> for U where T: _Contains {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ -note: required because of the requirements on the impl of `Delegates<()>` for `&C` - --> $DIR/issue-85848.rs:12:12 - | -LL | impl Delegates for T where T: Contains {} - | ^^^^^^^^^^^^ ^ -note: required by a bound in `writes_to_specific_path` - --> $DIR/issue-85848.rs:29:31 - | -LL | fn writes_to_specific_path>(cap: &C) {} - | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` - -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/issues/issue-87076.rs b/src/test/ui/const-generics/issues/issue-87076.rs index 5dfda943bf6..05ba266d2d8 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 0aaeaffb4cb..5294cc3b5f4 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 2c411a3bdc5..6da5395ef83 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 b29e853510b..00000000000 --- 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/macro_rules-braces.min.stderr b/src/test/ui/const-generics/macro_rules-braces.min.stderr deleted file mode 100644 index f6d8020f3fb..00000000000 --- a/src/test/ui/const-generics/macro_rules-braces.min.stderr +++ /dev/null @@ -1,60 +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: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:36: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 - -error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:40: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 - -error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:45: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 - -error: generic parameters may not be used in const operations - --> $DIR/macro_rules-braces.rs:50: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 - -error: aborting due to 6 previous errors - diff --git a/src/test/ui/const-generics/macro_rules-braces.rs b/src/test/ui/const-generics/macro_rules-braces.rs deleted file mode 100644 index 605a10880bb..00000000000 --- a/src/test/ui/const-generics/macro_rules-braces.rs +++ /dev/null @@ -1,77 +0,0 @@ -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(const_generics))] - -mod m { - pub const P: usize = 0; -} - -const Q: usize = 0; - -fn test() { - struct Foo; - macro_rules! foo { - ($x:expr) => { - [u8; $x] //[full]~ ERROR constant expression depends - } - } - macro_rules! bar { - ($x:expr) => { - [u8; { $x }] //[full]~ ERROR constant expression depends - } - } - macro_rules! baz { - ( $x:expr) => { - Foo<$x> //[full]~ ERROR constant expression depends - } - } - macro_rules! biz { - ($x:expr) => { - Foo<{ $x }> //[full]~ ERROR constant expression depends - }; - } - - let _: foo!(N); - let _: foo!({ N }); - let _: foo!({{ N }}); //[min]~ 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!(Q); - let _: bar!(m::P); - let _: baz!(N); - let _: baz!({ N }); - let _: baz!({{ N }}); //[min]~ 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!(Q); - let _: biz!(m::P); - let _: foo!(3); - let _: foo!({ 3 }); - let _: foo!({{ 3 }}); - let _: bar!(3); - let _: bar!({ 3 }); - let _: baz!(3); - let _: baz!({ 3 }); - let _: baz!({{ 3 }}); - let _: biz!(3); - let _: biz!({ 3 }); - let _: foo!(10 + 7); - let _: foo!({ 10 + 7 }); - let _: foo!({{ 10 + 7 }}); - let _: bar!(10 + 7); - let _: bar!({ 10 + 7 }); - let _: baz!(10 + 7); //~ ERROR expressions must be enclosed in braces - let _: baz!({ 10 + 7 }); - let _: baz!({{ 10 + 7 }}); - let _: biz!(10 + 7); - let _: biz!({ 10 + 7 }); -} - -fn main() { - test::<3>(); -} 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 8d9246fe56f..bf0d0f352eb 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 a658a7b3956..12ffbd53ab0 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 ae82c85eb7e..bba4e68d4cc 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 f7a2e484fc6..1a333642f0c 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 881f8b98aad..6215b7d936c 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 5def54ca26d..5f641b07095 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 cc114f70239..16a7687c00b 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 647ef5400cb..13e1a232b3a 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 435a63a5283..2adfa9a8c4b 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 6a5739db3ae..00000000000 --- 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 6defd393ba0..c435344580a 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 be8ebb7f401..b3d62d64f3b 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 671f1103dcc..f9b56bd387a 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 552b1b2a66a..c6324bca124 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 c1ac7eec1e7..6b8e688fba8 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 6ded9f13bc4..9d12250c914 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 2d00141fbf7..9a73f1a53e5 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 2e306f8c4c8..0d38bd39351 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 9c7f5ab91ed..03c2f54861b 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 961aeefd550..383ab4cd8c9 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 1c5ff9175f3..17defbe86aa 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 76c1b84aef5..b24a7afabd9 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 4d94b789a6c..b87e3960fc9 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 5ac5161ca8f..ed81c01bb17 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 ca7d33c0eb9..302dd47e9b7 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 a04c6d5e64e..35ff7768a91 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 166a35ee455..0a4581afc29 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 f020e2bf66f..7f740005e04 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 ed39a0c56b4..00000000000 --- 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 bf1bf8af922..3a7eb464630 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 86e6159fdb5..1af866694ab 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 deaab830e91..21e0bb48cd8 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 db998033c0a..00000000000 --- 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 db998033c0a..00000000000 --- 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 32970ccaa5d..be1c4b0e8e8 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 47617c7849f..67f497af505 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 30d05c708e1..2cdef3fb452 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 f735be9c24e..14af8d77a5f 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 3147d61ec9b..1a63bec7b6f 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 bf855d4dcaa..8c990577f3d 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 920c067dc1a..68d1940160c 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 cd9c3ae7bbc..5dfcbba0e59 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 4997d493bbb..e844148346f 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 417fe2501ae..7216b25f0df 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 2ece25bb41b..08b6d4bf554 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 4a2c303095e..27dd51de241 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 a1163fca8d4..b26f551eb86 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 75ddd839f66..cbb6b398e01 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 b3585d5fc10..933ca027609 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 df7c277f605..c72d9fbec2d 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 5fb571f2394..346ac4b72cc 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 f3516d1de96..d845bc610cf 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 33735ef87c5..638e7a88d67 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.full.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.full.stderr deleted file mode 100644 index 8ac9bab6320..00000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71382.full.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.min.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr deleted file mode 100644 index 8ac9bab6320..00000000000 --- 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 b3677613dbc..1c4073e3668 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.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.stderr new file mode 100644 index 00000000000..ad522aead90 --- /dev/null +++ b/src/test/ui/const-generics/type-dependent/issue-71382.stderr @@ -0,0 +1,8 @@ +error: using function pointers as const generic parameters is forbidden + --> $DIR/issue-71382.rs:12:23 + | +LL | fn test u8>(&self) -> u8 { + | ^^^^^^^^^^ + +error: aborting due to previous error + 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 3701e14eadc..060b899648e 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 5d7dcb9c458..5e1b8c63537 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 9e4afba3114..b755de30b9c 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 b61e970cfb3..2d678d0acd3 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 a4776a43b21..1b13133b5b9 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 a0a14558490..02108d85960 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 a0a14558490..02108d85960 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 7fba1afe918..3335ab870f4 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 9a2e9f09319..fb0d688a8ab 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 480ecdb3873..565c9ba1ff1 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 c19c8db737a..ec9221d2486 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 14cef083d83..c2092c4268e 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 9592f266230..c7270e835c5 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 4bab2bb5a77..191caa78f9e 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.full.stderr b/src/test/ui/const-generics/unknown_adt.full.stderr deleted file mode 100644 index b8b2e90aa66..00000000000 --- a/src/test/ui/const-generics/unknown_adt.full.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.min.stderr b/src/test/ui/const-generics/unknown_adt.min.stderr deleted file mode 100644 index b8b2e90aa66..00000000000 --- 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 977f90aad11..8cdd28a8c60 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.stderr b/src/test/ui/const-generics/unknown_adt.stderr new file mode 100644 index 00000000000..0f462dd4728 --- /dev/null +++ b/src/test/ui/const-generics/unknown_adt.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `UnknownStruct` in this scope + --> $DIR/unknown_adt.rs:2: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/unused-const-param.rs b/src/test/ui/const-generics/unused-const-param.rs index 2918e399dc8..c7f74cfac7d 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 836f26efc96..d080c210e6b 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 8899139aa6b..00000000000 --- 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.min.stderr b/src/test/ui/const-generics/unused_braces.min.stderr deleted file mode 100644 index 8899139aa6b..00000000000 --- a/src/test/ui/const-generics/unused_braces.min.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 0348bbacaab..47f0f8c1c96 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.stderr b/src/test/ui/const-generics/unused_braces.stderr new file mode 100644 index 00000000000..5e1bace5492 --- /dev/null +++ b/src/test/ui/const-generics/unused_braces.stderr @@ -0,0 +1,14 @@ +warning: unnecessary braces around const expression + --> $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:3:9 + | +LL | #![warn(unused_braces)] + | ^^^^^^^^^^^^^ + +warning: 1 warning emitted + 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 dfb593a9507..00000000000 --- 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 bc4c3f01ea9..00000000000 --- 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 8a5b6ddfe26..00000000000 --- 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 dc09cad3180..aa3ca1cf6de 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/const_evaluatable/associated-const.rs b/src/test/ui/const_evaluatable/associated-const.rs deleted file mode 100644 index a6777632254..00000000000 --- a/src/test/ui/const_evaluatable/associated-const.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass -struct Foo(T); -impl Foo { - const VALUE: usize = std::mem::size_of::(); -} - -fn test() { - let _ = [0; Foo::::VALUE]; -} - -fn main() {} diff --git a/src/test/ui/const_evaluatable/function-call.rs b/src/test/ui/const_evaluatable/function-call.rs deleted file mode 100644 index b5de66621c5..00000000000 --- a/src/test/ui/const_evaluatable/function-call.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-pass - -const fn foo() -> usize { - // We might instead branch on `std::mem::size_of::<*mut T>() < 8` here, - // which would cause this function to fail on 32 bit systems. - if false { - std::mem::size_of::() - } else { - 8 - } -} - -fn test() { - let _ = [0; foo::()]; - //~^ WARN cannot use constants which depend on generic parameters in types - //~| WARN this was previously accepted by the compiler but is being phased out -} - -fn main() {} diff --git a/src/test/ui/const_evaluatable/function-call.stderr b/src/test/ui/const_evaluatable/function-call.stderr deleted file mode 100644 index 0d8463714e8..00000000000 --- a/src/test/ui/const_evaluatable/function-call.stderr +++ /dev/null @@ -1,12 +0,0 @@ -warning: cannot use constants which depend on generic parameters in types - --> $DIR/function-call.rs:14:17 - | -LL | let _ = [0; foo::()]; - | ^^^^^^^^^^ - | - = note: `#[warn(const_evaluatable_unchecked)]` on by default - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #76200 - -warning: 1 warning emitted - diff --git a/src/test/ui/const_evaluatable/needs_where_clause.rs b/src/test/ui/const_evaluatable/needs_where_clause.rs deleted file mode 100644 index e8a625101d6..00000000000 --- a/src/test/ui/const_evaluatable/needs_where_clause.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![crate_type = "lib"] -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features)] - -const fn complex_maths(n : usize) -> usize { - 2 * n + 1 -} - -struct Example { - a: [f32; N], - b: [f32; complex_maths::(N)], - //~^ ERROR unconstrained - c: T, -} diff --git a/src/test/ui/const_evaluatable/needs_where_clause.stderr b/src/test/ui/const_evaluatable/needs_where_clause.stderr deleted file mode 100644 index 7b41e39b7d7..00000000000 --- a/src/test/ui/const_evaluatable/needs_where_clause.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/needs_where_clause.rs:11:6 - | -LL | b: [f32; complex_maths::(N)], - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); complex_maths::(N)]:` - -error: aborting due to previous error - diff --git a/src/test/ui/const_evaluatable/no_where_clause.rs b/src/test/ui/const_evaluatable/no_where_clause.rs deleted file mode 100644 index 6ae517af0d5..00000000000 --- a/src/test/ui/const_evaluatable/no_where_clause.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![feature(const_generics, generic_const_exprs)] -#![allow(incomplete_features, unused)] - -const fn complex_maths(n : usize) -> usize { - 2 * n + 1 -} - -pub struct Example { - a: [f32; N], - b: [f32; complex_maths(N)], - //~^ ERROR unconstrained generic -} - -impl Example { - pub fn new() -> Self { - Self { - a: [0.; N], - b: [0.; complex_maths(N)], - } - } -} - -impl Example<2> { - pub fn sum(&self) -> f32 { - self.a.iter().sum::() + self.b.iter().sum::() - } -} - -fn main() {} diff --git a/src/test/ui/const_evaluatable/no_where_clause.stderr b/src/test/ui/const_evaluatable/no_where_clause.stderr deleted file mode 100644 index 3e5c2f5cad1..00000000000 --- a/src/test/ui/const_evaluatable/no_where_clause.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/no_where_clause.rs:10:6 - | -LL | b: [f32; complex_maths(N)], - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); complex_maths(N)]:` - -error: aborting due to previous error - diff --git a/src/test/ui/consts/const-needs_drop-monomorphic.rs b/src/test/ui/consts/const-needs_drop-monomorphic.rs index 9f66e3cfa23..7402c680985 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 0770d06e15b..6e56d20c39d 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 c7677f81b5f..e4e10468d53 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 c3735658aa7..7ea8a39129e 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 ee0c3525b62..0a7a631606e 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 21f005aa49f..8f1b5b38e4c 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 8996df8ae10..4f5e236a37b 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 30745814b4a..04f5e5d4257 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 f915f6edef5..067e8c57cd6 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 ba359271940..75c9fa6c98d 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 60220be6b57..9860df3352a 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 06364eebef9..00000000000 --- 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 ed19109b38b..00000000000 --- 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 00000000000..8a3bcf25963 --- /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/feature-gates/feature-gate-const_param_types.stderr b/src/test/ui/feature-gates/feature-gate-const_param_types.stderr new file mode 100644 index 00000000000..5452186a3ae --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-const_param_types.stderr @@ -0,0 +1,11 @@ +error: `&'static str` is forbidden as the type of a const generic parameter + --> $DIR/feature-gate-const_param_types.rs:1:24 + | +LL | struct Foo; + | ^^^^^^^^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + = 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 7ea12e74e1e..ab09ebcae71 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 d319ae6403f..3b6216c3e63 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 4ca6d199835..00000000000 --- 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 81e9b1b36e0..3634ee004f7 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 b351b8b73a0..00000000000 --- 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 50eab7dcc97..00000000000 --- 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 4de872e8441..00000000000 --- 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 d71844eafde..7626f827fc5 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 a687a9e3be1..6376c429b28 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 5e97339f148..df244f02dce 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 d65e9f05904..3c78dd6c780 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 d75996bf0b3..00000000000 --- 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/mir/issue-80742.rs b/src/test/ui/mir/issue-80742.rs deleted file mode 100644 index cfd87bd9769..00000000000 --- a/src/test/ui/mir/issue-80742.rs +++ /dev/null @@ -1,33 +0,0 @@ -// check-fail - -// This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] -#![feature(const_generics)] - -use std::fmt::Debug; -use std::marker::PhantomData; -use std::mem::size_of; - -struct Inline -where - [u8; size_of::() + 1]: , -{ - _phantom: PhantomData, - buf: [u8; size_of::() + 1], -} - -impl Inline -where - [u8; size_of::() + 1]: , -{ - pub fn new(val: T) -> Inline { - todo!() - } -} - -fn main() { - let dst = Inline::::new(0); //~ ERROR - //~^ ERROR -} diff --git a/src/test/ui/mir/issue-80742.stderr b/src/test/ui/mir/issue-80742.stderr deleted file mode 100644 index b2b40bea708..00000000000 --- a/src/test/ui/mir/issue-80742.stderr +++ /dev/null @@ -1,72 +0,0 @@ -error[E0080]: evaluation of `Inline::::{constant#0}` failed - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -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 - | -LL | [u8; size_of::() + 1]: , - | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:23: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 - | -LL | / struct Inline -LL | | where -LL | | [u8; size_of::() + 1]: , -LL | | { -LL | | _phantom: PhantomData, -LL | | buf: [u8; size_of::() + 1], -LL | | } - | |_- function or associated item `new` not found for this -... -LL | let dst = Inline::::new(0); - | ^^^ function or associated item cannot be called on `Inline` due to unsatisfied trait bounds - | - ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL - | -LL | pub trait Debug { - | --------------- doesn't satisfy `dyn Debug: Sized` - | - = note: the following trait bounds were not satisfied: - `dyn Debug: Sized` - -error[E0080]: evaluation of `Inline::::{constant#0}` failed - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -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 - | -LL | [u8; size_of::() + 1]: , - | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:15:10 - -error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time - --> $DIR/issue-80742.rs:31: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 - | -LL | struct Inline - | ^ required by this bound in `Inline` -help: consider relaxing the implicit `Sized` restriction - | -LL | struct Inline - | ++++++++ - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0080, E0277, E0599. -For more information about an error, try `rustc --explain E0080`. 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 d895981050a..00000000000 --- 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 f20605e1b9a..2f41beeb969 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 266b6e62afd..d0ee8932996 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 04c279de29e..cbc1b63fbc4 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 e379e32c1fc..03d0bbb6afe 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 9eb34fb7349..f295cf15d08 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 c59055ba9d6..c4e566a42d0 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 f09ab3bf919..f96c04841dd 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 7f8151db06f..7ed572f80b8 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 b3c9246486e..b0b3464c610 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 b48915adc68..5ec4352919e 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 353da8fd20b..00000000000 --- 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 d6ed5f61a00..45c10b37816 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 c100e020c54..0e02883f67a 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 e82d40d33cd..5c06254143d 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 10a39a49147..cb46db83606 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 7539cbada8b..00000000000 --- 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 af111dd39fa..906350f5103 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 9da6a0f18e6..ec677e46b55 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 d53f562e99f..0ade36dafa4 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 e0c1b023861..00000000000 --- 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 3ba04af9046..00000000000 --- 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 e45950c4926..a4e40f516dc 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 7ea5efd4e6b..641cce26d99 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 918121cce9d..00000000000 --- 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 394b4280ab9..00000000000 --- 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 8c6ea3b3421..00000000000 --- 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 d0176b1e36d..00000000000 --- 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 9f1bffff77c..7ee5f7b068f 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 eb0c296bb62..5b42f10a6ee 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 74d5c0c9688..00000000000 --- 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 348563b94de..00000000000 --- 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 16b1830e985..00000000000 --- 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 6ba28c3463a..00000000000 --- 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 31e53e846d5..405e3039e7d 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 9bb2e227fc1..e3b3b27a6fc 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 8b20997fdf8..8b0c0f304fc 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 6d2cbb6ad96..aa60d0504e5 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 0accb516f5f..baa7eec0546 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 63c211f39fa..b89cc6451bb 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(); -- cgit 1.4.1-3-g733a5