From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/const-generics/apit-with-const-param.rs | 7 - src/test/ui/const-generics/arg-in-pat-1.rs | 23 -- src/test/ui/const-generics/arg-in-pat-2.rs | 10 - src/test/ui/const-generics/arg-in-pat-3.rs | 43 --- src/test/ui/const-generics/argument_order.rs | 15 - src/test/ui/const-generics/argument_order.stderr | 18 -- .../array-impls/alloc-traits-impls-length-32.rs | 48 --- .../array-impls/alloc-traits-impls-length-33.rs | 40 --- .../array-impls/alloc-types-impls-length-33.rs | 25 -- .../array-impls/core-traits-impls-length-32.rs | 66 ---- .../array-impls/core-traits-impls-length-33.rs | 66 ---- .../array-impls/into-iter-impls-length-32.rs | 40 --- .../array-impls/into-iter-impls-length-33.rs | 40 --- .../ui/const-generics/array-wrapper-struct-ctor.rs | 14 - .../const-generics/associated-type-bound-fail.rs | 12 - .../associated-type-bound-fail.stderr | 16 - .../ui/const-generics/associated-type-bound.rs | 19 -- .../const-generics/auxiliary/const_generic_lib.rs | 7 - src/test/ui/const-generics/auxiliary/crayte.rs | 16 - .../const-generics/auxiliary/generics_of_parent.rs | 23 -- .../auxiliary/generics_of_parent_impl_trait.rs | 8 - .../auxiliary/legacy-const-generics.rs | 6 - .../backcompat/trait-resolution-breakage.rs | 18 -- .../backcompat/unevaluated-consts.rs | 18 -- .../ui/const-generics/bad-const-generic-exprs.rs | 22 -- .../const-generics/bad-const-generic-exprs.stderr | 59 ---- src/test/ui/const-generics/broken-mir-1.rs | 13 - src/test/ui/const-generics/broken-mir-2.rs | 10 - .../cannot-infer-type-for-const-param.rs | 10 - src/test/ui/const-generics/coerce_unsized_array.rs | 8 - .../ui/const-generics/concrete-const-as-fn-arg.rs | 11 - .../const-generics/concrete-const-impl-method.rs | 21 -- .../const-generics/condition-in-trait-const-arg.rs | 14 - .../const-arg-in-const-arg.full.stderr | 162 ---------- .../const-arg-in-const-arg.min.stderr | 359 --------------------- .../ui/const-generics/const-arg-in-const-arg.rs | 60 ---- src/test/ui/const-generics/const-arg-in-fn.rs | 9 - .../const-arg-type-arg-misordered.rs | 8 - .../const-arg-type-arg-misordered.stderr | 9 - .../const-argument-cross-crate-mismatch.rs | 10 - .../const-argument-cross-crate-mismatch.stderr | 31 -- .../const-generics/const-argument-cross-crate.rs | 13 - .../const-argument-if-length.full.stderr | 35 -- .../const-argument-if-length.min.stderr | 36 --- .../ui/const-generics/const-argument-if-length.rs | 22 -- .../const-argument-non-static-lifetime.min.stderr | 12 - .../const-argument-non-static-lifetime.rs | 21 -- .../ui/const-generics/const-fn-with-const-param.rs | 10 - .../const-generic-default-wont-borrowck.rs | 5 - .../const-generic-default-wont-borrowck.stderr | 16 - .../ui/const-generics/const-generic-function.rs | 21 -- .../const-generics/const-generic-function.stderr | 54 ---- .../ui/const-generics/const-generic-type_name.rs | 8 - .../const-param-after-const-literal-arg.rs | 7 - .../const-param-before-other-params.rs | 7 - .../const-param-before-other-params.stderr | 8 - .../const-param-elided-lifetime.full.stderr | 33 -- .../const-param-elided-lifetime.min.stderr | 78 ----- .../const-generics/const-param-elided-lifetime.rs | 30 -- src/test/ui/const-generics/const-param-in-async.rs | 31 -- ...t-param-type-depends-on-const-param.full.stderr | 15 - ...st-param-type-depends-on-const-param.min.stderr | 33 -- .../const-param-type-depends-on-const-param.rs | 19 -- ...nst-param-type-depends-on-type-param-ungated.rs | 9 - ...param-type-depends-on-type-param-ungated.stderr | 9 - ...st-param-type-depends-on-type-param.full.stderr | 19 -- ...nst-param-type-depends-on-type-param.min.stderr | 19 -- .../const-param-type-depends-on-type-param.rs | 15 - .../const-parameter-uppercase-lint.rs | 7 - .../const-parameter-uppercase-lint.stderr | 14 - .../const-generics/const_trait_fn-issue-88433.rs | 27 -- src/test/ui/const-generics/core-types.rs | 50 --- src/test/ui/const-generics/cross_crate_complex.rs | 23 -- .../defaults/auxiliary/const_defaulty.rs | 11 - .../auxiliary/trait_object_lt_defaults_lib.rs | 1 - .../complex-generic-default-expr.min.stderr | 20 -- .../defaults/complex-generic-default-expr.rs | 12 - .../defaults/complex-unord-param.min.stderr | 8 - .../const-generics/defaults/complex-unord-param.rs | 17 - .../ui/const-generics/defaults/const-default.rs | 24 -- .../defaults/const-param-as-default-value.rs | 21 -- .../defaults/const-param-in-ty-defaults.rs | 12 - .../const-generics/defaults/default-annotation.rs | 17 - .../default-const-param-cannot-reference-self.rs | 14 - ...efault-const-param-cannot-reference-self.stderr | 21 -- .../ui/const-generics/defaults/default-on-impl.rs | 6 - .../const-generics/defaults/default-on-impl.stderr | 8 - .../defaults/default-param-wf-concrete.rs | 3 - .../defaults/default-param-wf-concrete.stderr | 9 - .../ui/const-generics/defaults/doesnt_infer.rs | 13 - .../ui/const-generics/defaults/doesnt_infer.stderr | 14 - src/test/ui/const-generics/defaults/external.rs | 24 -- .../ui/const-generics/defaults/forward-declared.rs | 13 - .../defaults/forward-declared.stderr | 27 -- .../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 -- .../const-generics/defaults/intermixed-lifetime.rs | 9 - .../defaults/intermixed-lifetime.stderr | 14 - src/test/ui/const-generics/defaults/mismatch.rs | 22 -- .../ui/const-generics/defaults/mismatch.stderr | 58 ---- .../defaults/mismatched_ty_const_in_trait_impl.rs | 41 --- .../mismatched_ty_const_in_trait_impl.stderr | 68 ---- .../param-order-err-pretty-prints-default.rs | 4 - .../param-order-err-pretty-prints-default.stderr | 8 - .../const-generics/defaults/pretty-printing-ast.rs | 11 - .../defaults/pretty-printing-ast.stdout | 18 -- .../const-generics/defaults/repr-c-issue-82792.rs | 11 - .../ui/const-generics/defaults/rp_impl_trait.rs | 29 -- .../const-generics/defaults/rp_impl_trait_fail.rs | 30 -- .../defaults/rp_impl_trait_fail.stderr | 36 --- .../ui/const-generics/defaults/self-referential.rs | 4 - .../defaults/self-referential.stderr | 11 - .../ui/const-generics/defaults/simple-defaults.rs | 13 - .../defaults/trait_object_lt_defaults.rs | 24 -- .../ui/const-generics/defaults/trait_objects.rs | 43 --- .../const-generics/defaults/trait_objects_fail.rs | 30 -- .../defaults/trait_objects_fail.stderr | 21 -- .../defaults/type-default-const-param-name.rs | 14 - src/test/ui/const-generics/defaults/wfness.rs | 23 -- src/test/ui/const-generics/defaults/wfness.stderr | 34 -- src/test/ui/const-generics/defaults/wrong-order.rs | 9 - .../ui/const-generics/defaults/wrong-order.stderr | 14 - .../ui/const-generics/deref-into-array-generic.rs | 27 -- .../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 | 22 -- .../dont-evaluate-array-len-on-err-1.stderr | 9 - src/test/ui/const-generics/dyn-supertraits.rs | 80 ----- .../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 ---- src/test/ui/const-generics/enum-variants.rs | 24 -- src/test/ui/const-generics/exhaustive-value.rs | 267 --------------- src/test/ui/const-generics/exhaustive-value.stderr | 20 -- .../expose-default-substs-param-env.rs | 9 - .../float-generic.adt_const_params.stderr | 11 - src/test/ui/const-generics/float-generic.rs | 12 - .../ui/const-generics/float-generic.simple.stderr | 11 - .../const-generics/fn-const-param-call.full.stderr | 15 - .../const-generics/fn-const-param-call.min.stderr | 14 - src/test/ui/const-generics/fn-const-param-call.rs | 22 -- .../fn-const-param-infer.full.stderr | 9 - .../const-generics/fn-const-param-infer.min.stderr | 8 - src/test/ui/const-generics/fn-const-param-infer.rs | 29 -- .../forbid-non-structural_match-types.rs | 13 - .../forbid-non-structural_match-types.stderr | 9 - .../const-generics/foreign-item-const-parameter.rs | 7 - .../foreign-item-const-parameter.stderr | 19 -- .../ui/const-generics/generic-param-mismatch.rs | 5 - .../const-generics/generic-param-mismatch.stderr | 14 - .../generic_arg_infer/array-repeat-expr.rs | 13 - .../generic_arg_infer/dont-use-defaults.rs | 15 - .../generic_arg_infer/in-signature.rs | 61 ---- .../generic_arg_infer/in-signature.stderr | 119 ------- .../generic_arg_infer/infer-arg-test.rs | 22 -- .../generic_arg_infer/infer-arg-test.stderr | 24 -- .../generic_arg_infer/infer_arg_and_const_arg.rs | 12 - .../generic_arg_infer/issue-91614.rs | 8 - .../generic_arg_infer/issue-91614.stderr | 20 -- .../abstract-const-as-cast-1.rs | 18 -- .../abstract-const-as-cast-2.rs | 20 -- .../abstract-const-as-cast-2.stderr | 26 -- .../abstract-const-as-cast-3.rs | 47 --- .../abstract-const-as-cast-3.stderr | 187 ----------- .../abstract-const-as-cast-4.rs | 29 -- .../abstract-consts-as-cast-5.rs | 11 - .../abstract-consts-as-cast-5.stderr | 10 - .../array-size-in-generic-struct-param.full.stderr | 19 -- .../array-size-in-generic-struct-param.min.stderr | 29 -- .../array-size-in-generic-struct-param.rs | 29 -- .../const_equate_assoc_consts.rs | 27 -- .../doesnt_unify_evaluatable.rs | 15 - .../doesnt_unify_evaluatable.stderr | 10 - .../dropck_unifies_assoc_consts.rs | 20 -- .../assoc_const_unification/unifies_evaluatable.rs | 18 -- .../generic_const_exprs/associated-const.rs | 11 - .../generic_const_exprs/associated-consts.rs | 31 -- .../auxiliary/const_evaluatable_lib.rs | 9 - .../auxiliary/issue-94287-aux.rs | 21 -- .../const-generics/generic_const_exprs/closures.rs | 6 - .../generic_const_exprs/closures.stderr | 26 -- .../const_eval_resolve_canonical.rs | 28 -- .../const_kind_expr/wf_obligation.rs | 22 -- .../const_kind_expr/wf_obligation.stderr | 20 -- .../generic_const_exprs/cross_crate.rs | 15 - .../generic_const_exprs/cross_crate_predicate.rs | 14 - .../cross_crate_predicate.stderr | 54 ---- .../dependence_lint.full.stderr | 39 --- .../generic_const_exprs/dependence_lint.gce.stderr | 34 -- .../generic_const_exprs/dependence_lint.rs | 26 -- .../generic_const_exprs/different-fn.rs | 17 - .../generic_const_exprs/different-fn.stderr | 20 -- .../const-generics/generic_const_exprs/division.rs | 11 - .../dont-eagerly-error-in-is-const-evaluatable.rs | 16 - .../generic_const_exprs/drop_impl.rs | 16 - .../generic_const_exprs/elaborate-trait-pred.rs | 24 -- .../generic_const_exprs/eval-privacy.rs | 26 -- .../generic_const_exprs/eval-privacy.stderr | 12 - .../generic_const_exprs/eval-try-unify.rs | 26 -- .../generic_const_exprs/eval-try-unify.stderr | 11 - .../generic_const_exprs/evaluated-to-ambig.rs | 22 -- .../feature-gate-generic_const_exprs.rs | 11 - .../feature-gate-generic_const_exprs.stderr | 11 - .../const-generics/generic_const_exprs/fn_call.rs | 30 -- .../generic_const_exprs/from-sig-fail.rs | 11 - .../generic_const_exprs/from-sig-fail.stderr | 9 - .../const-generics/generic_const_exprs/from-sig.rs | 14 - .../generic_const_exprs/function-call.rs | 20 -- .../generic_const_exprs/function-call.stderr | 12 - .../generic_const_exprs/impl-bounds.rs | 25 -- .../generic_const_exprs/infer-too-generic.rs | 24 -- .../generic_const_exprs/issue-100217.rs | 42 --- .../generic_const_exprs/issue-100360.rs | 13 - .../generic_const_exprs/issue-102074.rs | 23 -- .../generic_const_exprs/issue-102768.rs | 14 - .../generic_const_exprs/issue-102768.stderr | 33 -- .../generic_const_exprs/issue-62504.full.stderr | 20 -- .../generic_const_exprs/issue-62504.min.stderr | 27 -- .../generic_const_exprs/issue-62504.rs | 27 -- .../generic_const_exprs/issue-69654.rs | 19 -- .../generic_const_exprs/issue-69654.stderr | 24 -- .../generic_const_exprs/issue-72787.min.stderr | 55 ---- .../generic_const_exprs/issue-72787.rs | 35 -- .../issue-72819-generic-in-const-eval.full.stderr | 35 -- .../issue-72819-generic-in-const-eval.min.stderr | 11 - .../issue-72819-generic-in-const-eval.rs | 23 -- .../generic_const_exprs/issue-73298.rs | 23 -- .../generic_const_exprs/issue-73899.rs | 20 -- .../generic_const_exprs/issue-74634.rs | 28 -- .../generic_const_exprs/issue-74713.rs | 8 - .../generic_const_exprs/issue-74713.stderr | 22 -- .../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-82268.rs | 73 ----- .../generic_const_exprs/issue-83765.rs | 38 --- .../generic_const_exprs/issue-83765.stderr | 34 -- .../generic_const_exprs/issue-83972.rs | 38 --- .../generic_const_exprs/issue-84408.rs | 38 --- .../generic_const_exprs/issue-84669.rs | 30 -- .../generic_const_exprs/issue-85848.rs | 32 -- .../generic_const_exprs/issue-85848.stderr | 63 ---- .../generic_const_exprs/issue-86710.rs | 73 ----- .../generic_const_exprs/issue-89851.rs | 12 - .../generic_const_exprs/issue-90847.rs | 9 - .../generic_const_exprs/issue-94287.rs | 10 - .../generic_const_exprs/issue-94287.stderr | 15 - .../generic_const_exprs/issue-97047-ice-1.rs | 25 -- .../generic_const_exprs/issue-97047-ice-1.stderr | 19 -- .../generic_const_exprs/issue-97047-ice-2.rs | 23 -- .../generic_const_exprs/issue-97047-ice-2.stderr | 19 -- .../generic_const_exprs/issue-99705.rs | 33 -- .../generic_const_exprs/less_than.rs | 14 - .../generic_const_exprs/let-bindings.rs | 15 - .../generic_const_exprs/let-bindings.stderr | 20 -- .../generic_const_exprs/needs_where_clause.rs | 14 - .../generic_const_exprs/needs_where_clause.stderr | 10 - .../nested-abstract-consts-1.rs | 24 -- .../nested-abstract-consts-2.rs | 35 -- .../nested_uneval_unification-1.rs | 34 -- .../nested_uneval_unification-2.rs | 29 -- .../generic_const_exprs/no_dependence.rs | 13 - .../generic_const_exprs/no_where_clause.rs | 29 -- .../generic_const_exprs/no_where_clause.stderr | 10 - .../normed_to_param_is_evaluatable.rs | 12 - .../generic_const_exprs/object-safety-err-ret.rs | 21 -- .../object-safety-err-ret.stderr | 18 -- .../object-safety-err-where-bounds.rs | 22 -- .../object-safety-err-where-bounds.stderr | 24 -- .../object-safety-ok-infer-err.rs | 21 -- .../object-safety-ok-infer-err.stderr | 19 -- .../generic_const_exprs/object-safety-ok.rs | 21 -- .../generic_const_exprs/obligation-cause.rs | 24 -- .../generic_const_exprs/obligation-cause.stderr | 20 -- .../generic_const_exprs/simple_fail.rs | 17 - .../generic_const_exprs/simple_fail.stderr | 15 - .../subexprs_are_const_evalutable.rs | 17 - .../generic_const_exprs/ty-alias-substitution.rs | 14 - .../generic_const_exprs/unify-op-with-fn-call.rs | 35 -- .../unify-op-with-fn-call.stderr | 10 - .../ui/const-generics/generic_const_exprs/unop.rs | 14 - .../unused-complex-default-expr.rs | 6 - .../generic_const_exprs/unused_expr.rs | 25 -- .../generic_const_exprs/unused_expr.stderr | 29 -- src/test/ui/const-generics/ice-68875.rs | 11 - src/test/ui/const-generics/ice-68875.stderr | 8 - .../ice-const-generic-function-return-ty.rs | 5 - .../ice-const-generic-function-return-ty.stderr | 8 - .../ui/const-generics/impl-const-generic-struct.rs | 12 - .../incorrect-number-of-const-args.rs | 11 - .../incorrect-number-of-const-args.stderr | 35 -- .../infer/cannot-infer-const-args.rs | 7 - .../infer/cannot-infer-const-args.stderr | 14 - src/test/ui/const-generics/infer/issue-77092.rs | 14 - .../ui/const-generics/infer/issue-77092.stderr | 14 - src/test/ui/const-generics/infer/method-chain.rs | 16 - .../ui/const-generics/infer/method-chain.stderr | 14 - .../const-generics/infer/one-param-uninferred.rs | 11 - .../infer/one-param-uninferred.stderr | 14 - .../ui/const-generics/infer/uninferred-consts.rs | 11 - .../const-generics/infer/uninferred-consts.stderr | 14 - src/test/ui/const-generics/infer_arg_from_pat.rs | 25 -- .../ui/const-generics/infer_arr_len_from_pat.rs | 11 - .../ui/const-generics/inhabited-assoc-ty-ice-1.rs | 28 -- .../ui/const-generics/inhabited-assoc-ty-ice-2.rs | 21 -- .../integer-literal-generic-arg-in-where-clause.rs | 18 -- ...trinsics-type_name-as-const-argument.min.stderr | 20 -- .../intrinsics-type_name-as-const-argument.rs | 21 -- .../invalid-const-arg-for-type-param.rs | 14 - .../invalid-const-arg-for-type-param.stderr | 48 --- .../ui/const-generics/invalid-constant-in-args.rs | 6 - .../const-generics/invalid-constant-in-args.stderr | 17 - src/test/ui/const-generics/invalid-enum.rs | 35 -- src/test/ui/const-generics/invalid-enum.stderr | 75 ----- src/test/ui/const-generics/invariant.rs | 34 -- src/test/ui/const-generics/invariant.stderr | 26 -- src/test/ui/const-generics/issue-102124.rs | 20 -- src/test/ui/const-generics/issue-46511.rs | 8 - src/test/ui/const-generics/issue-46511.stderr | 21 -- src/test/ui/const-generics/issue-66451.rs | 28 -- src/test/ui/const-generics/issue-66451.stderr | 20 -- src/test/ui/const-generics/issue-70408.rs | 13 - src/test/ui/const-generics/issue-80471.rs | 13 - src/test/ui/const-generics/issue-80471.stderr | 18 -- src/test/ui/const-generics/issue-93647.rs | 6 - src/test/ui/const-generics/issue-93647.stderr | 12 - src/test/ui/const-generics/issue-97007.rs | 88 ----- .../issues/auxiliary/const_generic_issues_lib.rs | 15 - .../const-generics/issues/auxiliary/impl-const.rs | 9 - src/test/ui/const-generics/issues/issue-100313.rs | 21 -- .../ui/const-generics/issues/issue-100313.stderr | 20 -- .../issues/issue-56445-1.full.stderr | 11 - .../const-generics/issues/issue-56445-1.min.stderr | 20 -- src/test/ui/const-generics/issues/issue-56445-1.rs | 13 - src/test/ui/const-generics/issues/issue-56445-2.rs | 11 - .../ui/const-generics/issues/issue-56445-2.stderr | 14 - src/test/ui/const-generics/issues/issue-56445-3.rs | 12 - .../ui/const-generics/issues/issue-56445-3.stderr | 8 - .../issues/issue-60818-struct-constructors.rs | 7 - src/test/ui/const-generics/issues/issue-61336-1.rs | 9 - src/test/ui/const-generics/issues/issue-61336-2.rs | 13 - .../ui/const-generics/issues/issue-61336-2.stderr | 15 - src/test/ui/const-generics/issues/issue-61336.rs | 13 - .../ui/const-generics/issues/issue-61336.stderr | 15 - src/test/ui/const-generics/issues/issue-61422.rs | 24 -- src/test/ui/const-generics/issues/issue-61432.rs | 9 - .../issue-62187-encountered-polymorphic-const.rs | 12 - .../const-generics/issues/issue-62878.full.stderr | 9 - .../const-generics/issues/issue-62878.min.stderr | 18 -- src/test/ui/const-generics/issues/issue-62878.rs | 11 - .../issues/issue-63322-forbid-dyn.full.stderr | 9 - .../issues/issue-63322-forbid-dyn.min.stderr | 11 - .../issues/issue-63322-forbid-dyn.rs | 17 - src/test/ui/const-generics/issues/issue-64519.rs | 17 - .../issue-66596-impl-trait-for-str-const-arg.rs | 16 - src/test/ui/const-generics/issues/issue-66906.rs | 9 - src/test/ui/const-generics/issues/issue-67185-1.rs | 29 -- src/test/ui/const-generics/issues/issue-67185-2.rs | 31 -- .../ui/const-generics/issues/issue-67185-2.stderr | 99 ------ .../const-generics/issues/issue-67375.full.stderr | 12 - .../const-generics/issues/issue-67375.min.stderr | 21 -- src/test/ui/const-generics/issues/issue-67375.rs | 12 - .../const-generics/issues/issue-67739.full.stderr | 10 - .../const-generics/issues/issue-67739.min.stderr | 10 - src/test/ui/const-generics/issues/issue-67739.rs | 18 -- .../issues/issue-67945-1.full.stderr | 17 - .../const-generics/issues/issue-67945-1.min.stderr | 30 -- src/test/ui/const-generics/issues/issue-67945-1.rs | 19 -- .../issues/issue-67945-2.full.stderr | 17 - .../const-generics/issues/issue-67945-2.min.stderr | 8 - 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 | 21 -- src/test/ui/const-generics/issues/issue-67945-3.rs | 17 - .../issues/issue-67945-4.full.stderr | 16 - .../const-generics/issues/issue-67945-4.min.stderr | 21 -- src/test/ui/const-generics/issues/issue-67945-4.rs | 16 - .../issues/issue-68104-print-stack-overflow.rs | 13 - .../const-generics/issues/issue-68366.full.stderr | 21 -- .../const-generics/issues/issue-68366.min.stderr | 30 -- src/test/ui/const-generics/issues/issue-68366.rs | 20 -- src/test/ui/const-generics/issues/issue-68596.rs | 15 - .../issues/issue-68615-adt.min.stderr | 11 - .../ui/const-generics/issues/issue-68615-adt.rs | 13 - .../issues/issue-68615-array.min.stderr | 11 - .../ui/const-generics/issues/issue-68615-array.rs | 13 - .../const-generics/issues/issue-69654-run-pass.rs | 15 - src/test/ui/const-generics/issues/issue-70125-1.rs | 17 - src/test/ui/const-generics/issues/issue-70125-2.rs | 12 - src/test/ui/const-generics/issues/issue-70167.rs | 6 - .../issues/issue-70180-1-stalled_on.rs | 33 -- .../issues/issue-70180-2-stalled_on.rs | 33 -- src/test/ui/const-generics/issues/issue-70225.rs | 19 -- .../const-generics/issues/issue-70273-assoc-fn.rs | 14 - .../const-generics/issues/issue-71169.full.stderr | 9 - .../const-generics/issues/issue-71169.min.stderr | 18 -- src/test/ui/const-generics/issues/issue-71169.rs | 11 - src/test/ui/const-generics/issues/issue-71202.rs | 31 -- .../ui/const-generics/issues/issue-71202.stderr | 33 -- .../const-generics/issues/issue-71381.full.stderr | 28 -- .../const-generics/issues/issue-71381.min.stderr | 27 -- src/test/ui/const-generics/issues/issue-71381.rs | 36 --- .../const-generics/issues/issue-71382.full.stderr | 9 - .../const-generics/issues/issue-71382.min.stderr | 8 - src/test/ui/const-generics/issues/issue-71382.rs | 25 -- src/test/ui/const-generics/issues/issue-71547.rs | 18 -- .../const-generics/issues/issue-71611.full.stderr | 16 - .../const-generics/issues/issue-71611.min.stderr | 15 - src/test/ui/const-generics/issues/issue-71611.rs | 11 - src/test/ui/const-generics/issues/issue-71986.rs | 6 - .../const-generics/issues/issue-72352.full.stderr | 9 - .../const-generics/issues/issue-72352.min.stderr | 8 - src/test/ui/const-generics/issues/issue-72352.rs | 22 -- src/test/ui/const-generics/issues/issue-72845.rs | 49 --- .../ui/const-generics/issues/issue-72845.stderr | 12 - src/test/ui/const-generics/issues/issue-73120.rs | 10 - src/test/ui/const-generics/issues/issue-73260.rs | 19 -- .../ui/const-generics/issues/issue-73260.stderr | 37 --- .../const-generics/issues/issue-73491.min.stderr | 11 - src/test/ui/const-generics/issues/issue-73491.rs | 11 - ...7-static-reference-array-const-param.min.stderr | 11 - ...sue-73727-static-reference-array-const-param.rs | 14 - .../const-generics/issues/issue-74101.min.stderr | 20 -- src/test/ui/const-generics/issues/issue-74101.rs | 12 - .../const-generics/issues/issue-74255.min.stderr | 11 - src/test/ui/const-generics/issues/issue-74255.rs | 20 -- src/test/ui/const-generics/issues/issue-74906.rs | 22 -- .../const-generics/issues/issue-74950.min.stderr | 47 --- src/test/ui/const-generics/issues/issue-74950.rs | 24 -- .../const-generics/issues/issue-75047.min.stderr | 11 - src/test/ui/const-generics/issues/issue-75047.rs | 17 - src/test/ui/const-generics/issues/issue-75299.rs | 8 - .../issues/issue-76701-ty-param-in-const.rs | 11 - .../issues/issue-76701-ty-param-in-const.stderr | 20 -- src/test/ui/const-generics/issues/issue-77357.rs | 11 - .../ui/const-generics/issues/issue-77357.stderr | 11 - src/test/ui/const-generics/issues/issue-79674.rs | 28 -- .../ui/const-generics/issues/issue-79674.stderr | 20 -- src/test/ui/const-generics/issues/issue-80062.rs | 10 - .../ui/const-generics/issues/issue-80062.stderr | 11 - src/test/ui/const-generics/issues/issue-80375.rs | 4 - .../ui/const-generics/issues/issue-80375.stderr | 11 - src/test/ui/const-generics/issues/issue-82956.rs | 33 -- .../ui/const-generics/issues/issue-82956.stderr | 21 -- src/test/ui/const-generics/issues/issue-83249.rs | 23 -- .../ui/const-generics/issues/issue-83249.stderr | 14 - src/test/ui/const-generics/issues/issue-83288.rs | 69 ---- src/test/ui/const-generics/issues/issue-83466.rs | 17 - .../ui/const-generics/issues/issue-83466.stderr | 22 -- src/test/ui/const-generics/issues/issue-83765.rs | 116 ------- .../ui/const-generics/issues/issue-83765.stderr | 21 -- src/test/ui/const-generics/issues/issue-83993.rs | 14 - src/test/ui/const-generics/issues/issue-84659.rs | 12 - .../ui/const-generics/issues/issue-84659.stderr | 10 - src/test/ui/const-generics/issues/issue-85031-2.rs | 18 -- .../ui/const-generics/issues/issue-85031-2.stderr | 14 - src/test/ui/const-generics/issues/issue-86033.rs | 20 -- src/test/ui/const-generics/issues/issue-86530.rs | 20 -- .../ui/const-generics/issues/issue-86530.stderr | 20 -- src/test/ui/const-generics/issues/issue-86535-2.rs | 19 -- src/test/ui/const-generics/issues/issue-86535.rs | 20 -- src/test/ui/const-generics/issues/issue-86820.rs | 24 -- .../ui/const-generics/issues/issue-86820.stderr | 16 - src/test/ui/const-generics/issues/issue-87076.rs | 20 -- src/test/ui/const-generics/issues/issue-87470.rs | 24 -- src/test/ui/const-generics/issues/issue-87493.rs | 14 - .../ui/const-generics/issues/issue-87493.stderr | 30 -- src/test/ui/const-generics/issues/issue-87964.rs | 29 -- src/test/ui/const-generics/issues/issue-88119.rs | 36 --- src/test/ui/const-generics/issues/issue-88468.rs | 13 - src/test/ui/const-generics/issues/issue-88997.rs | 14 - .../ui/const-generics/issues/issue-88997.stderr | 15 - src/test/ui/const-generics/issues/issue-89146.rs | 26 -- src/test/ui/const-generics/issues/issue-89304.rs | 20 -- src/test/ui/const-generics/issues/issue-89320.rs | 19 -- src/test/ui/const-generics/issues/issue-89334.rs | 16 - src/test/ui/const-generics/issues/issue-90318.rs | 30 -- .../ui/const-generics/issues/issue-90318.stderr | 29 -- src/test/ui/const-generics/issues/issue-90364.rs | 9 - .../ui/const-generics/issues/issue-90364.stderr | 9 - src/test/ui/const-generics/issues/issue-90455.rs | 12 - .../ui/const-generics/issues/issue-90455.stderr | 10 - src/test/ui/const-generics/issues/issue-92186.rs | 12 - src/test/ui/const-generics/issues/issue-96654.rs | 15 - src/test/ui/const-generics/issues/issue-97278.rs | 14 - .../ui/const-generics/issues/issue-97278.stderr | 9 - src/test/ui/const-generics/issues/issue-97634.rs | 10 - src/test/ui/const-generics/issues/issue-98629.rs | 16 - .../ui/const-generics/issues/issue-98629.stderr | 12 - src/test/ui/const-generics/issues/issue-99641.rs | 18 -- .../ui/const-generics/issues/issue-99641.stderr | 15 - .../const-generics/late-bound-vars/in_closure.rs | 18 -- .../ui/const-generics/late-bound-vars/simple.rs | 16 - .../ui/const-generics/legacy-const-generics-bad.rs | 16 - .../legacy-const-generics-bad.stderr | 20 -- .../ui/const-generics/legacy-const-generics.rs | 18 -- .../min_const_generics/assoc_const.rs | 16 - .../min_const_generics/complex-expression.rs | 48 --- .../min_const_generics/complex-expression.stderr | 75 ----- .../min_const_generics/complex-types.rs | 27 -- .../min_const_generics/complex-types.stderr | 65 ---- .../const-evaluatable-unchecked.rs | 35 -- .../const-evaluatable-unchecked.stderr | 30 -- ...ion-suggest-missing-braces-without-turbofish.rs | 47 --- ...suggest-missing-braces-without-turbofish.stderr | 140 -------- .../const-expression-suggest-missing-braces.rs | 51 --- .../const-expression-suggest-missing-braces.stderr | 143 -------- .../min_const_generics/const_default_first.rs | 7 - .../min_const_generics/const_default_first.stderr | 8 - .../min_const_generics/const_fn_in_generics.rs | 15 - .../min_const_generics/default_function_param.rs | 4 - .../default_function_param.stderr | 8 - .../min_const_generics/default_trait_param.rs | 4 - .../forbid-non-static-lifetimes.rs | 25 -- .../forbid-non-static-lifetimes.stderr | 21 -- .../min_const_generics/forbid-self-no-normalize.rs | 15 - .../forbid-self-no-normalize.stderr | 14 - .../min_const_generics/inferred_const.rs | 9 - .../invalid-patterns.32bit.stderr | 62 ---- .../invalid-patterns.64bit.stderr | 62 ---- .../min_const_generics/invalid-patterns.rs | 47 --- .../min_const_generics/macro-fail.rs | 39 --- .../min_const_generics/macro-fail.stderr | 71 ---- .../ui/const-generics/min_const_generics/macro.rs | 55 ---- .../min_const_generics/self-ty-in-const-1.rs | 25 -- .../min_const_generics/self-ty-in-const-1.stderr | 23 -- .../min_const_generics/self-ty-in-const-2.rs | 19 -- .../min_const_generics/self-ty-in-const-2.stderr | 14 - .../min_const_generics/type_and_const_defaults.rs | 25 -- src/test/ui/const-generics/nested-type.full.stderr | 11 - src/test/ui/const-generics/nested-type.min.stderr | 18 -- src/test/ui/const-generics/nested-type.rs | 19 -- .../ui/const-generics/occurs-check/bind-param.rs | 17 - .../const-generics/occurs-check/unify-fixpoint.rs | 12 - .../occurs-check/unify-fixpoint.stderr | 11 - .../occurs-check/unify-n-nplusone.rs | 16 - .../occurs-check/unify-n-nplusone.stderr | 9 - .../const-generics/occurs-check/unused-substs-1.rs | 13 - .../occurs-check/unused-substs-1.stderr | 19 -- .../const-generics/occurs-check/unused-substs-2.rs | 28 -- .../occurs-check/unused-substs-2.stderr | 9 - .../const-generics/occurs-check/unused-substs-3.rs | 19 -- .../occurs-check/unused-substs-3.stderr | 11 - .../const-generics/occurs-check/unused-substs-4.rs | 11 - .../occurs-check/unused-substs-4.stderr | 9 - .../const-generics/occurs-check/unused-substs-5.rs | 20 -- .../occurs-check/unused-substs-5.stderr | 11 - .../outer-lifetime-in-const-generic-default.rs | 10 - .../outer-lifetime-in-const-generic-default.stderr | 11 - src/test/ui/const-generics/overlapping_impls.rs | 36 --- .../params-in-ct-in-ty-param-lazy-norm.full.stderr | 15 - .../params-in-ct-in-ty-param-lazy-norm.min.stderr | 24 -- .../params-in-ct-in-ty-param-lazy-norm.rs | 12 - .../const-generics/parent_generics_of_encoding.rs | 25 -- .../parent_generics_of_encoding_impl_trait.rs | 11 - .../parent_generics_of_encoding_impl_trait.stderr | 15 - .../parser-error-recovery/issue-89013-no-assoc.rs | 16 - .../issue-89013-no-assoc.stderr | 14 - .../parser-error-recovery/issue-89013-no-kw.rs | 18 -- .../parser-error-recovery/issue-89013-no-kw.stderr | 35 -- .../parser-error-recovery/issue-89013-type.rs | 16 - .../parser-error-recovery/issue-89013-type.stderr | 8 - .../parser-error-recovery/issue-89013.rs | 19 -- .../parser-error-recovery/issue-89013.stderr | 47 --- .../ui/const-generics/projection-as-arg-const.rs | 20 -- .../const-generics/projection-as-arg-const.stderr | 11 - src/test/ui/const-generics/promotion.rs | 9 - .../raw-ptr-const-param-deref.full.stderr | 15 - .../raw-ptr-const-param-deref.min.stderr | 14 - .../ui/const-generics/raw-ptr-const-param-deref.rs | 21 -- .../const-generics/raw-ptr-const-param.full.stderr | 9 - .../const-generics/raw-ptr-const-param.min.stderr | 8 - src/test/ui/const-generics/raw-ptr-const-param.rs | 11 - .../slice-const-param-mismatch.full.stderr | 36 --- .../slice-const-param-mismatch.min.stderr | 20 -- .../const-generics/slice-const-param-mismatch.rs | 19 -- src/test/ui/const-generics/slice-const-param.rs | 19 -- .../ui/const-generics/sneaky-array-repeat-expr.rs | 32 -- .../const-generics/sneaky-array-repeat-expr.stderr | 18 -- .../std/const-generics-range.min.stderr | 56 ---- .../ui/const-generics/std/const-generics-range.rs | 37 --- .../struct-with-invalid-const-param.rs | 5 - .../struct-with-invalid-const-param.stderr | 9 - .../ui/const-generics/suggest_const_for_array.rs | 10 - .../const-generics/suggest_const_for_array.stderr | 15 - src/test/ui/const-generics/trait-const-args.rs | 27 -- ...ansmute-const-param-static-reference.min.stderr | 11 - .../transmute-const-param-static-reference.rs | 16 - .../transparent-maybeunit-array-wrapper.rs | 12 - .../const-generics/try_unify_ignore_lifetimes.rs | 33 -- .../const-generics/type-after-const-ok.min.stderr | 8 - src/test/ui/const-generics/type-after-const-ok.rs | 6 - .../type-dependent/auxiliary/type_dependent_lib.rs | 33 -- .../type-dependent/const-arg-in-const-arg.rs | 26 -- .../const-generics/type-dependent/issue-61936.rs | 47 --- .../const-generics/type-dependent/issue-63695.rs | 15 - .../const-generics/type-dependent/issue-67144-1.rs | 25 -- .../const-generics/type-dependent/issue-67144-2.rs | 19 -- .../const-generics/type-dependent/issue-69816.rs | 17 - .../const-generics/type-dependent/issue-70217.rs | 14 - .../const-generics/type-dependent/issue-70507.rs | 45 --- .../const-generics/type-dependent/issue-70586.rs | 30 -- .../type-dependent/issue-71348.min.stderr | 20 -- .../const-generics/type-dependent/issue-71348.rs | 38 --- .../const-generics/type-dependent/issue-71382.rs | 21 -- .../type-dependent/issue-71382.stderr | 8 - .../const-generics/type-dependent/issue-71805.rs | 38 --- .../const-generics/type-dependent/issue-73730.rs | 14 - .../ui/const-generics/type-dependent/non-local.rs | 21 -- src/test/ui/const-generics/type-dependent/qpath.rs | 9 - .../ui/const-generics/type-dependent/simple.rs | 9 - .../type-dependent/type-mismatch.full.stderr | 14 - .../type-dependent/type-mismatch.min.stderr | 14 - .../const-generics/type-dependent/type-mismatch.rs | 10 - src/test/ui/const-generics/type_mismatch.rs | 9 - src/test/ui/const-generics/type_mismatch.stderr | 23 -- src/test/ui/const-generics/type_not_in_scope.rs | 11 - .../ui/const-generics/type_not_in_scope.stderr | 24 -- src/test/ui/const-generics/type_of_anon_const.rs | 17 - .../types-mismatch-const-args.full.stderr | 34 -- .../types-mismatch-const-args.min.stderr | 36 --- .../ui/const-generics/types-mismatch-const-args.rs | 22 -- .../uninferred-consts-during-codegen-1.rs | 15 - .../uninferred-consts-during-codegen-2.rs | 15 - src/test/ui/const-generics/unknown_adt.rs | 4 - src/test/ui/const-generics/unknown_adt.stderr | 9 - src/test/ui/const-generics/unused-const-param.rs | 5 - .../const-generics/unused-type-param-suggestion.rs | 4 - .../unused-type-param-suggestion.stderr | 12 - src/test/ui/const-generics/unused_braces.fixed | 11 - .../ui/const-generics/unused_braces.full.fixed | 16 - src/test/ui/const-generics/unused_braces.min.fixed | 16 - src/test/ui/const-generics/unused_braces.rs | 11 - src/test/ui/const-generics/unused_braces.stderr | 19 -- src/test/ui/const-generics/where-clauses.rs | 30 -- 656 files changed, 14823 deletions(-) delete mode 100644 src/test/ui/const-generics/apit-with-const-param.rs delete mode 100644 src/test/ui/const-generics/arg-in-pat-1.rs delete mode 100644 src/test/ui/const-generics/arg-in-pat-2.rs delete mode 100644 src/test/ui/const-generics/arg-in-pat-3.rs delete mode 100644 src/test/ui/const-generics/argument_order.rs delete mode 100644 src/test/ui/const-generics/argument_order.stderr delete mode 100644 src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs delete mode 100644 src/test/ui/const-generics/array-impls/alloc-traits-impls-length-33.rs delete mode 100644 src/test/ui/const-generics/array-impls/alloc-types-impls-length-33.rs delete mode 100644 src/test/ui/const-generics/array-impls/core-traits-impls-length-32.rs delete mode 100644 src/test/ui/const-generics/array-impls/core-traits-impls-length-33.rs delete mode 100644 src/test/ui/const-generics/array-impls/into-iter-impls-length-32.rs delete mode 100644 src/test/ui/const-generics/array-impls/into-iter-impls-length-33.rs delete mode 100644 src/test/ui/const-generics/array-wrapper-struct-ctor.rs delete mode 100644 src/test/ui/const-generics/associated-type-bound-fail.rs delete mode 100644 src/test/ui/const-generics/associated-type-bound-fail.stderr delete mode 100644 src/test/ui/const-generics/associated-type-bound.rs delete mode 100644 src/test/ui/const-generics/auxiliary/const_generic_lib.rs delete mode 100644 src/test/ui/const-generics/auxiliary/crayte.rs delete mode 100644 src/test/ui/const-generics/auxiliary/generics_of_parent.rs delete mode 100644 src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs delete mode 100644 src/test/ui/const-generics/auxiliary/legacy-const-generics.rs delete mode 100644 src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs delete mode 100644 src/test/ui/const-generics/backcompat/unevaluated-consts.rs delete mode 100644 src/test/ui/const-generics/bad-const-generic-exprs.rs delete mode 100644 src/test/ui/const-generics/bad-const-generic-exprs.stderr delete mode 100644 src/test/ui/const-generics/broken-mir-1.rs delete mode 100644 src/test/ui/const-generics/broken-mir-2.rs delete mode 100644 src/test/ui/const-generics/cannot-infer-type-for-const-param.rs delete mode 100644 src/test/ui/const-generics/coerce_unsized_array.rs delete mode 100644 src/test/ui/const-generics/concrete-const-as-fn-arg.rs delete mode 100644 src/test/ui/const-generics/concrete-const-impl-method.rs delete mode 100644 src/test/ui/const-generics/condition-in-trait-const-arg.rs delete mode 100644 src/test/ui/const-generics/const-arg-in-const-arg.full.stderr delete mode 100644 src/test/ui/const-generics/const-arg-in-const-arg.min.stderr delete mode 100644 src/test/ui/const-generics/const-arg-in-const-arg.rs delete mode 100644 src/test/ui/const-generics/const-arg-in-fn.rs delete mode 100644 src/test/ui/const-generics/const-arg-type-arg-misordered.rs delete 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.rs delete mode 100644 src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr delete mode 100644 src/test/ui/const-generics/const-argument-cross-crate.rs delete mode 100644 src/test/ui/const-generics/const-argument-if-length.full.stderr delete mode 100644 src/test/ui/const-generics/const-argument-if-length.min.stderr delete mode 100644 src/test/ui/const-generics/const-argument-if-length.rs delete mode 100644 src/test/ui/const-generics/const-argument-non-static-lifetime.min.stderr delete mode 100644 src/test/ui/const-generics/const-argument-non-static-lifetime.rs delete mode 100644 src/test/ui/const-generics/const-fn-with-const-param.rs delete mode 100644 src/test/ui/const-generics/const-generic-default-wont-borrowck.rs delete mode 100644 src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr delete mode 100644 src/test/ui/const-generics/const-generic-function.rs delete mode 100644 src/test/ui/const-generics/const-generic-function.stderr delete mode 100644 src/test/ui/const-generics/const-generic-type_name.rs delete mode 100644 src/test/ui/const-generics/const-param-after-const-literal-arg.rs delete mode 100644 src/test/ui/const-generics/const-param-before-other-params.rs delete mode 100644 src/test/ui/const-generics/const-param-before-other-params.stderr delete mode 100644 src/test/ui/const-generics/const-param-elided-lifetime.full.stderr delete mode 100644 src/test/ui/const-generics/const-param-elided-lifetime.min.stderr delete mode 100644 src/test/ui/const-generics/const-param-elided-lifetime.rs delete mode 100644 src/test/ui/const-generics/const-param-in-async.rs delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-const-param.full.stderr delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-const-param.rs delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-type-param.full.stderr delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-type-param.min.stderr delete mode 100644 src/test/ui/const-generics/const-param-type-depends-on-type-param.rs delete mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.rs delete mode 100644 src/test/ui/const-generics/const-parameter-uppercase-lint.stderr delete mode 100644 src/test/ui/const-generics/const_trait_fn-issue-88433.rs delete mode 100644 src/test/ui/const-generics/core-types.rs delete mode 100644 src/test/ui/const-generics/cross_crate_complex.rs delete mode 100644 src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs delete mode 100644 src/test/ui/const-generics/defaults/auxiliary/trait_object_lt_defaults_lib.rs delete mode 100644 src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr delete mode 100644 src/test/ui/const-generics/defaults/complex-generic-default-expr.rs delete mode 100644 src/test/ui/const-generics/defaults/complex-unord-param.min.stderr delete mode 100644 src/test/ui/const-generics/defaults/complex-unord-param.rs delete mode 100644 src/test/ui/const-generics/defaults/const-default.rs delete mode 100644 src/test/ui/const-generics/defaults/const-param-as-default-value.rs delete mode 100644 src/test/ui/const-generics/defaults/const-param-in-ty-defaults.rs delete mode 100644 src/test/ui/const-generics/defaults/default-annotation.rs delete mode 100644 src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.rs delete mode 100644 src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.stderr delete mode 100644 src/test/ui/const-generics/defaults/default-on-impl.rs delete mode 100644 src/test/ui/const-generics/defaults/default-on-impl.stderr delete mode 100644 src/test/ui/const-generics/defaults/default-param-wf-concrete.rs delete mode 100644 src/test/ui/const-generics/defaults/default-param-wf-concrete.stderr delete mode 100644 src/test/ui/const-generics/defaults/doesnt_infer.rs delete mode 100644 src/test/ui/const-generics/defaults/doesnt_infer.stderr delete mode 100644 src/test/ui/const-generics/defaults/external.rs delete mode 100644 src/test/ui/const-generics/defaults/forward-declared.rs delete mode 100644 src/test/ui/const-generics/defaults/forward-declared.stderr delete mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs delete mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr delete mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs delete mode 100644 src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr delete mode 100644 src/test/ui/const-generics/defaults/generic-expr-default.rs delete mode 100644 src/test/ui/const-generics/defaults/generic-expr-default.stderr delete mode 100644 src/test/ui/const-generics/defaults/intermixed-lifetime.rs delete mode 100644 src/test/ui/const-generics/defaults/intermixed-lifetime.stderr delete mode 100644 src/test/ui/const-generics/defaults/mismatch.rs delete mode 100644 src/test/ui/const-generics/defaults/mismatch.stderr delete mode 100644 src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs delete mode 100644 src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr delete mode 100644 src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs delete mode 100644 src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr delete mode 100644 src/test/ui/const-generics/defaults/pretty-printing-ast.rs delete mode 100644 src/test/ui/const-generics/defaults/pretty-printing-ast.stdout delete mode 100644 src/test/ui/const-generics/defaults/repr-c-issue-82792.rs delete mode 100644 src/test/ui/const-generics/defaults/rp_impl_trait.rs delete mode 100644 src/test/ui/const-generics/defaults/rp_impl_trait_fail.rs delete mode 100644 src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr delete mode 100644 src/test/ui/const-generics/defaults/self-referential.rs delete mode 100644 src/test/ui/const-generics/defaults/self-referential.stderr delete mode 100644 src/test/ui/const-generics/defaults/simple-defaults.rs delete mode 100644 src/test/ui/const-generics/defaults/trait_object_lt_defaults.rs delete mode 100644 src/test/ui/const-generics/defaults/trait_objects.rs delete mode 100644 src/test/ui/const-generics/defaults/trait_objects_fail.rs delete mode 100644 src/test/ui/const-generics/defaults/trait_objects_fail.stderr delete mode 100644 src/test/ui/const-generics/defaults/type-default-const-param-name.rs delete mode 100644 src/test/ui/const-generics/defaults/wfness.rs delete mode 100644 src/test/ui/const-generics/defaults/wfness.stderr delete mode 100644 src/test/ui/const-generics/defaults/wrong-order.rs delete mode 100644 src/test/ui/const-generics/defaults/wrong-order.stderr delete mode 100644 src/test/ui/const-generics/deref-into-array-generic.rs delete mode 100644 src/test/ui/const-generics/different_generic_args.full.stderr delete mode 100644 src/test/ui/const-generics/different_generic_args.min.stderr delete mode 100644 src/test/ui/const-generics/different_generic_args.rs delete mode 100644 src/test/ui/const-generics/different_generic_args_array.rs delete mode 100644 src/test/ui/const-generics/different_generic_args_array.stderr delete mode 100644 src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs delete mode 100644 src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr delete mode 100644 src/test/ui/const-generics/dyn-supertraits.rs delete mode 100644 src/test/ui/const-generics/early/closing-args-token.rs delete mode 100644 src/test/ui/const-generics/early/closing-args-token.stderr delete mode 100644 src/test/ui/const-generics/early/const-expression-parameter.rs delete mode 100644 src/test/ui/const-generics/early/const-expression-parameter.stderr delete mode 100644 src/test/ui/const-generics/early/const-param-from-outer-fn.rs delete mode 100644 src/test/ui/const-generics/early/const-param-from-outer-fn.stderr delete mode 100644 src/test/ui/const-generics/early/const-param-hygiene.rs delete mode 100644 src/test/ui/const-generics/early/const-param-shadowing.rs delete mode 100644 src/test/ui/const-generics/early/const-param-shadowing.stderr delete mode 100644 src/test/ui/const-generics/early/invalid-const-arguments.rs delete mode 100644 src/test/ui/const-generics/early/invalid-const-arguments.stderr delete mode 100644 src/test/ui/const-generics/early/macro_rules-braces.rs delete mode 100644 src/test/ui/const-generics/early/macro_rules-braces.stderr delete mode 100644 src/test/ui/const-generics/enum-variants.rs delete mode 100644 src/test/ui/const-generics/exhaustive-value.rs delete mode 100644 src/test/ui/const-generics/exhaustive-value.stderr delete mode 100644 src/test/ui/const-generics/expose-default-substs-param-env.rs delete mode 100644 src/test/ui/const-generics/float-generic.adt_const_params.stderr delete mode 100644 src/test/ui/const-generics/float-generic.rs delete mode 100644 src/test/ui/const-generics/float-generic.simple.stderr delete mode 100644 src/test/ui/const-generics/fn-const-param-call.full.stderr delete mode 100644 src/test/ui/const-generics/fn-const-param-call.min.stderr delete mode 100644 src/test/ui/const-generics/fn-const-param-call.rs delete mode 100644 src/test/ui/const-generics/fn-const-param-infer.full.stderr delete mode 100644 src/test/ui/const-generics/fn-const-param-infer.min.stderr delete mode 100644 src/test/ui/const-generics/fn-const-param-infer.rs delete mode 100644 src/test/ui/const-generics/forbid-non-structural_match-types.rs delete 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.rs delete mode 100644 src/test/ui/const-generics/foreign-item-const-parameter.stderr delete mode 100644 src/test/ui/const-generics/generic-param-mismatch.rs delete mode 100644 src/test/ui/const-generics/generic-param-mismatch.stderr delete mode 100644 src/test/ui/const-generics/generic_arg_infer/array-repeat-expr.rs delete mode 100644 src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs delete mode 100644 src/test/ui/const-generics/generic_arg_infer/in-signature.rs delete mode 100644 src/test/ui/const-generics/generic_arg_infer/in-signature.stderr delete mode 100644 src/test/ui/const-generics/generic_arg_infer/infer-arg-test.rs delete mode 100644 src/test/ui/const-generics/generic_arg_infer/infer-arg-test.stderr delete mode 100644 src/test/ui/const-generics/generic_arg_infer/infer_arg_and_const_arg.rs delete mode 100644 src/test/ui/const-generics/generic_arg_infer/issue-91614.rs delete mode 100644 src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/const_equate_assoc_consts.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/dropck_unifies_assoc_consts.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/unifies_evaluatable.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/associated-const.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/associated-consts.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/auxiliary/issue-94287-aux.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/closures.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/closures.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/cross_crate.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/different-fn.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/different-fn.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/division.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/drop_impl.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/eval-try-unify.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/fn_call.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/from-sig.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/function-call.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/function-call.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-100217.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-100360.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-102074.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-102768.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-62504.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-69654.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72787.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-73298.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-73899.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-74634.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-74713.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-74713.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-76595.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-80742.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-82268.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-83765.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-83972.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-84408.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-84669.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-85848.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-86710.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-89851.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-90847.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-94287.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-94287.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/issue-99705.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/less_than.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/let-bindings.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/no_dependence.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs delete 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/normed_to_param_is_evaluatable.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/simple_fail.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr delete mode 100644 src/test/ui/const-generics/generic_const_exprs/unop.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/unused_expr.rs delete mode 100644 src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr delete mode 100644 src/test/ui/const-generics/ice-68875.rs delete mode 100644 src/test/ui/const-generics/ice-68875.stderr delete mode 100644 src/test/ui/const-generics/ice-const-generic-function-return-ty.rs delete mode 100644 src/test/ui/const-generics/ice-const-generic-function-return-ty.stderr delete mode 100644 src/test/ui/const-generics/impl-const-generic-struct.rs delete mode 100644 src/test/ui/const-generics/incorrect-number-of-const-args.rs delete 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.rs delete mode 100644 src/test/ui/const-generics/infer/cannot-infer-const-args.stderr delete mode 100644 src/test/ui/const-generics/infer/issue-77092.rs delete mode 100644 src/test/ui/const-generics/infer/issue-77092.stderr delete mode 100644 src/test/ui/const-generics/infer/method-chain.rs delete mode 100644 src/test/ui/const-generics/infer/method-chain.stderr delete mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.rs delete mode 100644 src/test/ui/const-generics/infer/one-param-uninferred.stderr delete mode 100644 src/test/ui/const-generics/infer/uninferred-consts.rs delete mode 100644 src/test/ui/const-generics/infer/uninferred-consts.stderr delete mode 100644 src/test/ui/const-generics/infer_arg_from_pat.rs delete mode 100644 src/test/ui/const-generics/infer_arr_len_from_pat.rs delete mode 100644 src/test/ui/const-generics/inhabited-assoc-ty-ice-1.rs delete mode 100644 src/test/ui/const-generics/inhabited-assoc-ty-ice-2.rs delete mode 100644 src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs delete mode 100644 src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr delete mode 100644 src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs delete mode 100644 src/test/ui/const-generics/invalid-const-arg-for-type-param.rs delete mode 100644 src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr delete mode 100644 src/test/ui/const-generics/invalid-constant-in-args.rs delete mode 100644 src/test/ui/const-generics/invalid-constant-in-args.stderr delete mode 100644 src/test/ui/const-generics/invalid-enum.rs delete mode 100644 src/test/ui/const-generics/invalid-enum.stderr delete mode 100644 src/test/ui/const-generics/invariant.rs delete mode 100644 src/test/ui/const-generics/invariant.stderr delete mode 100644 src/test/ui/const-generics/issue-102124.rs delete mode 100644 src/test/ui/const-generics/issue-46511.rs delete mode 100644 src/test/ui/const-generics/issue-46511.stderr delete mode 100644 src/test/ui/const-generics/issue-66451.rs delete mode 100644 src/test/ui/const-generics/issue-66451.stderr delete mode 100644 src/test/ui/const-generics/issue-70408.rs delete mode 100644 src/test/ui/const-generics/issue-80471.rs delete mode 100644 src/test/ui/const-generics/issue-80471.stderr delete mode 100644 src/test/ui/const-generics/issue-93647.rs delete mode 100644 src/test/ui/const-generics/issue-93647.stderr delete mode 100644 src/test/ui/const-generics/issue-97007.rs delete mode 100644 src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs delete mode 100644 src/test/ui/const-generics/issues/auxiliary/impl-const.rs delete mode 100644 src/test/ui/const-generics/issues/issue-100313.rs delete mode 100644 src/test/ui/const-generics/issues/issue-100313.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-56445-1.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-56445-1.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-56445-1.rs delete mode 100644 src/test/ui/const-generics/issues/issue-56445-2.rs delete mode 100644 src/test/ui/const-generics/issues/issue-56445-2.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-56445-3.rs delete mode 100644 src/test/ui/const-generics/issues/issue-56445-3.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61336-1.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61336-2.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61336-2.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61336.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61336.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-61422.rs delete mode 100644 src/test/ui/const-generics/issues/issue-61432.rs delete mode 100644 src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs delete mode 100644 src/test/ui/const-generics/issues/issue-62878.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62878.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-62878.rs delete mode 100644 src/test/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs delete mode 100644 src/test/ui/const-generics/issues/issue-64519.rs delete mode 100644 src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs delete mode 100644 src/test/ui/const-generics/issues/issue-66906.rs delete mode 100644 src/test/ui/const-generics/issues/issue-67185-1.rs delete mode 100644 src/test/ui/const-generics/issues/issue-67185-2.rs delete mode 100644 src/test/ui/const-generics/issues/issue-67185-2.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67375.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67375.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67375.rs delete mode 100644 src/test/ui/const-generics/issues/issue-67739.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67739.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67739.rs delete mode 100644 src/test/ui/const-generics/issues/issue-67945-1.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-1.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-1.rs delete mode 100644 src/test/ui/const-generics/issues/issue-67945-2.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-2.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-2.rs 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-67945-4.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-4.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-67945-4.rs delete mode 100644 src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs delete mode 100644 src/test/ui/const-generics/issues/issue-68366.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-68366.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-68366.rs delete mode 100644 src/test/ui/const-generics/issues/issue-68596.rs delete mode 100644 src/test/ui/const-generics/issues/issue-68615-adt.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-68615-adt.rs delete mode 100644 src/test/ui/const-generics/issues/issue-68615-array.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-68615-array.rs delete mode 100644 src/test/ui/const-generics/issues/issue-69654-run-pass.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70125-1.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70125-2.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70167.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70225.rs delete mode 100644 src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71169.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71169.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71169.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71202.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71202.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71381.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71381.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71381.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71382.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71382.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71382.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71547.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71611.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71611.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-71611.rs delete mode 100644 src/test/ui/const-generics/issues/issue-71986.rs delete mode 100644 src/test/ui/const-generics/issues/issue-72352.full.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72352.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-72352.rs delete mode 100644 src/test/ui/const-generics/issues/issue-72845.rs delete mode 100644 src/test/ui/const-generics/issues/issue-72845.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-73120.rs delete mode 100644 src/test/ui/const-generics/issues/issue-73260.rs delete mode 100644 src/test/ui/const-generics/issues/issue-73260.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-73491.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-73491.rs delete mode 100644 src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.rs delete mode 100644 src/test/ui/const-generics/issues/issue-74101.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-74101.rs delete mode 100644 src/test/ui/const-generics/issues/issue-74255.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-74255.rs delete mode 100644 src/test/ui/const-generics/issues/issue-74906.rs delete mode 100644 src/test/ui/const-generics/issues/issue-74950.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-74950.rs delete mode 100644 src/test/ui/const-generics/issues/issue-75047.min.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-75047.rs delete mode 100644 src/test/ui/const-generics/issues/issue-75299.rs delete mode 100644 src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs delete 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-77357.rs delete mode 100644 src/test/ui/const-generics/issues/issue-77357.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-79674.rs delete mode 100644 src/test/ui/const-generics/issues/issue-79674.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-80062.rs delete mode 100644 src/test/ui/const-generics/issues/issue-80062.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-80375.rs delete mode 100644 src/test/ui/const-generics/issues/issue-80375.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-82956.rs delete mode 100644 src/test/ui/const-generics/issues/issue-82956.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-83249.rs delete mode 100644 src/test/ui/const-generics/issues/issue-83249.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-83288.rs delete mode 100644 src/test/ui/const-generics/issues/issue-83466.rs delete mode 100644 src/test/ui/const-generics/issues/issue-83466.stderr 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-83993.rs delete mode 100644 src/test/ui/const-generics/issues/issue-84659.rs delete mode 100644 src/test/ui/const-generics/issues/issue-84659.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-85031-2.rs delete mode 100644 src/test/ui/const-generics/issues/issue-85031-2.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-86033.rs delete mode 100644 src/test/ui/const-generics/issues/issue-86530.rs delete mode 100644 src/test/ui/const-generics/issues/issue-86530.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-86535-2.rs delete mode 100644 src/test/ui/const-generics/issues/issue-86535.rs delete mode 100644 src/test/ui/const-generics/issues/issue-86820.rs delete mode 100644 src/test/ui/const-generics/issues/issue-86820.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-87076.rs delete mode 100644 src/test/ui/const-generics/issues/issue-87470.rs delete mode 100644 src/test/ui/const-generics/issues/issue-87493.rs delete mode 100644 src/test/ui/const-generics/issues/issue-87493.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-87964.rs delete mode 100644 src/test/ui/const-generics/issues/issue-88119.rs delete mode 100644 src/test/ui/const-generics/issues/issue-88468.rs delete mode 100644 src/test/ui/const-generics/issues/issue-88997.rs delete mode 100644 src/test/ui/const-generics/issues/issue-88997.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-89146.rs delete mode 100644 src/test/ui/const-generics/issues/issue-89304.rs delete mode 100644 src/test/ui/const-generics/issues/issue-89320.rs delete mode 100644 src/test/ui/const-generics/issues/issue-89334.rs delete mode 100644 src/test/ui/const-generics/issues/issue-90318.rs delete mode 100644 src/test/ui/const-generics/issues/issue-90318.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-90364.rs delete mode 100644 src/test/ui/const-generics/issues/issue-90364.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-90455.rs delete mode 100644 src/test/ui/const-generics/issues/issue-90455.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-92186.rs delete mode 100644 src/test/ui/const-generics/issues/issue-96654.rs delete mode 100644 src/test/ui/const-generics/issues/issue-97278.rs delete mode 100644 src/test/ui/const-generics/issues/issue-97278.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-97634.rs delete mode 100644 src/test/ui/const-generics/issues/issue-98629.rs delete mode 100644 src/test/ui/const-generics/issues/issue-98629.stderr delete mode 100644 src/test/ui/const-generics/issues/issue-99641.rs delete mode 100644 src/test/ui/const-generics/issues/issue-99641.stderr delete mode 100644 src/test/ui/const-generics/late-bound-vars/in_closure.rs delete mode 100644 src/test/ui/const-generics/late-bound-vars/simple.rs delete mode 100644 src/test/ui/const-generics/legacy-const-generics-bad.rs delete mode 100644 src/test/ui/const-generics/legacy-const-generics-bad.stderr delete mode 100644 src/test/ui/const-generics/legacy-const-generics.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/assoc_const.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/complex-expression.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/complex-expression.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/complex-types.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/complex-types.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/const_default_first.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/const_default_first.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/default_function_param.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/default_function_param.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/default_trait_param.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/inferred_const.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/invalid-patterns.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/macro-fail.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/macro-fail.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/macro.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs delete mode 100644 src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr delete mode 100644 src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs delete mode 100644 src/test/ui/const-generics/nested-type.full.stderr delete mode 100644 src/test/ui/const-generics/nested-type.min.stderr delete mode 100644 src/test/ui/const-generics/nested-type.rs delete mode 100644 src/test/ui/const-generics/occurs-check/bind-param.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unify-fixpoint.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr delete mode 100644 src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-1.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-1.stderr delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-2.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-2.stderr delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-3.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-3.stderr delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-4.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-4.stderr delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-5.rs delete mode 100644 src/test/ui/const-generics/occurs-check/unused-substs-5.stderr delete mode 100644 src/test/ui/const-generics/outer-lifetime-in-const-generic-default.rs delete mode 100644 src/test/ui/const-generics/outer-lifetime-in-const-generic-default.stderr delete mode 100644 src/test/ui/const-generics/overlapping_impls.rs delete mode 100644 src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr delete mode 100644 src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr delete mode 100644 src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs delete mode 100644 src/test/ui/const-generics/parent_generics_of_encoding.rs delete mode 100644 src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs delete mode 100644 src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.rs delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.stderr delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013-type.rs delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013-type.stderr delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013.rs delete mode 100644 src/test/ui/const-generics/parser-error-recovery/issue-89013.stderr delete mode 100644 src/test/ui/const-generics/projection-as-arg-const.rs delete mode 100644 src/test/ui/const-generics/projection-as-arg-const.stderr delete mode 100644 src/test/ui/const-generics/promotion.rs delete mode 100644 src/test/ui/const-generics/raw-ptr-const-param-deref.full.stderr delete mode 100644 src/test/ui/const-generics/raw-ptr-const-param-deref.min.stderr delete mode 100644 src/test/ui/const-generics/raw-ptr-const-param-deref.rs delete mode 100644 src/test/ui/const-generics/raw-ptr-const-param.full.stderr delete mode 100644 src/test/ui/const-generics/raw-ptr-const-param.min.stderr delete mode 100644 src/test/ui/const-generics/raw-ptr-const-param.rs delete mode 100644 src/test/ui/const-generics/slice-const-param-mismatch.full.stderr delete mode 100644 src/test/ui/const-generics/slice-const-param-mismatch.min.stderr delete mode 100644 src/test/ui/const-generics/slice-const-param-mismatch.rs delete mode 100644 src/test/ui/const-generics/slice-const-param.rs delete mode 100644 src/test/ui/const-generics/sneaky-array-repeat-expr.rs delete mode 100644 src/test/ui/const-generics/sneaky-array-repeat-expr.stderr delete mode 100644 src/test/ui/const-generics/std/const-generics-range.min.stderr delete mode 100644 src/test/ui/const-generics/std/const-generics-range.rs delete mode 100644 src/test/ui/const-generics/struct-with-invalid-const-param.rs delete mode 100644 src/test/ui/const-generics/struct-with-invalid-const-param.stderr delete mode 100644 src/test/ui/const-generics/suggest_const_for_array.rs delete mode 100644 src/test/ui/const-generics/suggest_const_for_array.stderr delete mode 100644 src/test/ui/const-generics/trait-const-args.rs delete mode 100644 src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr delete mode 100644 src/test/ui/const-generics/transmute-const-param-static-reference.rs delete mode 100644 src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs delete mode 100644 src/test/ui/const-generics/try_unify_ignore_lifetimes.rs delete mode 100644 src/test/ui/const-generics/type-after-const-ok.min.stderr delete mode 100644 src/test/ui/const-generics/type-after-const-ok.rs delete mode 100644 src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs delete mode 100644 src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-61936.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-63695.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-67144-1.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-67144-2.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-69816.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-70217.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-70507.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-70586.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71348.min.stderr delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71348.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71382.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71382.stderr delete mode 100644 src/test/ui/const-generics/type-dependent/issue-71805.rs delete mode 100644 src/test/ui/const-generics/type-dependent/issue-73730.rs delete mode 100644 src/test/ui/const-generics/type-dependent/non-local.rs delete mode 100644 src/test/ui/const-generics/type-dependent/qpath.rs delete mode 100644 src/test/ui/const-generics/type-dependent/simple.rs delete mode 100644 src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr delete mode 100644 src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr delete mode 100644 src/test/ui/const-generics/type-dependent/type-mismatch.rs delete mode 100644 src/test/ui/const-generics/type_mismatch.rs delete mode 100644 src/test/ui/const-generics/type_mismatch.stderr delete mode 100644 src/test/ui/const-generics/type_not_in_scope.rs delete mode 100644 src/test/ui/const-generics/type_not_in_scope.stderr delete mode 100644 src/test/ui/const-generics/type_of_anon_const.rs delete mode 100644 src/test/ui/const-generics/types-mismatch-const-args.full.stderr delete mode 100644 src/test/ui/const-generics/types-mismatch-const-args.min.stderr delete mode 100644 src/test/ui/const-generics/types-mismatch-const-args.rs delete mode 100644 src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs delete mode 100644 src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs delete mode 100644 src/test/ui/const-generics/unknown_adt.rs delete mode 100644 src/test/ui/const-generics/unknown_adt.stderr delete mode 100644 src/test/ui/const-generics/unused-const-param.rs delete mode 100644 src/test/ui/const-generics/unused-type-param-suggestion.rs delete mode 100644 src/test/ui/const-generics/unused-type-param-suggestion.stderr delete mode 100644 src/test/ui/const-generics/unused_braces.fixed delete mode 100644 src/test/ui/const-generics/unused_braces.full.fixed delete mode 100644 src/test/ui/const-generics/unused_braces.min.fixed delete mode 100644 src/test/ui/const-generics/unused_braces.rs delete mode 100644 src/test/ui/const-generics/unused_braces.stderr delete mode 100644 src/test/ui/const-generics/where-clauses.rs (limited to 'src/test/ui/const-generics') diff --git a/src/test/ui/const-generics/apit-with-const-param.rs b/src/test/ui/const-generics/apit-with-const-param.rs deleted file mode 100644 index 2a04dc313..000000000 --- a/src/test/ui/const-generics/apit-with-const-param.rs +++ /dev/null @@ -1,7 +0,0 @@ -// check-pass - -trait Trait {} - -fn f(_: impl Trait) {} - -fn main() {} diff --git a/src/test/ui/const-generics/arg-in-pat-1.rs b/src/test/ui/const-generics/arg-in-pat-1.rs deleted file mode 100644 index 82555084e..000000000 --- a/src/test/ui/const-generics/arg-in-pat-1.rs +++ /dev/null @@ -1,23 +0,0 @@ -// check-pass -enum ConstGenericEnum { - Foo([i32; N]), - Bar, -} - -fn foo(val: &ConstGenericEnum) { - if let ConstGenericEnum::::Foo(field, ..) = val {} -} - -fn bar(val: &ConstGenericEnum) { - match val { - ConstGenericEnum::::Foo(field, ..) => (), - ConstGenericEnum::::Bar => (), - } -} - -fn main() { - match ConstGenericEnum::Bar { - ConstGenericEnum::<3>::Foo(field, ..) => (), - ConstGenericEnum::<3>::Bar => (), - } -} diff --git a/src/test/ui/const-generics/arg-in-pat-2.rs b/src/test/ui/const-generics/arg-in-pat-2.rs deleted file mode 100644 index dc9e722ed..000000000 --- a/src/test/ui/const-generics/arg-in-pat-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -// check-pass -enum Generic { - Variant, -} - -fn main() { - match todo!() { - Generic::<0usize>::Variant => todo!() - } -} diff --git a/src/test/ui/const-generics/arg-in-pat-3.rs b/src/test/ui/const-generics/arg-in-pat-3.rs deleted file mode 100644 index 24626a3b6..000000000 --- a/src/test/ui/const-generics/arg-in-pat-3.rs +++ /dev/null @@ -1,43 +0,0 @@ -// check-pass -struct Foo; - -fn bindingp() { - match Foo { - mut x @ Foo::<3> => { - let ref mut _x @ Foo::<3> = x; - } - } -} - -struct Bar { - field: Foo, -} - -fn structp() { - match todo!() { - Bar::<3> { - field: Foo::<3>, - } => (), - } -} - -struct Baz(Foo); - -fn tuplestructp() { - match Baz(Foo) { - Baz::<3>(Foo::<3>) => (), - } -} - -impl Baz { - const ASSOC: usize = 3; -} - -fn pathp() { - match 3 { - Baz::<3>::ASSOC => (), - _ => (), - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/argument_order.rs b/src/test/ui/const-generics/argument_order.rs deleted file mode 100644 index 196d9b8a1..000000000 --- a/src/test/ui/const-generics/argument_order.rs +++ /dev/null @@ -1,15 +0,0 @@ -struct Bad { - arr: [u8; { N }], - another: T, -} - -struct AlsoBad { - //~^ ERROR lifetime parameters must be declared prior - a: &'a T, - b: &'b U, -} - -fn main() { - let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; - //~^ ERROR lifetime provided when a type was expected - } diff --git a/src/test/ui/const-generics/argument_order.stderr b/src/test/ui/const-generics/argument_order.stderr deleted file mode 100644 index 99122c6f5..000000000 --- a/src/test/ui/const-generics/argument_order.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: lifetime parameters must be declared prior to type and const parameters - --> $DIR/argument_order.rs:6: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:13:23 - | -LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; - | ^^^^^^^ - | - = note: lifetime arguments must be provided before type arguments - = help: reorder the arguments: lifetimes, then type and consts: `<'a, 'b, N, T, M, U>` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs b/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs deleted file mode 100644 index b4a083636..000000000 --- a/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-32.rs +++ /dev/null @@ -1,48 +0,0 @@ -// check-pass - -pub fn yes_vec_partial_eq_array() -> impl PartialEq<[B; 32]> -where - A: PartialEq, -{ - Vec::::new() -} - -pub fn yes_vec_partial_eq_ref_array<'a, A, B>() -> impl PartialEq<&'a [B; 32]> -where - A: PartialEq, -{ - Vec::::new() -} - -pub fn yes_array_into_vec() -> Vec { - [].into() -} - -pub fn yes_array_into_box() -> Box<[T]> { - [].into() -} - -use std::collections::VecDeque; - -pub fn yes_vecdeque_partial_eq_array() -> impl PartialEq<[B; 32]> -where - A: PartialEq, -{ - VecDeque::::new() -} - -pub fn yes_vecdeque_partial_eq_ref_array<'a, A, B>() -> impl PartialEq<&'a [B; 32]> -where - A: PartialEq, -{ - VecDeque::::new() -} - -pub fn yes_vecdeque_partial_eq_ref_mut_array<'a, A, B>() -> impl PartialEq<&'a mut [B; 32]> -where - A: PartialEq, -{ - VecDeque::::new() -} - -fn main() {} diff --git a/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-33.rs b/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-33.rs deleted file mode 100644 index 35df3278a..000000000 --- a/src/test/ui/const-generics/array-impls/alloc-traits-impls-length-33.rs +++ /dev/null @@ -1,40 +0,0 @@ -// check-pass - -pub fn yes_vec_partial_eq_array() -> impl PartialEq<[B; 33]> -where - A: PartialEq, -{ - Vec::::new() -} - -pub fn yes_vec_partial_eq_ref_array<'a, A, B>() -> impl PartialEq<&'a [B; 33]> -where - A: PartialEq, -{ - Vec::::new() -} - -use std::collections::VecDeque; - -pub fn yes_vecdeque_partial_eq_array() -> impl PartialEq<[B; 33]> -where - A: PartialEq, -{ - VecDeque::::new() -} - -pub fn yes_vecdeque_partial_eq_ref_array<'a, A, B>() -> impl PartialEq<&'a [B; 33]> -where - A: PartialEq, -{ - VecDeque::::new() -} - -pub fn yes_vecdeque_partial_eq_ref_mut_array<'a, A, B>() -> impl PartialEq<&'a mut [B; 33]> -where - A: PartialEq, -{ - VecDeque::::new() -} - -fn main() {} diff --git a/src/test/ui/const-generics/array-impls/alloc-types-impls-length-33.rs b/src/test/ui/const-generics/array-impls/alloc-types-impls-length-33.rs deleted file mode 100644 index 294b405e0..000000000 --- a/src/test/ui/const-generics/array-impls/alloc-types-impls-length-33.rs +++ /dev/null @@ -1,25 +0,0 @@ -// check-pass - -use std::{convert::TryFrom, rc::Rc, sync::Arc}; - -pub fn yes_vec() { - let v: Vec<_> = [0; 33].into(); -} - -pub fn yes_box() { - let boxed_slice = Box::new([0; 33]) as Box<[i32]>; - let boxed_array = >::try_from(boxed_slice); - let boxed_slice = >::from([0; 33]); -} - -pub fn yes_rc() { - let boxed_slice = Rc::new([0; 33]) as Rc<[i32]>; - let boxed_array = >::try_from(boxed_slice); -} - -pub fn yes_arc() { - let boxed_slice = Arc::new([0; 33]) as Arc<[i32]>; - let boxed_array = >::try_from(boxed_slice); -} - -fn main() {} diff --git a/src/test/ui/const-generics/array-impls/core-traits-impls-length-32.rs b/src/test/ui/const-generics/array-impls/core-traits-impls-length-32.rs deleted file mode 100644 index 9998bb84c..000000000 --- a/src/test/ui/const-generics/array-impls/core-traits-impls-length-32.rs +++ /dev/null @@ -1,66 +0,0 @@ -// check-pass - -pub fn yes_as_ref() -> impl AsRef<[u8]> { - [0; 32] -} - -pub fn yes_as_mut() -> impl AsMut<[u8]> { - [0; 32] -} - -pub fn yes_borrow() -> impl std::borrow::Borrow<[u8]> { - [0; 32] -} - -pub fn yes_borrow_mut() -> impl std::borrow::BorrowMut<[u8]> { - [0; 32] -} - -pub fn yes_try_from_slice() -> impl std::convert::TryFrom<&'static [u8]> { - [0; 32] -} - -pub fn yes_ref_try_from_slice() -> impl std::convert::TryFrom<&'static [u8]> { - let a: &'static _ = &[0; 32]; - a -} - -pub fn yes_hash() -> impl std::hash::Hash { - [0; 32] -} - -pub fn yes_debug() -> impl std::fmt::Debug { - [0; 32] -} - -pub fn yes_ref_into_iterator() -> impl IntoIterator { - let a: &'static _ = &[0; 32]; - a -} - -pub fn yes_partial_eq() -> impl PartialEq<[u8; 32]> { - [0; 32] -} - -pub fn yes_partial_eq_slice() -> impl PartialEq<[u8]> { - [0; 32] -} - -pub fn yes_slice_partial_eq() -> impl PartialEq<[u8; 32]> { - let a: &'static _ = &[0; 32]; - &a[..] -} - -pub fn yes_eq() -> impl Eq { - [0; 32] -} - -pub fn yes_partial_ord() -> impl PartialOrd<[u8; 32]> { - [0; 32] -} - -pub fn yes_ord() -> impl Ord { - [0; 32] -} - -fn main() {} diff --git a/src/test/ui/const-generics/array-impls/core-traits-impls-length-33.rs b/src/test/ui/const-generics/array-impls/core-traits-impls-length-33.rs deleted file mode 100644 index c609a7c6f..000000000 --- a/src/test/ui/const-generics/array-impls/core-traits-impls-length-33.rs +++ /dev/null @@ -1,66 +0,0 @@ -// check-pass - -pub fn yes_as_ref() -> impl AsRef<[u8]> { - [0; 33] -} - -pub fn yes_as_mut() -> impl AsMut<[u8]> { - [0; 33] -} - -pub fn yes_borrow() -> impl std::borrow::Borrow<[u8]> { - [0; 33] -} - -pub fn yes_borrow_mut() -> impl std::borrow::BorrowMut<[u8]> { - [0; 33] -} - -pub fn yes_try_from_slice() -> impl std::convert::TryFrom<&'static [u8]> { - [0; 33] -} - -pub fn yes_ref_try_from_slice() -> impl std::convert::TryFrom<&'static [u8]> { - let a: &'static _ = &[0; 33]; - a -} - -pub fn yes_hash() -> impl std::hash::Hash { - [0; 33] -} - -pub fn yes_debug() -> impl std::fmt::Debug { - [0; 33] -} - -pub fn yes_ref_into_iterator() -> impl IntoIterator { - let a: &'static _ = &[0; 33]; - a -} - -pub fn yes_partial_eq() -> impl PartialEq<[u8; 33]> { - [0; 33] -} - -pub fn yes_partial_eq_slice() -> impl PartialEq<[u8]> { - [0; 33] -} - -pub fn yes_slice_partial_eq() -> impl PartialEq<[u8; 33]> { - let a: &'static _ = &[0; 33]; - &a[..] -} - -pub fn yes_eq() -> impl Eq { - [0; 33] -} - -pub fn yes_partial_ord() -> impl PartialOrd<[u8; 33]> { - [0; 33] -} - -pub fn yes_ord() -> impl Ord { - [0; 33] -} - -fn main() {} diff --git a/src/test/ui/const-generics/array-impls/into-iter-impls-length-32.rs b/src/test/ui/const-generics/array-impls/into-iter-impls-length-32.rs deleted file mode 100644 index 457e5ae60..000000000 --- a/src/test/ui/const-generics/array-impls/into-iter-impls-length-32.rs +++ /dev/null @@ -1,40 +0,0 @@ -// check-pass - -#![feature(trusted_len)] - -use std::{ - array::IntoIter, - fmt::Debug, - iter::{ExactSizeIterator, FusedIterator, TrustedLen}, -}; - -pub fn yes_iterator() -> impl Iterator { - IntoIterator::into_iter([0i32; 32]) -} - -pub fn yes_double_ended_iterator() -> impl DoubleEndedIterator { - IntoIterator::into_iter([0i32; 32]) -} - -pub fn yes_exact_size_iterator() -> impl ExactSizeIterator { - IntoIterator::into_iter([0i32; 32]) -} - -pub fn yes_fused_iterator() -> impl FusedIterator { - IntoIterator::into_iter([0i32; 32]) -} - -pub fn yes_trusted_len() -> impl TrustedLen { - IntoIterator::into_iter([0i32; 32]) -} - -pub fn yes_clone() -> impl Clone { - IntoIterator::into_iter([0i32; 32]) -} - -pub fn yes_debug() -> impl Debug { - IntoIterator::into_iter([0i32; 32]) -} - - -fn main() {} diff --git a/src/test/ui/const-generics/array-impls/into-iter-impls-length-33.rs b/src/test/ui/const-generics/array-impls/into-iter-impls-length-33.rs deleted file mode 100644 index 4f343f3f9..000000000 --- a/src/test/ui/const-generics/array-impls/into-iter-impls-length-33.rs +++ /dev/null @@ -1,40 +0,0 @@ -// check-pass - -#![feature(trusted_len)] - -use std::{ - array::IntoIter, - fmt::Debug, - iter::{ExactSizeIterator, FusedIterator, TrustedLen}, -}; - -pub fn yes_iterator() -> impl Iterator { - IntoIterator::into_iter([0i32; 33]) -} - -pub fn yes_double_ended_iterator() -> impl DoubleEndedIterator { - IntoIterator::into_iter([0i32; 33]) -} - -pub fn yes_exact_size_iterator() -> impl ExactSizeIterator { - IntoIterator::into_iter([0i32; 33]) -} - -pub fn yes_fused_iterator() -> impl FusedIterator { - IntoIterator::into_iter([0i32; 33]) -} - -pub fn yes_trusted_len() -> impl TrustedLen { - IntoIterator::into_iter([0i32; 33]) -} - -pub fn yes_clone() -> impl Clone { - IntoIterator::into_iter([0i32; 33]) -} - -pub fn yes_debug() -> impl Debug { - IntoIterator::into_iter([0i32; 33]) -} - - -fn main() {} diff --git a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs deleted file mode 100644 index a712f691d..000000000 --- a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass - -#![allow(dead_code)] - -struct ArrayStruct { - data: [T; N], -} - -struct ArrayTuple([T; N]); - -fn main() { - let _ = ArrayStruct { data: [0u32; 8] }; - let _ = ArrayTuple([0u32; 8]); -} diff --git a/src/test/ui/const-generics/associated-type-bound-fail.rs b/src/test/ui/const-generics/associated-type-bound-fail.rs deleted file mode 100644 index 937b8bcb6..000000000 --- a/src/test/ui/const-generics/associated-type-bound-fail.rs +++ /dev/null @@ -1,12 +0,0 @@ -trait Bar {} - -trait Foo { - type Assoc: Bar; -} - -impl Bar<3> for u16 {} -impl Foo for i16 { - type Assoc = u16; //~ ERROR the trait bound `u16: Bar` -} - -fn main() {} diff --git a/src/test/ui/const-generics/associated-type-bound-fail.stderr b/src/test/ui/const-generics/associated-type-bound-fail.stderr deleted file mode 100644 index e5e7ee26e..000000000 --- a/src/test/ui/const-generics/associated-type-bound-fail.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: the trait bound `u16: Bar` is not satisfied - --> $DIR/associated-type-bound-fail.rs:9:18 - | -LL | type Assoc = u16; - | ^^^ the trait `Bar` is not implemented for `u16` - | - = help: the trait `Bar<3>` is implemented for `u16` -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 deleted file mode 100644 index 3044736b4..000000000 --- a/src/test/ui/const-generics/associated-type-bound.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-pass -trait Bar {} - -trait Foo { - type Assoc: Bar; -} - -impl Bar for u8 {} -impl Bar<3> for u16 {} - -impl Foo for i8 { - type Assoc = u8; -} - -impl Foo<3> for i16 { - type Assoc = u16; -} - -fn main() {} diff --git a/src/test/ui/const-generics/auxiliary/const_generic_lib.rs b/src/test/ui/const-generics/auxiliary/const_generic_lib.rs deleted file mode 100644 index 922f92d9f..000000000 --- a/src/test/ui/const-generics/auxiliary/const_generic_lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub struct Struct(pub [u8; N]); - -pub type Alias = Struct<2>; - -pub fn function(value: Struct<3>) -> u8 { - value.0[0] -} diff --git a/src/test/ui/const-generics/auxiliary/crayte.rs b/src/test/ui/const-generics/auxiliary/crayte.rs deleted file mode 100644 index 19a8bb0f4..000000000 --- a/src/test/ui/const-generics/auxiliary/crayte.rs +++ /dev/null @@ -1,16 +0,0 @@ -// edition:2018 - -pub trait Foo {} -struct Local; -impl Foo for Local {} - -pub fn out_foo() -> impl Foo { Local } -pub fn in_foo(_: impl Foo) {} - -pub async fn async_simple(_: [u8; N]) {} -pub async fn async_out_foo() -> impl Foo { Local } -pub async fn async_in_foo(_: impl Foo) {} - -pub trait Bar { - type Assoc: Foo; -} diff --git a/src/test/ui/const-generics/auxiliary/generics_of_parent.rs b/src/test/ui/const-generics/auxiliary/generics_of_parent.rs deleted file mode 100644 index 5c2b1f4bd..000000000 --- a/src/test/ui/const-generics/auxiliary/generics_of_parent.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// library portion of regression test for #87674 -pub struct Foo([(); N + 1]) -where - [(); N + 1]: ; - -// library portion of regression test for #87603 -pub struct S -where - [T; N * 2]: Sized, -{ - pub s: [T; N * 2], -} -impl S -where - [T; N * 2]: Sized, -{ - pub fn test() -> Self { - S { s: [T::default(); N * 2] } - } -} 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 deleted file mode 100644 index cd5b8161d..000000000 --- a/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// library portion of testing that `impl Trait<{ expr }>` doesnt -// ice because of a `DefKind::TyParam` parent -pub fn foo(foo: impl Into<[(); N + 1]>) { - foo.into(); -} diff --git a/src/test/ui/const-generics/auxiliary/legacy-const-generics.rs b/src/test/ui/const-generics/auxiliary/legacy-const-generics.rs deleted file mode 100644 index 67352a2fb..000000000 --- a/src/test/ui/const-generics/auxiliary/legacy-const-generics.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_legacy_const_generics(1)] -pub fn foo(x: usize, z: usize) -> [usize; 3] { - [x, Y, z] -} diff --git a/src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs b/src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs deleted file mode 100644 index df1c99e86..000000000 --- a/src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -trait Trait { - const ASSOC_CONST: usize = 0; -} - -impl Trait<()> for u8 {} - -// `u8::ASSOC_CONST` is resolved today, but will be ambiguous -// under lazy normalization. -fn foo() -> [(T, U); u8::ASSOC_CONST] -where - u8: Trait + Trait, -{ - todo!() -} - -fn main() {} diff --git a/src/test/ui/const-generics/backcompat/unevaluated-consts.rs b/src/test/ui/const-generics/backcompat/unevaluated-consts.rs deleted file mode 100644 index 3f90d22ae..000000000 --- a/src/test/ui/const-generics/backcompat/unevaluated-consts.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -// If we allow the parent generics here without using lazy normalization -// this results in a cycle error. -struct Foo(T, U); - -impl From<[u8; 1 + 1]> for Foo { - fn from(value: [u8; 1 + 1]) -> Foo { - todo!(); - } -} - -fn break_me() -where - [u8; 1 + 1]: From<[u8; 1 + 1]> -{} - -fn main() {} diff --git a/src/test/ui/const-generics/bad-const-generic-exprs.rs b/src/test/ui/const-generics/bad-const-generic-exprs.rs deleted file mode 100644 index ca91643ed..000000000 --- a/src/test/ui/const-generics/bad-const-generic-exprs.rs +++ /dev/null @@ -1,22 +0,0 @@ -struct Wow; - -fn main() { - let _: Wow; - //~^ ERROR invalid const generic expression - //~| HELP expressions must be enclosed in braces to be used as const generic arguments - let _: Wow<|| ()>; - //~^ ERROR invalid const generic expression - //~| HELP expressions must be enclosed in braces to be used as const generic arguments - let _: Wow; - //~^ ERROR expected one of - //~| HELP expressions must be enclosed in braces to be used as const generic arguments - let _: Wow; - //~^ ERROR expected one of - //~| HELP expressions must be enclosed in braces to be used as const generic arguments - - // FIXME(compiler-errors): This one is still unsatisfying, - // and probably a case I could see someone typing by accident.. - let _: Wow<[12]>; - //~^ ERROR expected type, found - //~| ERROR type provided when a constant was expected -} diff --git a/src/test/ui/const-generics/bad-const-generic-exprs.stderr b/src/test/ui/const-generics/bad-const-generic-exprs.stderr deleted file mode 100644 index 24668b08b..000000000 --- a/src/test/ui/const-generics/bad-const-generic-exprs.stderr +++ /dev/null @@ -1,59 +0,0 @@ -error: invalid const generic expression - --> $DIR/bad-const-generic-exprs.rs:4:16 - | -LL | let _: Wow; - | ^^^^^^^^^^ - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | let _: Wow<{ if true {} }>; - | + + - -error: invalid const generic expression - --> $DIR/bad-const-generic-exprs.rs:7:16 - | -LL | let _: Wow<|| ()>; - | ^^^^^ - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | let _: Wow<{ || () }>; - | + + - -error: expected one of `,` or `>`, found `.` - --> $DIR/bad-const-generic-exprs.rs:10:17 - | -LL | let _: Wow; - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | let _: Wow<{ A.b }>; - | + + - -error: expected one of `,` or `>`, found `.` - --> $DIR/bad-const-generic-exprs.rs:13:17 - | -LL | let _: Wow; - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | let _: Wow<{ A.0 }>; - | + + - -error: expected type, found `12` - --> $DIR/bad-const-generic-exprs.rs:19:17 - | -LL | let _: Wow<[12]>; - | ^^ expected type - -error[E0747]: type provided when a constant was expected - --> $DIR/bad-const-generic-exprs.rs:19:16 - | -LL | let _: Wow<[12]>; - | ^^^^ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/broken-mir-1.rs b/src/test/ui/const-generics/broken-mir-1.rs deleted file mode 100644 index 6b6140e3a..000000000 --- a/src/test/ui/const-generics/broken-mir-1.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -pub trait Foo { - fn foo(&self); -} - - -impl Foo for [T; N] { - fn foo(&self) { - let _ = &self; - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/broken-mir-2.rs b/src/test/ui/const-generics/broken-mir-2.rs deleted file mode 100644 index 9d6228117..000000000 --- a/src/test/ui/const-generics/broken-mir-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass - -#![allow(dead_code)] - -use std::fmt::Debug; - -#[derive(Debug)] -struct S([T; N]); - -fn main() {} 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 deleted file mode 100644 index a6e767489..000000000 --- a/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs +++ /dev/null @@ -1,10 +0,0 @@ -// check-pass - -// This test confirms that the types can be inferred correctly for this example with const -// generics. Previously this would ICE, and more recently error. - -struct Foo(pub [u8; NUM_BYTES]); - -fn main() { - let _ = Foo::<3>([1, 2, 3]); -} diff --git a/src/test/ui/const-generics/coerce_unsized_array.rs b/src/test/ui/const-generics/coerce_unsized_array.rs deleted file mode 100644 index ffd5eb9d4..000000000 --- a/src/test/ui/const-generics/coerce_unsized_array.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass -fn foo(v: &[u8; N]) -> &[u8] { - v -} - -fn main() { - assert_eq!(foo(&[1, 2]), &[1, 2]); -} 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 deleted file mode 100644 index 372f0433e..000000000 --- a/src/test/ui/const-generics/concrete-const-as-fn-arg.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test that a concrete const type i.e. A<2>, can be used as an argument type in a function -// run-pass - -struct A; // ok - -fn with_concrete_const_arg(_: A<2>) -> u32 { 17 } - -fn main() { - let val: A<2> = A; - assert_eq!(with_concrete_const_arg(val), 17); -} diff --git a/src/test/ui/const-generics/concrete-const-impl-method.rs b/src/test/ui/const-generics/concrete-const-impl-method.rs deleted file mode 100644 index 53c9c0ead..000000000 --- a/src/test/ui/const-generics/concrete-const-impl-method.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test that a method/associated non-method within an impl block of a concrete const type i.e. A<2>, -// is callable. -// run-pass - -pub struct A; - -impl A<2> { - fn impl_method(&self) -> u32 { - 17 - } - - fn associated_non_method() -> u32 { - 17 - } -} - -fn main() { - let val: A<2> = A; - assert_eq!(val.impl_method(), 17); - assert_eq!(A::<2>::associated_non_method(), 17); -} 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 deleted file mode 100644 index 6f85237cf..000000000 --- a/src/test/ui/const-generics/condition-in-trait-const-arg.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Checks that `impl Trait<{anon_const}> for Type` evaluates successfully. -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -trait IsZeroTrait{} - -impl IsZeroTrait<{0u8 == 0u8}> for () {} - -impl IsZeroTrait for ((),) {} - -fn main() {} diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.full.stderr b/src/test/ui/const-generics/const-arg-in-const-arg.full.stderr deleted file mode 100644 index 8672e79b3..000000000 --- a/src/test/ui/const-generics/const-arg-in-const-arg.full.stderr +++ /dev/null @@ -1,162 +0,0 @@ -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:18:23 - | -LL | let _: [u8; faz::<'a>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:21:23 - | -LL | let _: [u8; faz::<'b>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:41:24 - | -LL | let _: Foo<{ faz::<'a>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:44:24 - | -LL | let _: Foo<{ faz::<'b>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:13:12 - | -LL | let _: [u8; foo::()]; - | ^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); foo::()]:` - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:15:12 - | -LL | let _: [u8; bar::()]; - | ^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); bar::()]:` - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:36:12 - | -LL | let _: Foo<{ foo::() }>; - | ^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { foo::() }]:` - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:38:12 - | -LL | let _: Foo<{ bar::() }>; - | ^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { bar::() }]:` - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:25:17 - | -LL | let _ = [0; foo::()]; - | ^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); foo::()]:` - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:27:17 - | -LL | let _ = [0; bar::()]; - | ^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); bar::()]:` - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:30:23 - | -LL | let _ = [0; faz::<'a>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:33:23 - | -LL | let _ = [0; faz::<'b>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:47:19 - | -LL | let _ = Foo::<{ foo::() }>; - | ^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { foo::() }]:` - -error: unconstrained generic constant - --> $DIR/const-arg-in-const-arg.rs:49:19 - | -LL | let _ = Foo::<{ bar::() }>; - | ^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { bar::() }]:` - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:52:27 - | -LL | let _ = Foo::<{ faz::<'a>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:55:27 - | -LL | let _ = Foo::<{ faz::<'b>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: aborting due to 16 previous errors - 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 deleted file mode 100644 index f1353aa99..000000000 --- a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr +++ /dev/null @@ -1,359 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:13:23 - | -LL | let _: [u8; foo::()]; - | ^ 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/const-arg-in-const-arg.rs:15:23 - | -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(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:18:23 - | -LL | let _: [u8; faz::<'a>(&())]; - | ^^ - | - = 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:20:23 - | -LL | let _: [u8; baz::<'a>(&())]; - | ^^ - | - = 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:21:23 - | -LL | let _: [u8; faz::<'b>(&())]; - | ^^ - | - = 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:23:23 - | -LL | let _: [u8; baz::<'b>(&())]; - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:27:23 - | -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(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:30:23 - | -LL | let _ = [0; faz::<'a>(&())]; - | ^^ - | - = 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:23 - | -LL | let _ = [0; baz::<'a>(&())]; - | ^^ - | - = 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:23 - | -LL | let _ = [0; faz::<'b>(&())]; - | ^^ - | - = 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:35:23 - | -LL | let _ = [0; baz::<'b>(&())]; - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:36:24 - | -LL | let _: Foo<{ foo::() }>; - | ^ 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/const-arg-in-const-arg.rs:38:24 - | -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(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:41:24 - | -LL | let _: Foo<{ faz::<'a>(&()) }>; - | ^^ - | - = 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:43:24 - | -LL | let _: Foo<{ baz::<'a>(&()) }>; - | ^^ - | - = 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:44:24 - | -LL | let _: Foo<{ faz::<'b>(&()) }>; - | ^^ - | - = 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:46:24 - | -LL | let _: Foo<{ baz::<'b>(&()) }>; - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error: generic parameters may not be used in const operations - --> $DIR/const-arg-in-const-arg.rs:47:27 - | -LL | let _ = Foo::<{ foo::() }>; - | ^ 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/const-arg-in-const-arg.rs:49:27 - | -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(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:52:27 - | -LL | let _ = Foo::<{ faz::<'a>(&()) }>; - | ^^ - | - = 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:54:27 - | -LL | let _ = Foo::<{ baz::<'a>(&()) }>; - | ^^ - | - = 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:55:27 - | -LL | let _ = Foo::<{ faz::<'b>(&()) }>; - | ^^ - | - = 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:57:27 - | -LL | let _ = Foo::<{ baz::<'b>(&()) }>; - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:15:23 - | -LL | let _: [u8; bar::()]; - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | let _: [u8; bar::<{ N }>()]; - | + + - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:18:23 - | -LL | let _: [u8; faz::<'a>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:21:23 - | -LL | let _: [u8; faz::<'b>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:38:24 - | -LL | let _: Foo<{ bar::() }>; - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | let _: Foo<{ bar::<{ N }>() }>; - | + + - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:41:24 - | -LL | let _: Foo<{ faz::<'a>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:44:24 - | -LL | let _: Foo<{ faz::<'b>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: constant expression depends on a generic parameter - --> $DIR/const-arg-in-const-arg.rs:25:17 - | -LL | let _ = [0; foo::()]; - | ^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:27:23 - | -LL | let _ = [0; bar::()]; - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | let _ = [0; bar::<{ N }>()]; - | + + - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:30:23 - | -LL | let _ = [0; faz::<'a>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:33:23 - | -LL | let _ = [0; faz::<'b>(&())]; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-arg-in-const-arg.rs:49:27 - | -LL | let _ = Foo::<{ bar::() }>; - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | let _ = Foo::<{ bar::<{ N }>() }>; - | + + - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:52:27 - | -LL | let _ = Foo::<{ faz::<'a>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/const-arg-in-const-arg.rs:55:27 - | -LL | let _ = Foo::<{ faz::<'b>(&()) }>; - | ^^ - | -note: the late bound lifetime parameter is introduced here - --> $DIR/const-arg-in-const-arg.rs:8:14 - | -LL | const fn faz<'a>(_: &'a ()) -> usize { 13 } - | ^^ - -error: aborting due to 36 previous errors - -Some errors have detailed explanations: E0658, E0747. -For more information about an error, try `rustc --explain E0658`. 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 deleted file mode 100644 index 44a4f560a..000000000 --- a/src/test/ui/const-generics/const-arg-in-const-arg.rs +++ /dev/null @@ -1,60 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -const fn foo() -> usize { std::mem::size_of::() } -const fn bar() -> usize { N } -const fn faz<'a>(_: &'a ()) -> usize { 13 } -const fn baz<'a>(_: &'a ()) -> usize where &'a (): Sized { 13 } - -struct Foo; -fn test<'a, 'b, T, const N: usize>() where &'b (): Sized { - let _: [u8; foo::()]; //[min]~ ERROR generic parameters may not - //[full]~^ ERROR unconstrained generic constant - let _: [u8; bar::()]; //[min]~ ERROR generic parameters may not - //[min]~^ ERROR unresolved item provided when a constant was expected - //[full]~^^ ERROR unconstrained generic constant - let _: [u8; faz::<'a>(&())]; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _: [u8; baz::<'a>(&())]; //[min]~ ERROR a non-static lifetime - let _: [u8; faz::<'b>(&())]; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _: [u8; baz::<'b>(&())]; //[min]~ ERROR a non-static lifetime - - let _ = [0; foo::()]; //[min]~ ERROR constant expression depends on a generic parameter - //[full]~^ ERROR unconstrained generic constant - let _ = [0; bar::()]; //[min]~ ERROR generic parameters may not - //[min]~^ ERROR unresolved item provided when a constant was expected - //[full]~^^ ERROR unconstrained generic constant - let _ = [0; faz::<'a>(&())]; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _ = [0; baz::<'a>(&())]; //[min]~ ERROR a non-static lifetime - let _ = [0; faz::<'b>(&())]; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _ = [0; baz::<'b>(&())]; //[min]~ ERROR a non-static lifetime - let _: Foo<{ foo::() }>; //[min]~ ERROR generic parameters may not - //[full]~^ ERROR unconstrained generic constant - let _: Foo<{ bar::() }>; //[min]~ ERROR generic parameters may not - //[min]~^ ERROR unresolved item provided when a constant was expected - //[full]~^^ ERROR unconstrained generic constant - let _: Foo<{ faz::<'a>(&()) }>; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _: Foo<{ baz::<'a>(&()) }>; //[min]~ ERROR a non-static lifetime - let _: Foo<{ faz::<'b>(&()) }>; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _: Foo<{ baz::<'b>(&()) }>; //[min]~ ERROR a non-static lifetime - let _ = Foo::<{ foo::() }>; //[min]~ ERROR generic parameters may not - //[full]~^ ERROR unconstrained generic constant - let _ = Foo::<{ bar::() }>; //[min]~ ERROR generic parameters may not - //[min]~^ ERROR unresolved item provided when a constant was expected - //[full]~^^ ERROR unconstrained generic constant - let _ = Foo::<{ faz::<'a>(&()) }>; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _ = Foo::<{ baz::<'a>(&()) }>; //[min]~ ERROR a non-static lifetime - let _ = Foo::<{ faz::<'b>(&()) }>; //[min]~ ERROR a non-static lifetime - //~^ ERROR cannot specify lifetime arguments - let _ = Foo::<{ baz::<'b>(&()) }>; //[min]~ ERROR a non-static lifetime -} - -fn main() {} diff --git a/src/test/ui/const-generics/const-arg-in-fn.rs b/src/test/ui/const-generics/const-arg-in-fn.rs deleted file mode 100644 index 9b225b18d..000000000 --- a/src/test/ui/const-generics/const-arg-in-fn.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-pass -fn const_u32_identity() -> u32 { - X -} - - fn main() { - let val = const_u32_identity::<18>(); - assert_eq!(val, 18); -} 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 deleted file mode 100644 index 8ee17e637..000000000 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs +++ /dev/null @@ -1,8 +0,0 @@ -type Array = [T; N]; - -fn foo() -> Array { - //~^ ERROR constant provided when a type was expected - unimplemented!() -} - -fn main() {} 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 deleted file mode 100644 index 4e12f7a8c..000000000 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0747]: constant provided when a type was expected - --> $DIR/const-arg-type-arg-misordered.rs:3: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-argument-cross-crate-mismatch.rs b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs deleted file mode 100644 index d863d097d..000000000 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:const_generic_lib.rs - -extern crate const_generic_lib; - -fn main() { - let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); - //~^ ERROR mismatched types - let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); - //~^ ERROR mismatched types -} 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 deleted file mode 100644 index d5eefd357..000000000 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr +++ /dev/null @@ -1,31 +0,0 @@ -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 - | | - | arguments to this struct are incorrect - | -note: tuple struct defined here - --> $DIR/auxiliary/const_generic_lib.rs:1:12 - | -LL | pub struct Struct(pub [u8; N]); - | ^^^^^^ - -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 - | | - | arguments to this struct are incorrect - | -note: tuple struct defined here - --> $DIR/auxiliary/const_generic_lib.rs:1:12 - | -LL | pub struct Struct(pub [u8; N]); - | ^^^^^^ - -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.rs b/src/test/ui/const-generics/const-argument-cross-crate.rs deleted file mode 100644 index 5693409e9..000000000 --- a/src/test/ui/const-generics/const-argument-cross-crate.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -// revisions: full min -// aux-build:const_generic_lib.rs - -extern crate const_generic_lib; - -struct Container(#[allow(unused_tuple_struct_fields)] const_generic_lib::Alias); - -fn main() { - let res = const_generic_lib::function(const_generic_lib::Struct([14u8, 1u8, 2u8])); - assert_eq!(res, 14u8); - let _ = Container(const_generic_lib::Struct([0u8, 1u8])); -} 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 deleted file mode 100644 index 2ceba59cf..000000000 --- a/src/test/ui/const-generics/const-argument-if-length.full.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/const-argument-if-length.rs:15:12 - | -LL | pub struct AtLeastByte { - | - this type parameter needs to be `std::marker::Sized` -LL | value: T, - | ^ doesn't have a size known at compile-time - | - = note: only the last field of a struct may have a dynamically sized type - = help: change the field's type to have a statically known size -help: consider removing the `?Sized` bound to make the type parameter `Sized` - | -LL - pub struct AtLeastByte { -LL + pub struct AtLeastByte { - | -help: borrowed types always have a statically known size - | -LL | value: &T, - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -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 deleted file mode 100644 index f85e60f63..000000000 --- a/src/test/ui/const-generics/const-argument-if-length.min.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error: generic parameters may not be used in const operations - --> $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(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:15:12 - | -LL | pub struct AtLeastByte { - | - this type parameter needs to be `std::marker::Sized` -LL | value: T, - | ^ doesn't have a size known at compile-time - | - = note: only the last field of a struct may have a dynamically sized type - = help: change the field's type to have a statically known size -help: consider removing the `?Sized` bound to make the type parameter `Sized` - | -LL - pub struct AtLeastByte { -LL + pub struct AtLeastByte { - | -help: borrowed types always have a statically known size - | -LL | value: &T, - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | value: Box, - | ++++ + - -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.rs b/src/test/ui/const-generics/const-argument-if-length.rs deleted file mode 100644 index db1eafca2..000000000 --- a/src/test/ui/const-generics/const-argument-if-length.rs +++ /dev/null @@ -1,22 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -pub const fn is_zst() -> usize { - if std::mem::size_of::() == 0 { - 1 - } else { - 0 - } -} - -pub struct AtLeastByte { - value: T, - //~^ 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.min.stderr b/src/test/ui/const-generics/const-argument-non-static-lifetime.min.stderr deleted file mode 100644 index f1f3a9c3d..000000000 --- a/src/test/ui/const-generics/const-argument-non-static-lifetime.min.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: a non-static lifetime is not allowed in a `const` - --> $DIR/const-argument-non-static-lifetime.rs:15:17 - | -LL | let _: &'a (); - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. 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 deleted file mode 100644 index 36a569784..000000000 --- a/src/test/ui/const-generics/const-argument-non-static-lifetime.rs +++ /dev/null @@ -1,21 +0,0 @@ -// [full] check-pass -// revisions: full min - -// regression test for #78180 -// compile-flags: -Zsave-analysis - -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] -#![allow(dead_code)] - -fn test() {} - -fn wow<'a>() -> &'a () { - test::<{ - let _: &'a (); //[min]~ ERROR a non-static lifetime - 3 - }>(); - &() -} - -fn main() {} 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 deleted file mode 100644 index 161bfaab4..000000000 --- a/src/test/ui/const-generics/const-fn-with-const-param.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Checks that `const fn` with const params can be used. -// run-pass - -const fn const_u32_identity() -> u32 { - X -} - -fn main() { - assert_eq!(const_u32_identity::<18>(), 18); -} diff --git a/src/test/ui/const-generics/const-generic-default-wont-borrowck.rs b/src/test/ui/const-generics/const-generic-default-wont-borrowck.rs deleted file mode 100644 index e64adacac..000000000 --- a/src/test/ui/const-generics/const-generic-default-wont-borrowck.rs +++ /dev/null @@ -1,5 +0,0 @@ -struct X; - -fn main() {} diff --git a/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr b/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr deleted file mode 100644 index 0ed370b83..000000000 --- a/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0381]: used binding `s` isn't initialized - --> $DIR/const-generic-default-wont-borrowck.rs:2:26 - | -LL | let s: &'static str; s.len() - | - ^^^^^^^ `*s` used here but it isn't initialized - | | - | binding declared here but left uninitialized - | -help: consider assigning a value - | -LL | let s: &'static str = todo!(); s.len() - | +++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/const-generics/const-generic-function.rs b/src/test/ui/const-generics/const-generic-function.rs deleted file mode 100644 index c8d2683e5..000000000 --- a/src/test/ui/const-generics/const-generic-function.rs +++ /dev/null @@ -1,21 +0,0 @@ -fn foo() -> i32 { - N -} - -const fn bar(n: i32, m: i32) -> i32 { - n -} - -const fn baz() -> i32 { - 1 -} - -const FOO: i32 = 3; - -fn main() { - foo::(); //~ ERROR expected type, found function `baz` - //~| ERROR unresolved item provided when a constant was expected - foo::(); //~ ERROR expected type, found `1` - foo::(); //~ ERROR expected type, found `1` - foo::(); //~ ERROR expected type, found `2` -} diff --git a/src/test/ui/const-generics/const-generic-function.stderr b/src/test/ui/const-generics/const-generic-function.stderr deleted file mode 100644 index 5ad3f1006..000000000 --- a/src/test/ui/const-generics/const-generic-function.stderr +++ /dev/null @@ -1,54 +0,0 @@ -error: expected type, found `1` - --> $DIR/const-generic-function.rs:18:19 - | -LL | foo::(); - | ^ expected type - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar(bar(1, 1), bar(1, 1)) }>(); - | + + - -error: expected type, found `1` - --> $DIR/const-generic-function.rs:19:15 - | -LL | foo::(); - | ^ expected type - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar(1, 1) }>(); - | + + - -error: expected type, found `2` - --> $DIR/const-generic-function.rs:20:20 - | -LL | foo::(); - | ^ expected type - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar(FOO, 2) }>(); - | + + - -error[E0573]: expected type, found function `baz` - --> $DIR/const-generic-function.rs:16:11 - | -LL | foo::(); - | ^^^^^ not a type - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/const-generic-function.rs:16:11 - | -LL | foo::(); - | ^^^^^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | foo::<{ baz() }>(); - | + + - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0573, E0747. -For more information about an error, try `rustc --explain E0573`. diff --git a/src/test/ui/const-generics/const-generic-type_name.rs b/src/test/ui/const-generics/const-generic-type_name.rs deleted file mode 100644 index bb16be9c5..000000000 --- a/src/test/ui/const-generics/const-generic-type_name.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass - -#[derive(Debug)] -struct S; - -fn main() { - assert_eq!(std::any::type_name::>(), "const_generic_type_name::S<3>"); -} 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 deleted file mode 100644 index d8a0e076e..000000000 --- a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs +++ /dev/null @@ -1,7 +0,0 @@ -// check-pass - -struct Foo; - -impl Foo<1, A> {} // ok - -fn main() {} 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 deleted file mode 100644 index cb1cebe1f..000000000 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn bar(_: &'a ()) { - //~^ ERROR lifetime parameters must be declared prior to type and const parameters -} - -fn foo(_: &T) {} - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-before-other-params.stderr b/src/test/ui/const-generics/const-param-before-other-params.stderr deleted file mode 100644 index 2c7a47bbc..000000000 --- a/src/test/ui/const-generics/const-param-before-other-params.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: lifetime parameters must be declared prior to type and const parameters - --> $DIR/const-param-before-other-params.rs:1:21 - | -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-elided-lifetime.full.stderr b/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr deleted file mode 100644 index d6753a74f..000000000 --- a/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $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: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: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: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:26:17 - | -LL | fn bar() {} - | ^ explicit lifetime name needed here - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0637`. 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 deleted file mode 100644 index 4bba42c77..000000000 --- a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr +++ /dev/null @@ -1,78 +0,0 @@ -error[E0637]: `&` without an explicit lifetime name cannot be used here - --> $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: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: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: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: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:9:19 - | -LL | struct A; - | ^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs:14:15 - | -LL | impl A { - | ^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/const-param-elided-lifetime.rs: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(adt_const_params)]` - -error: `&'static u8` is forbidden as the type of a const generic parameter - --> $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(adt_const_params)]` - -error: `&'static u8` is forbidden as the type of a const generic parameter - --> $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(adt_const_params)]` - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0637`. diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.rs b/src/test/ui/const-generics/const-param-elided-lifetime.rs deleted file mode 100644 index 487b82dbf..000000000 --- a/src/test/ui/const-generics/const-param-elided-lifetime.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Elided lifetimes within the type of a const generic parameters is disallowed. This matches the -// behaviour of trait bounds where `fn foo>() {}` is illegal. Though we could change -// 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(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct A; -//~^ ERROR `&` without an explicit lifetime name cannot be used here -//[min]~^^ ERROR `&'static u8` is forbidden -trait B {} - -impl A { -//~^ ERROR `&` without an explicit lifetime name cannot be used here -//[min]~^^ ERROR `&'static u8` is forbidden - fn foo(&self) {} - //~^ ERROR `&` without an explicit lifetime name cannot be used here - //[min]~^^ ERROR `&'static u8` is forbidden -} - -impl B for A {} -//~^ ERROR `&` without an explicit lifetime name cannot be used here -//[min]~^^ ERROR `&'static u8` is forbidden - -fn bar() {} -//~^ ERROR `&` without an explicit lifetime name cannot be used here -//[min]~^^ ERROR `&'static u8` is forbidden - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-in-async.rs b/src/test/ui/const-generics/const-param-in-async.rs deleted file mode 100644 index f823431e6..000000000 --- a/src/test/ui/const-generics/const-param-in-async.rs +++ /dev/null @@ -1,31 +0,0 @@ -// edition:2018 -// check-pass - -async fn foo(arg: [u8; N]) -> usize { arg.len() } - -async fn bar() -> [u8; N] { - [0; N] -} - -trait Trait { - fn fynn(&self) -> usize; -} -impl Trait for [u8; N] { - fn fynn(&self) -> usize { - N - } -} -async fn baz() -> impl Trait { - [0; N] -} - -async fn biz(v: impl Trait) -> usize { - v.fynn() -} - -async fn user() { - let _ = foo::(bar().await).await; - let _ = biz(baz::().await).await; -} - -fn main() { } diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.full.stderr b/src/test/ui/const-generics/const-param-type-depends-on-const-param.full.stderr deleted file mode 100644 index f639e276f..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.full.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-const-param.rs:11:52 - | -LL | pub struct Dependent([(); N]); - | ^ the type must not depend on the parameter `N` - -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-const-param.rs:15:40 - | -LL | pub struct SelfDependent; - | ^ the type must not depend on the parameter `N` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0770`. 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 deleted file mode 100644 index a7b78b80c..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-const-param.rs:11:52 - | -LL | pub struct Dependent([(); N]); - | ^ the type must not depend on the parameter `N` - -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-const-param.rs:15:40 - | -LL | pub struct SelfDependent; - | ^ the type must not depend on the parameter `N` - -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/const-param-type-depends-on-const-param.rs:11:47 - | -LL | pub struct Dependent([(); N]); - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/const-param-type-depends-on-const-param.rs:15:35 - | -LL | pub struct SelfDependent; - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0770`. 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 deleted file mode 100644 index 9d50f9a47..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs +++ /dev/null @@ -1,19 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -// Currently, const parameters cannot depend on other generic parameters, -// as our current implementation can't really support this. -// -// We may want to lift this restriction in the future. - -pub struct Dependent([(); N]); -//~^ ERROR: the type of const parameters must not depend on other generic parameters -//[min]~^^ ERROR `[u8; _]` is forbidden - -pub struct SelfDependent; -//~^ ERROR: the type of const parameters must not depend on other generic parameters -//[min]~^^ ERROR `[u8; _]` is forbidden - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs b/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs deleted file mode 100644 index 781f50e61..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.rs +++ /dev/null @@ -1,9 +0,0 @@ -// compile-flags: -Zsave-analysis -// Regression test for #69414 ^ - -use std::marker::PhantomData; - -struct B(PhantomData<[T; N]>); -//~^ ERROR the type of const parameters must not depend on other generic parameters - -fn main() {} diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr b/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr deleted file mode 100644 index 8e14defd6..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param-ungated.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-type-param-ungated.rs:6:22 - | -LL | struct B(PhantomData<[T; N]>); - | ^ the type must not depend on the parameter `T` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.full.stderr b/src/test/ui/const-generics/const-param-type-depends-on-type-param.full.stderr deleted file mode 100644 index 32f7dea82..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param.full.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-type-param.rs:11:34 - | -LL | pub struct Dependent([(); X]); - | ^ the type must not depend on the parameter `T` - -error[E0392]: parameter `T` is never used - --> $DIR/const-param-type-depends-on-type-param.rs:11:22 - | -LL | pub struct Dependent([(); X]); - | ^ unused parameter - | - = 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 2 previous errors - -Some errors have detailed explanations: E0392, E0770. -For more information about an error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.min.stderr b/src/test/ui/const-generics/const-param-type-depends-on-type-param.min.stderr deleted file mode 100644 index 32f7dea82..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param.min.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/const-param-type-depends-on-type-param.rs:11:34 - | -LL | pub struct Dependent([(); X]); - | ^ the type must not depend on the parameter `T` - -error[E0392]: parameter `T` is never used - --> $DIR/const-param-type-depends-on-type-param.rs:11:22 - | -LL | pub struct Dependent([(); X]); - | ^ unused parameter - | - = 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 2 previous errors - -Some errors have detailed explanations: E0392, E0770. -For more information about an error, try `rustc --explain E0392`. 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 deleted file mode 100644 index 71d91fd7e..000000000 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs +++ /dev/null @@ -1,15 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -// Currently, const parameters cannot depend on other generic parameters, -// as our current implementation can't really support this. -// -// We may want to lift this restriction in the future. - -pub struct Dependent([(); X]); -//~^ ERROR: the type of const parameters must not depend on other generic parameters -//~| ERROR: parameter `T` is never used - -fn main() {} diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs deleted file mode 100644 index b08d62ccc..000000000 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![deny(non_upper_case_globals)] - -fn noop() { - //~^ ERROR const parameter `x` should have an upper case name -} - -fn main() {} diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr deleted file mode 100644 index efaa18285..000000000 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr +++ /dev/null @@ -1,14 +0,0 @@ -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_trait_fn-issue-88433.rs b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs deleted file mode 100644 index 6e04cfaec..000000000 --- a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs +++ /dev/null @@ -1,27 +0,0 @@ -// build-pass - -#![feature(const_trait_impl)] - -#[const_trait] -trait Func { - type Output; - - fn call_once(self, arg: T) -> Self::Output; -} - - -struct Closure; - -impl const Func<&usize> for Closure { - type Output = usize; - - fn call_once(self, arg: &usize) -> Self::Output { - *arg - } -} - -enum Bug { - V(T), -} - -fn main() {} diff --git a/src/test/ui/const-generics/core-types.rs b/src/test/ui/const-generics/core-types.rs deleted file mode 100644 index 91410c4af..000000000 --- a/src/test/ui/const-generics/core-types.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Check that all types allowed with `min_const_generics` work. -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct A; -struct B; -struct C; -struct D; -struct E; -struct F; -struct G; -struct H; -struct I; -struct J; -struct K; -struct L; -struct M; -struct N; - -fn main() { - let _ = A::<{u8::MIN}>; - let _ = A::<{u8::MAX}>; - let _ = B::<{u16::MIN}>; - let _ = B::<{u16::MAX}>; - let _ = C::<{u32::MIN}>; - let _ = C::<{u32::MAX}>; - let _ = D::<{u64::MIN}>; - let _ = D::<{u64::MAX}>; - let _ = E::<{u128::MIN}>; - let _ = E::<{u128::MAX}>; - let _ = F::<{usize::MIN}>; - let _ = F::<{usize::MAX}>; - let _ = G::<{i8::MIN}>; - let _ = G::<{i8::MAX}>; - let _ = H::<{i16::MIN}>; - let _ = H::<{i16::MAX}>; - let _ = I::<{i32::MIN}>; - let _ = I::<{i32::MAX}>; - let _ = J::<{i64::MIN}>; - let _ = J::<{i64::MAX}>; - let _ = K::<{i128::MIN}>; - let _ = K::<{i128::MAX}>; - let _ = L::<{isize::MIN}>; - let _ = L::<{isize::MAX}>; - let _ = M::<'A'>; - let _ = N::; -} diff --git a/src/test/ui/const-generics/cross_crate_complex.rs b/src/test/ui/const-generics/cross_crate_complex.rs deleted file mode 100644 index ebde155f7..000000000 --- a/src/test/ui/const-generics/cross_crate_complex.rs +++ /dev/null @@ -1,23 +0,0 @@ -// aux-build:crayte.rs -// edition:2018 -// run-pass -extern crate crayte; - -use crayte::*; - -async fn foo() { - in_foo(out_foo::<3>()); - async_simple([0; 17]).await; - async_in_foo(async_out_foo::<4>().await).await; -} - -struct Faz; - -impl Foo for Faz {} -impl Bar for Faz { - type Assoc = Faz; -} - -fn main() { - let _ = foo; -} diff --git a/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs b/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs deleted file mode 100644 index eed982534..000000000 --- a/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs +++ /dev/null @@ -1,11 +0,0 @@ -pub struct Defaulted; -impl Defaulted { - pub fn new() -> Self { - Defaulted - } -} -impl Defaulted { - pub fn value(&self) -> usize { - N - } -} diff --git a/src/test/ui/const-generics/defaults/auxiliary/trait_object_lt_defaults_lib.rs b/src/test/ui/const-generics/defaults/auxiliary/trait_object_lt_defaults_lib.rs deleted file mode 100644 index 26a2c47ff..000000000 --- a/src/test/ui/const-generics/defaults/auxiliary/trait_object_lt_defaults_lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct Foo<'a, const N: usize, T: 'a + ?Sized>(pub &'a T, [(); N]); 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 deleted file mode 100644 index b836cfeae..000000000 --- a/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/complex-generic-default-expr.rs:6:47 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-generic-default-expr.rs:9:62 - | -LL | struct Bar() }>(T); - | ^ 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: 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 deleted file mode 100644 index 7f50d4c9f..000000000 --- a/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: full min -//[full] check-pass -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Foo; -//[min]~^ ERROR generic parameters may not be used in const operations - -struct Bar() }>(T); -//[min]~^ ERROR generic parameters may not be used in const operations - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/complex-unord-param.min.stderr b/src/test/ui/const-generics/defaults/complex-unord-param.min.stderr deleted file mode 100644 index 8e8d26a00..000000000 --- a/src/test/ui/const-generics/defaults/complex-unord-param.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: type parameters must be declared prior to const parameters - --> $DIR/complex-unord-param.rs:8:41 - | -LL | struct NestedArrays<'a, const N: usize, A: 'a, const M: usize, T:'a =u32> { - | ---------------------^----------------------^--------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, A: 'a, T: 'a = u32, const N: usize, const M: usize>` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/defaults/complex-unord-param.rs b/src/test/ui/const-generics/defaults/complex-unord-param.rs deleted file mode 100644 index aebc5975a..000000000 --- a/src/test/ui/const-generics/defaults/complex-unord-param.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -// Checks a complicated usage of unordered params -#![allow(dead_code)] - -struct NestedArrays<'a, const N: usize, A: 'a, const M: usize, T:'a =u32> { - args: &'a [&'a [T; M]; N], - specifier: A, -} - -fn main() { - let array = [1, 2, 3]; - let nest = [&array]; - let _ = NestedArrays { - args: &nest, - specifier: true, - }; -} diff --git a/src/test/ui/const-generics/defaults/const-default.rs b/src/test/ui/const-generics/defaults/const-default.rs deleted file mode 100644 index 65cb0eb14..000000000 --- a/src/test/ui/const-generics/defaults/const-default.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -pub struct ConstDefault; - -impl ConstDefault { - fn foo(self) -> usize { - N - } -} - -impl ConstDefault { - fn new() -> Self { - ConstDefault - } - - fn bar(self) {} -} - -pub fn main() { - let s = ConstDefault::new(); - assert_eq!(s.foo(), 3); - - let w = ConstDefault::<3>; - w.bar(); -} diff --git a/src/test/ui/const-generics/defaults/const-param-as-default-value.rs b/src/test/ui/const-generics/defaults/const-param-as-default-value.rs deleted file mode 100644 index c1c955d87..000000000 --- a/src/test/ui/const-generics/defaults/const-param-as-default-value.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -struct Foo([u8; N], [u8; M]); - -fn foo() -> Foo { - let x = [0; N]; - Foo(x, x) -} - -// To check that we actually apply the correct substs for const param defaults. -fn concrete_foo() -> Foo<13> { - Foo(Default::default(), Default::default()) -} - - -fn main() { - let val = foo::<13>(); - assert_eq!(val.0, val.1); - - let val = concrete_foo(); - assert_eq!(val.0, val.1); -} diff --git a/src/test/ui/const-generics/defaults/const-param-in-ty-defaults.rs b/src/test/ui/const-generics/defaults/const-param-in-ty-defaults.rs deleted file mode 100644 index 5f0cafe2e..000000000 --- a/src/test/ui/const-generics/defaults/const-param-in-ty-defaults.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -struct Foo(T); - -impl Foo { - fn new() -> Self { - Foo([0; N]) - } -} - -fn main() { - assert_eq!(Foo::new().0, [0; 10]); -} diff --git a/src/test/ui/const-generics/defaults/default-annotation.rs b/src/test/ui/const-generics/defaults/default-annotation.rs deleted file mode 100644 index 7a9f5732f..000000000 --- a/src/test/ui/const-generics/defaults/default-annotation.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -#![feature(staged_api)] -#![allow(incomplete_features)] -// FIXME(const_generics_defaults): 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; - -#[stable(feature = "const_default_unstable", since="none")] -pub struct ConstDefaultStable; - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.rs b/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.rs deleted file mode 100644 index 45275e609..000000000 --- a/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct Struct; -//~^ ERROR generic parameters cannot use `Self` in their defaults [E0735] - -enum Enum { } -//~^ ERROR generic parameters cannot use `Self` in their defaults [E0735] - -union Union { not_empty: () } -//~^ ERROR generic parameters cannot use `Self` in their defaults [E0735] - -fn main() { - let _: Struct; - let _: Enum; - let _: Union; -} diff --git a/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.stderr b/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.stderr deleted file mode 100644 index 72d7001fd..000000000 --- a/src/test/ui/const-generics/defaults/default-const-param-cannot-reference-self.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0735]: generic parameters cannot use `Self` in their defaults - --> $DIR/default-const-param-cannot-reference-self.rs:1:34 - | -LL | struct Struct; - | ^^^^ `Self` in generic parameter default - -error[E0735]: generic parameters cannot use `Self` in their defaults - --> $DIR/default-const-param-cannot-reference-self.rs:4:30 - | -LL | enum Enum { } - | ^^^^ `Self` in generic parameter default - -error[E0735]: generic parameters cannot use `Self` in their defaults - --> $DIR/default-const-param-cannot-reference-self.rs:7:32 - | -LL | union Union { not_empty: () } - | ^^^^ `Self` in generic parameter default - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0735`. diff --git a/src/test/ui/const-generics/defaults/default-on-impl.rs b/src/test/ui/const-generics/defaults/default-on-impl.rs deleted file mode 100644 index 9ce46aa09..000000000 --- a/src/test/ui/const-generics/defaults/default-on-impl.rs +++ /dev/null @@ -1,6 +0,0 @@ -struct Foo; - -impl Foo {} -//~^ ERROR defaults for const parameters are only allowed - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/default-on-impl.stderr b/src/test/ui/const-generics/defaults/default-on-impl.stderr deleted file mode 100644 index 4b2b05742..000000000 --- a/src/test/ui/const-generics/defaults/default-on-impl.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:3:6 - | -LL | impl Foo {} - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/defaults/default-param-wf-concrete.rs b/src/test/ui/const-generics/defaults/default-param-wf-concrete.rs deleted file mode 100644 index 41a52c7eb..000000000 --- a/src/test/ui/const-generics/defaults/default-param-wf-concrete.rs +++ /dev/null @@ -1,3 +0,0 @@ -struct Foo; -//~^ ERROR evaluation of constant value failed -fn main() {} diff --git a/src/test/ui/const-generics/defaults/default-param-wf-concrete.stderr b/src/test/ui/const-generics/defaults/default-param-wf-concrete.stderr deleted file mode 100644 index e8ebddade..000000000 --- a/src/test/ui/const-generics/defaults/default-param-wf-concrete.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> $DIR/default-param-wf-concrete.rs:1:28 - | -LL | struct Foo; - | ^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/defaults/doesnt_infer.rs b/src/test/ui/const-generics/defaults/doesnt_infer.rs deleted file mode 100644 index 9c59e672d..000000000 --- a/src/test/ui/const-generics/defaults/doesnt_infer.rs +++ /dev/null @@ -1,13 +0,0 @@ -// test that defaulted const params are not used to help type inference - -struct Foo; - -impl Foo { - fn foo() -> Self { loop {} } -} - -fn main() { - let foo = Foo::<1>::foo(); - let foo = Foo::foo(); - //~^ error: type annotations needed for `Foo` -} diff --git a/src/test/ui/const-generics/defaults/doesnt_infer.stderr b/src/test/ui/const-generics/defaults/doesnt_infer.stderr deleted file mode 100644 index 227b2f402..000000000 --- a/src/test/ui/const-generics/defaults/doesnt_infer.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed for `Foo` - --> $DIR/doesnt_infer.rs:11:9 - | -LL | let foo = Foo::foo(); - | ^^^ - | -help: consider giving `foo` an explicit type, where the the value of const parameter `N` is specified - | -LL | let foo: Foo = 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/defaults/external.rs b/src/test/ui/const-generics/defaults/external.rs deleted file mode 100644 index 25ec523cb..000000000 --- a/src/test/ui/const-generics/defaults/external.rs +++ /dev/null @@ -1,24 +0,0 @@ -// aux-build:const_defaulty.rs -// check-pass -extern crate const_defaulty; -use const_defaulty::Defaulted; - -struct Local; -impl Local { - fn new() -> Self { - Local - } -} -implLocal { - fn value(&self) -> usize { - N - } -} - -fn main() { - let v = Defaulted::new(); - assert_eq!(v.value(), 3); - - let l = Local::new(); - assert_eq!(l.value(), 4); -} diff --git a/src/test/ui/const-generics/defaults/forward-declared.rs b/src/test/ui/const-generics/defaults/forward-declared.rs deleted file mode 100644 index ede3d873b..000000000 --- a/src/test/ui/const-generics/defaults/forward-declared.rs +++ /dev/null @@ -1,13 +0,0 @@ -struct Foo; -//~^ ERROR generic parameters with a default cannot use forward declared identifiers - -enum Bar {} -//~^ ERROR generic parameters with a default cannot use forward declared identifiers - -struct Foo2; -//~^ ERROR generic parameters with a default cannot use forward declared identifiers - -enum Bar2 {} -//~^ ERROR generic parameters with a default cannot use forward declared identifiers - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/forward-declared.stderr b/src/test/ui/const-generics/defaults/forward-declared.stderr deleted file mode 100644 index 4856c7a1f..000000000 --- a/src/test/ui/const-generics/defaults/forward-declared.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0128]: generic parameters with a default cannot use forward declared identifiers - --> $DIR/forward-declared.rs:1:29 - | -LL | struct Foo; - | ^ defaulted generic parameters cannot be forward declared - -error[E0128]: generic parameters with a default cannot use forward declared identifiers - --> $DIR/forward-declared.rs:4:27 - | -LL | enum Bar {} - | ^ defaulted generic parameters cannot be forward declared - -error[E0128]: generic parameters with a default cannot use forward declared identifiers - --> $DIR/forward-declared.rs:7:30 - | -LL | struct Foo2; - | ^ defaulted generic parameters cannot be forward declared - -error[E0128]: generic parameters with a default cannot use forward declared identifiers - --> $DIR/forward-declared.rs:10:28 - | -LL | enum Bar2 {} - | ^ defaulted generic parameters cannot be forward declared - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0128`. 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 deleted file mode 100644 index f082bd8d2..000000000 --- a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(generic_const_exprs)] -#![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 deleted file mode 100644 index 61b355118..000000000 --- a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/generic-expr-default-concrete.rs:10:5 - | -LL | Foo::<10, 12> - | ^^^^^^^^^^^^^ expected `11`, found `12` - | - = note: expected constant `11` - found constant `12` - -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 deleted file mode 100644 index 777865d1c..000000000 --- a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(generic_const_exprs)] -#![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 deleted file mode 100644 index e83f89a60..000000000 --- a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/generic-expr-default-mismatched-types.rs:12:5 - | -LL | Foo:: - | ^^^^^^^^^^^^^^^^^^^ expected `{ N + 1 }`, found `{ N + 2 }` - | - = note: expected constant `{ N + 1 }` - found constant `{ 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 deleted file mode 100644 index 8fe43feb7..000000000 --- a/src/test/ui/const-generics/defaults/generic-expr-default.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![feature(generic_const_exprs)] -#![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 deleted file mode 100644 index ada1498d1..000000000 --- a/src/test/ui/const-generics/defaults/generic-expr-default.stderr +++ /dev/null @@ -1,18 +0,0 @@ -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.rs b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs deleted file mode 100644 index beaf7fc60..000000000 --- a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs +++ /dev/null @@ -1,9 +0,0 @@ -// Checks that lifetimes cannot be interspersed between consts and types. - -struct Foo(&'a (), T); -//~^ ERROR lifetime parameters must be declared prior to type and const parameters - -struct Bar(&'a (), T); -//~^ ERROR lifetime parameters must be declared prior to type and const parameters - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr deleted file mode 100644 index 5cff61dd9..000000000 --- a/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: lifetime parameters must be declared prior to type and const parameters - --> $DIR/intermixed-lifetime.rs:3: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 and const parameters - --> $DIR/intermixed-lifetime.rs:6:37 - | -LL | struct Bar(&'a (), T); - | --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>` - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/defaults/mismatch.rs b/src/test/ui/const-generics/defaults/mismatch.rs deleted file mode 100644 index ec131505e..000000000 --- a/src/test/ui/const-generics/defaults/mismatch.rs +++ /dev/null @@ -1,22 +0,0 @@ -pub struct Example; -pub struct Example2(T); -pub struct Example3(T); -pub struct Example4; - -fn main() { - let e: Example<13> = (); - //~^ Error: mismatched types - //~| expected struct `Example` - let e: Example2 = (); - //~^ Error: mismatched types - //~| expected struct `Example2` - let e: Example3<13, u32> = (); - //~^ Error: mismatched types - //~| expected struct `Example3` - let e: Example3<7> = (); - //~^ Error: mismatched types - //~| expected struct `Example3<7>` - let e: Example4<7> = (); - //~^ Error: mismatched types - //~| expected struct `Example4<7>` -} diff --git a/src/test/ui/const-generics/defaults/mismatch.stderr b/src/test/ui/const-generics/defaults/mismatch.stderr deleted file mode 100644 index 52c54aace..000000000 --- a/src/test/ui/const-generics/defaults/mismatch.stderr +++ /dev/null @@ -1,58 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/mismatch.rs:7:26 - | -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:10:32 - | -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:13:32 - | -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:16:26 - | -LL | let e: Example3<7> = (); - | ----------- ^^ expected struct `Example3`, found `()` - | | - | expected due to this - | - = note: expected struct `Example3<7>` - found unit type `()` - -error[E0308]: mismatched types - --> $DIR/mismatch.rs:19:26 - | -LL | let e: Example4<7> = (); - | ----------- ^^ expected struct `Example4`, found `()` - | | - | expected due to this - | - = note: expected struct `Example4<7>` - 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/mismatched_ty_const_in_trait_impl.rs b/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs deleted file mode 100644 index 5c9323261..000000000 --- a/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs +++ /dev/null @@ -1,41 +0,0 @@ -trait Trait { - fn foo() {} -} -impl Trait for () { - fn foo() {} - //~^ error: method `foo` has an incompatible generic parameter for trait -} - -trait Other { - fn bar() {} -} -impl Other for () { - fn bar() {} - //~^ error: method `bar` has an incompatible generic parameter for trait -} - -trait Uwu { - fn baz() {} -} -impl Uwu for () { - fn baz() {} - //~^ error: method `baz` has an incompatible generic parameter for trait -} - -trait Aaaaaa { - fn bbbb() {} -} -impl Aaaaaa for () { - fn bbbb() {} - //~^ error: method `bbbb` has an incompatible generic parameter for trait -} - -trait Names { - fn abcd() {} -} -impl Names for () { - fn abcd() {} - //~^ error: method `abcd` has an incompatible generic parameter for trait -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr b/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr deleted file mode 100644 index 3455f2c8e..000000000 --- a/src/test/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr +++ /dev/null @@ -1,68 +0,0 @@ -error[E0053]: method `foo` has an incompatible generic parameter for trait `Trait` - --> $DIR/mismatched_ty_const_in_trait_impl.rs:5:12 - | -LL | trait Trait { - | ----- -LL | fn foo() {} - | - expected type parameter -LL | } -LL | impl Trait for () { - | ----------------- -LL | fn foo() {} - | ^^^^^^^^^^^^ found const parameter of type `u64` - -error[E0053]: method `bar` has an incompatible generic parameter for trait `Other` - --> $DIR/mismatched_ty_const_in_trait_impl.rs:13:12 - | -LL | trait Other { - | ----- -LL | fn bar() {} - | ----------- expected const parameter of type `u8` -LL | } -LL | impl Other for () { - | ----------------- -LL | fn bar() {} - | ^ found type parameter - -error[E0053]: method `baz` has an incompatible generic parameter for trait `Uwu` - --> $DIR/mismatched_ty_const_in_trait_impl.rs:21:12 - | -LL | trait Uwu { - | --- -LL | fn baz() {} - | ------------ expected const parameter of type `u32` -LL | } -LL | impl Uwu for () { - | --------------- -LL | fn baz() {} - | ^^^^^^^^^^^^ found const parameter of type `i32` - -error[E0053]: method `bbbb` has an incompatible generic parameter for trait `Aaaaaa` - --> $DIR/mismatched_ty_const_in_trait_impl.rs:29:13 - | -LL | trait Aaaaaa { - | ------ -LL | fn bbbb() {} - | ------------ expected const parameter of type `u32` -LL | } -LL | impl Aaaaaa for () { - | ------------------ -LL | fn bbbb() {} - | ^ found type parameter - -error[E0053]: method `abcd` has an incompatible generic parameter for trait `Names` - --> $DIR/mismatched_ty_const_in_trait_impl.rs:37:13 - | -LL | trait Names { - | ----- -LL | fn abcd() {} - | - expected type parameter -LL | } -LL | impl Names for () { - | ----------------- -LL | fn abcd() {} - | ^^^^^^^^^^^^ found const parameter of type `u32` - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs b/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs deleted file mode 100644 index f928fc9e7..000000000 --- a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs +++ /dev/null @@ -1,4 +0,0 @@ -struct Foo(&'a u32); -//~^ ERROR lifetime parameters must be declared prior to type and const parameters - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr b/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr deleted file mode 100644 index ba08b4646..000000000 --- a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: lifetime parameters must be declared prior to type and const parameters - --> $DIR/param-order-err-pretty-prints-default.rs:1:33 - | -LL | struct Foo(&'a u32); - | ----------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const M: usize = 10>` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/defaults/pretty-printing-ast.rs b/src/test/ui/const-generics/defaults/pretty-printing-ast.rs deleted file mode 100644 index e202d4e86..000000000 --- a/src/test/ui/const-generics/defaults/pretty-printing-ast.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test the AST pretty printer correctly handles default values for const generics -// check-pass -// compile-flags: -Z unpretty=expanded - -#![crate_type = "lib"] - -trait Foo {} - -fn foo() {} - -struct Range; diff --git a/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout b/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout deleted file mode 100644 index 121138605..000000000 --- a/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout +++ /dev/null @@ -1,18 +0,0 @@ -#![feature(prelude_import)] -#![no_std] -// Test the AST pretty printer correctly handles default values for const generics -// check-pass -// compile-flags: -Z unpretty=expanded - -#![crate_type = "lib"] -#[prelude_import] -use ::std::prelude::rust_2015::*; -#[macro_use] -extern crate std; - -trait Foo {} - -fn foo() {} - -struct Range; diff --git a/src/test/ui/const-generics/defaults/repr-c-issue-82792.rs b/src/test/ui/const-generics/defaults/repr-c-issue-82792.rs deleted file mode 100644 index 118da2723..000000000 --- a/src/test/ui/const-generics/defaults/repr-c-issue-82792.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Regression test for #82792. - -// run-pass - -#[repr(C)] -pub struct Loaf { - head: [T; N], - slice: [T], -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/rp_impl_trait.rs b/src/test/ui/const-generics/defaults/rp_impl_trait.rs deleted file mode 100644 index dde8eea45..000000000 --- a/src/test/ui/const-generics/defaults/rp_impl_trait.rs +++ /dev/null @@ -1,29 +0,0 @@ -// run-pass -struct Uwu; - -trait Trait {} -impl Trait for Uwu {} - -fn rawr() -> impl Trait { - Uwu:: -} - -trait Traitor { } - -impl Traitor for u32 {} -impl Traitor<1, 1> for u64 {} - -fn uwu() -> impl Traitor { - 1_u32 -} - -fn owo() -> impl Traitor { - 1_u64 -} - -fn main() { - rawr::<3>(); - rawr::<7>(); - uwu::<{ u8::MAX }>(); - owo(); -} diff --git a/src/test/ui/const-generics/defaults/rp_impl_trait_fail.rs b/src/test/ui/const-generics/defaults/rp_impl_trait_fail.rs deleted file mode 100644 index 80013e7b4..000000000 --- a/src/test/ui/const-generics/defaults/rp_impl_trait_fail.rs +++ /dev/null @@ -1,30 +0,0 @@ -struct Uwu; - -trait Trait {} -impl Trait for Uwu {} - -fn rawr() -> impl Trait { - //~^ error: the trait bound `Uwu<10, 12>: Trait` is not satisfied - Uwu::<10, 12> -} - -trait Traitor {} - -impl Traitor for u32 {} -impl Traitor<1, 2> for u64 {} - -fn uwu() -> impl Traitor { - //~^ error: the trait bound `u32: Traitor` is not satisfied - 1_u32 -} - -fn owo() -> impl Traitor { - //~^ error: the trait bound `u64: Traitor` is not satisfied - 1_u64 -} - -fn main() { - rawr(); - uwu(); - owo(); -} diff --git a/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr b/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr deleted file mode 100644 index a46bd5352..000000000 --- a/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0277]: the trait bound `Uwu<10, 12>: Trait` is not satisfied - --> $DIR/rp_impl_trait_fail.rs:6:14 - | -LL | fn rawr() -> impl Trait { - | ^^^^^^^^^^ the trait `Trait` is not implemented for `Uwu<10, 12>` -LL | -LL | Uwu::<10, 12> - | ------------- return type was inferred to be `Uwu<10, 12>` here - | - = help: the trait `Trait` is implemented for `Uwu` - -error[E0277]: the trait bound `u32: Traitor` is not satisfied - --> $DIR/rp_impl_trait_fail.rs:16:26 - | -LL | fn uwu() -> impl Traitor { - | ^^^^^^^^^^^^^^^ the trait `Traitor` is not implemented for `u32` -LL | -LL | 1_u32 - | ----- return type was inferred to be `u32` here - | - = help: the trait `Traitor` is implemented for `u32` - -error[E0277]: the trait bound `u64: Traitor` is not satisfied - --> $DIR/rp_impl_trait_fail.rs:21:13 - | -LL | fn owo() -> impl Traitor { - | ^^^^^^^^^^^^ the trait `Traitor` is not implemented for `u64` -LL | -LL | 1_u64 - | ----- return type was inferred to be `u64` here - | - = help: the trait `Traitor<1, 2>` is implemented for `u64` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/defaults/self-referential.rs b/src/test/ui/const-generics/defaults/self-referential.rs deleted file mode 100644 index 14a870dc3..000000000 --- a/src/test/ui/const-generics/defaults/self-referential.rs +++ /dev/null @@ -1,4 +0,0 @@ -trait Foo {} -//~^ ERROR the name `M` is already used for a generic parameter in this item's generic parameters -impl Foo<2> for () {} -fn main() {} diff --git a/src/test/ui/const-generics/defaults/self-referential.stderr b/src/test/ui/const-generics/defaults/self-referential.stderr deleted file mode 100644 index 170c1f7f7..000000000 --- a/src/test/ui/const-generics/defaults/self-referential.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0403]: the name `M` is already used for a generic parameter in this item's generic parameters - --> $DIR/self-referential.rs:1:30 - | -LL | trait Foo {} - | - ^ already used - | | - | first use of `M` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0403`. diff --git a/src/test/ui/const-generics/defaults/simple-defaults.rs b/src/test/ui/const-generics/defaults/simple-defaults.rs deleted file mode 100644 index 6a782d223..000000000 --- a/src/test/ui/const-generics/defaults/simple-defaults.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -// Checks that type param defaults are allowed after const params. -#![allow(dead_code)] - -struct FixedOutput<'a, const N: usize, T=u32> { - out: &'a [T; N], -} - -trait FixedOutputter { - fn out(&self) -> FixedOutput<'_, 10>; -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/trait_object_lt_defaults.rs b/src/test/ui/const-generics/defaults/trait_object_lt_defaults.rs deleted file mode 100644 index a1828727e..000000000 --- a/src/test/ui/const-generics/defaults/trait_object_lt_defaults.rs +++ /dev/null @@ -1,24 +0,0 @@ -// aux-build:trait_object_lt_defaults_lib.rs -// run-pass -#![allow(dead_code)] -extern crate trait_object_lt_defaults_lib; - -// Tests that `A<'a, 3, dyn Test>` is short for `A<'a, 3, dyn Test + 'a>` -// and `Foo<'a, 3, dyn Test>` is short for `Foo<'a, 3, dyn Test + 'a>` -// Test is in `const-generics/defaults` because it relies on param ordering - -trait Test {} - -struct A<'a, const N: usize, T: ?Sized + 'a>(&'a T, [(); N]); -fn blah<'a>(mut a: A<'a, 3, dyn Test>, arg: &'a (dyn Test + 'a)) { - a.0 = arg; -} - -fn other_blah<'a>( - mut a: trait_object_lt_defaults_lib::Foo<'a, 3, dyn Test>, - arg: &'a (dyn Test + 'a), -) { - a.0 = arg; -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/trait_objects.rs b/src/test/ui/const-generics/defaults/trait_objects.rs deleted file mode 100644 index 750e40313..000000000 --- a/src/test/ui/const-generics/defaults/trait_objects.rs +++ /dev/null @@ -1,43 +0,0 @@ -// run-pass -trait Trait { - fn uwu(&self) -> u8 { - N - } -} - -impl Trait for u32 {} - -impl Trait<12> for u64 { - fn uwu(&self) -> u8 { - *self as u8 - } -} - -fn foo(arg: &dyn Trait) -> u8 { - arg.uwu() -} - -trait Traitor { - fn owo(&self) -> u8 { - M - } -} - -impl Traitor<2> for bool { } -impl Traitor for u8 { - fn owo(&self) -> u8 { - *self - } -} - -fn bar(arg: &dyn Traitor) -> u8 { - arg.owo() -} - -fn main() { - assert_eq!(foo(&10_u32), 12); - assert_eq!(foo(&3_u64), 3); - - assert_eq!(bar(&true), 2); - assert_eq!(bar(&1_u8), 1); -} diff --git a/src/test/ui/const-generics/defaults/trait_objects_fail.rs b/src/test/ui/const-generics/defaults/trait_objects_fail.rs deleted file mode 100644 index 6ab803f99..000000000 --- a/src/test/ui/const-generics/defaults/trait_objects_fail.rs +++ /dev/null @@ -1,30 +0,0 @@ -trait Trait { - fn uwu(&self) -> u8 { - N - } -} - -impl Trait<2> for u32 {} - -fn foo(arg: &dyn Trait) -> u8 { - arg.uwu() -} - -trait Traitor { - fn owo(&self) -> u8 { - M - } -} - -impl Traitor<2, 3> for bool {} - -fn bar(arg: &dyn Traitor) -> u8 { - arg.owo() -} - -fn main() { - foo(&10_u32); - //~^ error: the trait bound `u32: Trait` is not satisfied - bar(&true); - //~^ error: the trait bound `bool: Traitor<_>` is not satisfied -} diff --git a/src/test/ui/const-generics/defaults/trait_objects_fail.stderr b/src/test/ui/const-generics/defaults/trait_objects_fail.stderr deleted file mode 100644 index 0e8334d03..000000000 --- a/src/test/ui/const-generics/defaults/trait_objects_fail.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: the trait bound `u32: Trait` is not satisfied - --> $DIR/trait_objects_fail.rs:26:9 - | -LL | foo(&10_u32); - | ^^^^^^^ the trait `Trait` is not implemented for `u32` - | - = help: the trait `Trait<2>` is implemented for `u32` - = note: required for the cast from `u32` to the object type `dyn Trait` - -error[E0277]: the trait bound `bool: Traitor<_>` is not satisfied - --> $DIR/trait_objects_fail.rs:28:9 - | -LL | bar(&true); - | ^^^^^ the trait `Traitor<_>` is not implemented for `bool` - | - = help: the trait `Traitor<2, 3>` is implemented for `bool` - = note: required for the cast from `bool` to the object type `dyn Traitor<_>` - -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/defaults/type-default-const-param-name.rs b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs deleted file mode 100644 index 405664ded..000000000 --- a/src/test/ui/const-generics/defaults/type-default-const-param-name.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass -struct N; - -struct Foo(T); - -impl Foo { - fn new() -> Self { - Foo(N) - } -} - -fn main() { - let Foo::<1, N>(N) = Foo::new(); -} diff --git a/src/test/ui/const-generics/defaults/wfness.rs b/src/test/ui/const-generics/defaults/wfness.rs deleted file mode 100644 index a93f67081..000000000 --- a/src/test/ui/const-generics/defaults/wfness.rs +++ /dev/null @@ -1,23 +0,0 @@ -struct Ooopsies; -//~^ error: evaluation of constant value failed - -trait Trait {} -impl Trait<3> for () {} -struct WhereClause -where - (): Trait; -//~^ error: the trait bound `(): Trait<2>` is not satisfied - -trait Traitor {} -struct WhereClauseTooGeneric(T) -where - (): Traitor; - -// no error on struct def -struct DependentDefaultWfness>(T); -fn foo() -> DependentDefaultWfness { - //~^ error: the trait bound `(): Trait<1>` is not satisfied - loop {} -} - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/wfness.stderr b/src/test/ui/const-generics/defaults/wfness.stderr deleted file mode 100644 index 25038f830..000000000 --- a/src/test/ui/const-generics/defaults/wfness.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> $DIR/wfness.rs:1:33 - | -LL | struct Ooopsies; - | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow - -error[E0277]: the trait bound `(): Trait<2>` is not satisfied - --> $DIR/wfness.rs:8:9 - | -LL | (): Trait; - | ^^^^^^^^ the trait `Trait<2>` is not implemented for `()` - | - = help: the trait `Trait<3>` is implemented for `()` - -error[E0277]: the trait bound `(): Trait<1>` is not satisfied - --> $DIR/wfness.rs:18:13 - | -LL | fn foo() -> DependentDefaultWfness { - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<1>` is not implemented for `()` - | - = help: the trait `Trait<3>` is implemented for `()` -note: required by a bound in `WhereClause` - --> $DIR/wfness.rs:8:9 - | -LL | struct WhereClause - | ----------- required by a bound in this -LL | where -LL | (): Trait; - | ^^^^^^^^ required by this bound in `WhereClause` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0080, E0277. -For more information about an error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/defaults/wrong-order.rs b/src/test/ui/const-generics/defaults/wrong-order.rs deleted file mode 100644 index d53d56f41..000000000 --- a/src/test/ui/const-generics/defaults/wrong-order.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct A { - //~^ ERROR generic parameters with a default must be trailing - arg: T, -} - -struct Foo(T); -//~^ error: generic parameters with a default must be trailing - -fn main() {} diff --git a/src/test/ui/const-generics/defaults/wrong-order.stderr b/src/test/ui/const-generics/defaults/wrong-order.stderr deleted file mode 100644 index 4d2628d03..000000000 --- a/src/test/ui/const-generics/defaults/wrong-order.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: generic parameters with a default must be trailing - --> $DIR/wrong-order.rs:1:10 - | -LL | struct A { - | ^ - -error: generic parameters with a default must be trailing - --> $DIR/wrong-order.rs:6:18 - | -LL | struct Foo(T); - | ^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/deref-into-array-generic.rs b/src/test/ui/const-generics/deref-into-array-generic.rs deleted file mode 100644 index 7d75af12b..000000000 --- a/src/test/ui/const-generics/deref-into-array-generic.rs +++ /dev/null @@ -1,27 +0,0 @@ -// check-pass - -struct Test([T; N]); - -impl Default for Test { - fn default() -> Self { - Self([T::default(); N]) - } -} - -impl std::ops::Deref for Test { - type Target = [T; N]; - - fn deref(&self) -> &[T; N] { - &self.0 - } -} - -fn test() -> Test { - let test = Test::default(); - println!("{}", test.len()); - test -} - -fn main() { - test(); -} diff --git a/src/test/ui/const-generics/different_generic_args.full.stderr b/src/test/ui/const-generics/different_generic_args.full.stderr deleted file mode 100644 index eba1768f7..000000000 --- a/src/test/ui/const-generics/different_generic_args.full.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different_generic_args.rs:11:9 - | -LL | u = ConstUsize::<4> {}; - | ^^^^^^^^^^^^^^^^^^ expected `3`, found `4` - | - = note: expected struct `ConstUsize<3>` - found struct `ConstUsize<4>` - -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 deleted file mode 100644 index eba1768f7..000000000 --- a/src/test/ui/const-generics/different_generic_args.min.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different_generic_args.rs:11:9 - | -LL | u = ConstUsize::<4> {}; - | ^^^^^^^^^^^^^^^^^^ expected `3`, found `4` - | - = note: expected struct `ConstUsize<3>` - found struct `ConstUsize<4>` - -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 deleted file mode 100644 index 9ee0e0747..000000000 --- a/src/test/ui/const-generics/different_generic_args.rs +++ /dev/null @@ -1,13 +0,0 @@ -// 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 deleted file mode 100644 index 4d225dfdd..000000000 --- a/src/test/ui/const-generics/different_generic_args_array.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Check that different const types are different. -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -struct Const {} - -fn main() { - let mut x = Const::<{ [3] }> {}; - x = Const::<{ [4] }> {}; - //~^ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/different_generic_args_array.stderr b/src/test/ui/const-generics/different_generic_args_array.stderr deleted file mode 100644 index 4c5b5ada4..000000000 --- a/src/test/ui/const-generics/different_generic_args_array.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different_generic_args_array.rs:9:9 - | -LL | x = Const::<{ [4] }> {}; - | ^^^^^^^^^^^^^^^^^^^ expected `[3]`, found `[4]` - | - = note: expected struct `Const<[3]>` - found struct `Const<[4]>` - -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 deleted file mode 100644 index 6c4ee1af2..000000000 --- a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// This tests that during error handling for the "trait not implemented" error -// we dont try to evaluate std::mem::size_of:: causing an ICE - -struct Adt; - -trait Foo { - type Assoc; - fn foo() - where - [Adt; std::mem::size_of::()]: , - { - <[Adt; std::mem::size_of::()] as Foo>::bar() - //~^ Error: the trait bound - } - - fn bar() {} -} - -fn main() {} diff --git a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr deleted file mode 100644 index 68ce61bd4..000000000 --- a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0277]: the trait bound `[Adt; _]: Foo` is not satisfied - --> $DIR/dont-evaluate-array-len-on-err-1.rs:15:9 - | -LL | <[Adt; std::mem::size_of::()] as Foo>::bar() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `[Adt; _]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/dyn-supertraits.rs b/src/test/ui/const-generics/dyn-supertraits.rs deleted file mode 100644 index 3dee326a1..000000000 --- a/src/test/ui/const-generics/dyn-supertraits.rs +++ /dev/null @@ -1,80 +0,0 @@ -// run-pass - -trait Foo { - fn myfun(&self) -> usize; -} -trait Bar : Foo {} -trait Baz: Foo<3> {} - -struct FooType; -struct BarType; -struct BazType; - -impl Foo for FooType { - fn myfun(&self) -> usize { N } -} -impl Foo for BarType { - fn myfun(&self) -> usize { N + 1 } -} -impl Bar for BarType {} -impl Foo<3> for BazType { - fn myfun(&self) -> usize { 999 } -} -impl Baz for BazType {} - -trait Foz {} -trait Boz: Foo<3> + Foz {} -trait Bok: Foo + Foz {} - -struct FozType; -struct BozType; -struct BokType; - -impl Foz for FozType {} - -impl Foz for BozType {} -impl Foo<3> for BozType { - fn myfun(&self) -> usize { 9999 } -} -impl Boz for BozType {} - -impl Foz for BokType {} -impl Foo for BokType { - fn myfun(&self) -> usize { N + 2 } -} -impl Bok for BokType {} - -fn a(x: &dyn Foo) -> usize { x.myfun() } -fn b(x: &dyn Foo<3>) -> usize { x.myfun() } -fn c, const N: usize>(x: T) -> usize { a::(&x) } -fn d>(x: &T) -> usize { x.myfun() } -fn e(x: &dyn Bar<3>) -> usize { d(x) } - -fn main() { - let foo = FooType::<3> {}; - assert!(a(&foo) == 3); - assert!(b(&foo) == 3); - assert!(d(&foo) == 3); - - let bar = BarType::<3> {}; - assert!(a(&bar) == 4); - assert!(b(&bar) == 4); - assert!(d(&bar) == 4); - assert!(e(&bar) == 4); - - let baz = BazType {}; - assert!(a(&baz) == 999); - assert!(b(&baz) == 999); - assert!(d(&baz) == 999); - - let boz = BozType {}; - assert!(a(&boz) == 9999); - assert!(b(&boz) == 9999); - assert!(d(&boz) == 9999); - - let bok = BokType::<3> {}; - assert!(a(&bok) == 5); - assert!(b(&bok) == 5); - assert!(d(&bok) == 5); - assert!(c(BokType::<3> {}) == 5); -} diff --git a/src/test/ui/const-generics/early/closing-args-token.rs b/src/test/ui/const-generics/early/closing-args-token.rs deleted file mode 100644 index cb4d6299e..000000000 --- a/src/test/ui/const-generics/early/closing-args-token.rs +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index 58fff3a85..000000000 --- a/src/test/ui/const-generics/early/closing-args-token.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: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 deleted file mode 100644 index 4cf7ba869..000000000 --- a/src/test/ui/const-generics/early/const-expression-parameter.rs +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 4ce1be25e..000000000 --- a/src/test/ui/const-generics/early/const-expression-parameter.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: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 deleted file mode 100644 index c3b418ee3..000000000 --- a/src/test/ui/const-generics/early/const-param-from-outer-fn.rs +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index e3bf38b70..000000000 --- a/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr +++ /dev/null @@ -1,13 +0,0 @@ -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 { - | - help: try using a local generic parameter 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 deleted file mode 100644 index fd4e5b409..000000000 --- a/src/test/ui/const-generics/early/const-param-hygiene.rs +++ /dev/null @@ -1,17 +0,0 @@ -// 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 deleted file mode 100644 index ddd15dbc4..000000000 --- a/src/test/ui/const-generics/early/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/early/const-param-shadowing.stderr b/src/test/ui/const-generics/early/const-param-shadowing.stderr deleted file mode 100644 index 625338bd9..000000000 --- a/src/test/ui/const-generics/early/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/early/invalid-const-arguments.rs b/src/test/ui/const-generics/early/invalid-const-arguments.rs deleted file mode 100644 index 6619c9758..000000000 --- a/src/test/ui/const-generics/early/invalid-const-arguments.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![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 deleted file mode 100644 index b46e7e24f..000000000 --- a/src/test/ui/const-generics/early/invalid-const-arguments.stderr +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100644 index 0ae914635..000000000 --- a/src/test/ui/const-generics/early/macro_rules-braces.rs +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100644 index 49382dbf0..000000000 --- a/src/test/ui/const-generics/early/macro_rules-braces.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: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/enum-variants.rs b/src/test/ui/const-generics/enum-variants.rs deleted file mode 100644 index 5c6c4a8ef..000000000 --- a/src/test/ui/const-generics/enum-variants.rs +++ /dev/null @@ -1,24 +0,0 @@ -// check-pass -enum Foo { - Variant, - Variant2(), - Variant3{}, -} - -struct Bar; -struct Bar2(); -struct Bar3 {} - -fn main() { - let _ = Foo::Variant::<1>; - let _ = Foo::Variant2::<1>(); - let _ = Foo::Variant3::<1>{}; - - let _ = Foo::<1>::Variant; - let _ = Foo::<1>::Variant2(); - let _ = Foo::<1>::Variant3{}; - - let _ = Bar::<1>; - let _ = Bar2::<1>(); - let _ = Bar3::<1>{}; -} diff --git a/src/test/ui/const-generics/exhaustive-value.rs b/src/test/ui/const-generics/exhaustive-value.rs deleted file mode 100644 index 778d49834..000000000 --- a/src/test/ui/const-generics/exhaustive-value.rs +++ /dev/null @@ -1,267 +0,0 @@ -trait Foo { - fn test() {} -} -impl Foo<0> for () {} -impl Foo<1> for () {} -impl Foo<2> for () {} -impl Foo<3> for () {} -impl Foo<4> for () {} -impl Foo<5> for () {} -impl Foo<6> for () {} -impl Foo<7> for () {} -impl Foo<8> for () {} -impl Foo<9> for () {} -impl Foo<10> for () {} -impl Foo<11> for () {} -impl Foo<12> for () {} -impl Foo<13> for () {} -impl Foo<14> for () {} -impl Foo<15> for () {} -impl Foo<16> for () {} -impl Foo<17> for () {} -impl Foo<18> for () {} -impl Foo<19> for () {} -impl Foo<20> for () {} -impl Foo<21> for () {} -impl Foo<22> for () {} -impl Foo<23> for () {} -impl Foo<24> for () {} -impl Foo<25> for () {} -impl Foo<26> for () {} -impl Foo<27> for () {} -impl Foo<28> for () {} -impl Foo<29> for () {} -impl Foo<30> for () {} -impl Foo<31> for () {} -impl Foo<32> for () {} -impl Foo<33> for () {} -impl Foo<34> for () {} -impl Foo<35> for () {} -impl Foo<36> for () {} -impl Foo<37> for () {} -impl Foo<38> for () {} -impl Foo<39> for () {} -impl Foo<40> for () {} -impl Foo<41> for () {} -impl Foo<42> for () {} -impl Foo<43> for () {} -impl Foo<44> for () {} -impl Foo<45> for () {} -impl Foo<46> for () {} -impl Foo<47> for () {} -impl Foo<48> for () {} -impl Foo<49> for () {} -impl Foo<50> for () {} -impl Foo<51> for () {} -impl Foo<52> for () {} -impl Foo<53> for () {} -impl Foo<54> for () {} -impl Foo<55> for () {} -impl Foo<56> for () {} -impl Foo<57> for () {} -impl Foo<58> for () {} -impl Foo<59> for () {} -impl Foo<60> for () {} -impl Foo<61> for () {} -impl Foo<62> for () {} -impl Foo<63> for () {} -impl Foo<64> for () {} -impl Foo<65> for () {} -impl Foo<66> for () {} -impl Foo<67> for () {} -impl Foo<68> for () {} -impl Foo<69> for () {} -impl Foo<70> for () {} -impl Foo<71> for () {} -impl Foo<72> for () {} -impl Foo<73> for () {} -impl Foo<74> for () {} -impl Foo<75> for () {} -impl Foo<76> for () {} -impl Foo<77> for () {} -impl Foo<78> for () {} -impl Foo<79> for () {} -impl Foo<80> for () {} -impl Foo<81> for () {} -impl Foo<82> for () {} -impl Foo<83> for () {} -impl Foo<84> for () {} -impl Foo<85> for () {} -impl Foo<86> for () {} -impl Foo<87> for () {} -impl Foo<88> for () {} -impl Foo<89> for () {} -impl Foo<90> for () {} -impl Foo<91> for () {} -impl Foo<92> for () {} -impl Foo<93> for () {} -impl Foo<94> for () {} -impl Foo<95> for () {} -impl Foo<96> for () {} -impl Foo<97> for () {} -impl Foo<98> for () {} -impl Foo<99> for () {} -impl Foo<100> for () {} -impl Foo<101> for () {} -impl Foo<102> for () {} -impl Foo<103> for () {} -impl Foo<104> for () {} -impl Foo<105> for () {} -impl Foo<106> for () {} -impl Foo<107> for () {} -impl Foo<108> for () {} -impl Foo<109> for () {} -impl Foo<110> for () {} -impl Foo<111> for () {} -impl Foo<112> for () {} -impl Foo<113> for () {} -impl Foo<114> for () {} -impl Foo<115> for () {} -impl Foo<116> for () {} -impl Foo<117> for () {} -impl Foo<118> for () {} -impl Foo<119> for () {} -impl Foo<120> for () {} -impl Foo<121> for () {} -impl Foo<122> for () {} -impl Foo<123> for () {} -impl Foo<124> for () {} -impl Foo<125> for () {} -impl Foo<126> for () {} -impl Foo<127> for () {} -impl Foo<128> for () {} -impl Foo<129> for () {} -impl Foo<130> for () {} -impl Foo<131> for () {} -impl Foo<132> for () {} -impl Foo<133> for () {} -impl Foo<134> for () {} -impl Foo<135> for () {} -impl Foo<136> for () {} -impl Foo<137> for () {} -impl Foo<138> for () {} -impl Foo<139> for () {} -impl Foo<140> for () {} -impl Foo<141> for () {} -impl Foo<142> for () {} -impl Foo<143> for () {} -impl Foo<144> for () {} -impl Foo<145> for () {} -impl Foo<146> for () {} -impl Foo<147> for () {} -impl Foo<148> for () {} -impl Foo<149> for () {} -impl Foo<150> for () {} -impl Foo<151> for () {} -impl Foo<152> for () {} -impl Foo<153> for () {} -impl Foo<154> for () {} -impl Foo<155> for () {} -impl Foo<156> for () {} -impl Foo<157> for () {} -impl Foo<158> for () {} -impl Foo<159> for () {} -impl Foo<160> for () {} -impl Foo<161> for () {} -impl Foo<162> for () {} -impl Foo<163> for () {} -impl Foo<164> for () {} -impl Foo<165> for () {} -impl Foo<166> for () {} -impl Foo<167> for () {} -impl Foo<168> for () {} -impl Foo<169> for () {} -impl Foo<170> for () {} -impl Foo<171> for () {} -impl Foo<172> for () {} -impl Foo<173> for () {} -impl Foo<174> for () {} -impl Foo<175> for () {} -impl Foo<176> for () {} -impl Foo<177> for () {} -impl Foo<178> for () {} -impl Foo<179> for () {} -impl Foo<180> for () {} -impl Foo<181> for () {} -impl Foo<182> for () {} -impl Foo<183> for () {} -impl Foo<184> for () {} -impl Foo<185> for () {} -impl Foo<186> for () {} -impl Foo<187> for () {} -impl Foo<188> for () {} -impl Foo<189> for () {} -impl Foo<190> for () {} -impl Foo<191> for () {} -impl Foo<192> for () {} -impl Foo<193> for () {} -impl Foo<194> for () {} -impl Foo<195> for () {} -impl Foo<196> for () {} -impl Foo<197> for () {} -impl Foo<198> for () {} -impl Foo<199> for () {} -impl Foo<200> for () {} -impl Foo<201> for () {} -impl Foo<202> for () {} -impl Foo<203> for () {} -impl Foo<204> for () {} -impl Foo<205> for () {} -impl Foo<206> for () {} -impl Foo<207> for () {} -impl Foo<208> for () {} -impl Foo<209> for () {} -impl Foo<210> for () {} -impl Foo<211> for () {} -impl Foo<212> for () {} -impl Foo<213> for () {} -impl Foo<214> for () {} -impl Foo<215> for () {} -impl Foo<216> for () {} -impl Foo<217> for () {} -impl Foo<218> for () {} -impl Foo<219> for () {} -impl Foo<220> for () {} -impl Foo<221> for () {} -impl Foo<222> for () {} -impl Foo<223> for () {} -impl Foo<224> for () {} -impl Foo<225> for () {} -impl Foo<226> for () {} -impl Foo<227> for () {} -impl Foo<228> for () {} -impl Foo<229> for () {} -impl Foo<230> for () {} -impl Foo<231> for () {} -impl Foo<232> for () {} -impl Foo<233> for () {} -impl Foo<234> for () {} -impl Foo<235> for () {} -impl Foo<236> for () {} -impl Foo<237> for () {} -impl Foo<238> for () {} -impl Foo<239> for () {} -impl Foo<240> for () {} -impl Foo<241> for () {} -impl Foo<242> for () {} -impl Foo<243> for () {} -impl Foo<244> for () {} -impl Foo<245> for () {} -impl Foo<246> for () {} -impl Foo<247> for () {} -impl Foo<248> for () {} -impl Foo<249> for () {} -impl Foo<250> for () {} -impl Foo<251> for () {} -impl Foo<252> for () {} -impl Foo<253> for () {} -impl Foo<254> for () {} -impl Foo<255> for () {} - -fn foo() { - <() as Foo>::test() //~ ERROR the trait bound `(): Foo` -} - -fn main() { - foo::<7>(); -} diff --git a/src/test/ui/const-generics/exhaustive-value.stderr b/src/test/ui/const-generics/exhaustive-value.stderr deleted file mode 100644 index 76a83ba67..000000000 --- a/src/test/ui/const-generics/exhaustive-value.stderr +++ /dev/null @@ -1,20 +0,0 @@ -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 other types implement trait `Foo`: - <() as Foo<0>> - <() as Foo<100>> - <() as Foo<101>> - <() as Foo<102>> - <() as Foo<103>> - <() as Foo<104>> - <() as Foo<105>> - <() as Foo<106>> - and 248 others - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/expose-default-substs-param-env.rs b/src/test/ui/const-generics/expose-default-substs-param-env.rs deleted file mode 100644 index e40c93116..000000000 --- a/src/test/ui/const-generics/expose-default-substs-param-env.rs +++ /dev/null @@ -1,9 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -#![allow(unused_braces, incomplete_features)] - -pub trait Foo {} -pub trait Bar: Foo<{ 1 }> { } - -fn main() {} diff --git a/src/test/ui/const-generics/float-generic.adt_const_params.stderr b/src/test/ui/const-generics/float-generic.adt_const_params.stderr deleted file mode 100644 index fef5ef0d1..000000000 --- a/src/test/ui/const-generics/float-generic.adt_const_params.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0741]: `f32` is forbidden as the type of a const generic parameter - --> $DIR/float-generic.rs:5:17 - | -LL | fn foo() {} - | ^^^ - | - = note: floats do not derive `Eq` or `Ord`, which are required for const parameters - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/float-generic.rs b/src/test/ui/const-generics/float-generic.rs deleted file mode 100644 index b72059b5b..000000000 --- a/src/test/ui/const-generics/float-generic.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: simple adt_const_params -#![cfg_attr(adt_const_params, feature(adt_const_params))] -#![cfg_attr(adt_const_params, allow(incomplete_features))] - -fn foo() {} -//~^ ERROR `f32` is forbidden as the type of a const generic parameter - -const C: f32 = 1.0; - -fn main() { - foo::(); -} diff --git a/src/test/ui/const-generics/float-generic.simple.stderr b/src/test/ui/const-generics/float-generic.simple.stderr deleted file mode 100644 index 89ca36b0f..000000000 --- a/src/test/ui/const-generics/float-generic.simple.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `f32` is forbidden as the type of a const generic parameter - --> $DIR/float-generic.rs:5:17 - | -LL | fn foo() {} - | ^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/fn-const-param-call.full.stderr b/src/test/ui/const-generics/fn-const-param-call.full.stderr deleted file mode 100644 index b55c24498..000000000 --- a/src/test/ui/const-generics/fn-const-param-call.full.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/fn-const-param-call.rs:11:25 - | -LL | struct Wrapper u32>; - | ^^^^^^^^^^^ - -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/fn-const-param-call.rs:13:15 - | -LL | impl u32> Wrapper { - | ^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/fn-const-param-call.min.stderr b/src/test/ui/const-generics/fn-const-param-call.min.stderr deleted file mode 100644 index d984449e6..000000000 --- a/src/test/ui/const-generics/fn-const-param-call.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: using function pointers as const generic parameters is forbidden - --> $DIR/fn-const-param-call.rs:11:25 - | -LL | struct Wrapper u32>; - | ^^^^^^^^^^^ - -error: using function pointers as const generic parameters is forbidden - --> $DIR/fn-const-param-call.rs:13:15 - | -LL | impl u32> Wrapper { - | ^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/fn-const-param-call.rs b/src/test/ui/const-generics/fn-const-param-call.rs deleted file mode 100644 index dc516fb71..000000000 --- a/src/test/ui/const-generics/fn-const-param-call.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Check that functions cannot be used as const parameters. -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -fn function() -> u32 { - 17 -} - -struct Wrapper u32>; //~ ERROR: using function pointers as const generic parameters - -impl u32> Wrapper { -//~^ ERROR: using function pointers as const generic parameters - fn call() -> u32 { - F() - } -} - -fn main() { - assert_eq!(Wrapper::::call(), 17); -} diff --git a/src/test/ui/const-generics/fn-const-param-infer.full.stderr b/src/test/ui/const-generics/fn-const-param-infer.full.stderr deleted file mode 100644 index 2d66a1923..000000000 --- a/src/test/ui/const-generics/fn-const-param-infer.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/fn-const-param-infer.rs:6:25 - | -LL | struct Checked bool>; - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/fn-const-param-infer.min.stderr b/src/test/ui/const-generics/fn-const-param-infer.min.stderr deleted file mode 100644 index f0767a109..000000000 --- a/src/test/ui/const-generics/fn-const-param-infer.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: using function pointers as const generic parameters is forbidden - --> $DIR/fn-const-param-infer.rs:6:25 - | -LL | struct Checked bool>; - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/fn-const-param-infer.rs b/src/test/ui/const-generics/fn-const-param-infer.rs deleted file mode 100644 index 22f5f529c..000000000 --- a/src/test/ui/const-generics/fn-const-param-infer.rs +++ /dev/null @@ -1,29 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Checked bool>; -//~^ ERROR: using function pointers as const generic parameters - -fn not_one(val: usize) -> bool { val != 1 } -fn not_two(val: usize) -> bool { val != 2 } - -fn generic_arg(val: T) -> bool { true } - -fn generic(val: usize) -> bool { val != 1 } - -fn main() { - let _: Option> = None; - let _: Checked = Checked::; - let _: Checked = Checked::; - - let _ = Checked::; - let _ = Checked::<{generic_arg::}>; - let _ = Checked::<{generic_arg::}>; - - let _ = Checked::; - let _ = Checked::<{generic::}>; - let _: Checked<{generic::}> = Checked::<{generic::}>; - let _: Checked<{generic::}> = Checked::<{generic::}>; -} 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 deleted file mode 100644 index 6ae9d5cfb..000000000 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -#[derive(PartialEq, Eq)] -struct A; - -struct B; // ok - -struct C; - -struct D; //~ ERROR `C` must be annotated with `#[derive(PartialEq, Eq)]` - -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 deleted file mode 100644 index 81b9bdfbd..000000000 --- a/src/test/ui/const-generics/forbid-non-structural_match-types.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: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.rs b/src/test/ui/const-generics/foreign-item-const-parameter.rs deleted file mode 100644 index 4fe377b59..000000000 --- a/src/test/ui/const-generics/foreign-item-const-parameter.rs +++ /dev/null @@ -1,7 +0,0 @@ -extern "C" { - fn foo(); //~ ERROR foreign items may not have const parameters - - fn bar(_: T); //~ ERROR foreign items may not have type or const parameters -} - -fn main() {} diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.stderr deleted file mode 100644 index b02db8700..000000000 --- a/src/test/ui/const-generics/foreign-item-const-parameter.stderr +++ /dev/null @@ -1,19 +0,0 @@ -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-param-mismatch.rs b/src/test/ui/const-generics/generic-param-mismatch.rs deleted file mode 100644 index 2e201e50a..000000000 --- a/src/test/ui/const-generics/generic-param-mismatch.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn test() -> [u8; M] { - [0; N] //~ ERROR mismatched types -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic-param-mismatch.stderr b/src/test/ui/const-generics/generic-param-mismatch.stderr deleted file mode 100644 index d0776d49d..000000000 --- a/src/test/ui/const-generics/generic-param-mismatch.stderr +++ /dev/null @@ -1,14 +0,0 @@ -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_arg_infer/array-repeat-expr.rs b/src/test/ui/const-generics/generic_arg_infer/array-repeat-expr.rs deleted file mode 100644 index d3e53d7a8..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/array-repeat-expr.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass - -// To avoid having to `or` gate `_` as an expr. -#![feature(generic_arg_infer)] - -fn foo() -> [u8; 3] { - let x: [u8; _] = [0; _]; - x -} - -fn main() { - assert_eq!([0; _], foo()); -} diff --git a/src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs b/src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs deleted file mode 100644 index 251160a0f..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/dont-use-defaults.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass -#![feature(generic_arg_infer)] - -// test that we dont use defaults to aide in type inference - -struct Foo; -impl Foo { - fn make_arr() -> [(); N] { - [(); N] - } -} - -fn main() { - let [(), (), ()] = Foo::<_>::make_arr(); -} diff --git a/src/test/ui/const-generics/generic_arg_infer/in-signature.rs b/src/test/ui/const-generics/generic_arg_infer/in-signature.rs deleted file mode 100644 index 1f60b2242..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/in-signature.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![crate_type = "rlib"] -#![feature(generic_arg_infer)] - -struct Foo; -struct Bar(T); - -fn arr_fn() -> [u8; _] { - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types - [0; 3] -} - -fn ty_fn() -> Bar { - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types - Bar::(0) -} - -fn ty_fn_mixed() -> Bar<_, _> { - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types - Bar::(0) -} - -const ARR_CT: [u8; _] = [0; 3]; -//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants -static ARR_STATIC: [u8; _] = [0; 3]; -//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static variables -const TY_CT: Bar = Bar::(0); -//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants -static TY_STATIC: Bar = Bar::(0); -//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static variables -const TY_CT_MIXED: Bar<_, _> = Bar::(0); -//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants -static TY_STATIC_MIXED: Bar<_, _> = Bar::(0); -//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static variables -trait ArrAssocConst { - const ARR: [u8; _]; - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants -} -trait TyAssocConst { - const ARR: Bar; - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants -} -trait TyAssocConstMixed { - const ARR: Bar<_, _>; - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants -} - -trait AssocTy { - type Assoc; -} -impl AssocTy for i8 { - type Assoc = [u8; _]; - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated types -} -impl AssocTy for i16 { - type Assoc = Bar; - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated types -} -impl AssocTy for i32 { - type Assoc = Bar<_, _>; - //~^ ERROR the placeholder `_` is not allowed within types on item signatures for associated types -} diff --git a/src/test/ui/const-generics/generic_arg_infer/in-signature.stderr b/src/test/ui/const-generics/generic_arg_infer/in-signature.stderr deleted file mode 100644 index 52d1b29f9..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/in-signature.stderr +++ /dev/null @@ -1,119 +0,0 @@ -error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/in-signature.rs:7:21 - | -LL | fn arr_fn() -> [u8; _] { - | -----^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `[u8; 3]` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/in-signature.rs:12:24 - | -LL | fn ty_fn() -> Bar { - | ---------^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `Bar` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types - --> $DIR/in-signature.rs:17:25 - | -LL | fn ty_fn_mixed() -> Bar<_, _> { - | ----^--^- - | | | | - | | | not allowed in type signatures - | | not allowed in type signatures - | help: replace with the correct return type: `Bar` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/in-signature.rs:22:15 - | -LL | const ARR_CT: [u8; _] = [0; 3]; - | ^^^^^^^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/in-signature.rs:24:20 - | -LL | static ARR_STATIC: [u8; _] = [0; 3]; - | ^^^^^^^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/in-signature.rs:26:14 - | -LL | const TY_CT: Bar = Bar::(0); - | ^^^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/in-signature.rs:28:19 - | -LL | static TY_STATIC: Bar = Bar::(0); - | ^^^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/in-signature.rs:30:20 - | -LL | const TY_CT_MIXED: Bar<_, _> = Bar::(0); - | ^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables - --> $DIR/in-signature.rs:32:25 - | -LL | static TY_STATIC_MIXED: Bar<_, _> = Bar::(0); - | ^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/in-signature.rs:35:21 - | -LL | const ARR: [u8; _]; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/in-signature.rs:39:25 - | -LL | const ARR: Bar; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants - --> $DIR/in-signature.rs:43:20 - | -LL | const ARR: Bar<_, _>; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/in-signature.rs:51:23 - | -LL | type Assoc = [u8; _]; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/in-signature.rs:55:27 - | -LL | type Assoc = Bar; - | ^ not allowed in type signatures - -error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types - --> $DIR/in-signature.rs:59:22 - | -LL | type Assoc = Bar<_, _>; - | ^ ^ not allowed in type signatures - | | - | not allowed in type signatures - -error: aborting due to 15 previous errors - -For more information about this error, try `rustc --explain E0121`. diff --git a/src/test/ui/const-generics/generic_arg_infer/infer-arg-test.rs b/src/test/ui/const-generics/generic_arg_infer/infer-arg-test.rs deleted file mode 100644 index 29aa0f59d..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/infer-arg-test.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![feature(generic_arg_infer)] - -struct All<'a, T, const N: usize> { - v: &'a T, -} - -struct BadInfer<_>; -//~^ ERROR expected identifier -//~| ERROR parameter `_` is never used - -fn all_fn<'a, T, const N: usize>() {} - -fn bad_infer_fn<_>() {} -//~^ ERROR expected identifier - - -fn main() { - let a: All<_, _, _>; - all_fn(); - let v: [u8; _]; - let v: [u8; 10] = [0; _]; -} diff --git a/src/test/ui/const-generics/generic_arg_infer/infer-arg-test.stderr b/src/test/ui/const-generics/generic_arg_infer/infer-arg-test.stderr deleted file mode 100644 index e6d0c743d..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/infer-arg-test.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error: expected identifier, found reserved identifier `_` - --> $DIR/infer-arg-test.rs:7:17 - | -LL | struct BadInfer<_>; - | ^ expected identifier, found reserved identifier - -error: expected identifier, found reserved identifier `_` - --> $DIR/infer-arg-test.rs:13:17 - | -LL | fn bad_infer_fn<_>() {} - | ^ expected identifier, found reserved identifier - -error[E0392]: parameter `_` is never used - --> $DIR/infer-arg-test.rs:7:17 - | -LL | struct BadInfer<_>; - | ^ unused parameter - | - = help: consider removing `_`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `_` to be a const parameter, use `const _: usize` instead - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/generic_arg_infer/infer_arg_and_const_arg.rs b/src/test/ui/const-generics/generic_arg_infer/infer_arg_and_const_arg.rs deleted file mode 100644 index 23c8d7537..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/infer_arg_and_const_arg.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -#![feature(generic_arg_infer)] - -struct Foo; -struct Bar; - -fn main() { - let _: Foo = Foo::<_, 1>; - let _: Foo<_, 1> = Foo::; - let _: Bar<1, _> = Bar::<_, 300>; - let _: Bar<_, 300> = Bar::<1, _>; -} diff --git a/src/test/ui/const-generics/generic_arg_infer/issue-91614.rs b/src/test/ui/const-generics/generic_arg_infer/issue-91614.rs deleted file mode 100644 index b45e2cbc7..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/issue-91614.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(portable_simd)] -#![feature(generic_arg_infer)] -use std::simd::Mask; - -fn main() { - let y = Mask::<_, _>::splat(false); - //~^ ERROR: type annotations needed for -} diff --git a/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr b/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr deleted file mode 100644 index 688db695f..000000000 --- a/src/test/ui/const-generics/generic_arg_infer/issue-91614.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0283]: type annotations needed for `Mask<_, LANES>` - --> $DIR/issue-91614.rs:6:9 - | -LL | let y = Mask::<_, _>::splat(false); - | ^ ------------------- type must be known at this point - | - = note: cannot satisfy `_: MaskElement` -note: required by a bound in `Mask::::splat` - --> $SRC_DIR/core/src/../../portable-simd/crates/core_simd/src/masks.rs:LL:COL - | -LL | T: MaskElement, - | ^^^^^^^^^^^ required by this bound in `Mask::::splat` -help: consider giving `y` an explicit type, where the type for type parameter `T` is specified - | -LL | let y: Mask<_, LANES> = Mask::<_, _>::splat(false); - | ++++++++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0283`. 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 deleted file mode 100644 index 06f00de13..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Foo([u8; N as usize]) -where - [(); N as usize]:; - -struct Bar([u8; (N + 2) as usize]) where [(); (N + 2) as usize]:; - -// unifying with subtrees -struct Evaluatable; -fn foo() where Evaluatable<{N as usize as u16 }>: { - let _ = Foo::([1; N as usize]); -} - - -fn main() {} 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 deleted file mode 100644 index 3b5b87b2b..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Evaluatable {} - -struct Foo([u8; N as usize]) -//~^ Error: unconstrained generic constant -//~| help: try adding a `where` bound using this expression: `where [(); N as usize]:` -where - Evaluatable<{N as u128}>:; - -struct Foo2(Evaluatable::<{N as u128}>) where Evaluatable<{N as usize as u128 }>:; -//~^ Error: unconstrained generic constant -//~| help: try adding a `where` bound using this expression: `where [(); {N as u128}]:` - -struct Bar([u8; (N + 2) as usize]) where [(); (N + 1) as usize]:; -//~^ Error: unconstrained generic constant -//~| help: try adding a `where` bound using this expression: `where [(); (N + 2) as usize]:` - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr deleted file mode 100644 index 5ca04d25e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-2.rs:6:25 - | -LL | struct Foo([u8; N as usize]) - | ^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); N as usize]:` - -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-2.rs:12:26 - | -LL | struct Foo2(Evaluatable::<{N as u128}>) where Evaluatable<{N as usize as u128 }>:; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); {N as u128}]:` - -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-2.rs:16:25 - | -LL | struct Bar([u8; (N + 2) as usize]) where [(); (N + 1) as usize]:; - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); (N + 2) as usize]:` - -error: aborting due to 3 previous errors - 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 deleted file mode 100644 index 7561ae2fe..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs +++ /dev/null @@ -1,47 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Trait {} -pub struct EvaluatableU128; - -struct HasCastInTraitImpl; -impl Trait for HasCastInTraitImpl {} - -pub fn use_trait_impl() -where - [(); { N + 1}]:, - EvaluatableU128<{N as u128}>:, { - fn assert_impl() {} - - // errors are bad but seems to be pre-existing issue #86198 - assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant - assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant - assert_impl::>(); - //~^ Error: mismatched types - assert_impl::>(); - //~^ Error: mismatched types -} -pub fn use_trait_impl_2() -where - [(); { N + 1}]:, - EvaluatableU128<{N as _}>:, { - fn assert_impl() {} - - // errors are bad but seems to be pre-existing issue #86198 - assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant - assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant - assert_impl::>(); - //~^ Error: mismatched types - assert_impl::>(); - //~^ Error: mismatched types -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr deleted file mode 100644 index ada1050d3..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr +++ /dev/null @@ -1,187 +0,0 @@ -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-3.rs:17:19 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:` -note: required for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>` to implement `Trait` - --> $DIR/abstract-const-as-cast-3.rs:8:22 - | -LL | impl Trait for HasCastInTraitImpl {} - | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `use_trait_impl::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:14:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:17:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }` - | - = note: expected constant `{ N as u128 }` - found constant `{ O as u128 }` -note: required by a bound in `use_trait_impl::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:14:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl::assert_impl` - -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-3.rs:20:19 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:` -note: required for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>` to implement `Trait` - --> $DIR/abstract-const-as-cast-3.rs:8:22 - | -LL | impl Trait for HasCastInTraitImpl {} - | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `use_trait_impl::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:14:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:20:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }` - | - = note: expected constant `{ N as _ }` - found constant `{ O as u128 }` -note: required by a bound in `use_trait_impl::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:14:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:23:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12`, found `13` - | - = note: expected constant `12` - found constant `13` -note: required by a bound in `use_trait_impl::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:14:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:25:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13`, found `14` - | - = note: expected constant `13` - found constant `14` -note: required by a bound in `use_trait_impl::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:14:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl::assert_impl` - -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-3.rs:35:19 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:` -note: required for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>` to implement `Trait` - --> $DIR/abstract-const-as-cast-3.rs:8:22 - | -LL | impl Trait for HasCastInTraitImpl {} - | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `use_trait_impl_2::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:32:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:35:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }` - | - = note: expected constant `{ N as u128 }` - found constant `{ O as u128 }` -note: required by a bound in `use_trait_impl_2::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:32:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl` - -error: unconstrained generic constant - --> $DIR/abstract-const-as-cast-3.rs:38:19 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:` -note: required for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>` to implement `Trait` - --> $DIR/abstract-const-as-cast-3.rs:8:22 - | -LL | impl Trait for HasCastInTraitImpl {} - | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `use_trait_impl_2::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:32:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:38:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }` - | - = note: expected constant `{ N as _ }` - found constant `{ O as u128 }` -note: required by a bound in `use_trait_impl_2::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:32:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:41:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12`, found `13` - | - = note: expected constant `12` - found constant `13` -note: required by a bound in `use_trait_impl_2::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:32:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl` - -error[E0308]: mismatched types - --> $DIR/abstract-const-as-cast-3.rs:43:5 - | -LL | assert_impl::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13`, found `14` - | - = note: expected constant `13` - found constant `14` -note: required by a bound in `use_trait_impl_2::assert_impl` - --> $DIR/abstract-const-as-cast-3.rs:32:23 - | -LL | fn assert_impl() {} - | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl` - -error: aborting due to 12 previous errors - -For more information about this error, try `rustc --explain E0308`. 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 deleted file mode 100644 index 184263f89..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs +++ /dev/null @@ -1,29 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Trait {} -pub struct EvaluatableU128; - -struct HasCastInTraitImpl; -impl Trait for HasCastInTraitImpl {} - -pub fn use_trait_impl() where EvaluatableU128<{N as u128}>:, { - fn assert_impl() {} - - assert_impl::>(); - assert_impl::>(); - assert_impl::>(); - assert_impl::>(); -} -pub fn use_trait_impl_2() where EvaluatableU128<{N as _}>:, { - fn assert_impl() {} - - assert_impl::>(); - assert_impl::>(); - assert_impl::>(); - assert_impl::>(); -} - - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs deleted file mode 100644 index 916d60c0e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn foo(a: [(); N as usize]) { - bar::<{ N as usize as usize }>(); - //~^ error: unconstrained generic constant -} - -fn bar() {} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.stderr deleted file mode 100644 index d48b639db..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/abstract-consts-as-cast-5.rs:5:11 - | -LL | bar::<{ N as usize as usize }>(); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { N as usize as usize }]:` - -error: aborting due to previous error - 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 deleted file mode 100644 index 041232e86..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr +++ /dev/null @@ -1,19 +0,0 @@ -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], - | ^^^^^^^^^^^^ field access is not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -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 deleted file mode 100644 index 18e9135d0..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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(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(adt_const_params)]` - -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 deleted file mode 100644 index 7d3fe413c..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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(generic_const_exprs, adt_const_params))] -#![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/assoc_const_unification/const_equate_assoc_consts.rs b/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/const_equate_assoc_consts.rs deleted file mode 100644 index e8f89cb1a..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/const_equate_assoc_consts.rs +++ /dev/null @@ -1,27 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Trait { - const ASSOC: usize; -} -impl Trait for T { - const ASSOC: usize = std::mem::size_of::(); -} - -struct Foo([u8; T::ASSOC]) -where - [(); T::ASSOC]:; - -fn bar() -where - [(); T::ASSOC]:, -{ - let _: Foo = Foo::<_>(make()); -} - -fn make() -> ! { - todo!() -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs b/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs deleted file mode 100644 index c8f7553da..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Trait { - const ASSOC: usize; -} - -fn foo() where [(); U::ASSOC]:, { - bar::<{ T::ASSOC }>(); - //~^ ERROR: unconstrained generic constant -} - -fn bar() {} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr b/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr deleted file mode 100644 index e4a0cabe5..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/doesnt_unify_evaluatable.rs:9:11 - | -LL | bar::<{ T::ASSOC }>(); - | ^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { T::ASSOC }]:` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/dropck_unifies_assoc_consts.rs b/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/dropck_unifies_assoc_consts.rs deleted file mode 100644 index 274caa1e9..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/dropck_unifies_assoc_consts.rs +++ /dev/null @@ -1,20 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Trait { - const ASSOC: usize; -} - -struct Foo(T) -where - [(); T::ASSOC]:; - -impl Drop for Foo -where - [(); T::ASSOC]:, -{ - fn drop(&mut self) {} -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/unifies_evaluatable.rs b/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/unifies_evaluatable.rs deleted file mode 100644 index 6597b9f2b..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/assoc_const_unification/unifies_evaluatable.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Trait { - const ASSOC: usize; -} - -fn foo() where [(); T::ASSOC]:, { - bar::<{ T::ASSOC }>(); -} - -fn bar() -> [(); N] { - [(); N] -} - -fn main() {} 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 deleted file mode 100644 index a67776322..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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-generics/generic_const_exprs/associated-consts.rs b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs deleted file mode 100644 index b839008d4..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs +++ /dev/null @@ -1,31 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait BlockCipher { - const BLOCK_SIZE: usize; -} - -struct FooCipher; -impl BlockCipher for FooCipher { - const BLOCK_SIZE: usize = 64; -} - -struct BarCipher; -impl BlockCipher for BarCipher { - const BLOCK_SIZE: usize = 32; -} - -pub struct Block(#[allow(unused_tuple_struct_fields)] C); - -pub fn test() -where - [u8; M - C::BLOCK_SIZE]: Sized, -{ - let _ = [0; M - C::BLOCK_SIZE]; -} - -fn main() { - test::(); - test::(); -} 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 deleted file mode 100644 index 15d618cae..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub fn test1() -> [u8; std::mem::size_of::() - 1] -where - [u8; std::mem::size_of::() - 1]: Sized, -{ - [0; std::mem::size_of::() - 1] -} diff --git a/src/test/ui/const-generics/generic_const_exprs/auxiliary/issue-94287-aux.rs b/src/test/ui/const-generics/generic_const_exprs/auxiliary/issue-94287-aux.rs deleted file mode 100644 index df454dae7..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/auxiliary/issue-94287-aux.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![feature(generic_const_exprs)] - -use std::str::FromStr; - -pub struct If; - -pub trait True {} - -impl True for If {} - -pub struct FixedI32; - -impl FromStr for FixedI32 -where - If<{ FRAC <= 32 }>: True, -{ - type Err = (); - fn from_str(_s: &str) -> Result { - unimplemented!() - } -} diff --git a/src/test/ui/const-generics/generic_const_exprs/closures.rs b/src/test/ui/const-generics/generic_const_exprs/closures.rs deleted file mode 100644 index 1ea310d06..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/closures.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -fn test() -> [u8; N + (|| 42)()] {} -//~^ ERROR cycle detected when building an abstract representation - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/closures.stderr b/src/test/ui/const-generics/generic_const_exprs/closures.stderr deleted file mode 100644 index a7d891d77..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/closures.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0391]: cycle detected when building an abstract representation for `test::{constant#0}` - --> $DIR/closures.rs:3:35 - | -LL | fn test() -> [u8; N + (|| 42)()] {} - | ^^^^^^^^^^^^^ - | -note: ...which requires building THIR for `test::{constant#0}`... - --> $DIR/closures.rs:3:35 - | -LL | fn test() -> [u8; N + (|| 42)()] {} - | ^^^^^^^^^^^^^ -note: ...which requires type-checking `test::{constant#0}`... - --> $DIR/closures.rs:3:35 - | -LL | fn test() -> [u8; N + (|| 42)()] {} - | ^^^^^^^^^^^^^ - = note: ...which again requires building an abstract representation for `test::{constant#0}`, completing the cycle -note: cycle used when checking that `test` is well-formed - --> $DIR/closures.rs:3:1 - | -LL | fn test() -> [u8; N + (|| 42)()] {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs b/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs deleted file mode 100644 index 5874625ad..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/const_eval_resolve_canonical.rs +++ /dev/null @@ -1,28 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Foo { - type Assoc: Default; -} - -impl Foo<0> for () { - type Assoc = u32; -} - -impl Foo<3> for () { - type Assoc = i64; -} - -fn foo(_: T) -> <() as Foo<{ N + 1 }>>::Assoc -where - (): Foo<{ N + 1 }>, -{ - Default::default() -} - -fn main() { - let mut _q = Default::default(); - _q = foo::<_, 2>(_q); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs b/src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs deleted file mode 100644 index 6093fc70b..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![feature(generic_const_exprs, generic_arg_infer)] -#![allow(incomplete_features)] - -// minimized repro for #105205 -// -// the `foo::<_, L>` call results in a `WellFormed(_)` obligation and a -// `ConstEvaluatable(Unevaluated(_ + 1 + L))` obligation. Attempting to fulfill the latter -// unifies the `_` with `Expr(L - 1)` from the paramenv which turns the `WellFormed` -// obligation into `WellFormed(Expr(L - 1))` - -fn foo(_: [(); N + 1 + M]) {} - -fn ice() -where - [(); (L - 1) + 1 + L]:, -{ - foo::<_, L>([(); L + 1 + L]); - //~^ ERROR: mismatched types - //~^^ ERROR: unconstrained generic constant -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr b/src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr deleted file mode 100644 index da5194696..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/wf_obligation.rs:17:17 - | -LL | foo::<_, L>([(); L + 1 + L]); - | ^^^^^^^^^^^^^^^ expected `N + 1 + M`, found `L + 1 + L` - | - = note: expected constant `N + 1 + M` - found constant `L + 1 + L` - -error: unconstrained generic constant - --> $DIR/wf_obligation.rs:17:22 - | -LL | foo::<_, L>([(); L + 1 + L]); - | ^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); L + 1 + L]:` - -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/cross_crate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs deleted file mode 100644 index dfc69e0b0..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs +++ /dev/null @@ -1,15 +0,0 @@ -// aux-build:const_evaluatable_lib.rs -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -extern crate const_evaluatable_lib; - -fn user() where [u8; std::mem::size_of::() - 1]: Sized { - assert_eq!(const_evaluatable_lib::test1::(), [0; std::mem::size_of::() - 1]); -} - -fn main() { - assert_eq!(const_evaluatable_lib::test1::(), [0; 3]); - user::(); - user::(); -} 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 deleted file mode 100644 index b08fffd69..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs +++ /dev/null @@ -1,14 +0,0 @@ -// aux-build:const_evaluatable_lib.rs -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -extern crate const_evaluatable_lib; - -fn user() { - let _ = const_evaluatable_lib::test1::(); - //~^ ERROR unconstrained generic constant - //~| ERROR unconstrained generic constant - //~| ERROR unconstrained generic constant - //~| ERROR unconstrained generic constant -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr deleted file mode 100644 index 7b4d46b82..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr +++ /dev/null @@ -1,54 +0,0 @@ -error: unconstrained generic constant - --> $DIR/cross_crate_predicate.rs:7:13 - | -LL | let _ = const_evaluatable_lib::test1::(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::() - 1]:` -note: required by a bound in `test1` - --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10 - | -LL | [u8; std::mem::size_of::() - 1]: Sized, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1` - -error: unconstrained generic constant - --> $DIR/cross_crate_predicate.rs:7:13 - | -LL | let _ = const_evaluatable_lib::test1::(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::() - 1]:` -note: required by a bound in `test1` - --> $DIR/auxiliary/const_evaluatable_lib.rs:4:27 - | -LL | pub fn test1() -> [u8; std::mem::size_of::() - 1] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1` - -error: unconstrained generic constant - --> $DIR/cross_crate_predicate.rs:7:13 - | -LL | let _ = const_evaluatable_lib::test1::(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::() - 1]:` -note: required by a bound in `test1` - --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10 - | -LL | [u8; std::mem::size_of::() - 1]: Sized, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1` - -error: unconstrained generic constant - --> $DIR/cross_crate_predicate.rs:7:13 - | -LL | let _ = const_evaluatable_lib::test1::(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::() - 1]:` -note: required by a bound in `test1` - --> $DIR/auxiliary/const_evaluatable_lib.rs:4:27 - | -LL | pub fn test1() -> [u8; std::mem::size_of::() - 1] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1` - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr deleted file mode 100644 index d674e3acd..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/dependence_lint.rs:14:32 - | -LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce - | ^ 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/dependence_lint.rs:21:37 - | -LL | let _: [u8; if true { size_of::() } else { 3 }]; // error on stable, error with gce - | ^ 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 - -warning: cannot use constants which depend on generic parameters in types - --> $DIR/dependence_lint.rs:10:9 - | -LL | [0; size_of::<*mut T>()]; // lint on stable, error with `generic_const_exprs` - | ^^^^^^^^^^^^^^^^^^^ - | - = 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 - = note: `#[warn(const_evaluatable_unchecked)]` on by default - -warning: cannot use constants which depend on generic parameters in types - --> $DIR/dependence_lint.rs:17:9 - | -LL | [0; if false { size_of::() } else { 3 }]; // lint on stable, error with gce - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 - -error: aborting due to 2 previous errors; 2 warnings emitted - diff --git a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr deleted file mode 100644 index 74111ef1d..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error: overly complex generic constant - --> $DIR/dependence_lint.rs:17:9 - | -LL | [0; if false { size_of::() } else { 3 }]; // lint on stable, error with gce - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants - | - = help: consider moving this anonymous constant into a `const` function - -error: overly complex generic constant - --> $DIR/dependence_lint.rs:21:17 - | -LL | let _: [u8; if true { size_of::() } else { 3 }]; // error on stable, error with gce - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants - | - = help: consider moving this anonymous constant into a `const` function - -error: unconstrained generic constant - --> $DIR/dependence_lint.rs:14:12 - | -LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); size_of::<*mut T>()]:` - -error: unconstrained generic constant - --> $DIR/dependence_lint.rs:10:9 - | -LL | [0; size_of::<*mut T>()]; // lint on stable, error with `generic_const_exprs` - | ^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); size_of::<*mut T>()]:` - -error: aborting due to 4 previous errors - diff --git a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs deleted file mode 100644 index b715e07f8..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs +++ /dev/null @@ -1,26 +0,0 @@ -// revisions: full gce -// compile-flags: -Zdeduplicate-diagnostics=yes - -#![cfg_attr(gce, feature(generic_const_exprs))] -#![allow(incomplete_features)] - -use std::mem::size_of; - -fn foo() { - [0; size_of::<*mut T>()]; // lint on stable, error with `generic_const_exprs` - //[gce]~^ ERROR unconstrained - //[full]~^^ WARNING cannot use constants - //[full]~| WARNING this was previously accepted - let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce - //[full]~^ ERROR generic parameters may not be used - //[gce]~^^ ERROR unconstrained generic - [0; if false { size_of::() } else { 3 }]; // lint on stable, error with gce - //[gce]~^ ERROR overly complex - //[full]~^^ WARNING cannot use constants - //[full]~| WARNING this was previously accepted - let _: [u8; if true { size_of::() } else { 3 }]; // error on stable, error with gce - //[full]~^ ERROR generic parameters may not be used - //[gce]~^^ ERROR overly complex -} - -fn main() {} 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 deleted file mode 100644 index e8bc703bd..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/different-fn.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -use std::mem::size_of; -use std::marker::PhantomData; - -struct Foo(PhantomData); - -fn test() -> [u8; size_of::()] { - [0; size_of::>()] - //~^ ERROR unconstrained generic constant - //~| ERROR mismatched types -} - -fn main() { - test::(); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr b/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr deleted file mode 100644 index 83a2f3740..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/different-fn.rs:10:5 - | -LL | [0; size_of::>()] - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `size_of::()`, found `size_of::>()` - | - = note: expected constant `size_of::()` - found constant `size_of::>()` - -error: unconstrained generic constant - --> $DIR/different-fn.rs:10:9 - | -LL | [0; size_of::>()] - | ^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); size_of::>()]:` - -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/division.rs b/src/test/ui/const-generics/generic_const_exprs/division.rs deleted file mode 100644 index 098fa9e04..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/division.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn with_bound() where [u8; N / 2]: Sized { - let _: [u8; N / 2] = [0; N / 2]; -} - -fn main() { - with_bound::<4>(); -} 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 deleted file mode 100644 index 3543960c3..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs +++ /dev/null @@ -1,16 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// This test is a repro for #82279. It checks that we don't error -// when calling is_const_evaluatable on `std::mem::size_of::()` -// when looking for candidates that may prove `T: Foo` in `foo` - -trait Foo {} - -#[allow(dead_code)] -fn foo() {} - -impl Foo for T where [(); std::mem::size_of::()]: {} - -fn main() {} 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 deleted file mode 100644 index 077f77aa0..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs +++ /dev/null @@ -1,16 +0,0 @@ -//check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Foo -where - [(); N + 1]: ; - -impl Drop for Foo -where - [(); N + 1]: , -{ - fn drop(&mut self) {} -} - -fn main() {} 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 deleted file mode 100644 index e4111157e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -// Test that we use the elaborated predicates from traits -// to satisfy const evaluatable predicates. -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -use std::mem::size_of; - -trait Foo: Sized -where - [(); size_of::()]: Sized, -{ -} - -impl Foo for u64 {} -impl Foo for u32 {} - -fn foo() -> [u8; size_of::()] { - [0; size_of::()] -} - -fn main() { - assert_eq!(foo::(), [0; 4]); - assert_eq!(foo::(), [0; 8]); -} 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 deleted file mode 100644 index 8023b998a..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs +++ /dev/null @@ -1,26 +0,0 @@ -#![crate_type = "lib"] -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub struct Const; - -pub trait Trait { - type AssocTy; - fn assoc_fn() -> Self::AssocTy; -} - -impl Trait for Const // OK, trait impl predicates -where - Const<{ my_const_fn(U) }>: , -{ - type AssocTy = Const<{ my_const_fn(U) }>; - //~^ ERROR private type - fn assoc_fn() -> Self::AssocTy { - Const - } -} - -const fn my_const_fn(val: u8) -> u8 { - // body of this function doesn't matter - val -} diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr deleted file mode 100644 index 2d9de8805..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface - --> $DIR/eval-privacy.rs:16:5 - | -LL | type AssocTy = Const<{ my_const_fn(U) }>; - | ^^^^^^^^^^^^ can't leak private type -... -LL | const fn my_const_fn(val: u8) -> u8 { - | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.rs b/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.rs deleted file mode 100644 index c59d62e57..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.rs +++ /dev/null @@ -1,26 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -//~^ WARNING the feature `generic_const_exprs` is incomplete - -trait Generic { - const ASSOC: usize; -} - -impl Generic for u8 { - const ASSOC: usize = 17; -} -impl Generic for u16 { - const ASSOC: usize = 13; -} - - -fn uses_assoc_type() -> [u8; N + T::ASSOC] { - [0; N + T::ASSOC] -} - -fn only_generic_n() -> [u8; N + 13] { - uses_assoc_type::() -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr b/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr deleted file mode 100644 index 8eb1fccc5..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr +++ /dev/null @@ -1,11 +0,0 @@ -warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/eval-try-unify.rs:3:12 - | -LL | #![feature(generic_const_exprs)] - | ^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #76560 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: 1 warning emitted - 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 deleted file mode 100644 index 340e35e1c..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs +++ /dev/null @@ -1,22 +0,0 @@ -// check-pass - -// We previously always returned ambiguity when equating generic consts, even if they -// only contain generic parameters. This is incorrect as trying to unify `N > 1` with `M > 1` -// should fail. -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -enum Assert {} -trait IsTrue {} -impl IsTrue for Assert {} - -struct Foo; -trait Bar {} -impl Bar for Foo -where - Assert<{ N > 1 }>: IsTrue, - Assert<{ M > 1 }>: IsTrue, -{ -} - -fn main() {} 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 deleted file mode 100644 index 10ab2fd86..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs +++ /dev/null @@ -1,11 +0,0 @@ -type Arr = [u8; N - 1]; -//~^ ERROR generic parameters may not be used in const operations - -fn test() -> Arr where Arr: Default { - Default::default() -} - -fn main() { - let x = test::<33>(); - assert_eq!(x, [0; 32]); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr deleted file mode 100644 index 2d60ebaa8..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index cbe4277df..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/fn_call.rs +++ /dev/null @@ -1,30 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -const fn test_me(a: usize, b: usize) -> usize { - if a < b { - std::mem::size_of::() - } else { - usize::MAX - } -} - -fn test_simple() -> [u8; std::mem::size_of::()] -where - [u8; std::mem::size_of::()]: Sized, -{ - [0; std::mem::size_of::()] -} - -fn test_with_args() -> [u8; test_me::(N, N + 1) + N] -where - [u8; test_me::(N, N + 1) + N]: Sized, -{ - [0; test_me::(N, N + 1) + N] -} - -fn main() { - assert_eq!([0; 8], test_simple::()); - assert_eq!([0; 12], test_with_args::()); -} 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 deleted file mode 100644 index b8f9827ec..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn test() -> [u8; N - 1] { - //~^ ERROR evaluation of `test::<0>::{constant#0}` failed - todo!() -} - -fn main() { - test::<0>(); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr deleted file mode 100644 index bd71b49ee..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0080]: evaluation of `test::<0>::{constant#0}` failed - --> $DIR/from-sig-fail.rs:4:35 - | -LL | fn test() -> [u8; N - 1] { - | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0080`. 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 deleted file mode 100644 index 28de4f864..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/from-sig.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Foo; - -fn test() -> Foo<{ N > 10 }> { - Foo -} - -fn main() { - let _: Foo = test::<12>(); - let _: Foo = test::<9>(); -} 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 deleted file mode 100644 index 3c866333d..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/function-call.rs +++ /dev/null @@ -1,20 +0,0 @@ -// check-pass -// compile-flags: -Zdeduplicate-diagnostics=yes - -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 deleted file mode 100644 index 84abfe578..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/function-call.stderr +++ /dev/null @@ -1,12 +0,0 @@ -warning: cannot use constants which depend on generic parameters in types - --> $DIR/function-call.rs:15:17 - | -LL | let _ = [0; foo::()]; - | ^^^^^^^^^^ - | - = 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 - = note: `#[warn(const_evaluatable_unchecked)]` on by default - -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 deleted file mode 100644 index 7120d6ee2..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs +++ /dev/null @@ -1,25 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -use std::mem::size_of; - -struct Foo(T); - -impl Foo() }> { - fn test() { - let _: [u8; std::mem::size_of::()]; - } -} - -trait Bar { - fn test_me(); -} - -impl Bar<{ size_of::() }> for Foo { - fn test_me() { - let _: [u8; std::mem::size_of::()]; - } -} - -fn main() {} 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 deleted file mode 100644 index b8058c252..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -use std::{mem, ptr}; - -fn split_first(arr: [T; N]) -> (T, [T; N - 1]) -where - [T; N - 1]: Sized, -{ - let arr = mem::ManuallyDrop::new(arr); - unsafe { - let head = ptr::read(&arr[0]); - let tail = ptr::read(&arr[1..] as *const [T] as *const [T; N - 1]); - (head, tail) - } -} - -fn main() { - let arr = [0, 1, 2, 3, 4]; - let (head, tail) = split_first(arr); - assert_eq!(head, 0); - assert_eq!(tail, [1, 2, 3, 4]); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-100217.rs b/src/test/ui/const-generics/generic_const_exprs/issue-100217.rs deleted file mode 100644 index acdc348a3..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-100217.rs +++ /dev/null @@ -1,42 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -trait TraitOne { - const MY_NUM: usize; - type MyErr: std::fmt::Debug; - - fn do_one_stuff(arr: [u8; Self::MY_NUM]) -> Result<(), Self::MyErr>; -} - -trait TraitTwo { - fn do_two_stuff(); -} - -impl TraitTwo for O -where - [(); Self::MY_NUM]:, -{ - fn do_two_stuff() { - O::do_one_stuff([5; Self::MY_NUM]).unwrap() - } -} - -struct Blargotron; - -#[derive(Debug)] -struct ErrTy([(); N]); - -impl TraitOne for Blargotron { - const MY_NUM: usize = 3; - type MyErr = ErrTy<{ Self::MY_NUM }>; - - fn do_one_stuff(_arr: [u8; Self::MY_NUM]) -> Result<(), Self::MyErr> { - Ok(()) - } -} - -fn main() { - Blargotron::do_two_stuff(); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-100360.rs b/src/test/ui/const-generics/generic_const_exprs/issue-100360.rs deleted file mode 100644 index 5572f1f88..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-100360.rs +++ /dev/null @@ -1,13 +0,0 @@ -// check-pass -// (this requires debug assertions) - -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -fn foo(arg: &'static bool) -> bool { - B == arg -} - -fn main() { - foo::<{ &true }>(&false); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-102074.rs b/src/test/ui/const-generics/generic_const_exprs/issue-102074.rs deleted file mode 100644 index 66d15cf12..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-102074.rs +++ /dev/null @@ -1,23 +0,0 @@ -// check-pass -// Checks that the NoopMethodCall lint doesn't call Instance::resolve on unresolved consts - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -#[derive(Debug, Clone)] -pub struct Aes128CipherKey([u8; Aes128Cipher::KEY_LEN]); - -impl Aes128CipherKey { - pub fn new(key: &[u8; Aes128Cipher::KEY_LEN]) -> Self { - Self(key.clone()) - } -} - -#[derive(Debug, Clone)] -pub struct Aes128Cipher; - -impl Aes128Cipher { - const KEY_LEN: usize = 16; -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-102768.rs b/src/test/ui/const-generics/generic_const_exprs/issue-102768.rs deleted file mode 100644 index 7aea0d30d..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-102768.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait X { - type Y<'a>; -} - -const _: () = { - fn f2<'a>(arg: Box = &'a ()>>) {} - //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments - //~| ERROR this associated type takes 0 generic arguments but 1 generic argument -}; - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr deleted file mode 100644 index 8278edabe..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied - --> $DIR/issue-102768.rs:9:30 - | -LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^ expected 1 lifetime argument - | -note: associated type defined here, with 1 lifetime parameter: `'a` - --> $DIR/issue-102768.rs:5:10 - | -LL | type Y<'a>; - | ^ -- -help: add missing lifetime argument - | -LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | +++ - -error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/issue-102768.rs:9:30 - | -LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments - | -note: associated type defined here, with 0 generic parameters - --> $DIR/issue-102768.rs:5:10 - | -LL | type Y<'a>; - | ^ - -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/generic_const_exprs/issue-62504.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr deleted file mode 100644 index 0742db398..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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 constant `X` - found constant `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 deleted file mode 100644 index 9bea4105d..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr +++ /dev/null @@ -1,27 +0,0 @@ -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[E0308]: mismatched types - --> $DIR/issue-62504.rs:18:21 - | -LL | ArrayHolder([0; Self::SIZE]) - | ----------- ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` - | | - | arguments to this struct are incorrect - | - = note: expected array `[u32; X]` - found array `[u32; _]` -note: tuple struct defined here - --> $DIR/issue-62504.rs:14:8 - | -LL | struct ArrayHolder([u32; X]); - | ^^^^^^^^^^^ - -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 deleted file mode 100644 index a97f4b8ff..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 9b36699bb..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![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 deleted file mode 100644 index c3e2f8e16..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr +++ /dev/null @@ -1,24 +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 - | | - | found this type parameter - -error[E0599]: the function or associated item `foo` exists for struct `Foo<_>`, 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 struct -... -LL | Foo::foo(); - | ^^^ function or associated item cannot be called on `Foo<_>` 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 deleted file mode 100644 index 4d0d0253f..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr +++ /dev/null @@ -1,55 +0,0 @@ -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: cannot satisfy `IsLessOrEqual: True` - --> $DIR/issue-72787.rs:21:26 - | -LL | IsLessOrEqual: True, - | ^^^^ - | - = note: cannot satisfy `IsLessOrEqual: True` - -error[E0283]: type annotations needed: cannot satisfy `IsLessOrEqual: True` - --> $DIR/issue-72787.rs:21:26 - | -LL | IsLessOrEqual: True, - | ^^^^ - | - = note: cannot satisfy `IsLessOrEqual: 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 deleted file mode 100644 index c651bf1c8..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs +++ /dev/null @@ -1,35 +0,0 @@ -// [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 -//[min]~| Error type annotations needed - 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 deleted file mode 100644 index f2fddfbfb..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr +++ /dev/null @@ -1,35 +0,0 @@ -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 constant `false` - found constant `true` -note: required by a bound in `Arr` - --> $DIR/issue-72819-generic-in-const-eval.rs:8:39 - | -LL | struct Arr - | --- required by a bound in this -LL | where Assert::<{N < usize::MAX / 2}>: IsTrue, - | ^^^^^^ required by this bound in `Arr` - -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 constant `false` - found constant `true` -note: required by a bound in `Arr` - --> $DIR/issue-72819-generic-in-const-eval.rs:8:39 - | -LL | struct Arr - | --- required by a bound in this -LL | where Assert::<{N < usize::MAX / 2}>: IsTrue, - | ^^^^^^ required by this bound in `Arr` - -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 deleted file mode 100644 index 42671412f..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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(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 deleted file mode 100644 index 7a5aa9e47..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs +++ /dev/null @@ -1,23 +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(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-73298.rs b/src/test/ui/const-generics/generic_const_exprs/issue-73298.rs deleted file mode 100644 index 3c59e1b79..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-73298.rs +++ /dev/null @@ -1,23 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -use std::convert::AsMut; -use std::default::Default; - -trait Foo: Sized { - type Baz: Default + AsMut<[u8]>; - fn bar() { - Self::Baz::default().as_mut(); - } -} - -impl Foo for () { - type Baz = [u8; 1 * 1]; - //type Baz = [u8; 1]; -} - -fn main() { - <() as Foo>::bar(); -} 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 deleted file mode 100644 index d1ab1be04..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs +++ /dev/null @@ -1,20 +0,0 @@ -// 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 deleted file mode 100644 index cd1f7a9da..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs +++ /dev/null @@ -1,28 +0,0 @@ -// 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-74713.rs b/src/test/ui/const-generics/generic_const_exprs/issue-74713.rs deleted file mode 100644 index 0bcb997d9..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-74713.rs +++ /dev/null @@ -1,8 +0,0 @@ -fn bug<'a>() -where - [(); { //~ ERROR mismatched types - let _: &'a (); //~ ERROR a non-static lifetime is not allowed in a `const` - }]: -{} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-74713.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-74713.stderr deleted file mode 100644 index e7673df0a..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-74713.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0658]: a non-static lifetime is not allowed in a `const` - --> $DIR/issue-74713.rs:4:17 - | -LL | let _: &'a (); - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error[E0308]: mismatched types - --> $DIR/issue-74713.rs:3:10 - | -LL | [(); { - | __________^ -LL | | let _: &'a (); -LL | | }]: - | |_____^ expected `usize`, found `()` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0308, E0658. -For more information about an error, try `rustc --explain E0308`. 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 deleted file mode 100644 index faa8b3d10..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![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 deleted file mode 100644 index c587a7e15..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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/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 deleted file mode 100644 index 2fa9a71fb..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![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 deleted file mode 100644 index c90774e94..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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/generic_const_exprs/issue-80561-incorrect-param-env.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs deleted file mode 100644 index 77d3c98da..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index 275f69953..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs +++ /dev/null @@ -1,32 +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)] - -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 deleted file mode 100644 index bf1b411ee..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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` - | -note: inside `std::mem::size_of::` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `Inline::::{constant#0}` - --> $DIR/issue-80742.rs:22:10 - | -LL | [u8; size_of::() + 1]: , - | ^^^^^^^^^^^^^^ - -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 - | ---------------- function or associated item `new` not found for this struct -... -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` - | -note: inside `std::mem::size_of::` - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | intrinsics::size_of::() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `Inline::::{constant#0}` - --> $DIR/issue-80742.rs:14:10 - | -LL | [u8; size_of::() + 1]: , - | ^^^^^^^^^^^^^^ - -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-82268.rs b/src/test/ui/const-generics/generic_const_exprs/issue-82268.rs deleted file mode 100644 index d08fc5beb..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-82268.rs +++ /dev/null @@ -1,73 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -trait Collate { - type Pass; - type Fail; - - fn collate(self) -> (Self::Pass, Self::Fail); -} - -impl Collate for () { - type Pass = (); - type Fail = (); - - fn collate(self) -> ((), ()) { - ((), ()) - } -} - -trait CollateStep { - type Pass; - type Fail; - fn collate_step(x: X, prev: Prev) -> (Self::Pass, Self::Fail); -} - -impl CollateStep for () { - type Pass = (X, P); - type Fail = F; - - fn collate_step(x: X, (p, f): (P, F)) -> ((X, P), F) { - ((x, p), f) - } -} - -struct CollateOpImpl; -trait CollateOpStep { - type NextOp; - type Apply; -} - -impl CollateOpStep for CollateOpImpl -where - CollateOpImpl<{ MASK >> 1 }>: Sized, -{ - type NextOp = CollateOpImpl<{ MASK >> 1 }>; - type Apply = (); -} - -impl Collate for (H, T) -where - T: Collate, - Op::Apply: CollateStep, -{ - type Pass = >::Pass; - type Fail = >::Fail; - - fn collate(self) -> (Self::Pass, Self::Fail) { - >::collate_step(self.0, self.1.collate()) - } -} - -fn collate(x: X) -> (X::Pass, X::Fail) -where - X: Collate>, -{ - x.collate() -} - -fn main() { - dbg!(collate::<_, 5>(("Hello", (42, ('!', ()))))); -} 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 deleted file mode 100644 index fac811d13..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs +++ /dev/null @@ -1,38 +0,0 @@ -#![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 deleted file mode 100644 index b693023f1..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr +++ /dev/null @@ -1,34 +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 constant `Self::DIM` - found constant `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]:` -note: required by a bound in `TensorSize::size` - --> $DIR/issue-83765.rs:9:31 - | -LL | fn size(&self) -> [usize; Self::DIM]; - | ^^^^^^^^^ required by this bound in `TensorSize::size` - -error[E0308]: mismatched types - --> $DIR/issue-83765.rs:32:9 - | -LL | self.reference.size() - | ^^^^^^^^^^^^^^^^^^^^^ expected `DIM`, found `Self::DIM` - | - = note: expected constant `DIM` - found constant `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-83972.rs b/src/test/ui/const-generics/generic_const_exprs/issue-83972.rs deleted file mode 100644 index 0063719b8..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-83972.rs +++ /dev/null @@ -1,38 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -pub trait Foo { - fn foo(&self); -} - -pub struct FooImpl; -impl Foo for FooImpl { - fn foo(&self) {} -} - -pub trait Bar: 'static { - type Foo: Foo; - fn get() -> &'static Self::Foo; -} - -struct BarImpl; -impl Bar for BarImpl { - type Foo = FooImpl< - { - { 4 } - }, - >; - fn get() -> &'static Self::Foo { - &FooImpl - } -} - -pub fn boom() { - B::get().foo(); -} - -fn main() { - boom::(); -} 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 deleted file mode 100644 index fb2e5590d..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs +++ /dev/null @@ -1,38 +0,0 @@ -// 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-84669.rs b/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs deleted file mode 100644 index 3933ff20a..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs +++ /dev/null @@ -1,30 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Foo { - type Output; - - fn foo() -> Self::Output; -} - -impl Foo for [u8; 3] { - type Output = [u8; 1 + 2]; - - fn foo() -> [u8; 3] { - [1u8; 3] - } -} - -fn bug() -where - [u8; N]: Foo, - <[u8; N] as Foo>::Output: AsRef<[u8]>, -{ - <[u8; N]>::foo().as_ref(); -} - -fn main() { - bug::<3>(); -} 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 deleted file mode 100644 index 3a7f4c618..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs +++ /dev/null @@ -1,32 +0,0 @@ -#![feature(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 - //~| ERROR: mismatched types [E0308] -} - -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 deleted file mode 100644 index 09bcb0860..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr +++ /dev/null @@ -1,63 +0,0 @@ -error[E0277]: the trait bound `(): _Contains<&C>` is not satisfied - --> $DIR/issue-85848.rs:24:29 - | -LL | writes_to_specific_path(&cap); - | ----------------------- ^^^^ the trait `_Contains<&C>` is not implemented for `()` - | | - | required by a bound introduced by this call - | - = help: the trait `Delegates` is implemented for `T` -note: required for `&C` to implement `Contains<(), true>` - --> $DIR/issue-85848.rs:21:12 - | -LL | impl Contains() }> for U where T: _Contains {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ -note: required for `&C` to implement `Delegates<()>` - --> $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:30: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:29 - | -LL | writes_to_specific_path(&cap); - | ----------------------- ^^^^ - | | - | required by a bound introduced by this call - | - = help: try adding a `where` bound using this expression: `where [(); { contains::() }]:` -note: required for `&C` to implement `Contains<(), true>` - --> $DIR/issue-85848.rs:21:12 - | -LL | impl Contains() }> for U where T: _Contains {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ -note: required for `&C` to implement `Delegates<()>` - --> $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:30:31 - | -LL | fn writes_to_specific_path>(cap: &C) {} - | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path` - -error[E0308]: mismatched types - --> $DIR/issue-85848.rs:24:5 - | -LL | writes_to_specific_path(&cap); - | ^^^^^^^^^^^^^^^^^^^^^^^ expected `true`, found `{ contains::() }` - | - = note: expected constant `true` - found constant `{ contains::() }` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0277, E0308. -For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-86710.rs b/src/test/ui/const-generics/generic_const_exprs/issue-86710.rs deleted file mode 100644 index bdd8a21b3..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-86710.rs +++ /dev/null @@ -1,73 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -use std::marker::PhantomData; - -fn main() { - let x = FooImpl::> { phantom: PhantomData }; - let _ = x.foo::>(); -} - -trait Foo -where - T: Bar, -{ - fn foo(&self) - where - T: Operation, - >::Output: Bar; -} - -struct FooImpl -where - T: Bar, -{ - phantom: PhantomData, -} - -impl Foo for FooImpl -where - T: Bar, -{ - fn foo(&self) - where - T: Operation, - >::Output: Bar, - { - <>::Output as Bar>::error_occurs_here(); - } -} - -trait Bar { - fn error_occurs_here(); -} - -struct BarImpl; - -impl Bar for BarImpl { - fn error_occurs_here() {} -} - -trait Operation { - type Output; -} - -//// Part-A: This causes error. -impl Operation> for BarImpl -where - BarImpl<{ N + M }>: Sized, -{ - type Output = BarImpl<{ N + M }>; -} - -//// Part-B: This doesn't cause error. -// impl Operation> for BarImpl { -// type Output = BarImpl; -// } - -//// Part-C: This also doesn't cause error. -// impl Operation> for BarImpl { -// type Output = BarImpl<{ M }>; -// } diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-89851.rs b/src/test/ui/const-generics/generic_const_exprs/issue-89851.rs deleted file mode 100644 index cde849d90..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-89851.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -// (this requires debug assertions) - -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -pub const BAR: () = ice::<"">(); -pub const fn ice() { - &10; -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-90847.rs b/src/test/ui/const-generics/generic_const_exprs/issue-90847.rs deleted file mode 100644 index ebc6fe141..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-90847.rs +++ /dev/null @@ -1,9 +0,0 @@ -// check-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] -#![feature(adt_const_params)] - -struct Foo where [(); 0 + 0]: Sized; - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-94287.rs b/src/test/ui/const-generics/generic_const_exprs/issue-94287.rs deleted file mode 100644 index 643126a46..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-94287.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:issue-94287-aux.rs -// build-fail - -extern crate issue_94287_aux; - -use std::str::FromStr; - -fn main() { - let _ = >::from_str(""); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-94287.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-94287.stderr deleted file mode 100644 index 7390a0077..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-94287.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: failed to evaluate generic const expression - --> $DIR/auxiliary/issue-94287-aux.rs:15:8 - | -LL | If<{ FRAC <= 32 }>: True, - | ^^^^^^^^^^^^^^ - | - = note: the crate this constant originates from uses `#![feature(generic_const_exprs)]` -help: consider enabling this feature - --> $DIR/issue-94287.rs:1:1 - | -LL | #![feature(generic_const_exprs)] - | - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs deleted file mode 100644 index 67e30232e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs +++ /dev/null @@ -1,25 +0,0 @@ -// check-pass - -#![feature(adt_const_params, generic_const_exprs)] -//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] -//~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] - -pub struct Changes -where - [(); CHANGES.len()]:, -{ - changes: [usize; CHANGES.len()], -} - -impl Changes -where - [(); CHANGES.len()]:, -{ - pub const fn new() -> Self { - Self { - changes: [0; CHANGES.len()], - } - } -} - -pub fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr deleted file mode 100644 index 1cceaece7..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-97047-ice-1.rs:3:12 - | -LL | #![feature(adt_const_params, generic_const_exprs)] - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #95174 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-97047-ice-1.rs:3:30 - | -LL | #![feature(adt_const_params, generic_const_exprs)] - | ^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #76560 for more information - -warning: 2 warnings emitted - diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs deleted file mode 100644 index 00568a089..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs +++ /dev/null @@ -1,23 +0,0 @@ -// check-pass - -#![feature(adt_const_params, generic_const_exprs)] -//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] -//~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] - -pub struct Changes -where - [(); CHANGES.len()]:, -{ - changes: [usize; CHANGES.len()], -} - -impl Changes -where - [(); CHANGES.len()]:, -{ - pub fn combine(&mut self, other: &Self) { - for _change in &self.changes {} - } -} - -pub fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr deleted file mode 100644 index 774e842bc..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-97047-ice-2.rs:3:12 - | -LL | #![feature(adt_const_params, generic_const_exprs)] - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #95174 for more information - = note: `#[warn(incomplete_features)]` on by default - -warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-97047-ice-2.rs:3:30 - | -LL | #![feature(adt_const_params, generic_const_exprs)] - | ^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #76560 for more information - -warning: 2 warnings emitted - diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-99705.rs b/src/test/ui/const-generics/generic_const_exprs/issue-99705.rs deleted file mode 100644 index 75b57b621..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/issue-99705.rs +++ /dev/null @@ -1,33 +0,0 @@ -// check-pass -#![crate_type = "lib"] -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -pub trait MyIterator { - type Output; -} - -pub trait Foo { - const ABC: usize; -} - -pub struct IteratorStruct{ - -} - -pub struct Bar { - pub data: [usize; N] -} - -impl MyIterator for IteratorStruct { - type Output = Bar; -} - -pub fn test1() -> impl MyIterator> where [(); T::ABC]: Sized { - IteratorStruct::<{T::ABC}>{} -} - -pub trait Baz{} -impl Baz for Bar {} -pub fn test2() -> impl MyIterator> where [(); T::ABC]: Sized { - IteratorStruct::<{T::ABC}>{} -} 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 deleted file mode 100644 index 2e9af1bf4..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/less_than.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Foo; - -fn test() -> Foo<{ N > 10 }> where Foo<{ N > 10 }>: Sized { - Foo -} - -fn main() { - let _: Foo = test::<12>(); - let _: Foo = test::<9>(); -} 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 deleted file mode 100644 index cd5d76dd9..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// We do not yet want to support let-bindings in abstract consts, -// so this test should keep failing for now. -fn test() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default { - //~^ ERROR overly complex generic constant - //~| ERROR overly complex generic constant - Default::default() -} - -fn main() { - let x = test::<31>(); - assert_eq!(x, [0; 32]); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr b/src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr deleted file mode 100644 index 5ebb4c399..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: overly complex generic constant - --> $DIR/let-bindings.rs:6:68 - | -LL | fn test() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default { - | ^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: overly complex generic constant - --> $DIR/let-bindings.rs:6:35 - | -LL | fn test() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default { - | ^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: aborting due to 2 previous errors - 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 deleted file mode 100644 index 2bd3c801f..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![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 deleted file mode 100644 index 7b41e39b7..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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-generics/generic_const_exprs/nested-abstract-consts-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs deleted file mode 100644 index 7e5022817..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn callee() -> usize -where - [u8; M2 + 1]: Sized, -{ - M2 -} - -fn caller() -> usize -where - [u8; N1 + 1]: Sized, - [u8; (N1 + 1) + 1]: Sized, -{ - callee::<{ N1 + 1 }>() -} - -fn main() { - assert_eq!(caller::<4>(), 5); -} - -// Test that the ``(N1 + 1) + 1`` bound on ``caller`` satisfies the ``M2 + 1`` bound on ``callee`` 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 deleted file mode 100644 index 769e3ae68..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs +++ /dev/null @@ -1,35 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Generic; - -struct ConstU64; - -impl Generic -where - ConstU64<{ K - 1 }>: , -{ - fn foo(self) -> u64 { - K - } -} - -impl Generic -where - ConstU64<{ K - 1 }>: , - ConstU64<{ K + 1 }>: , - ConstU64<{ K + 1 - 1 }>: , -{ - fn bar(self) -> u64 { - let x: Generic<{ K + 1 }> = Generic; - x.foo() - } -} - -fn main() { - assert_eq!((Generic::<10>).bar(), 11); -} - -// Test that the ``ConstU64<{ K + 1 - 1}>`` bound on ``bar``'s impl block satisfies the -// ``ConstU64<{K - 1}>`` bound on ``foo``'s impl block 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 deleted file mode 100644 index 316887e5e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs +++ /dev/null @@ -1,34 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn zero_init() -> Substs1 -where - [u8; N + 1]: , -{ - Substs1([0; N + 1]) -} -struct Substs1([u8; N + 1]) -where - [(); N + 1]: ; - -fn substs2() -> Substs1<{ M * 2 }> -where - [(); { M * 2 } + 1]: , -{ - zero_init::<{ M * 2 }>() -} - -fn substs3() -> Substs1<{ (L - 1) * 2 }> -where - [(); (L - 1) * 2 + 1]: , -{ - substs2::<{ L - 1 }>() -} - -fn main() { - assert_eq!(substs3::<2>().0, [0; 3]); -} - -// Test that the ``{ (L - 1) * 2 + 1 }`` bound on ``substs3`` satisfies the -// ``{ N + 1 }`` bound on ``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 deleted file mode 100644 index d45a6465b..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs +++ /dev/null @@ -1,29 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features, unused_parens, unused_braces)] - -fn zero_init() -> Substs1<{ (N) }> -where - [u8; { (N) }]: , -{ - Substs1([0; { (N) }]) -} - -struct Substs1([u8; { (N) }]) -where - [(); { (N) }]: ; - -fn substs2() -> Substs1<{ (M) }> { - zero_init::<{ (M) }>() -} - -fn substs3() -> Substs1<{ (L) }> { - substs2::<{ (L) }>() -} - -fn main() { - assert_eq!(substs3::<2>().0, [0; 2]); -} - -// Test that the implicit ``{ (L) }`` bound on ``substs3`` satisfies the -// ``{ (N) }`` bound on ``Substs1`` diff --git a/src/test/ui/const-generics/generic_const_exprs/no_dependence.rs b/src/test/ui/const-generics/generic_const_exprs/no_dependence.rs deleted file mode 100644 index db8dc6ed4..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/no_dependence.rs +++ /dev/null @@ -1,13 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn two_args() -> [u8; M + 2] { - [0; M + 2] -} - -fn yay() -> [u8; 4] { - two_args::() // no lint -} - -fn main() {} 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 deleted file mode 100644 index 9c5de0317..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![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 deleted file mode 100644 index 3e5c2f5ca..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/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/const-generics/generic_const_exprs/normed_to_param_is_evaluatable.rs b/src/test/ui/const-generics/generic_const_exprs/normed_to_param_is_evaluatable.rs deleted file mode 100644 index b37b354ae..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/normed_to_param_is_evaluatable.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features, unused_braces)] - -#[rustfmt::skip] -fn foo() { - bar::<{{{{{{ N }}}}}}>(); -} - -fn bar() {} - -fn main() {} 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 deleted file mode 100644 index 24d333aba..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - - -const fn bar() -> usize { 7 } - -trait Foo { - fn test(&self) -> [u8; bar::()]; -} - -impl Foo for () { - fn test(&self) -> [u8; bar::()] { - [0; bar::()] - } -} - -fn use_dyn(v: &dyn Foo) { //~ERROR the trait `Foo` cannot be made into an object - v.test(); -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr deleted file mode 100644 index 4e1d71f15..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/object-safety-err-ret.rs:17:16 - | -LL | fn use_dyn(v: &dyn Foo) { - | ^^^^^^^ `Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/object-safety-err-ret.rs:8:23 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | fn test(&self) -> [u8; bar::()]; - | ^^^^^^^^^^^^^^^^^^^ ...because method `test` references the `Self` type in its return type - = help: consider moving `test` to another trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0038`. 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 deleted file mode 100644 index 42c1cc507..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -#![deny(where_clauses_object_safety)] - - -const fn bar() -> usize { 7 } - -trait Foo { - fn test(&self) where [u8; bar::()]: Sized; - //~^ ERROR the trait `Foo` cannot be made into an object - //~| WARN this was previously accepted by the compiler but is being phased out -} - -impl Foo for () { - fn test(&self) where [u8; bar::()]: Sized {} -} - -fn use_dyn(v: &dyn Foo) { - v.test(); -} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr deleted file mode 100644 index 440cf457e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error: the trait `Foo` cannot be made into an object - --> $DIR/object-safety-err-where-bounds.rs:9:8 - | -LL | fn test(&self) where [u8; bar::()]: Sized; - | ^^^^ - | - = 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 #51443 -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/object-safety-err-where-bounds.rs:9:8 - | -LL | trait Foo { - | --- this trait cannot be made into an object... -LL | fn test(&self) where [u8; bar::()]: Sized; - | ^^^^ ...because method `test` references the `Self` type in its `where` clause - = help: consider moving `test` to another trait -note: the lint level is defined here - --> $DIR/object-safety-err-where-bounds.rs:3:9 - | -LL | #![deny(where_clauses_object_safety)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - 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 deleted file mode 100644 index 79e9834b5..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Foo { - fn test(&self) -> [u8; N + 1]; -} - -impl Foo for () { - fn test(&self) -> [u8; N + 1] { - [0; N + 1] - } -} - -fn use_dyn(v: &dyn Foo) where [u8; N + 1]: Sized { - assert_eq!(v.test(), [0; N + 1]); -} - -fn main() { - use_dyn(&()); - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr deleted file mode 100644 index 59e9fee1e..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0284]: type annotations needed - --> $DIR/object-safety-ok-infer-err.rs:19:5 - | -LL | use_dyn(&()); - | ^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `use_dyn` - | -note: required by a bound in `use_dyn` - --> $DIR/object-safety-ok-infer-err.rs:14:55 - | -LL | fn use_dyn(v: &dyn Foo) where [u8; N + 1]: Sized { - | ^^^^^ required by this bound in `use_dyn` -help: consider specifying the generic argument - | -LL | use_dyn::(&()); - | +++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0284`. 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 deleted file mode 100644 index f4c89f623..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Foo { - fn test(&self) -> [u8; N + 1]; -} - -impl Foo for () { - fn test(&self) -> [u8; N + 1] { - [0; N + 1] - } -} - -fn use_dyn(v: &dyn Foo) where [u8; N + 1]: Sized { - assert_eq!(v.test(), [0; N + 1]); -} - -fn main() { - use_dyn::<3>(&()); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs b/src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs deleted file mode 100644 index e7c8e4f66..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -trait True {} - -struct Is; - -impl True for Is {} - -fn g() -//~^ NOTE required by a bound in this -where - Is<{ std::mem::size_of::() == 0 }>: True, - //~^ NOTE required by a bound in `g` - //~| NOTE required by this bound in `g` -{ -} - -fn main() { - g::(); - //~^ ERROR mismatched types - //~| NOTE expected `false`, found `true` - //~| NOTE expected constant `false` -} diff --git a/src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr b/src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr deleted file mode 100644 index a253ec676..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/obligation-cause.rs:20:5 - | -LL | g::(); - | ^^^^^^^^^^ expected `false`, found `true` - | - = note: expected constant `false` - found constant `true` -note: required by a bound in `g` - --> $DIR/obligation-cause.rs:13:44 - | -LL | fn g() - | - required by a bound in this -... -LL | Is<{ std::mem::size_of::() == 0 }>: True, - | ^^^^ required by this bound in `g` - -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/simple_fail.rs b/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs deleted file mode 100644 index cae54df4c..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -type Arr = [u8; N - 1]; -//~^ ERROR evaluation of `Arr::<0>::{constant#0}` failed - -fn test() -> Arr -where - [u8; N - 1]: Sized, - //~^ ERROR evaluation of `test::<0>::{constant#0}` failed -{ - todo!() -} - -fn main() { - test::<0>(); -} 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 deleted file mode 100644 index a25fa56b7..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0080]: evaluation of `test::<0>::{constant#0}` failed - --> $DIR/simple_fail.rs:9:10 - | -LL | [u8; N - 1]: Sized, - | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow - -error[E0080]: evaluation of `Arr::<0>::{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 deleted file mode 100644 index d6574a3aa..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn make_array() -> [(); M + 1] { - [(); M + 1] -} - -fn foo() -> [(); (N * 2) + 1] { - make_array::<{ N * 2 }>() -} - -fn main() { - assert_eq!(foo::<10>(), [(); 10 * 2 + 1]) -} - -// Tests that N * 2 is considered const_evalutable by appearing as part of the (N * 2) + 1 const 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 deleted file mode 100644 index d058b3638..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass -// Test that we correctly substitute generic arguments for type aliases. -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -type Alias = [T; N + 1]; - -fn foo() -> Alias where [u8; M + 1]: Sized { - [0; M + 1] -} - -fn main() { - foo::<0>(); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs b/src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs deleted file mode 100644 index c0404d35b..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![feature(generic_const_exprs, adt_const_params, const_trait_impl)] -#![allow(incomplete_features)] - -// test `N + N` unifies with explicit function calls for non-builtin-types -#[derive(PartialEq, Eq)] -struct Foo(u8); - -impl const std::ops::Add for Foo { - type Output = Self; - - fn add(self, rhs: Self) -> Self::Output { - self - } -} - -struct Evaluatable; - -fn foo(a: Evaluatable<{ N + N }>) { - bar::<{ std::ops::Add::add(N, N) }>(); -} - -fn bar() {} - -// test that `N + N` unifies with explicit function calls for builin-types -struct Evaluatable2; - -fn foo2(a: Evaluatable2<{ N + N }>) { - bar2::<{ std::ops::Add::add(N, N) }>(); - //~^ error: unconstrained generic constant - // FIXME(generic_const_exprs) make this not an error -} - -fn bar2() {} - -fn main() {} diff --git a/src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr b/src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr deleted file mode 100644 index d18c7916f..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/unify-op-with-fn-call.rs:28:12 - | -LL | bar2::<{ std::ops::Add::add(N, N) }>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { std::ops::Add::add(N, N) }]:` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/generic_const_exprs/unop.rs b/src/test/ui/const-generics/generic_const_exprs/unop.rs deleted file mode 100644 index c12fef083..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/unop.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Foo; - -fn test() -> Foo<{ !(N > 10) }> where Foo<{ !(N > 10) }>: Sized { - Foo -} - -fn main() { - let _: Foo = test::<12>(); - let _: Foo = test::<9>(); -} 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 deleted file mode 100644 index 9580f8a7f..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs +++ /dev/null @@ -1,6 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -struct Foo; -struct Bar(Foo); -fn main() {} 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 deleted file mode 100644 index c1bf19e0f..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn add() -> [u8; { N + 1; 5 }] { - //~^ ERROR overly complex generic constant - todo!() -} - -fn div() -> [u8; { N / 1; 5 }] { - //~^ ERROR overly complex generic constant - todo!() -} - -const fn foo(n: usize) {} - -fn fn_call() -> [u8; { foo(N); 5 }] { - //~^ ERROR overly complex generic constant - todo!() -} - -fn main() { - add::<12>(); - div::<9>(); - fn_call::<14>(); -} diff --git a/src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr b/src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr deleted file mode 100644 index df73acf53..000000000 --- a/src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error: overly complex generic constant - --> $DIR/unused_expr.rs:4:34 - | -LL | fn add() -> [u8; { N + 1; 5 }] { - | ^^^^^^^^^^^^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: overly complex generic constant - --> $DIR/unused_expr.rs:9:34 - | -LL | fn div() -> [u8; { N / 1; 5 }] { - | ^^^^^^^^^^^^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: overly complex generic constant - --> $DIR/unused_expr.rs:16:38 - | -LL | fn fn_call() -> [u8; { foo(N); 5 }] { - | ^^^^^^^^^^^^^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/const-generics/ice-68875.rs b/src/test/ui/const-generics/ice-68875.rs deleted file mode 100644 index 2ef7cfdbe..000000000 --- a/src/test/ui/const-generics/ice-68875.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-fail - -struct DataWrapper<'a> { - data: &'a [u8; Self::SIZE], //~ ERROR generic `Self` types are currently not permitted in anonymous constants -} - -impl DataWrapper<'_> { - const SIZE: usize = 14; -} - -pub fn main() {} diff --git a/src/test/ui/const-generics/ice-68875.stderr b/src/test/ui/const-generics/ice-68875.stderr deleted file mode 100644 index 1db62c57f..000000000 --- a/src/test/ui/const-generics/ice-68875.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/ice-68875.rs:4:20 - | -LL | data: &'a [u8; Self::SIZE], - | ^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/ice-const-generic-function-return-ty.rs b/src/test/ui/const-generics/ice-const-generic-function-return-ty.rs deleted file mode 100644 index 2bf628af8..000000000 --- a/src/test/ui/const-generics/ice-const-generic-function-return-ty.rs +++ /dev/null @@ -1,5 +0,0 @@ -// #95163 -fn return_ty() -> impl Into<<() as Reexported; -//~^ ERROR expected one of `(`, `::`, `<`, or `>`, found `;` - -fn main() {} diff --git a/src/test/ui/const-generics/ice-const-generic-function-return-ty.stderr b/src/test/ui/const-generics/ice-const-generic-function-return-ty.stderr deleted file mode 100644 index a72f5800a..000000000 --- a/src/test/ui/const-generics/ice-const-generic-function-return-ty.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: expected one of `(`, `::`, `<`, or `>`, found `;` - --> $DIR/ice-const-generic-function-return-ty.rs:2:46 - | -LL | fn return_ty() -> impl Into<<() as Reexported; - | ^ expected one of `(`, `::`, `<`, or `>` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/impl-const-generic-struct.rs b/src/test/ui/const-generics/impl-const-generic-struct.rs deleted file mode 100644 index 7eb2c6a51..000000000 --- a/src/test/ui/const-generics/impl-const-generic-struct.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -struct S; - -impl S { - fn x() -> u32 { - X - } -} - -fn main() { - assert_eq!(S::<19>::x(), 19); -} 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 deleted file mode 100644 index de2d126af..000000000 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.rs +++ /dev/null @@ -1,11 +0,0 @@ -fn foo() -> usize { - 0 -} - -fn main() { - foo::<0>(); - //~^ ERROR this function takes 2 - - foo::<0, 0, 0>(); - //~^ ERROR this function takes 2 -} 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 deleted file mode 100644 index a845454f7..000000000 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.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: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.rs b/src/test/ui/const-generics/infer/cannot-infer-const-args.rs deleted file mode 100644 index f85a72910..000000000 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn foo() -> usize { - 0 -} - -fn main() { - foo(); //~ ERROR type annotations needed -} 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 deleted file mode 100644 index 93e45a88a..000000000 --- a/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/cannot-infer-const-args.rs:6:5 - | -LL | foo(); - | ^^^ cannot infer the value of the const parameter `X` declared on the function `foo` - | -help: consider specifying the generic 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/issue-77092.rs b/src/test/ui/const-generics/infer/issue-77092.rs deleted file mode 100644 index fcf7d3282..000000000 --- a/src/test/ui/const-generics/infer/issue-77092.rs +++ /dev/null @@ -1,14 +0,0 @@ -use std::convert::TryInto; - -fn take_array_from_mut(data: &mut [T], start: usize) -> &mut [T; N] { - (&mut data[start .. start + N]).try_into().unwrap() -} - -fn main() { - let mut arr = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - - for i in 1 .. 4 { - println!("{:?}", take_array_from_mut(&mut arr, i)); - //~^ ERROR type annotations needed - } -} diff --git a/src/test/ui/const-generics/infer/issue-77092.stderr b/src/test/ui/const-generics/infer/issue-77092.stderr deleted file mode 100644 index 1682b26ac..000000000 --- a/src/test/ui/const-generics/infer/issue-77092.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-77092.rs:11:26 - | -LL | println!("{:?}", take_array_from_mut(&mut arr, i)); - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of the const parameter `N` declared on the function `take_array_from_mut` - | -help: consider specifying the generic arguments - | -LL | println!("{:?}", take_array_from_mut::(&mut arr, i)); - | ++++++++++ - -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 deleted file mode 100644 index 0c5eed489..000000000 --- a/src/test/ui/const-generics/infer/method-chain.rs +++ /dev/null @@ -1,16 +0,0 @@ -struct Foo; - -impl Foo { - fn bar(self) -> Foo { - Foo - } - - fn baz(self) -> Foo { - println!("baz: {}", N); - Foo - } -} - -fn main() { - Foo.bar().bar().bar().bar().baz(); //~ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/method-chain.stderr b/src/test/ui/const-generics/infer/method-chain.stderr deleted file mode 100644 index ff6da535b..000000000 --- a/src/test/ui/const-generics/infer/method-chain.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/method-chain.rs:15:33 - | -LL | Foo.bar().bar().bar().bar().baz(); - | ^^^ cannot infer the value of the const parameter `N` declared on the associated function `baz` - | -help: consider specifying the generic 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.rs b/src/test/ui/const-generics/infer/one-param-uninferred.rs deleted file mode 100644 index d6018650f..000000000 --- a/src/test/ui/const-generics/infer/one-param-uninferred.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test that we emit an error if we cannot properly infer a constant. -fn foo() -> [u8; N] { - todo!() -} - -fn main() { - // FIXME(const_generics): Currently this only suggests one const parameter, - // but instead it should suggest to provide all parameters. - let _: [u8; 17] = foo(); - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.stderr deleted file mode 100644 index cf70c2181..000000000 --- a/src/test/ui/const-generics/infer/one-param-uninferred.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/one-param-uninferred.rs:9:23 - | -LL | let _: [u8; 17] = foo(); - | ^^^ cannot infer the value of the const parameter `M` declared on the function `foo` - | -help: consider specifying the generic arguments - | -LL | let _: [u8; 17] = foo::<17, M>(); - | +++++++++ - -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 deleted file mode 100644 index 657f4b513..000000000 --- a/src/test/ui/const-generics/infer/uninferred-consts.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Test that we emit an error if we cannot properly infer a constant. - -// taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893 -struct Foo; -impl Foo { - fn foo(self) {} -} -fn main() { - Foo.foo(); - //~^ ERROR type annotations needed -} diff --git a/src/test/ui/const-generics/infer/uninferred-consts.stderr b/src/test/ui/const-generics/infer/uninferred-consts.stderr deleted file mode 100644 index 3980ecea8..000000000 --- a/src/test/ui/const-generics/infer/uninferred-consts.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/uninferred-consts.rs:9:9 - | -LL | Foo.foo(); - | ^^^ cannot infer the value of the const parameter `A` declared on the associated function `foo` - | -help: consider specifying the generic arguments - | -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 deleted file mode 100644 index 10317a1b9..000000000 --- a/src/test/ui/const-generics/infer_arg_from_pat.rs +++ /dev/null @@ -1,25 +0,0 @@ -// run-pass -// -// see issue #70529 - -struct A { - arr: [u8; N], -} - -impl A { - fn new() -> Self { - A { - arr: [0; N], - } - } - - fn value(&self) -> usize { - N - } -} - -fn main() { - let a = A::new(); - let [_, _] = a.arr; - assert_eq!(a.value(), 2); -} 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 deleted file mode 100644 index 40f6f5b8d..000000000 --- a/src/test/ui/const-generics/infer_arr_len_from_pat.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass -// -// see issue #70529 - -fn as_chunks() -> [u8; N] { - loop {} -} - -fn main() { - let [_, _] = as_chunks(); -} diff --git a/src/test/ui/const-generics/inhabited-assoc-ty-ice-1.rs b/src/test/ui/const-generics/inhabited-assoc-ty-ice-1.rs deleted file mode 100644 index b385406b0..000000000 --- a/src/test/ui/const-generics/inhabited-assoc-ty-ice-1.rs +++ /dev/null @@ -1,28 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// This tests that the inhabited check doesn't cause -// ICEs by trying to evaluate `T::ASSOC` with an incorrect `ParamEnv`. - -trait Foo { - const ASSOC: usize = 1; -} - -#[allow(unused_tuple_struct_fields)] -struct Iced(T, [(); T::ASSOC]) -where - [(); T::ASSOC]: ; - -impl Foo for u32 {} - -fn foo() -where - [(); T::ASSOC]: , -{ - let _iced: Iced = return; -} - -fn main() { - foo::(); -} diff --git a/src/test/ui/const-generics/inhabited-assoc-ty-ice-2.rs b/src/test/ui/const-generics/inhabited-assoc-ty-ice-2.rs deleted file mode 100644 index 216d29c7c..000000000 --- a/src/test/ui/const-generics/inhabited-assoc-ty-ice-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// This tests that the inhabited check doesn't cause -// ICEs by trying to evaluate `T::ASSOC` with an incorrect `ParamEnv`. - -trait Foo { - const ASSOC: usize = 1; -} - -#[allow(unused_tuple_struct_fields)] -struct Iced(T, [(); T::ASSOC]) -where - [(); T::ASSOC]: ; - -impl Foo for u32 {} - -fn main() { - let _iced: Iced = return; -} 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 deleted file mode 100644 index 2b8731ba7..000000000 --- a/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -fn takes_closure_of_array_3(f: F) where F: Fn([i32; 3]) { - f([1, 2, 3]); -} - -fn takes_closure_of_array_3_apit(f: impl Fn([i32; 3])) { - f([1, 2, 3]); -} - -fn returns_closure_of_array_3() -> impl Fn([i32; 3]) { - |_| {} -} - -fn main() { - takes_closure_of_array_3(returns_closure_of_array_3()); - takes_closure_of_array_3_apit(returns_closure_of_array_3()); -} 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 deleted file mode 100644 index b8a1027c9..000000000 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: generic parameters may not be used in const operations - --> $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(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:10:22 - | -LL | trait Trait {} - | ^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 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 deleted file mode 100644 index 147a00cb2..000000000 --- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs +++ /dev/null @@ -1,21 +0,0 @@ -// [full] check-pass -// revisions: full min - -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(adt_const_params, generic_const_exprs))] - -#![feature(core_intrinsics)] -#![feature(const_type_name)] - -trait Trait {} -//[min]~^ ERROR `&'static str` is forbidden as the type of a const generic parameter - -struct Bug -where - T: Trait<{std::intrinsics::type_name::()}> - //[min]~^ ERROR generic parameters may not be used in const operations -{ - t: T -} - -fn main() {} diff --git a/src/test/ui/const-generics/invalid-const-arg-for-type-param.rs b/src/test/ui/const-generics/invalid-const-arg-for-type-param.rs deleted file mode 100644 index 7d4dc98f3..000000000 --- a/src/test/ui/const-generics/invalid-const-arg-for-type-param.rs +++ /dev/null @@ -1,14 +0,0 @@ -use std::convert::TryInto; - -struct S; - -fn main() { - let _: u32 = 5i32.try_into::<32>().unwrap(); - //~^ ERROR this associated function takes - - S.f::<0>(); - //~^ ERROR no method named `f` - - S::<0>; - //~^ ERROR this struct takes 0 -} diff --git a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr deleted file mode 100644 index d955b4f96..000000000 --- a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/invalid-const-arg-for-type-param.rs:6:23 - | -LL | let _: u32 = 5i32.try_into::<32>().unwrap(); - | ^^^^^^^^ expected 0 generic arguments - | -note: associated function defined here, with 0 generic parameters - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - | -LL | fn try_into(self) -> Result; - | ^^^^^^^^ -help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument - | -LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: remove these generics - | -LL - let _: u32 = 5i32.try_into::<32>().unwrap(); -LL + let _: u32 = 5i32.try_into().unwrap(); - | - -error[E0599]: no method named `f` found for struct `S` in the current scope - --> $DIR/invalid-const-arg-for-type-param.rs:9:7 - | -LL | struct S; - | -------- method `f` not found for this struct -... -LL | S.f::<0>(); - | ^ method not found in `S` - -error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/invalid-const-arg-for-type-param.rs:12:5 - | -LL | S::<0>; - | ^----- help: remove these generics - | | - | expected 0 generic arguments - | -note: struct defined here, with 0 generic parameters - --> $DIR/invalid-const-arg-for-type-param.rs:3:8 - | -LL | struct S; - | ^ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0107, E0599. -For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/invalid-constant-in-args.rs b/src/test/ui/const-generics/invalid-constant-in-args.rs deleted file mode 100644 index 7419d4a25..000000000 --- a/src/test/ui/const-generics/invalid-constant-in-args.rs +++ /dev/null @@ -1,6 +0,0 @@ -use std::cell::Cell; - -fn main() { - let _: Cell<&str, "a"> = Cell::new(""); - //~^ ERROR this struct takes 1 generic argument but 2 generic arguments were supplied -} diff --git a/src/test/ui/const-generics/invalid-constant-in-args.stderr b/src/test/ui/const-generics/invalid-constant-in-args.stderr deleted file mode 100644 index 1400d2bf5..000000000 --- a/src/test/ui/const-generics/invalid-constant-in-args.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0107]: this struct takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/invalid-constant-in-args.rs:4:12 - | -LL | let _: Cell<&str, "a"> = Cell::new(""); - | ^^^^ --- help: remove this generic argument - | | - | expected 1 generic argument - | -note: struct defined here, with 1 generic parameter: `T` - --> $SRC_DIR/core/src/cell.rs:LL:COL - | -LL | pub struct Cell { - | ^^^^ - - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/invalid-enum.rs b/src/test/ui/const-generics/invalid-enum.rs deleted file mode 100644 index cb6d05349..000000000 --- a/src/test/ui/const-generics/invalid-enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -#[derive(PartialEq, Eq)] -enum CompileFlag { - A, - B, -} - -pub fn test_1() {} -pub fn test_2(x: T) {} -pub struct Example{ - x: T, -} - -impl Example { - const ASSOC_FLAG: CompileFlag = CompileFlag::A; -} - -pub fn main() { - test_1::(); - //~^ ERROR: expected type, found variant - //~| ERROR: unresolved item provided when a constant was expected - - test_2::<_, CompileFlag::A>(0); - //~^ ERROR: expected type, found variant - //~| ERROR: unresolved item provided when a constant was expected - - let _: Example = Example { x: 0 }; - //~^ ERROR: expected type, found variant - //~| ERROR: unresolved item provided when a constant was expected - - let _: Example = Example { x: 0 }; - //~^ ERROR: type provided when a constant was expected -} diff --git a/src/test/ui/const-generics/invalid-enum.stderr b/src/test/ui/const-generics/invalid-enum.stderr deleted file mode 100644 index 0d3643f6f..000000000 --- a/src/test/ui/const-generics/invalid-enum.stderr +++ /dev/null @@ -1,75 +0,0 @@ -error[E0573]: expected type, found variant `CompileFlag::A` - --> $DIR/invalid-enum.rs:21:12 - | -LL | test_1::(); - | ^^^^^^^^^^^^^^ - | | - | not a type - | help: try using the variant's enum: `CompileFlag` - -error[E0573]: expected type, found variant `CompileFlag::A` - --> $DIR/invalid-enum.rs:25:15 - | -LL | test_2::<_, CompileFlag::A>(0); - | ^^^^^^^^^^^^^^ - | | - | not a type - | help: try using the variant's enum: `CompileFlag` - -error[E0573]: expected type, found variant `CompileFlag::A` - --> $DIR/invalid-enum.rs:29:18 - | -LL | let _: Example = Example { x: 0 }; - | ^^^^^^^^^^^^^^ - | | - | not a type - | help: try using the variant's enum: `CompileFlag` - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/invalid-enum.rs:29:18 - | -LL | let _: Example = Example { x: 0 }; - | ^^^^^^^^^^^^^^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | let _: Example<{ CompileFlag::A }, _> = Example { x: 0 }; - | + + - -error[E0747]: type provided when a constant was expected - --> $DIR/invalid-enum.rs:33:18 - | -LL | let _: Example = Example { x: 0 }; - | ^^^^^^^^^^^^^^^^^^^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | let _: Example<{ Example::ASSOC_FLAG }, _> = Example { x: 0 }; - | + + - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/invalid-enum.rs:21:12 - | -LL | test_1::(); - | ^^^^^^^^^^^^^^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | test_1::<{ CompileFlag::A }>(); - | + + - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/invalid-enum.rs:25:15 - | -LL | test_2::<_, CompileFlag::A>(0); - | ^^^^^^^^^^^^^^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | test_2::<_, { CompileFlag::A }>(0); - | + + - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0573, E0747. -For more information about an error, try `rustc --explain E0573`. diff --git a/src/test/ui/const-generics/invariant.rs b/src/test/ui/const-generics/invariant.rs deleted file mode 100644 index 39d658be6..000000000 --- a/src/test/ui/const-generics/invariant.rs +++ /dev/null @@ -1,34 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -use std::marker::PhantomData; - -trait SadBee { - const ASSOC: usize; -} -// fn(&'static ())` is a supertype of `for<'a> fn(&'a ())` while -// we allow two different impls for these types, leading -// to different const eval results. -impl SadBee for for<'a> fn(&'a ()) { - const ASSOC: usize = 0; -} -impl SadBee for fn(&'static ()) { - //~^ WARNING conflicting implementations of trait - //~| WARNING this was previously accepted - const ASSOC: usize = 100; -} - -struct Foo([u8; ::ASSOC], PhantomData) -where - [(); ::ASSOC]: ; - -fn covariant( - v: &'static Foo fn(&'a ())> -) -> &'static Foo { - v - //~^ ERROR mismatched types -} - -fn main() { - let y = covariant(&Foo([], PhantomData)); - println!("{:?}", y.0); -} diff --git a/src/test/ui/const-generics/invariant.stderr b/src/test/ui/const-generics/invariant.stderr deleted file mode 100644 index aabe4c93b..000000000 --- a/src/test/ui/const-generics/invariant.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())` - --> $DIR/invariant.rs:14:1 - | -LL | impl SadBee for for<'a> fn(&'a ()) { - | ---------------------------------- first implementation here -... -LL | impl SadBee for fn(&'static ()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())` - | - = 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 #56105 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - = note: `#[warn(coherence_leak_check)]` on by default - -error[E0308]: mismatched types - --> $DIR/invariant.rs:27:5 - | -LL | v - | ^ one type is more general than the other - | - = note: expected reference `&Foo` - found reference `&Foo fn(&'a ())>` - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issue-102124.rs b/src/test/ui/const-generics/issue-102124.rs deleted file mode 100644 index a28f198e9..000000000 --- a/src/test/ui/const-generics/issue-102124.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass -// compile-flags: -Zmir-opt-level=3 - -// regression test for #102124 - -const L: usize = 4; - -pub trait Print { - fn print(&self) -> usize { - N - } -} - -pub struct Printer; -impl Print for Printer {} - -fn main() { - let p = Printer; - assert_eq!(p.print(), 4); -} diff --git a/src/test/ui/const-generics/issue-46511.rs b/src/test/ui/const-generics/issue-46511.rs deleted file mode 100644 index 71c50e2f3..000000000 --- a/src/test/ui/const-generics/issue-46511.rs +++ /dev/null @@ -1,8 +0,0 @@ -// check-fail - -struct Foo<'a> //~ ERROR parameter `'a` is never used [E0392] -{ - _a: [u8; std::mem::size_of::<&'a mut u8>()] //~ ERROR a non-static lifetime is not allowed in a `const` -} - -pub fn main() {} diff --git a/src/test/ui/const-generics/issue-46511.stderr b/src/test/ui/const-generics/issue-46511.stderr deleted file mode 100644 index b21afa56d..000000000 --- a/src/test/ui/const-generics/issue-46511.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0658]: a non-static lifetime is not allowed in a `const` - --> $DIR/issue-46511.rs:5:35 - | -LL | _a: [u8; std::mem::size_of::<&'a mut u8>()] - | ^^ - | - = note: see issue #76560 for more information - = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable - -error[E0392]: parameter `'a` is never used - --> $DIR/issue-46511.rs:3:12 - | -LL | struct Foo<'a> - | ^^ unused parameter - | - = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0392, E0658. -For more information about an error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issue-66451.rs b/src/test/ui/const-generics/issue-66451.rs deleted file mode 100644 index 3335f7d59..000000000 --- a/src/test/ui/const-generics/issue-66451.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -#[derive(Debug, PartialEq, Eq)] -struct Foo { - value: i32, - nested: &'static Bar, -} - -#[derive(Debug, PartialEq, Eq)] -struct Bar(T); - -struct Test; - -fn main() { - let x: Test<{ - Foo { - value: 3, - nested: &Bar(4), - } - }> = Test; - let y: Test<{ - Foo { - value: 3, - nested: &Bar(5), - } - }> = x; //~ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/issue-66451.stderr b/src/test/ui/const-generics/issue-66451.stderr deleted file mode 100644 index e0cb0b661..000000000 --- a/src/test/ui/const-generics/issue-66451.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-66451.rs:27:10 - | -LL | let y: Test<{ - | ____________- -LL | | Foo { -LL | | value: 3, -LL | | nested: &Bar(5), -LL | | } -LL | | }> = x; - | | - ^ expected `Foo { value: 3, nested: &Bar::(5) }`, found `Foo { value: 3, nested: &Bar::(4) }` - | |______| - | expected due to this - | - = note: expected struct `Test(5) }>` - found struct `Test(4) }>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/issue-70408.rs b/src/test/ui/const-generics/issue-70408.rs deleted file mode 100644 index f7557cb49..000000000 --- a/src/test/ui/const-generics/issue-70408.rs +++ /dev/null @@ -1,13 +0,0 @@ -// build-pass - -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -pub fn function_with_bytes() -> &'static [u8] { - BYTES -} - -pub fn main() { - assert_eq!(function_with_bytes::(), &[0x41, 0x41, 0x41, 0x41]); - assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA"); -} diff --git a/src/test/ui/const-generics/issue-80471.rs b/src/test/ui/const-generics/issue-80471.rs deleted file mode 100644 index d0af8a5ea..000000000 --- a/src/test/ui/const-generics/issue-80471.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(adt_const_params)] -//~^ WARN the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features] - -#[derive(PartialEq, Eq)] -enum Nat { - Z, - S(Box), -} - -fn foo() {} -//~^ ERROR `Box` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter - -fn main() {} diff --git a/src/test/ui/const-generics/issue-80471.stderr b/src/test/ui/const-generics/issue-80471.stderr deleted file mode 100644 index b89706710..000000000 --- a/src/test/ui/const-generics/issue-80471.stderr +++ /dev/null @@ -1,18 +0,0 @@ -warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/issue-80471.rs:1:12 - | -LL | #![feature(adt_const_params)] - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #95174 for more information - = note: `#[warn(incomplete_features)]` on by default - -error[E0741]: `Box` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter - --> $DIR/issue-80471.rs:10:17 - | -LL | fn foo() {} - | ^^^ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/issue-93647.rs b/src/test/ui/const-generics/issue-93647.rs deleted file mode 100644 index 806540e17..000000000 --- a/src/test/ui/const-generics/issue-93647.rs +++ /dev/null @@ -1,6 +0,0 @@ -struct X; - -fn main() {} diff --git a/src/test/ui/const-generics/issue-93647.stderr b/src/test/ui/const-generics/issue-93647.stderr deleted file mode 100644 index e2048ecd6..000000000 --- a/src/test/ui/const-generics/issue-93647.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0015]: cannot call non-const closure in constants - --> $DIR/issue-93647.rs:2:5 - | -LL | (||1usize)() - | ^^^^^^^^^^^^ - | - = note: closures need an RFC before allowed to be called in constants - = note: calls in constants are limited to constant functions, tuple structs and tuple variants - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/const-generics/issue-97007.rs b/src/test/ui/const-generics/issue-97007.rs deleted file mode 100644 index 7036834c4..000000000 --- a/src/test/ui/const-generics/issue-97007.rs +++ /dev/null @@ -1,88 +0,0 @@ -// check-pass - -#![feature(adt_const_params, generic_const_exprs)] -#![allow(incomplete_features)] - -mod lib { - const N_ISLANDS: usize = 4; - const N_BRIDGES: usize = 7; - const BRIDGES: [(usize, usize); 7] = [(0, 1), (0, 1), (0, 2), (0, 3), (0, 3), (1, 2), (2, 3)]; - - pub type Matrix = [[usize; N_ISLANDS]; N_ISLANDS]; - - const EMPTY_MATRIX: Matrix = [[0; N_ISLANDS]; N_ISLANDS]; - - const fn build(mut matrix: Matrix, (to, from): (usize, usize)) -> Matrix { - matrix[to][from] += 1; - matrix[from][to] += 1; - matrix - } - - pub const fn walk(mut matrix: Matrix, from: usize, to: usize) -> Matrix { - matrix[from][to] -= 1; - matrix[to][from] -= 1; - matrix - } - - const fn to_matrix(bridges: [(usize, usize); N_BRIDGES]) -> Matrix { - let matrix = EMPTY_MATRIX; - - let matrix = build(matrix, bridges[0]); - let matrix = build(matrix, bridges[1]); - let matrix = build(matrix, bridges[2]); - let matrix = build(matrix, bridges[3]); - let matrix = build(matrix, bridges[4]); - let matrix = build(matrix, bridges[5]); - let matrix = build(matrix, bridges[6]); - - matrix - } - - const BRIDGE_MATRIX: [[usize; N_ISLANDS]; N_ISLANDS] = to_matrix(BRIDGES); - - pub struct Walk { - _p: (), - } - - impl Walk<0, BRIDGE_MATRIX> { - pub const fn new() -> Self { - Self { _p: () } - } - } - - impl Walk { - pub fn proceed_to( - self, - ) -> Walk { - Walk { _p: () } - } - } - - pub struct Trophy { - _p: (), - } - - impl Walk { - pub fn collect_prize(self) -> Trophy { - Trophy { _p: () } - } - } -} - -pub use lib::{Trophy, Walk}; - -fn main() { - // Example, taking the first step - let _ = Walk::new().proceed_to::<1>(); - - // Don't be so eager to collect the trophy - // let trophy = Walk::new() - // .proceed_to::<1>() - // .proceed_to::<0>() - // .collect_prize(); - - // Can't just make a Trophy out of thin air, you must earn it - // let trophy: Trophy = Trophy { _p: () }; - - // Can you collect the Trophy? -} 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 deleted file mode 100644 index 6a10ee267..000000000 --- a/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// All of these three items must be in `lib2` to reproduce the error - -pub trait TypeFn { - type Output; -} - -pub struct GenericType; - -// Removing the braces around `42` resolves the crash -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 deleted file mode 100644 index de3a40860..000000000 --- a/src/test/ui/const-generics/issues/auxiliary/impl-const.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(generic_const_exprs)] - -pub struct Num; - -// Braces around const expression causes crash -impl Num<{5}> { - pub fn five(&self) { - } -} diff --git a/src/test/ui/const-generics/issues/issue-100313.rs b/src/test/ui/const-generics/issues/issue-100313.rs deleted file mode 100644 index 4e9d3626a..000000000 --- a/src/test/ui/const-generics/issues/issue-100313.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![allow(incomplete_features)] -#![feature(const_mut_refs)] -#![feature(adt_const_params)] - -struct T; - -impl T { - const fn set_false(&self) { - unsafe { - *(B as *const bool as *mut bool) = false; - //~^ ERROR evaluation of constant value failed [E0080] - } - } -} - -const _: () = { - let x = T::<{&true}>; - x.set_false(); -}; - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-100313.stderr b/src/test/ui/const-generics/issues/issue-100313.stderr deleted file mode 100644 index d4b486376..000000000 --- a/src/test/ui/const-generics/issues/issue-100313.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> $DIR/issue-100313.rs:10:13 - | -LL | *(B as *const bool as *mut bool) = false; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to alloc7 which is read-only - | -note: inside `T::<&true>::set_false` - --> $DIR/issue-100313.rs:10:13 - | -LL | *(B as *const bool as *mut bool) = false; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: inside `_` - --> $DIR/issue-100313.rs:18:5 - | -LL | x.set_false(); - | ^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0080`. 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 deleted file mode 100644 index 179643a75..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-1.full.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0771]: use of non-static lifetime `'a` in const generic - --> $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 - -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 deleted file mode 100644 index 43a5df117..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-1.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0771]: use of non-static lifetime `'a` in const generic - --> $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: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/issue-56445-1.rs:9:25 - | -LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0771`. diff --git a/src/test/ui/const-generics/issues/issue-56445-1.rs b/src/test/ui/const-generics/issues/issue-56445-1.rs deleted file mode 100644 index 13eb2ea9f..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-1.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995. -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] -#![crate_type = "lib"] - -use std::marker::PhantomData; - -struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); -//~^ ERROR: use of non-static lifetime `'a` in const generic -//[min]~| ERROR: `&'static str` is forbidden as the type of a const generic parameter - -impl Bug<'_, ""> {} diff --git a/src/test/ui/const-generics/issues/issue-56445-2.rs b/src/test/ui/const-generics/issues/issue-56445-2.rs deleted file mode 100644 index e078c8487..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-2.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-502095133 -struct OnDiskDirEntry<'a> { _s: &'a usize } - -impl<'a> OnDiskDirEntry<'a> { - const LFN_FRAGMENT_LEN: usize = 2; - - fn lfn_contents(&self) -> [char; Self::LFN_FRAGMENT_LEN] { loop { } } - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-56445-2.stderr b/src/test/ui/const-generics/issues/issue-56445-2.stderr deleted file mode 100644 index 770c80cbb..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-2.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/issue-56445-2.rs:7:38 - | -LL | fn lfn_contents(&self) -> [char; Self::LFN_FRAGMENT_LEN] { loop { } } - | ^^^^ - | -note: not a concrete type - --> $DIR/issue-56445-2.rs:4:10 - | -LL | impl<'a> OnDiskDirEntry<'a> { - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-56445-3.rs b/src/test/ui/const-generics/issues/issue-56445-3.rs deleted file mode 100644 index c29df1458..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-3.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-524494170 -pub struct Memory<'rom> { - rom: &'rom [u8], - ram: [u8; Self::SIZE], - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants -} - -impl<'rom> Memory<'rom> { - pub const SIZE: usize = 0x8000; -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-56445-3.stderr b/src/test/ui/const-generics/issues/issue-56445-3.stderr deleted file mode 100644 index f1c49eecf..000000000 --- a/src/test/ui/const-generics/issues/issue-56445-3.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/issue-56445-3.rs:4:15 - | -LL | ram: [u8; Self::SIZE], - | ^^^^ - -error: aborting due to previous error - 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 deleted file mode 100644 index 0066490df..000000000 --- a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs +++ /dev/null @@ -1,7 +0,0 @@ -// check-pass - -struct Generic; - -fn main() { - let _ = Generic::<0>; -} diff --git a/src/test/ui/const-generics/issues/issue-61336-1.rs b/src/test/ui/const-generics/issues/issue-61336-1.rs deleted file mode 100644 index beb37e63b..000000000 --- a/src/test/ui/const-generics/issues/issue-61336-1.rs +++ /dev/null @@ -1,9 +0,0 @@ -// build-pass -fn f(x: T) -> [T; N] { - [x; N] -} - -fn main() { - let x: [u32; 5] = f::(3); - assert_eq!(x, [3u32; 5]); -} diff --git a/src/test/ui/const-generics/issues/issue-61336-2.rs b/src/test/ui/const-generics/issues/issue-61336-2.rs deleted file mode 100644 index b7cd29f89..000000000 --- a/src/test/ui/const-generics/issues/issue-61336-2.rs +++ /dev/null @@ -1,13 +0,0 @@ -fn f(x: T) -> [T; N] { - [x; { N }] -} - -fn g(x: T) -> [T; N] { - [x; { N }] - //~^ ERROR the trait bound `T: Copy` is not satisfied -} - -fn main() { - let x: [u32; 5] = f::(3); - assert_eq!(x, [3u32; 5]); -} diff --git a/src/test/ui/const-generics/issues/issue-61336-2.stderr b/src/test/ui/const-generics/issues/issue-61336-2.stderr deleted file mode 100644 index 5bb356696..000000000 --- a/src/test/ui/const-generics/issues/issue-61336-2.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-61336-2.rs:6:6 - | -LL | [x; { N }] - | ^ the trait `Copy` is not implemented for `T` - | - = note: the `Copy` trait is required because this value will be copied for each element of the array -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 deleted file mode 100644 index 80be1d8e5..000000000 --- a/src/test/ui/const-generics/issues/issue-61336.rs +++ /dev/null @@ -1,13 +0,0 @@ -fn f(x: T) -> [T; N] { - [x; N] -} - -fn g(x: T) -> [T; N] { - [x; N] - //~^ ERROR the trait bound `T: Copy` is not satisfied -} - -fn main() { - let x: [u32; 5] = f::(3); - assert_eq!(x, [3u32; 5]); -} diff --git a/src/test/ui/const-generics/issues/issue-61336.stderr b/src/test/ui/const-generics/issues/issue-61336.stderr deleted file mode 100644 index 8d9e545b4..000000000 --- a/src/test/ui/const-generics/issues/issue-61336.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-61336.rs:6:6 - | -LL | [x; N] - | ^ the trait `Copy` is not implemented for `T` - | - = note: the `Copy` trait is required because this value will be copied for each element of the array -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.rs b/src/test/ui/const-generics/issues/issue-61422.rs deleted file mode 100644 index 0b9cf40d8..000000000 --- a/src/test/ui/const-generics/issues/issue-61422.rs +++ /dev/null @@ -1,24 +0,0 @@ -// check-pass -use std::mem; - -// Neither of the uninits below are currently accepted as not UB, however, -// this code does not run and is merely checking that we do not ICE on this pattern, -// so this is fine. - -fn foo() { - let arr: [u8; SIZE] = unsafe { - #[allow(deprecated)] - let array: [u8; SIZE] = mem::uninitialized(); - array - }; -} - -fn bar() { - let arr: [u8; SIZE] = unsafe { - let array: [u8; SIZE] = mem::MaybeUninit::uninit().assume_init(); - array - }; -} - - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-61432.rs b/src/test/ui/const-generics/issues/issue-61432.rs deleted file mode 100644 index 6192af82a..000000000 --- a/src/test/ui/const-generics/issues/issue-61432.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-pass - -fn promote() { - let _ = &N; -} - -fn main() { - promote::<0>(); -} 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 deleted file mode 100644 index fa76aeae9..000000000 --- a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -pub trait BitLen: Sized { - const BIT_LEN: usize; -} - -impl BitLen for [u8; L] { - const BIT_LEN: usize = 8 * L; -} - -fn main() { - let _foo = <[u8; 2]>::BIT_LEN; -} diff --git a/src/test/ui/const-generics/issues/issue-62878.full.stderr b/src/test/ui/const-generics/issues/issue-62878.full.stderr deleted file mode 100644 index 3a2b291d7..000000000 --- a/src/test/ui/const-generics/issues/issue-62878.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-62878.rs:5:38 - | -LL | fn foo() {} - | ^ the type must not depend on the parameter `N` - -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-62878.min.stderr b/src/test/ui/const-generics/issues/issue-62878.min.stderr deleted file mode 100644 index af029a651..000000000 --- a/src/test/ui/const-generics/issues/issue-62878.min.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-62878.rs:5:38 - | -LL | fn foo() {} - | ^ the type must not depend on the parameter `N` - -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/issue-62878.rs:5:33 - | -LL | fn foo() {} - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/issues/issue-62878.rs b/src/test/ui/const-generics/issues/issue-62878.rs deleted file mode 100644 index 578ce765b..000000000 --- a/src/test/ui/const-generics/issues/issue-62878.rs +++ /dev/null @@ -1,11 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params, generic_arg_infer))] -#![cfg_attr(full, allow(incomplete_features))] - -fn foo() {} -//~^ ERROR the type of const parameters must not -//[min]~| ERROR `[u8; _]` is forbidden as the type of a const generic parameter - -fn main() { - foo::<_, { [1] }>(); -} diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr deleted file mode 100644 index 16fabd1e8..000000000 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0741]: `(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 - | -LL | fn test() { - | ^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. 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 deleted file mode 100644 index 9f6c7ccf3..000000000 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `&'static (dyn A + 'static)` is forbidden as the type of a const generic parameter - --> $DIR/issue-63322-forbid-dyn.rs:9:18 - | -LL | fn test() { - | ^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs deleted file mode 100644 index 116c3fcfb..000000000 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs +++ /dev/null @@ -1,17 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -trait A {} -struct B; -impl A for B {} - -fn test() { - //[full]~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used - //[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden - unimplemented!() -} - -fn main() { - test::<{ &B }>(); -} diff --git a/src/test/ui/const-generics/issues/issue-64519.rs b/src/test/ui/const-generics/issues/issue-64519.rs deleted file mode 100644 index 969289b26..000000000 --- a/src/test/ui/const-generics/issues/issue-64519.rs +++ /dev/null @@ -1,17 +0,0 @@ -// check-pass -struct Foo { - state: Option<[u8; D]>, -} - -impl Iterator for Foo<{D}> { - type Item = [u8; D]; - fn next(&mut self) -> Option { - if true { - return Some(self.state.unwrap().clone()); - } else { - return Some(self.state.unwrap().clone()); - } - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs deleted file mode 100644 index 091419f0c..000000000 --- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check-pass -#![feature(adt_const_params)] -#![allow(incomplete_features)] - - -trait Trait { - type Assoc; -} - -impl Trait<"0"> for () { - type Assoc = (); -} - -fn main() { - let _: <() as Trait<"0">>::Assoc = (); -} diff --git a/src/test/ui/const-generics/issues/issue-66906.rs b/src/test/ui/const-generics/issues/issue-66906.rs deleted file mode 100644 index a0b3f9122..000000000 --- a/src/test/ui/const-generics/issues/issue-66906.rs +++ /dev/null @@ -1,9 +0,0 @@ -// check-pass - -pub struct Tuple; - -pub trait Trait { - type Input: From<>::Input>; -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-67185-1.rs b/src/test/ui/const-generics/issues/issue-67185-1.rs deleted file mode 100644 index 69425b25e..000000000 --- a/src/test/ui/const-generics/issues/issue-67185-1.rs +++ /dev/null @@ -1,29 +0,0 @@ -// check-pass - -trait Baz { - type Quaks; -} -impl Baz for u8 { - type Quaks = [u16; 3]; -} - -trait Bar {} -impl Bar for [u16; 3] {} -impl Bar for [[u16; 3]; 2] {} - -trait Foo - where - [::Quaks; 2]: Bar, - ::Quaks: Bar, -{ -} - -struct FooImpl; - -impl Foo for FooImpl {} - -fn f(_: impl Foo) {} - -fn main() { - f(FooImpl) -} diff --git a/src/test/ui/const-generics/issues/issue-67185-2.rs b/src/test/ui/const-generics/issues/issue-67185-2.rs deleted file mode 100644 index 18bb6f6bc..000000000 --- a/src/test/ui/const-generics/issues/issue-67185-2.rs +++ /dev/null @@ -1,31 +0,0 @@ -trait Baz { - type Quaks; -} -impl Baz for u8 { - type Quaks = [u16; 3]; -} - -trait Bar {} -impl Bar for [u16; 4] {} -impl Bar for [[u16; 3]; 3] {} - -trait Foo -where - [::Quaks; 2]: Bar, //~ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277] - ::Quaks: Bar, //~ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277] -{ -} - -struct FooImpl; - -impl Foo for FooImpl {} -//~^ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277] -//~^^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277] - -fn f(_: impl Foo) {} -//~^ ERROR the trait bound `[u16; 3]: Bar` is not satisfied [E0277] -//~^^ ERROR the trait bound `[[u16; 3]; 2]: Bar` is not satisfied [E0277] - -fn main() { - f(FooImpl) -} diff --git a/src/test/ui/const-generics/issues/issue-67185-2.stderr b/src/test/ui/const-generics/issues/issue-67185-2.stderr deleted file mode 100644 index c7be8e14a..000000000 --- a/src/test/ui/const-generics/issues/issue-67185-2.stderr +++ /dev/null @@ -1,99 +0,0 @@ -error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied - --> $DIR/issue-67185-2.rs:15:5 - | -LL | ::Quaks: Bar, - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[u16; 3]` - | - = help: the following other types implement trait `Bar`: - [[u16; 3]; 3] - [u16; 4] - = 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:14:5 - | -LL | [::Quaks; 2]: Bar, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` - | - = help: the following other types implement trait `Bar`: - [[u16; 3]; 3] - [u16; 4] - = 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:21:6 - | -LL | impl Foo for FooImpl {} - | ^^^ the trait `Bar` is not implemented for `[u16; 3]` - | - = help: the following other types implement trait `Bar`: - [[u16; 3]; 3] - [u16; 4] -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:15:25 - | -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:21:6 - | -LL | impl Foo for FooImpl {} - | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` - | - = help: the following other types implement trait `Bar`: - [[u16; 3]; 3] - [u16; 4] -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:14:30 - | -LL | trait Foo - | --- required by a bound in this -LL | where -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:25:14 - | -LL | fn f(_: impl Foo) {} - | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]` - | - = help: the following other types implement trait `Bar`: - [[u16; 3]; 3] - [u16; 4] -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:14:30 - | -LL | trait Foo - | --- required by a bound in this -LL | where -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:25:14 - | -LL | fn f(_: impl Foo) {} - | ^^^ the trait `Bar` is not implemented for `[u16; 3]` - | - = help: the following other types implement trait `Bar`: - [[u16; 3]; 3] - [u16; 4] -note: required by a bound in `Foo` - --> $DIR/issue-67185-2.rs:15:25 - | -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 deleted file mode 100644 index 0cf69879a..000000000 --- a/src/test/ui/const-generics/issues/issue-67375.full.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error: overly complex generic constant - --> $DIR/issue-67375.rs:7:17 - | -LL | inner: [(); { [|_: &T| {}; 0].len() }], - | ^^---------------------^^ - | | - | pointer casts are not allowed in generic constants - | - = help: consider moving this anonymous constant into a `const` function - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-67375.min.stderr b/src/test/ui/const-generics/issues/issue-67375.min.stderr deleted file mode 100644 index 5256d96c8..000000000 --- a/src/test/ui/const-generics/issues/issue-67375.min.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: generic parameters may not be used in const operations - --> $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(generic_const_exprs)]` to allow generic const expressions - -error[E0392]: parameter `T` is never used - --> $DIR/issue-67375.rs:5:12 - | -LL | struct Bug { - | ^ unused parameter - | - = 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 2 previous errors - -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issues/issue-67375.rs b/src/test/ui/const-generics/issues/issue-67375.rs deleted file mode 100644 index 8b4b276ba..000000000 --- a/src/test/ui/const-generics/issues/issue-67375.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(generic_const_exprs))] - -struct Bug { - //[min]~^ ERROR parameter `T` is never used - inner: [(); { [|_: &T| {}; 0].len() }], - //[min]~^ ERROR generic parameters may not be used in const operations - //[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 deleted file mode 100644 index f1a426c3c..000000000 --- a/src/test/ui/const-generics/issues/issue-67739.full.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/issue-67739.rs:11:15 - | -LL | [0u8; mem::size_of::()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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.min.stderr b/src/test/ui/const-generics/issues/issue-67739.min.stderr deleted file mode 100644 index dcbe5b94a..000000000 --- a/src/test/ui/const-generics/issues/issue-67739.min.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-67739.rs:11:15 - | -LL | [0u8; mem::size_of::()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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-67739.rs b/src/test/ui/const-generics/issues/issue-67739.rs deleted file mode 100644 index de0eb7f50..000000000 --- a/src/test/ui/const-generics/issues/issue-67739.rs +++ /dev/null @@ -1,18 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -use std::mem; - -pub trait Trait { - type Associated: Sized; - - fn associated_size(&self) -> usize { - [0u8; mem::size_of::()]; - //[min]~^ ERROR constant expression depends on a generic parameter - //[full]~^^ ERROR unconstrained generic constant - 0 - } -} - -fn main() {} 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 deleted file mode 100644 index 8e18fcdff..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-1.full.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-67945-1.rs:10:20 - | -LL | struct Bug { - | - this type parameter -... -LL | let x: S = MaybeUninit::uninit(); - | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit` - | | - | expected due to this - | - = note: expected type parameter `S` - found union `MaybeUninit<_>` - -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-67945-1.min.stderr b/src/test/ui/const-generics/issues/issue-67945-1.min.stderr deleted file mode 100644 index eee04eb75..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-1.min.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: generic parameters may not be used in const operations - --> $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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $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(generic_const_exprs)]` to allow generic const expressions - -error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-1.rs:7:12 - | -LL | struct Bug { - | ^ unused parameter - | - = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `S` to be a const parameter, use `const S: usize` instead - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issues/issue-67945-1.rs b/src/test/ui/const-generics/issues/issue-67945-1.rs deleted file mode 100644 index 99f88bc8e..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-1.rs +++ /dev/null @@ -1,19 +0,0 @@ -// revisions: full min -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(generic_const_exprs))] - -use std::mem::MaybeUninit; - -struct Bug { - //[min]~^ ERROR parameter `S` is never used - 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 - 0 - }], -} - -fn main() {} 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 deleted file mode 100644 index cce85772a..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: overly complex generic constant - --> $DIR/issue-67945-2.rs:7:13 - | -LL | A: [(); { - | _____________^ -LL | | -LL | | let x: Option> = None; -LL | | -LL | | 0 -LL | | }], - | |_____^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: aborting due to previous error - 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 deleted file mode 100644 index 6e07af1e6..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-2.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/issue-67945-2.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-2.rs b/src/test/ui/const-generics/issues/issue-67945-2.rs deleted file mode 100644 index cbb4e14ec..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, allow(incomplete_features))] -#![cfg_attr(full, feature(generic_const_exprs))] - -struct Bug { - A: [(); { - //[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 d3d9452d3..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-3.full.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: overly complex generic constant - --> $DIR/issue-67945-3.rs:10:13 - | -LL | A: [(); { - | _____________^ -LL | | let x: Option = None; -LL | | -LL | | 0 -LL | | }], - | |_____^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -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 8e6b4b204..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-3.min.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-67945-3.rs:11:23 - | -LL | let x: Option = None; - | ^ cannot perform const operation using `S` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions - -error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-3.rs:9: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 - -For more information about this error, try `rustc --explain E0392`. 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 fd8a393ef..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-3.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Regression test for -// https://github.com/rust-lang/rust/issues/67945#issuecomment-572617285 -// Make sure we don't emit an E0277 error. - -// revisions: full min -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Bug { //[min]~ ERROR: parameter `S` is never used - A: [(); { //[full]~ ERROR: overly complex generic constant - let x: Option = None; - //[min]~^ ERROR: generic parameters may not be used in const operations - 0 - }], -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-67945-4.full.stderr b/src/test/ui/const-generics/issues/issue-67945-4.full.stderr deleted file mode 100644 index 9604eb35d..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-4.full.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: overly complex generic constant - --> $DIR/issue-67945-4.rs:9:13 - | -LL | A: [(); { - | _____________^ -LL | | let x: Option> = None; -LL | | -LL | | 0 -LL | | }], - | |_____^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-67945-4.min.stderr b/src/test/ui/const-generics/issues/issue-67945-4.min.stderr deleted file mode 100644 index f9520872d..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-4.min.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-67945-4.rs:10:27 - | -LL | let x: Option> = None; - | ^ cannot perform const operation using `S` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions - -error[E0392]: parameter `S` is never used - --> $DIR/issue-67945-4.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 - -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/issues/issue-67945-4.rs b/src/test/ui/const-generics/issues/issue-67945-4.rs deleted file mode 100644 index 9a27bf09f..000000000 --- a/src/test/ui/const-generics/issues/issue-67945-4.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Regression test for -// https://github.com/rust-lang/rust/issues/67945#issuecomment-572617285 - -// revisions: full min -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Bug { //[min]~ ERROR: parameter `S` is never used - A: [(); { //[full]~ ERROR: overly complex generic constant - let x: Option> = None; - //[min]~^ ERROR: generic parameters may not be used in const operations - 0 - }], -} - -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 deleted file mode 100644 index ad5710baa..000000000 --- a/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:impl-const.rs -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -extern crate impl_const; - -use impl_const::*; - -pub fn main() { - let n = Num::<5>; - n.five(); -} diff --git a/src/test/ui/const-generics/issues/issue-68366.full.stderr b/src/test/ui/const-generics/issues/issue-68366.full.stderr deleted file mode 100644 index ca9eb801d..000000000 --- a/src/test/ui/const-generics/issues/issue-68366.full.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-68366.rs:11:7 - | -LL | impl Collatz<{Some(N)}> {} - | ^^^^^^^^^^^^^^ unconstrained const parameter - | - = note: expressions using a const parameter must map each value to a distinct output value - = note: proving the result of expressions other than the parameter are unique is not supported - -error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-68366.rs:17:6 - | -LL | impl Foo {} - | ^^^^^^^^^^^^^^ unconstrained const parameter - | - = note: expressions using a const parameter must map each value to a distinct output value - = note: proving the result of expressions other than the parameter are unique is not supported - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr deleted file mode 100644 index 3740ced90..000000000 --- a/src/test/ui/const-generics/issues/issue-68366.min.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-68366.rs:11:37 - | -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(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:7 - | -LL | impl Collatz<{Some(N)}> {} - | ^^^^^^^^^^^^^^ unconstrained const parameter - | - = note: expressions using a const parameter must map each value to a distinct output value - = note: proving the result of expressions other than the parameter are unique is not supported - -error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-68366.rs:17:6 - | -LL | impl Foo {} - | ^^^^^^^^^^^^^^ unconstrained const parameter - | - = note: expressions using a const parameter must map each value to a distinct output value - = note: proving the result of expressions other than the parameter are unique is not supported - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/const-generics/issues/issue-68366.rs b/src/test/ui/const-generics/issues/issue-68366.rs deleted file mode 100644 index 4c2741ab4..000000000 --- a/src/test/ui/const-generics/issues/issue-68366.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Checks that const expressions have a useful note explaining why they can't be evaluated. -// The note should relate to the fact that it cannot be shown forall N that it maps 1-1 to a new -// type. - -// revisions: full min -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Collatz>; - -impl Collatz<{Some(N)}> {} -//~^ ERROR the const parameter -//[min]~^^ generic parameters may not be used in const operations - -struct Foo; - -impl Foo {} -//~^ ERROR the const parameter - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-68596.rs b/src/test/ui/const-generics/issues/issue-68596.rs deleted file mode 100644 index c3c9141e4..000000000 --- a/src/test/ui/const-generics/issues/issue-68596.rs +++ /dev/null @@ -1,15 +0,0 @@ -// check-pass -pub struct S(u8); - -impl S { - pub fn get(&self) -> &u8 { - &self.0 - } -} - -fn main() { - const A: u8 = 5; - let s = S(0); - - s.get::(); -} 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 deleted file mode 100644 index df04c4896..000000000 --- a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `[usize; 0]` is forbidden as the type of a const generic parameter - --> $DIR/issue-68615-adt.rs:6:23 - | -LL | struct Const {} - | ^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-68615-adt.rs b/src/test/ui/const-generics/issues/issue-68615-adt.rs deleted file mode 100644 index 3ef1ad45e..000000000 --- a/src/test/ui/const-generics/issues/issue-68615-adt.rs +++ /dev/null @@ -1,13 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Const {} -//[min]~^ ERROR `[usize; 0]` is forbidden as the type of a const generic parameter -type MyConst = Const<{ [] }>; - -fn main() { - let _x = Const::<{ [] }> {}; - let _y = MyConst {}; -} 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 deleted file mode 100644 index 1b4517087..000000000 --- a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `[usize; 0]` is forbidden as the type of a const generic parameter - --> $DIR/issue-68615-array.rs:6:21 - | -LL | struct Foo {} - | ^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-68615-array.rs b/src/test/ui/const-generics/issues/issue-68615-array.rs deleted file mode 100644 index 93477be41..000000000 --- a/src/test/ui/const-generics/issues/issue-68615-array.rs +++ /dev/null @@ -1,13 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Foo {} -//[min]~^ ERROR `[usize; 0]` is forbidden as the type of a const generic parameter - -type MyFoo = Foo<{ [] }>; - -fn main() { - let _ = Foo::<{ [] }> {}; -} 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 deleted file mode 100644 index 63d7fde78..000000000 --- a/src/test/ui/const-generics/issues/issue-69654-run-pass.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass -trait Bar {} -impl Bar for [u8; 7] {} - -struct Foo {} -impl Foo -where - [u8; N]: Bar<[(); N]>, -{ - fn foo() {} -} - -fn main() { - Foo::foo(); -} diff --git a/src/test/ui/const-generics/issues/issue-70125-1.rs b/src/test/ui/const-generics/issues/issue-70125-1.rs deleted file mode 100644 index 0027cd46a..000000000 --- a/src/test/ui/const-generics/issues/issue-70125-1.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass - -const L: usize = 4; - -pub trait Print { - fn print(&self) -> usize { - N - } -} - -pub struct Printer; -impl Print for Printer {} - -fn main() { - let p = Printer; - assert_eq!(p.print(), 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 deleted file mode 100644 index cfd5e784e..000000000 --- a/src/test/ui/const-generics/issues/issue-70125-2.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -fn main() { - <()>::foo(); -} - -trait Foo { - fn foo() -> usize { - X - } -} - -impl Foo<3> for () {} diff --git a/src/test/ui/const-generics/issues/issue-70167.rs b/src/test/ui/const-generics/issues/issue-70167.rs deleted file mode 100644 index 3961941f8..000000000 --- a/src/test/ui/const-generics/issues/issue-70167.rs +++ /dev/null @@ -1,6 +0,0 @@ -// check-pass -pub trait Trait: From<>::Item> { - type Item; -} - -fn main() {} 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 deleted file mode 100644 index 2ec37cc3a..000000000 --- a/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs +++ /dev/null @@ -1,33 +0,0 @@ -// build-pass - -pub fn works() { - let array/*: [_; _]*/ = default_array(); - let _: [_; 4] = array; - Foo::foo(&array); -} - -pub fn didnt_work() { - let array/*: [_; _]*/ = default_array(); - Foo::foo(&array); - let _: [_; 4] = array; -} - -trait Foo { - fn foo(&self) {} -} - -impl Foo for [i32; 4] {} -impl Foo for [i64; 8] {} - -// Only needed because `[_; _]` is not valid type syntax. -fn default_array() -> [T; N] -where - [T; N]: Default, -{ - Default::default() -} - -fn main() { - works(); - didnt_work(); -} 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 deleted file mode 100644 index 95e548428..000000000 --- a/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs +++ /dev/null @@ -1,33 +0,0 @@ -// build-pass - -fn works() { - let array/*: [u8; _]*/ = default_byte_array(); - let _: [_; 4] = array; - Foo::foo(&array); -} - -fn didnt_work() { - let array/*: [u8; _]*/ = default_byte_array(); - Foo::foo(&array); - let _: [_; 4] = array; -} - -trait Foo { - fn foo(&self) {} -} - -impl Foo for [u8; 4] {} -impl Foo for [u8; 8] {} - -// Only needed because `[u8; _]` is not valid type syntax. -fn default_byte_array() -> [u8; N] -where - [u8; N]: Default, -{ - Default::default() -} - -fn main() { - works(); - didnt_work(); -} diff --git a/src/test/ui/const-generics/issues/issue-70225.rs b/src/test/ui/const-generics/issues/issue-70225.rs deleted file mode 100644 index d458d7b2e..000000000 --- a/src/test/ui/const-generics/issues/issue-70225.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-pass -#![deny(dead_code)] - -// We previously incorrectly linted `L` as unused here. -const L: usize = 3; - -fn main() { - let p = Printer {}; - p.print(); -} - -trait Print { - fn print(&self) -> usize { - 3 - } -} - -struct Printer {} -impl Print for Printer {} 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 deleted file mode 100644 index a76488249..000000000 --- a/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass - -trait T { - fn f(); -} -struct S; - -impl T<0usize> for S { - fn f() {} -} - -fn main() { - let _err = >::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 deleted file mode 100644 index 1f5880f36..000000000 --- a/src/test/ui/const-generics/issues/issue-71169.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71169.rs:5:43 - | -LL | fn foo() {} - | ^^^ the type must not depend on the parameter `LEN` - -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 deleted file mode 100644 index 87ed2d4f8..000000000 --- a/src/test/ui/const-generics/issues/issue-71169.min.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71169.rs:5:43 - | -LL | fn foo() {} - | ^^^ the type must not depend on the parameter `LEN` - -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/issue-71169.rs:5:38 - | -LL | fn foo() {} - | ^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/issues/issue-71169.rs b/src/test/ui/const-generics/issues/issue-71169.rs deleted file mode 100644 index 617149a84..000000000 --- a/src/test/ui/const-generics/issues/issue-71169.rs +++ /dev/null @@ -1,11 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -fn foo() {} -//~^ ERROR the type of const parameters must not -//[min]~^^ ERROR `[u8; _]` is forbidden as the type of a const generic parameter -fn main() { - const DATA: [u8; 4] = *b"ABCD"; - foo::<4, DATA>(); -} diff --git a/src/test/ui/const-generics/issues/issue-71202.rs b/src/test/ui/const-generics/issues/issue-71202.rs deleted file mode 100644 index 57fd72b12..000000000 --- a/src/test/ui/const-generics/issues/issue-71202.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features, const_evaluatable_unchecked)] - -use std::marker::PhantomData; - -struct DataHolder { - item: T, -} - -impl DataHolder { - const ITEM_IS_COPY: [(); 1 - { //~ ERROR unconstrained generic constant - 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] = []; -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-71202.stderr b/src/test/ui/const-generics/issues/issue-71202.stderr deleted file mode 100644 index 277540610..000000000 --- a/src/test/ui/const-generics/issues/issue-71202.stderr +++ /dev/null @@ -1,33 +0,0 @@ -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.full.stderr b/src/test/ui/const-generics/issues/issue-71381.full.stderr deleted file mode 100644 index e17cf96aa..000000000 --- a/src/test/ui/const-generics/issues/issue-71381.full.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71381.rs:14:82 - | -LL | pub fn call_me(&self) { - | ^^^^ the type must not depend on the parameter `Args` - -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71381.rs:23:40 - | -LL | const FN: unsafe extern "C" fn(Args), - | ^^^^ the type must not depend on the parameter `Args` - -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71381.rs:14:61 - | -LL | pub fn call_me(&self) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71381.rs:23:19 - | -LL | const FN: unsafe extern "C" fn(Args), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0741, E0770. -For more information about an error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/issues/issue-71381.min.stderr b/src/test/ui/const-generics/issues/issue-71381.min.stderr deleted file mode 100644 index 3950317b3..000000000 --- a/src/test/ui/const-generics/issues/issue-71381.min.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71381.rs:14:82 - | -LL | pub fn call_me(&self) { - | ^^^^ the type must not depend on the parameter `Args` - -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71381.rs:23:40 - | -LL | const FN: unsafe extern "C" fn(Args), - | ^^^^ the type must not depend on the parameter `Args` - -error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71381.rs:14:61 - | -LL | pub fn call_me(&self) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71381.rs:23:19 - | -LL | const FN: unsafe extern "C" fn(Args), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/issues/issue-71381.rs b/src/test/ui/const-generics/issues/issue-71381.rs deleted file mode 100644 index 66f819dbe..000000000 --- a/src/test/ui/const-generics/issues/issue-71381.rs +++ /dev/null @@ -1,36 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Test(*const usize); - -type PassArg = (); - -unsafe extern "C" fn pass(args: PassArg) { - println!("Hello, world!"); -} - -impl Test { - pub fn call_me(&self) { - //~^ ERROR: using function pointers as const generic parameters is forbidden - //~| ERROR: the type of const parameters must not depend on other generic parameters - self.0 = Self::trampiline:: as _ - } - - unsafe extern "C" fn trampiline< - Args: Sized, - const IDX: usize, - const FN: unsafe extern "C" fn(Args), - //~^ ERROR: using function pointers as const generic parameters is forbidden - //~| ERROR: the type of const parameters must not depend on other generic parameters - >( - args: Args, - ) { - FN(args) - } -} - -fn main() { - let x = Test(); - x.call_me::() -} diff --git a/src/test/ui/const-generics/issues/issue-71382.full.stderr b/src/test/ui/const-generics/issues/issue-71382.full.stderr deleted file mode 100644 index ab2a4e64a..000000000 --- a/src/test/ui/const-generics/issues/issue-71382.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71382.rs:16:23 - | -LL | fn test(&self) { - | ^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/issues/issue-71382.min.stderr b/src/test/ui/const-generics/issues/issue-71382.min.stderr deleted file mode 100644 index 715037bd5..000000000 --- a/src/test/ui/const-generics/issues/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(&self) { - | ^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-71382.rs b/src/test/ui/const-generics/issues/issue-71382.rs deleted file mode 100644 index 4392d72e5..000000000 --- a/src/test/ui/const-generics/issues/issue-71382.rs +++ /dev/null @@ -1,25 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Test(); - -fn pass() { - println!("Hello, world!"); -} - -impl Test { - pub fn call_me(&self) { - self.test::(); - } - - fn test(&self) { - //~^ ERROR: using function pointers as const generic parameters is forbidden - FN(); - } -} - -fn main() { - let x = Test(); - x.call_me() -} diff --git a/src/test/ui/const-generics/issues/issue-71547.rs b/src/test/ui/const-generics/issues/issue-71547.rs deleted file mode 100644 index 60776a1a9..000000000 --- a/src/test/ui/const-generics/issues/issue-71547.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -pub trait GetType { - type Ty; - fn get(&self) -> &Self::Ty; -} - -pub fn get_val(value: &T) -> &T::Ty -where - T: GetType<"hello">, -{ - value.get() -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-71611.full.stderr b/src/test/ui/const-generics/issues/issue-71611.full.stderr deleted file mode 100644 index 656aa29e1..000000000 --- a/src/test/ui/const-generics/issues/issue-71611.full.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71611.rs:5:31 - | -LL | fn func(outer: A) { - | ^ the type must not depend on the parameter `A` - -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71611.rs:5:21 - | -LL | fn func(outer: A) { - | ^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0741, E0770. -For more information about an error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/issues/issue-71611.min.stderr b/src/test/ui/const-generics/issues/issue-71611.min.stderr deleted file mode 100644 index 01a85b745..000000000 --- a/src/test/ui/const-generics/issues/issue-71611.min.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-71611.rs:5:31 - | -LL | fn func(outer: A) { - | ^ the type must not depend on the parameter `A` - -error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-71611.rs:5:21 - | -LL | fn func(outer: A) { - | ^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/issues/issue-71611.rs b/src/test/ui/const-generics/issues/issue-71611.rs deleted file mode 100644 index fbb91ca18..000000000 --- a/src/test/ui/const-generics/issues/issue-71611.rs +++ /dev/null @@ -1,11 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -fn func(outer: A) { - //~^ ERROR: using function pointers as const generic parameters is forbidden - //~| ERROR: the type of const parameters must not depend on other generic parameters - F(outer); -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-71986.rs b/src/test/ui/const-generics/issues/issue-71986.rs deleted file mode 100644 index 6f0a98ead..000000000 --- a/src/test/ui/const-generics/issues/issue-71986.rs +++ /dev/null @@ -1,6 +0,0 @@ -// check-pass - -pub trait Foo {} -pub fn bar>() {} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-72352.full.stderr b/src/test/ui/const-generics/issues/issue-72352.full.stderr deleted file mode 100644 index 92580b336..000000000 --- a/src/test/ui/const-generics/issues/issue-72352.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-72352.rs:7:42 - | -LL | unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/issues/issue-72352.min.stderr b/src/test/ui/const-generics/issues/issue-72352.min.stderr deleted file mode 100644 index eedd73c4d..000000000 --- a/src/test/ui/const-generics/issues/issue-72352.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: using function pointers as const generic parameters is forbidden - --> $DIR/issue-72352.rs:7:42 - | -LL | unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-72352.rs b/src/test/ui/const-generics/issues/issue-72352.rs deleted file mode 100644 index 2fa1d7a53..000000000 --- a/src/test/ui/const-generics/issues/issue-72352.rs +++ /dev/null @@ -1,22 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -use std::ffi::{CStr, CString}; - -unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { - //~^ ERROR: using function pointers as const generic parameters is forbidden - F(CStr::from_ptr(ptr)) -} - -fn safely_do_the_thing(s: &CStr) -> usize { - s.to_bytes().len() -} - -fn main() { - let baguette = CString::new("baguette").unwrap(); - let ptr = baguette.as_ptr(); - println!("{}", unsafe { - unsafely_do_the_thing::(ptr) - }); -} diff --git a/src/test/ui/const-generics/issues/issue-72845.rs b/src/test/ui/const-generics/issues/issue-72845.rs deleted file mode 100644 index bea5dc8ba..000000000 --- a/src/test/ui/const-generics/issues/issue-72845.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![feature(generic_const_exprs)] -#![feature(specialization)] -#![allow(incomplete_features)] - -//-------------------------------------------------- - -trait Depth { - const C: usize; -} - -trait Type { - type AT: Depth; -} - -//-------------------------------------------------- - -enum Predicate {} - -trait Satisfied {} - -impl Satisfied for Predicate {} - -//-------------------------------------------------- - -trait Spec1 {} - -impl Spec1 for T where Predicate<{T::AT::C > 0}>: Satisfied {} - -trait Spec2 {} - -//impl Spec2 for T where Predicate<{T::AT::C > 1}>: Satisfied {} -impl Spec2 for T where Predicate: Satisfied {} - -//-------------------------------------------------- - -trait Foo { - fn Bar(); -} - -impl Foo for T { - default fn Bar() {} -} - -impl Foo for T { -//~^ ERROR conflicting implementations of trait - fn Bar() {} -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-72845.stderr b/src/test/ui/const-generics/issues/issue-72845.stderr deleted file mode 100644 index 631c8605f..000000000 --- a/src/test/ui/const-generics/issues/issue-72845.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo` - --> $DIR/issue-72845.rs:44:1 - | -LL | impl Foo for T { - | ------------------------ first implementation here -... -LL | impl Foo for T { - | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/const-generics/issues/issue-73120.rs b/src/test/ui/const-generics/issues/issue-73120.rs deleted file mode 100644 index 050dc9bde..000000000 --- a/src/test/ui/const-generics/issues/issue-73120.rs +++ /dev/null @@ -1,10 +0,0 @@ -// 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 -) {} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-73260.rs b/src/test/ui/const-generics/issues/issue-73260.rs deleted file mode 100644 index d762f9c8b..000000000 --- a/src/test/ui/const-generics/issues/issue-73260.rs +++ /dev/null @@ -1,19 +0,0 @@ -// compile-flags: -Zsave-analysis -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] -struct Arr -where - Assert::<{N < usize::MAX / 2}>: IsTrue, -{} - -enum Assert {} - -trait IsTrue {} - -impl IsTrue for Assert {} - -fn main() { - let x: Arr<{usize::MAX}> = Arr {}; - //~^ ERROR mismatched types - //~| ERROR mismatched types -} diff --git a/src/test/ui/const-generics/issues/issue-73260.stderr b/src/test/ui/const-generics/issues/issue-73260.stderr deleted file mode 100644 index 7670032e5..000000000 --- a/src/test/ui/const-generics/issues/issue-73260.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-73260.rs:16:12 - | -LL | let x: Arr<{usize::MAX}> = Arr {}; - | ^^^^^^^^^^^^^^^^^ expected `false`, found `true` - | - = note: expected constant `false` - found constant `true` -note: required by a bound in `Arr` - --> $DIR/issue-73260.rs:6:37 - | -LL | struct Arr - | --- required by a bound in this -LL | where -LL | Assert::<{N < usize::MAX / 2}>: IsTrue, - | ^^^^^^ required by this bound in `Arr` - -error[E0308]: mismatched types - --> $DIR/issue-73260.rs:16:32 - | -LL | let x: Arr<{usize::MAX}> = Arr {}; - | ^^^ expected `false`, found `true` - | - = note: expected constant `false` - found constant `true` -note: required by a bound in `Arr` - --> $DIR/issue-73260.rs:6:37 - | -LL | struct Arr - | --- required by a bound in this -LL | where -LL | Assert::<{N < usize::MAX / 2}>: IsTrue, - | ^^^^^^ required by this bound in `Arr` - -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 deleted file mode 100644 index f2b58e59f..000000000 --- a/src/test/ui/const-generics/issues/issue-73491.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `[u32; _]` is forbidden as the type of a const generic parameter - --> $DIR/issue-73491.rs:8:19 - | -LL | fn hoge() {} - | ^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-73491.rs b/src/test/ui/const-generics/issues/issue-73491.rs deleted file mode 100644 index f15c1f2d4..000000000 --- a/src/test/ui/const-generics/issues/issue-73491.rs +++ /dev/null @@ -1,11 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -const LEN: usize = 1024; - -fn hoge() {} -//[min]~^ ERROR `[u32; _]` is forbidden as the type of a const generic parameter - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr b/src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr deleted file mode 100644 index 0a7db6247..000000000 --- a/src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `&'static [u32]` is forbidden as the type of a const generic parameter - --> $DIR/issue-73727-static-reference-array-const-param.rs:9:15 - | -LL | fn a() {} - | ^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.rs b/src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.rs deleted file mode 100644 index f0d604835..000000000 --- a/src/test/ui/const-generics/issues/issue-73727-static-reference-array-const-param.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Regression test for #73727 - -// revisions: full min -//[full]check-pass - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -fn a() {} -//[min]~^ ERROR `&'static [u32]` is forbidden as the type of a const generic parameter - -fn main() { - a::<{&[]}>(); -} diff --git a/src/test/ui/const-generics/issues/issue-74101.min.stderr b/src/test/ui/const-generics/issues/issue-74101.min.stderr deleted file mode 100644 index 82ffb2332..000000000 --- a/src/test/ui/const-generics/issues/issue-74101.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/issue-74101.rs:6:18 - | -LL | fn test() {} - | ^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/issue-74101.rs:9:21 - | -LL | struct Foo; - | ^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 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 deleted file mode 100644 index 6b606b946..000000000 --- a/src/test/ui/const-generics/issues/issue-74101.rs +++ /dev/null @@ -1,12 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -fn test() {} -//[min]~^ ERROR `[u8; _]` is forbidden as the type of a const generic parameter - -struct Foo; -//[min]~^ ERROR `[u8; _]` is forbidden as the type of a const generic parameter - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-74255.min.stderr b/src/test/ui/const-generics/issues/issue-74255.min.stderr deleted file mode 100644 index b462d8448..000000000 --- a/src/test/ui/const-generics/issues/issue-74255.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `IceEnum` is forbidden as the type of a const generic parameter - --> $DIR/issue-74255.rs:14:31 - | -LL | fn ice_struct_fn() {} - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-74255.rs b/src/test/ui/const-generics/issues/issue-74255.rs deleted file mode 100644 index 0e523926f..000000000 --- a/src/test/ui/const-generics/issues/issue-74255.rs +++ /dev/null @@ -1,20 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -#[derive(PartialEq, Eq)] -enum IceEnum { - Variant -} - -struct IceStruct; - -impl IceStruct { - fn ice_struct_fn() {} - //[min]~^ ERROR `IceEnum` is forbidden as the type of a const generic parameter -} - -fn main() { - IceStruct::ice_struct_fn::<{IceEnum::Variant}>(); -} diff --git a/src/test/ui/const-generics/issues/issue-74906.rs b/src/test/ui/const-generics/issues/issue-74906.rs deleted file mode 100644 index cc1f2853f..000000000 --- a/src/test/ui/const-generics/issues/issue-74906.rs +++ /dev/null @@ -1,22 +0,0 @@ -// edition:2018 -// check-pass - - -const SIZE: usize = 16; - -struct Bar {} - -struct Foo {} - -impl Foo { - async fn biz(_: &[[u8; SIZE]]) -> Vec<()> { - vec![] - } - - pub async fn baz(&self) -> Bar { - Self::biz(&vec![]).await; - Bar {} - } -} - -fn main() { } diff --git a/src/test/ui/const-generics/issues/issue-74950.min.stderr b/src/test/ui/const-generics/issues/issue-74950.min.stderr deleted file mode 100644 index 729ecc202..000000000 --- a/src/test/ui/const-generics/issues/issue-74950.min.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error: `Inner` is forbidden as the type of a const generic parameter - --> $DIR/issue-74950.rs:17:23 - | -LL | struct Outer; - | ^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `Inner` is forbidden as the type of a const generic parameter - --> $DIR/issue-74950.rs:17:23 - | -LL | struct Outer; - | ^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `Inner` is forbidden as the type of a const generic parameter - --> $DIR/issue-74950.rs:17:23 - | -LL | struct Outer; - | ^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `Inner` is forbidden as the type of a const generic parameter - --> $DIR/issue-74950.rs:17:23 - | -LL | struct Outer; - | ^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `Inner` is forbidden as the type of a const generic parameter - --> $DIR/issue-74950.rs:17:23 - | -LL | struct Outer; - | ^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 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 deleted file mode 100644 index 3e1ca4735..000000000 --- a/src/test/ui/const-generics/issues/issue-74950.rs +++ /dev/null @@ -1,24 +0,0 @@ -// [full] build-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - - -#[derive(PartialEq, Eq)] -struct Inner; - -// Note: We emit the error 5 times if we don't deduplicate: -// - struct definition -// - impl PartialEq -// - impl Eq -// - impl StructuralPartialEq -// - impl StructuralEq -#[derive(PartialEq, Eq)] -struct Outer; -//[min]~^ `Inner` is forbidden -//[min]~| `Inner` is forbidden -//[min]~| `Inner` is forbidden -//[min]~| `Inner` is forbidden -//[min]~| `Inner` is forbidden - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-75047.min.stderr b/src/test/ui/const-generics/issues/issue-75047.min.stderr deleted file mode 100644 index 7798ae796..000000000 --- a/src/test/ui/const-generics/issues/issue-75047.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/issue-75047.rs:14:21 - | -LL | struct Foo::value()]>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-75047.rs b/src/test/ui/const-generics/issues/issue-75047.rs deleted file mode 100644 index ee3dcf9ec..000000000 --- a/src/test/ui/const-generics/issues/issue-75047.rs +++ /dev/null @@ -1,17 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Bar(T); - -impl Bar { - const fn value() -> usize { - 42 - } -} - -struct Foo::value()]>; -//[min]~^ ERROR `[u8; _]` is forbidden as the type of a const generic parameter - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-75299.rs b/src/test/ui/const-generics/issues/issue-75299.rs deleted file mode 100644 index 83ef09af8..000000000 --- a/src/test/ui/const-generics/issues/issue-75299.rs +++ /dev/null @@ -1,8 +0,0 @@ -// compile-flags: -Zmir-opt-level=4 -// run-pass -fn main() { - fn foo() -> [u8; N] { - [0; N] - } - let _x = foo::<1>(); -} 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 deleted file mode 100644 index 2e6b02236..000000000 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs +++ /dev/null @@ -1,11 +0,0 @@ -fn ty_param() -> [u8; std::mem::size_of::()] { - //~^ ERROR generic parameters may not be used in const operations - todo!() -} - -fn const_param() -> [u8; N + 1] { - //~^ ERROR generic parameters may not be used in const operations - todo!() -} - -fn main() {} 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 deleted file mode 100644 index 3b53e18e6..000000000 --- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.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: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-77357.rs b/src/test/ui/const-generics/issues/issue-77357.rs deleted file mode 100644 index 3cb8d3846..000000000 --- a/src/test/ui/const-generics/issues/issue-77357.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait MyTrait {} - -fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - //~^ ERROR overly complex generic constant - todo!() -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-77357.stderr b/src/test/ui/const-generics/issues/issue-77357.stderr deleted file mode 100644 index 804c0ae51..000000000 --- a/src/test/ui/const-generics/issues/issue-77357.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: overly complex generic constant - --> $DIR/issue-77357.rs:6:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constant - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-79674.rs b/src/test/ui/const-generics/issues/issue-79674.rs deleted file mode 100644 index ff141d328..000000000 --- a/src/test/ui/const-generics/issues/issue-79674.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait MiniTypeId { - const TYPE_ID: u64; -} - -impl MiniTypeId for T { - const TYPE_ID: u64 = 0; -} - -enum Lift {} - -trait IsFalse {} -impl IsFalse for Lift {} - -const fn is_same_type() -> bool { - T::TYPE_ID == U::TYPE_ID -} - -fn requires_distinct(_a: A, _b: B) where - A: MiniTypeId, B: MiniTypeId, - Lift<{is_same_type::()}>: IsFalse {} - -fn main() { - requires_distinct("str", 12); - //~^ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/issues/issue-79674.stderr b/src/test/ui/const-generics/issues/issue-79674.stderr deleted file mode 100644 index 02b48b55f..000000000 --- a/src/test/ui/const-generics/issues/issue-79674.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-79674.rs:26:5 - | -LL | requires_distinct("str", 12); - | ^^^^^^^^^^^^^^^^^ expected `true`, found `false` - | - = note: expected constant `true` - found constant `false` -note: required by a bound in `requires_distinct` - --> $DIR/issue-79674.rs:23:37 - | -LL | fn requires_distinct(_a: A, _b: B) where - | ----------------- required by a bound in this -LL | A: MiniTypeId, B: MiniTypeId, -LL | Lift<{is_same_type::()}>: IsFalse {} - | ^^^^^^^ required by this bound in `requires_distinct` - -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.rs b/src/test/ui/const-generics/issues/issue-80062.rs deleted file mode 100644 index 56dc53298..000000000 --- a/src/test/ui/const-generics/issues/issue-80062.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Regression test for issue #80062 (fixed by `min_const_generics`) - -fn sof() -> T { unimplemented!() } - -fn test() { - let _: [u8; sof::()]; - //~^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-80062.stderr b/src/test/ui/const-generics/issues/issue-80062.stderr deleted file mode 100644 index 754f18d5c..000000000 --- a/src/test/ui/const-generics/issues/issue-80062.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-80062.rs:6:23 - | -LL | let _: [u8; sof::()]; - | ^ cannot perform const operation using `T` - | - = note: type parameters may not be used in const expressions - = help: use `#![feature(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.rs b/src/test/ui/const-generics/issues/issue-80375.rs deleted file mode 100644 index c906bb2c4..000000000 --- a/src/test/ui/const-generics/issues/issue-80375.rs +++ /dev/null @@ -1,4 +0,0 @@ -struct MyArray([u8; COUNT + 1]); -//~^ ERROR generic parameters may not be used in const operations - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-80375.stderr b/src/test/ui/const-generics/issues/issue-80375.stderr deleted file mode 100644 index 5409002a9..000000000 --- a/src/test/ui/const-generics/issues/issue-80375.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/issue-80375.rs:1:41 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-82956.rs b/src/test/ui/const-generics/issues/issue-82956.rs deleted file mode 100644 index 3539e9b96..000000000 --- a/src/test/ui/const-generics/issues/issue-82956.rs +++ /dev/null @@ -1,33 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub struct ConstCheck; - -pub trait True {} -impl True for ConstCheck {} - -pub trait OrdesDec { - type Newlen; - type Output; - - fn pop(self) -> (Self::Newlen, Self::Output); -} - -impl OrdesDec for [T; N] -where - ConstCheck<{N > 1}>: True, - [T; N - 1]: Sized, -{ - type Newlen = [T; N - 1]; - type Output = T; - - fn pop(self) -> (Self::Newlen, Self::Output) { - let mut iter = IntoIter::new(self); - //~^ ERROR: failed to resolve: use of undeclared type `IntoIter` - let end = iter.next_back().unwrap(); - let new = [(); N - 1].map(move |()| iter.next().unwrap()); - (new, end) - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-82956.stderr b/src/test/ui/const-generics/issues/issue-82956.stderr deleted file mode 100644 index d2320293e..000000000 --- a/src/test/ui/const-generics/issues/issue-82956.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared type `IntoIter` - --> $DIR/issue-82956.rs:25:24 - | -LL | let mut iter = IntoIter::new(self); - | ^^^^^^^^ use of undeclared type `IntoIter` - | -help: consider importing one of these items - | -LL | use std::array::IntoIter; - | -LL | use std::collections::binary_heap::IntoIter; - | -LL | use std::collections::btree_map::IntoIter; - | -LL | use std::collections::btree_set::IntoIter; - | - and 8 other candidates - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/const-generics/issues/issue-83249.rs b/src/test/ui/const-generics/issues/issue-83249.rs deleted file mode 100644 index 65148c55e..000000000 --- a/src/test/ui/const-generics/issues/issue-83249.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -trait Foo { - const N: usize; -} - -impl Foo for u8 { - const N: usize = 1; -} - -fn foo(_: [u8; T::N]) -> T { - todo!() -} - -pub fn bar() { - let _: u8 = foo([0; 1]); - - let _ = foo([0; 1]); - //~^ ERROR type annotations needed -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-83249.stderr b/src/test/ui/const-generics/issues/issue-83249.stderr deleted file mode 100644 index 362b8554b..000000000 --- a/src/test/ui/const-generics/issues/issue-83249.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-83249.rs:19:9 - | -LL | let _ = foo([0; 1]); - | ^ - | -help: consider giving this pattern a type - | -LL | let _: _ = foo([0; 1]); - | +++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/const-generics/issues/issue-83288.rs b/src/test/ui/const-generics/issues/issue-83288.rs deleted file mode 100644 index a24596d24..000000000 --- a/src/test/ui/const-generics/issues/issue-83288.rs +++ /dev/null @@ -1,69 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -use std::{marker::PhantomData, ops::Mul}; - -pub enum Nil {} -pub struct Cons { - _phantom: PhantomData<(T, L)>, -} - -pub trait Indices { - const RANK: usize; - const NUM_ELEMS: usize; -} - -impl Indices for Nil { - const RANK: usize = 0; - const NUM_ELEMS: usize = 1; -} - -impl, const N: usize> Indices for Cons { - const RANK: usize = I::RANK + 1; - const NUM_ELEMS: usize = I::NUM_ELEMS * N; -} - -pub trait Concat { - type Output; -} - -impl Concat for Nil { - type Output = J; -} - -impl Concat for Cons -where - I: Concat, -{ - type Output = Cons>::Output>; -} - -pub struct Tensor, const N: usize> -where - [u8; I::NUM_ELEMS]: Sized, -{ - pub data: [u8; I::NUM_ELEMS], - _phantom: PhantomData, -} - -impl, J: Indices, const N: usize> Mul> for Tensor -where - I: Concat, - >::Output: Indices, - [u8; I::NUM_ELEMS]: Sized, - [u8; J::NUM_ELEMS]: Sized, - [u8; >::Output::NUM_ELEMS]: Sized, -{ - type Output = Tensor<>::Output, N>; - - fn mul(self, _rhs: Tensor) -> Self::Output { - Tensor { - data: [0u8; >::Output::NUM_ELEMS], - _phantom: PhantomData, - } - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-83466.rs b/src/test/ui/const-generics/issues/issue-83466.rs deleted file mode 100644 index 73c930101..000000000 --- a/src/test/ui/const-generics/issues/issue-83466.rs +++ /dev/null @@ -1,17 +0,0 @@ -// regression test for #83466- tests that generic arg mismatch errors between -// consts and types are not suppressed when there are explicit late bound lifetimes - -struct S; -impl S { - fn func<'a, U>(self) -> U { - todo!() - } -} -fn dont_crash<'a, U>() { - S.func::<'a, 10_u32>() - //~^ WARNING cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - //~^^ WARNING this was previously accepted by - //~^^^ ERROR constant provided when a type was expected [E0747] -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-83466.stderr b/src/test/ui/const-generics/issues/issue-83466.stderr deleted file mode 100644 index bcfd70639..000000000 --- a/src/test/ui/const-generics/issues/issue-83466.stderr +++ /dev/null @@ -1,22 +0,0 @@ -warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present - --> $DIR/issue-83466.rs:11:14 - | -LL | fn func<'a, U>(self) -> U { - | -- the late bound lifetime parameter is introduced here -... -LL | S.func::<'a, 10_u32>() - | ^^ - | - = 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 #42868 - = note: `#[warn(late_bound_lifetime_arguments)]` on by default - -error[E0747]: constant provided when a type was expected - --> $DIR/issue-83466.rs:11:18 - | -LL | S.func::<'a, 10_u32>() - | ^^^^^^ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0747`. 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 71c164ab0..000000000 --- a/src/test/ui/const-generics/issues/issue-83765.rs +++ /dev/null @@ -1,116 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait TensorDimension { - const DIM: usize; - //~^ ERROR cycle detected when resolving instance - // FIXME Given the current state of the compiler its expected that we cycle here, - // but the cycle is still wrong. - const ISSCALAR: bool = Self::DIM == 0; - fn is_scalar(&self) -> bool { - Self::ISSCALAR - } -} - -trait TensorSize: TensorDimension { - fn size(&self) -> [usize; Self::DIM]; - fn inbounds(&self, index: [usize; Self::DIM]) -> bool { - index.iter().zip(self.size().iter()).all(|(i, s)| i < s) - } -} - -trait Broadcastable: TensorSize + Sized { - type Element; - fn bget(&self, index: [usize; Self::DIM]) -> Option; - fn lazy_updim( - &self, - size: [usize; NEWDIM], - ) -> LazyUpdim { - assert!( - NEWDIM >= Self::DIM, - "Updimmed tensor cannot have fewer indices than the initial one." - ); - LazyUpdim { size, reference: &self } - } - fn bmap T>(&self, foo: F) -> BMap { - BMap { reference: self, closure: foo } - } -} - -struct LazyUpdim<'a, T: Broadcastable, const OLDDIM: usize, const DIM: usize> { - size: [usize; DIM], - reference: &'a T, -} - -impl<'a, T: Broadcastable, const DIM: usize> TensorDimension for LazyUpdim<'a, T, { T::DIM }, DIM> { - const DIM: usize = DIM; -} - -impl<'a, T: Broadcastable, const DIM: usize> TensorSize for LazyUpdim<'a, T, { T::DIM }, DIM> { - fn size(&self) -> [usize; DIM] { - self.size - } -} - -impl<'a, T: Broadcastable, const DIM: usize> Broadcastable for LazyUpdim<'a, T, { T::DIM }, DIM> { - type Element = T::Element; - fn bget(&self, index: [usize; DIM]) -> Option { - assert!(DIM >= T::DIM); - if !self.inbounds(index) { - return None; - } - let size = self.size(); - let newindex: [usize; T::DIM] = Default::default(); - self.reference.bget(newindex) - } -} - -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] { - self.reference.size() - } -} - -impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> Broadcastable - for BMap<'a, R, T, F, DIM> -{ - type Element = R; - fn bget(&self, index: [usize; DIM]) -> Option { - self.reference.bget(index).map(&self.closure) - } -} - -impl TensorDimension for Vec { - const DIM: usize = 1; -} -impl TensorSize for Vec { - fn size(&self) -> [usize; 1] { - [self.len()] - } -} -impl Broadcastable for Vec { - type Element = T; - fn bget(&self, index: [usize; 1]) -> Option { - self.get(index[0]).cloned() - } -} - -fn main() { - let v = vec![1, 2, 3]; - let bv = v.lazy_updim([3, 4]); - let bbv = bv.bmap(|x| x * x); - - println!("The size of v is {:?}", bbv.bget([0, 2]).expect("Out of bounds.")); -} 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 d7b2b006c..000000000 --- a/src/test/ui/const-generics/issues/issue-83765.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0391]: cycle detected when resolving instance `::DIM, DIM> as TensorDimension>::DIM` - --> $DIR/issue-83765.rs:5:5 - | -LL | const DIM: usize; - | ^^^^^^^^^^^^^^^^ - | -note: ...which requires computing candidate for `::DIM, DIM> as TensorDimension>`... - --> $DIR/issue-83765.rs:4:1 - | -LL | trait TensorDimension { - | ^^^^^^^^^^^^^^^^^^^^^ - = note: ...which again requires resolving instance `::DIM, DIM> as TensorDimension>::DIM`, completing the cycle -note: cycle used when computing candidate for ` as TensorDimension>` - --> $DIR/issue-83765.rs:4:1 - | -LL | trait TensorDimension { - | ^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/const-generics/issues/issue-83993.rs b/src/test/ui/const-generics/issues/issue-83993.rs deleted file mode 100644 index f2f05d952..000000000 --- a/src/test/ui/const-generics/issues/issue-83993.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn bug<'a>() -where - for<'b> [(); { - let x: &'b (); - 0 - }]: -{} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-84659.rs b/src/test/ui/const-generics/issues/issue-84659.rs deleted file mode 100644 index 440ca740a..000000000 --- a/src/test/ui/const-generics/issues/issue-84659.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -trait Bar {} - -trait Foo<'a> { - const N: usize; - type Baz: Bar<{ Self::N }>; - //~^ ERROR: unconstrained generic constant -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-84659.stderr b/src/test/ui/const-generics/issues/issue-84659.stderr deleted file mode 100644 index 2dfc48a34..000000000 --- a/src/test/ui/const-generics/issues/issue-84659.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/issue-84659.rs:8:15 - | -LL | type Baz: Bar<{ Self::N }>; - | ^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); { Self::N }]:` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-85031-2.rs b/src/test/ui/const-generics/issues/issue-85031-2.rs deleted file mode 100644 index 4908fb296..000000000 --- a/src/test/ui/const-generics/issues/issue-85031-2.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass -// known-bug - -// This should not compile, as the compiler should not know -// `A - 0` is satisfied `?x - 0` if `?x` is inferred to `A`. -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -pub struct Ref<'a>(&'a i32); - -impl<'a> Ref<'a> { - pub fn foo() -> [(); A - 0] { - //~^ WARN function cannot - Self::foo() - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-85031-2.stderr b/src/test/ui/const-generics/issues/issue-85031-2.stderr deleted file mode 100644 index fc6905768..000000000 --- a/src/test/ui/const-generics/issues/issue-85031-2.stderr +++ /dev/null @@ -1,14 +0,0 @@ -warning: function cannot return without recursing - --> $DIR/issue-85031-2.rs:12:5 - | -LL | pub fn foo() -> [(); A - 0] { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing -LL | -LL | Self::foo() - | ----------- recursive call site - | - = help: a `loop` may express intention better if this is on purpose - = note: `#[warn(unconditional_recursion)]` on by default - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/issues/issue-86033.rs b/src/test/ui/const-generics/issues/issue-86033.rs deleted file mode 100644 index cf08f722f..000000000 --- a/src/test/ui/const-generics/issues/issue-86033.rs +++ /dev/null @@ -1,20 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait IsTrue {} -impl IsTrue for () {} - -pub trait IsZST {} - -impl IsZST for T -where - (): IsTrue<{ std::mem::size_of::() == 0 }> -{} - -fn _func() -> impl IsZST { - || {} -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-86530.rs b/src/test/ui/const-generics/issues/issue-86530.rs deleted file mode 100644 index b024decd4..000000000 --- a/src/test/ui/const-generics/issues/issue-86530.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait X { - const Y: usize; -} - -fn z(t: T) -where - T: X, - [(); T::Y]: , -{ -} - -fn unit_literals() { - z(" "); - //~^ ERROR: the trait bound `&str: X` is not satisfied -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-86530.stderr b/src/test/ui/const-generics/issues/issue-86530.stderr deleted file mode 100644 index c63857b23..000000000 --- a/src/test/ui/const-generics/issues/issue-86530.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0277]: the trait bound `&str: X` is not satisfied - --> $DIR/issue-86530.rs:16:7 - | -LL | z(" "); - | - ^^^ the trait `X` is not implemented for `&str` - | | - | required by a bound introduced by this call - | -note: required by a bound in `z` - --> $DIR/issue-86530.rs:10:8 - | -LL | fn z(t: T) - | - required by a bound in this -LL | where -LL | T: X, - | ^ required by this bound in `z` - -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-86535-2.rs b/src/test/ui/const-generics/issues/issue-86535-2.rs deleted file mode 100644 index 0b535fd66..000000000 --- a/src/test/ui/const-generics/issues/issue-86535-2.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-pass -#![feature(adt_const_params, generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait Foo { - const ASSOC_C: usize; - fn foo() where [(); Self::ASSOC_C]:; -} - -struct Bar; -impl Foo for Bar { - const ASSOC_C: usize = 3; - - fn foo() where [u8; Self::ASSOC_C]: { - let _: [u8; Self::ASSOC_C] = loop {}; - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-86535.rs b/src/test/ui/const-generics/issues/issue-86535.rs deleted file mode 100644 index 5289c4e99..000000000 --- a/src/test/ui/const-generics/issues/issue-86535.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass -#![feature(adt_const_params, generic_const_exprs)] -#![allow(incomplete_features, unused_variables)] - -struct F; -impl X for F<{ S }> { - const W: usize = 3; - - fn d(r: &[u8; Self::W]) -> F<{ S }> { - let x: [u8; Self::W] = [0; Self::W]; - F - } -} - -pub trait X { - const W: usize; - fn d(r: &[u8; Self::W]) -> Self; -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-86820.rs b/src/test/ui/const-generics/issues/issue-86820.rs deleted file mode 100644 index ae4bd943f..000000000 --- a/src/test/ui/const-generics/issues/issue-86820.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Regression test for the ICE described in #86820. - -#![allow(unused, dead_code)] -use std::ops::BitAnd; - -const C: fn() = || is_set(); -fn is_set() { - 0xffu8.bit::<0>(); -} - -trait Bits { - fn bit(self) -> bool; -} - -impl Bits for u8 { - fn bit(self) -> bool { - //~^ ERROR: method `bit` has an incompatible generic parameter for trait `Bits` [E0053] - let i = 1 << I; - let mask = u8::from(i); - mask & self == mask - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-86820.stderr b/src/test/ui/const-generics/issues/issue-86820.stderr deleted file mode 100644 index 3a9cd957f..000000000 --- a/src/test/ui/const-generics/issues/issue-86820.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0053]: method `bit` has an incompatible generic parameter for trait `Bits` - --> $DIR/issue-86820.rs:16:12 - | -LL | trait Bits { - | ---- -LL | fn bit(self) -> bool; - | ----------- expected const parameter of type `u8` -... -LL | impl Bits for u8 { - | ---------------- -LL | fn bit(self) -> bool { - | ^^^^^^^^^^^^^^ found const parameter of type `usize` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/ui/const-generics/issues/issue-87076.rs b/src/test/ui/const-generics/issues/issue-87076.rs deleted file mode 100644 index 8a567678b..000000000 --- a/src/test/ui/const-generics/issues/issue-87076.rs +++ /dev/null @@ -1,20 +0,0 @@ -// build-pass - -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -#[derive(PartialEq, Eq)] -pub struct UnitDims { - pub time: u8, - pub length: u8, -} - -pub struct UnitValue; - -impl UnitValue { - fn crash() {} -} - -fn main() { - UnitValue::<{ UnitDims { time: 1, length: 2 } }>::crash(); -} diff --git a/src/test/ui/const-generics/issues/issue-87470.rs b/src/test/ui/const-generics/issues/issue-87470.rs deleted file mode 100644 index d60181a41..000000000 --- a/src/test/ui/const-generics/issues/issue-87470.rs +++ /dev/null @@ -1,24 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait TraitWithConst { - const SOME_CONST: usize; -} - -pub trait OtherTrait: TraitWithConst { - fn some_fn(self) -> [u8 ; ::SOME_CONST]; -} - -impl TraitWithConst for f32 { - const SOME_CONST: usize = 32; -} - -impl OtherTrait for f32 { - fn some_fn(self) -> [u8 ; ::SOME_CONST] { - [0; 32] - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-87493.rs b/src/test/ui/const-generics/issues/issue-87493.rs deleted file mode 100644 index d8599ab22..000000000 --- a/src/test/ui/const-generics/issues/issue-87493.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub trait MyTrait { - type Assoc; -} - -pub fn foo(_s: S, _t: T) -where - S: MyTrait, - T: MyTrait, - //~^ ERROR: expected one of `,` or `>`, found `==` - //~| ERROR: this trait takes 0 generic arguments but 1 generic argument was supplied -{ -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-87493.stderr b/src/test/ui/const-generics/issues/issue-87493.stderr deleted file mode 100644 index 653afae21..000000000 --- a/src/test/ui/const-generics/issues/issue-87493.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: expected one of `,` or `>`, found `==` - --> $DIR/issue-87493.rs:8:22 - | -LL | T: MyTrait, - | ^^ expected one of `,` or `>` - | -help: if you meant to use an associated type binding, replace `==` with `=` - | -LL | T: MyTrait, - | ~ - -error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/issue-87493.rs:8:8 - | -LL | T: MyTrait, - | ^^^^^^^ expected 0 generic arguments - | -note: trait defined here, with 0 generic parameters - --> $DIR/issue-87493.rs:1:11 - | -LL | pub trait MyTrait { - | ^^^^^^^ -help: replace the generic bound with the associated type - | -LL | T: MyTrait, - | +++++++ - -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/issues/issue-87964.rs b/src/test/ui/const-generics/issues/issue-87964.rs deleted file mode 100644 index 116686abb..000000000 --- a/src/test/ui/const-generics/issues/issue-87964.rs +++ /dev/null @@ -1,29 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait Target { - const LENGTH: usize; -} - - -pub struct Container -where - [(); T::LENGTH]: Sized, -{ - _target: T, -} - -impl Container -where - [(); T::LENGTH]: Sized, -{ - pub fn start( - _target: T, - ) -> Container { - Container { _target } - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-88119.rs b/src/test/ui/const-generics/issues/issue-88119.rs deleted file mode 100644 index 647b0eea8..000000000 --- a/src/test/ui/const-generics/issues/issue-88119.rs +++ /dev/null @@ -1,36 +0,0 @@ -// check-pass - -#![allow(incomplete_features)] -#![feature(const_trait_impl, generic_const_exprs)] - -#[const_trait] -trait ConstName { - const NAME_BYTES: &'static [u8]; -} - -impl const ConstName for u8 { - const NAME_BYTES: &'static [u8] = b"u8"; -} - -const fn name_len() -> usize { - T::NAME_BYTES.len() -} - -impl const ConstName for &T -where - [(); name_len::()]:, -{ - const NAME_BYTES: &'static [u8] = b"&T"; -} - -impl const ConstName for &mut T -where - [(); name_len::()]:, -{ - const NAME_BYTES: &'static [u8] = b"&mut T"; -} - -pub const ICE_1: &'static [u8] = <&&mut u8 as ConstName>::NAME_BYTES; -pub const ICE_2: &'static [u8] = <&mut &u8 as ConstName>::NAME_BYTES; - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-88468.rs b/src/test/ui/const-generics/issues/issue-88468.rs deleted file mode 100644 index 914047236..000000000 --- a/src/test/ui/const-generics/issues/issue-88468.rs +++ /dev/null @@ -1,13 +0,0 @@ -// check-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -pub struct Assert(); -pub trait IsTrue {} -impl IsTrue for Assert {} - -pub trait IsNotZST {} -impl IsNotZST for T where Assert<{ std::mem::size_of::() > 0 }>: IsTrue {} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-88997.rs b/src/test/ui/const-generics/issues/issue-88997.rs deleted file mode 100644 index 7666a5141..000000000 --- a/src/test/ui/const-generics/issues/issue-88997.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -struct ConstAssert; -trait True {} -impl True for ConstAssert {} - -struct Range(T) -//~^ ERROR the type of const parameters must not depend on other generic parameters -//~| ERROR the type of const parameters must not depend on other generic parameters -where - ConstAssert<{ MIN <= MAX }>: True; - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-88997.stderr b/src/test/ui/const-generics/issues/issue-88997.stderr deleted file mode 100644 index 505ba0da2..000000000 --- a/src/test/ui/const-generics/issues/issue-88997.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-88997.rs:8:40 - | -LL | struct Range(T) - | ^ the type must not depend on the parameter `T` - -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-88997.rs:8:54 - | -LL | struct Range(T) - | ^ the type must not depend on the parameter `T` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0770`. diff --git a/src/test/ui/const-generics/issues/issue-89146.rs b/src/test/ui/const-generics/issues/issue-89146.rs deleted file mode 100644 index e3540f46f..000000000 --- a/src/test/ui/const-generics/issues/issue-89146.rs +++ /dev/null @@ -1,26 +0,0 @@ -// build-pass - -#![allow(incomplete_features)] -#![feature(generic_const_exprs)] - -pub trait Foo { - const SIZE: usize; - - fn to_bytes(&self) -> [u8; Self::SIZE]; -} - -pub fn bar(a: &G) -> u8 -where - [(); G::SIZE]: Sized, -{ - deeper_bar(a) -} - -fn deeper_bar(a: &G) -> u8 -where - [(); G::SIZE]: Sized, -{ - a.to_bytes()[0] -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-89304.rs b/src/test/ui/const-generics/issues/issue-89304.rs deleted file mode 100644 index d544d637c..000000000 --- a/src/test/ui/const-generics/issues/issue-89304.rs +++ /dev/null @@ -1,20 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct GenericStruct { val: i64 } - -impl From> for GenericStruct<{T + 1}> { - fn from(other: GenericStruct) -> Self { - Self { val: other.val } - } -} - -impl From> for GenericStruct { - fn from(other: GenericStruct<{T + 1}>) -> Self { - Self { val: other.val } - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-89320.rs b/src/test/ui/const-generics/issues/issue-89320.rs deleted file mode 100644 index afa5c8fab..000000000 --- a/src/test/ui/const-generics/issues/issue-89320.rs +++ /dev/null @@ -1,19 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub trait Enumerable { - const N: usize; -} - -#[derive(Clone)] -pub struct SymmetricGroup -where - S: Enumerable, - [(); S::N]: Sized, -{ - _phantom: std::marker::PhantomData, -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-89334.rs b/src/test/ui/const-generics/issues/issue-89334.rs deleted file mode 100644 index b15b7428c..000000000 --- a/src/test/ui/const-generics/issues/issue-89334.rs +++ /dev/null @@ -1,16 +0,0 @@ -// build-pass - -#![feature(generic_const_exprs)] -#![allow(unused_braces, incomplete_features)] - -pub trait AnotherTrait{ - const ARRAY_SIZE: usize; -} -pub trait Shard: - AsMut<[[u8; T::ARRAY_SIZE]]> -where - [(); T::ARRAY_SIZE]: Sized -{ -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-90318.rs b/src/test/ui/const-generics/issues/issue-90318.rs deleted file mode 100644 index d6c48e63b..000000000 --- a/src/test/ui/const-generics/issues/issue-90318.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![feature(const_type_id)] -#![feature(generic_const_exprs)] -#![feature(core_intrinsics)] -#![allow(incomplete_features)] - -use std::any::TypeId; - -struct If; -pub trait True {} -impl True for If {} - -fn consume(_val: T) -where - If<{ TypeId::of::() != TypeId::of::<()>() }>: True, - //~^ ERROR: can't compare -{ -} - -fn test() -where - If<{ TypeId::of::() != TypeId::of::<()>() }>: True, - //~^ ERROR: can't compare -{ -} - -fn main() { - let a = (); - consume(0i32); - consume(a); -} diff --git a/src/test/ui/const-generics/issues/issue-90318.stderr b/src/test/ui/const-generics/issues/issue-90318.stderr deleted file mode 100644 index aba4b5c1a..000000000 --- a/src/test/ui/const-generics/issues/issue-90318.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0277]: can't compare `TypeId` with `_` in const contexts - --> $DIR/issue-90318.rs:14:28 - | -LL | If<{ TypeId::of::() != TypeId::of::<()>() }>: True, - | ^^ no implementation for `TypeId == _` - | - = help: the trait `~const PartialEq<_>` is not implemented for `TypeId` -note: the trait `PartialEq<_>` is implemented for `TypeId`, but that implementation is not `const` - --> $DIR/issue-90318.rs:14:28 - | -LL | If<{ TypeId::of::() != TypeId::of::<()>() }>: True, - | ^^ - -error[E0277]: can't compare `TypeId` with `_` in const contexts - --> $DIR/issue-90318.rs:21:28 - | -LL | If<{ TypeId::of::() != TypeId::of::<()>() }>: True, - | ^^ no implementation for `TypeId == _` - | - = help: the trait `~const PartialEq<_>` is not implemented for `TypeId` -note: the trait `PartialEq<_>` is implemented for `TypeId`, but that implementation is not `const` - --> $DIR/issue-90318.rs:21:28 - | -LL | If<{ TypeId::of::() != TypeId::of::<()>() }>: True, - | ^^ - -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-90364.rs b/src/test/ui/const-generics/issues/issue-90364.rs deleted file mode 100644 index b11b07b50..000000000 --- a/src/test/ui/const-generics/issues/issue-90364.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub struct Foo(T) -//~^ ERROR the type of const parameters must not depend on other generic parameters -where - [(); 1]:; - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-90364.stderr b/src/test/ui/const-generics/issues/issue-90364.stderr deleted file mode 100644 index e85bd136e..000000000 --- a/src/test/ui/const-generics/issues/issue-90364.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0770]: the type of const parameters must not depend on other generic parameters - --> $DIR/issue-90364.rs:4:28 - | -LL | pub struct Foo(T) - | ^ the type must not depend on the parameter `T` - -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-90455.rs b/src/test/ui/const-generics/issues/issue-90455.rs deleted file mode 100644 index a580410cf..000000000 --- a/src/test/ui/const-generics/issues/issue-90455.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![feature(generic_const_exprs, adt_const_params)] -#![allow(incomplete_features)] - -struct FieldElement { - n: [u64; num_limbs(N)], - //~^ ERROR unconstrained generic constant -} -const fn num_limbs(_: &str) -> usize { - 0 -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-90455.stderr b/src/test/ui/const-generics/issues/issue-90455.stderr deleted file mode 100644 index 724d7f42e..000000000 --- a/src/test/ui/const-generics/issues/issue-90455.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: unconstrained generic constant - --> $DIR/issue-90455.rs:5:8 - | -LL | n: [u64; num_limbs(N)], - | ^^^^^^^^^^^^^^^^^^^ - | - = help: try adding a `where` bound using this expression: `where [(); num_limbs(N)]:` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/issues/issue-92186.rs b/src/test/ui/const-generics/issues/issue-92186.rs deleted file mode 100644 index 9ced4667d..000000000 --- a/src/test/ui/const-generics/issues/issue-92186.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass - -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -pub struct Foo; -pub trait Bar {} - -impl Bar for Foo<{ 1 }> {} -impl Bar for Foo<{ 2 }> {} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-96654.rs b/src/test/ui/const-generics/issues/issue-96654.rs deleted file mode 100644 index 8cf786dbe..000000000 --- a/src/test/ui/const-generics/issues/issue-96654.rs +++ /dev/null @@ -1,15 +0,0 @@ -// check-pass - -struct A {} - -struct B {} - -impl B { - const M: u32 = M; -} - -struct C { - a: A<{ B::<1>::M }>, -} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-97278.rs b/src/test/ui/const-generics/issues/issue-97278.rs deleted file mode 100644 index da0a9776f..000000000 --- a/src/test/ui/const-generics/issues/issue-97278.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -use std::sync::Arc; - -#[derive(PartialEq, Eq)] -enum Bar { - Bar(Arc) -} - -fn test() {} -//~^ ERROR `Arc` must be annotated with `#[derive(PartialEq, Eq)]` - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-97278.stderr b/src/test/ui/const-generics/issues/issue-97278.stderr deleted file mode 100644 index ff13cb505..000000000 --- a/src/test/ui/const-generics/issues/issue-97278.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0741]: `Arc` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter - --> $DIR/issue-97278.rs:11:20 - | -LL | fn test() {} - | ^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/issues/issue-97634.rs b/src/test/ui/const-generics/issues/issue-97634.rs deleted file mode 100644 index 422e8de68..000000000 --- a/src/test/ui/const-generics/issues/issue-97634.rs +++ /dev/null @@ -1,10 +0,0 @@ -// build-pass - -pub enum Register { - Field0 = 40, - Field1, -} - -fn main() { - let _b = Register::<0>::Field1 as u16; -} diff --git a/src/test/ui/const-generics/issues/issue-98629.rs b/src/test/ui/const-generics/issues/issue-98629.rs deleted file mode 100644 index 1d2d3012a..000000000 --- a/src/test/ui/const-generics/issues/issue-98629.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(const_trait_impl)] - -#[const_trait] -trait Trait { - const N: usize; -} - -impl const Trait for i32 {} -//~^ ERROR not all trait items implemented, missing: `N` - -fn f() -where - [(); ::N]:, -{} - -fn main() {} diff --git a/src/test/ui/const-generics/issues/issue-98629.stderr b/src/test/ui/const-generics/issues/issue-98629.stderr deleted file mode 100644 index 4a248be76..000000000 --- a/src/test/ui/const-generics/issues/issue-98629.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0046]: not all trait items implemented, missing: `N` - --> $DIR/issue-98629.rs:8:1 - | -LL | const N: usize; - | -------------- `N` from trait -... -LL | impl const Trait for i32 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `N` in implementation - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/ui/const-generics/issues/issue-99641.rs b/src/test/ui/const-generics/issues/issue-99641.rs deleted file mode 100644 index fae6d3fc4..000000000 --- a/src/test/ui/const-generics/issues/issue-99641.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -fn main() { - pub struct Color; - //~^ ERROR using function pointers - - impl Color { - //~^ ERROR using function pointers - pub fn new() -> Self { - Color:: - } - } - - pub const D65: (fn(),) = (|| {},); - - Color::::new(); -} diff --git a/src/test/ui/const-generics/issues/issue-99641.stderr b/src/test/ui/const-generics/issues/issue-99641.stderr deleted file mode 100644 index 349ebba08..000000000 --- a/src/test/ui/const-generics/issues/issue-99641.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-99641.rs:5:35 - | -LL | pub struct Color; - | ^^^^^^^ - -error[E0741]: using function pointers as const generic parameters is forbidden - --> $DIR/issue-99641.rs:8:23 - | -LL | impl Color { - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0741`. 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 deleted file mode 100644 index 5294cc3b5..000000000 --- a/src/test/ui/const-generics/late-bound-vars/in_closure.rs +++ /dev/null @@ -1,18 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -const fn inner<'a>() -> usize where &'a (): Sized { - 3 -} - -fn test<'a>() { - let _ = || { - let _: [u8; inner::<'a>()]; - let _ = [0; inner::<'a>()]; - }; -} - -fn main() { - test(); -} diff --git a/src/test/ui/const-generics/late-bound-vars/simple.rs b/src/test/ui/const-generics/late-bound-vars/simple.rs deleted file mode 100644 index 6da5395ef..000000000 --- a/src/test/ui/const-generics/late-bound-vars/simple.rs +++ /dev/null @@ -1,16 +0,0 @@ -// run-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -const fn inner<'a>() -> usize where &'a (): Sized { - 3 -} - -fn test<'a>() { - let _: [u8; inner::<'a>()]; - let _ = [0; inner::<'a>()]; -} - -fn main() { - test(); -} diff --git a/src/test/ui/const-generics/legacy-const-generics-bad.rs b/src/test/ui/const-generics/legacy-const-generics-bad.rs deleted file mode 100644 index 538eee337..000000000 --- a/src/test/ui/const-generics/legacy-const-generics-bad.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:legacy-const-generics.rs - -extern crate legacy_const_generics; - -fn foo() { - let a = 1; - legacy_const_generics::foo(0, a, 2); - //~^ ERROR attempt to use a non-constant value in a constant - - legacy_const_generics::foo(0, N, 2); - - legacy_const_generics::foo(0, N + 1, 2); - //~^ ERROR generic parameters may not be used in const operations -} - -fn main() {} diff --git a/src/test/ui/const-generics/legacy-const-generics-bad.stderr b/src/test/ui/const-generics/legacy-const-generics-bad.stderr deleted file mode 100644 index 3c78dd6c7..000000000 --- a/src/test/ui/const-generics/legacy-const-generics-bad.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0435]: attempt to use a non-constant value in a constant - --> $DIR/legacy-const-generics-bad.rs:7:35 - | -LL | let a = 1; - | ----- help: consider using `const` instead of `let`: `const a` -LL | legacy_const_generics::foo(0, a, 2); - | ^ non-constant value - -error: generic parameters may not be used in const operations - --> $DIR/legacy-const-generics-bad.rs:12:35 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0435`. diff --git a/src/test/ui/const-generics/legacy-const-generics.rs b/src/test/ui/const-generics/legacy-const-generics.rs deleted file mode 100644 index 9abc72d98..000000000 --- a/src/test/ui/const-generics/legacy-const-generics.rs +++ /dev/null @@ -1,18 +0,0 @@ -// aux-build:legacy-const-generics.rs -// run-pass - -#![feature(rustc_attrs)] - -extern crate legacy_const_generics; - -#[rustc_legacy_const_generics(1)] -pub fn bar(x: usize, z: usize) -> [usize; 3] { - [x, Y, z] -} - -fn main() { - assert_eq!(legacy_const_generics::foo(0 + 0, 1 + 1, 2 + 2), [0, 2, 4]); - assert_eq!(legacy_const_generics::foo::<{1 + 1}>(0 + 0, 2 + 2), [0, 2, 4]); - // FIXME: Only works cross-crate - //assert_eq!(bar(0, 1, 2), [0, 1, 2]); -} diff --git a/src/test/ui/const-generics/min_const_generics/assoc_const.rs b/src/test/ui/const-generics/min_const_generics/assoc_const.rs deleted file mode 100644 index 27e971b5b..000000000 --- a/src/test/ui/const-generics/min_const_generics/assoc_const.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check-pass -struct Foo; - -impl Foo { - const VALUE: usize = N * 2; -} - -trait Bar { - const ASSOC: usize; -} - -impl Bar for Foo { - const ASSOC: usize = N * 3; -} - -fn main() {} diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.rs b/src/test/ui/const-generics/min_const_generics/complex-expression.rs deleted file mode 100644 index 8e667aeba..000000000 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.rs +++ /dev/null @@ -1,48 +0,0 @@ -// compile-flags: -Zdeduplicate-diagnostics=yes -use std::mem::size_of; - -fn test() {} - -fn ok() -> [u8; M] { - [0; { M }] -} - -struct Break0([u8; { N + 1 }]); -//~^ ERROR generic parameters may not be used in const operations - -struct Break1([u8; { { N } }]); -//~^ ERROR generic parameters may not be used in const operations - -fn break2() { - let _: [u8; N + 1]; - //~^ ERROR generic parameters may not be used in const operations -} - -fn break3() { - let _ = [0; N + 1]; - //~^ ERROR generic parameters may not be used in const operations -} - -struct BreakTy0(T, [u8; { size_of::<*mut T>() }]); -//~^ ERROR generic parameters may not be used in const operations - -struct BreakTy1(T, [u8; { { size_of::<*mut T>() } }]); -//~^ ERROR generic parameters may not be used in const operations - -fn break_ty2() { - let _: [u8; size_of::<*mut T>() + 1]; - //~^ ERROR generic parameters may not be used in const operations -} - -fn break_ty3() { - let _ = [0; size_of::<*mut T>() + 1]; - //~^ WARN cannot use constants which depend on generic parameters in types - //~| WARN this was previously accepted by the compiler but is being phased out -} - - -trait Foo { - const ASSOC: usize; -} - -fn main() {} 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 deleted file mode 100644 index deabd05a6..000000000 --- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr +++ /dev/null @@ -1,75 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:10:38 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:13:40 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:17: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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:22:17 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:26:45 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:29:47 - | -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(generic_const_exprs)]` to allow generic const expressions - -error: generic parameters may not be used in const operations - --> $DIR/complex-expression.rs:33:32 - | -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(generic_const_exprs)]` to allow generic const expressions - -warning: cannot use constants which depend on generic parameters in types - --> $DIR/complex-expression.rs:38:17 - | -LL | let _ = [0; size_of::<*mut T>() + 1]; - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 - = note: `#[warn(const_evaluatable_unchecked)]` on by default - -error: aborting due to 7 previous errors; 1 warning emitted - diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.rs b/src/test/ui/const-generics/min_const_generics/complex-types.rs deleted file mode 100644 index 057bd5af8..000000000 --- a/src/test/ui/const-generics/min_const_generics/complex-types.rs +++ /dev/null @@ -1,27 +0,0 @@ -#![feature(never_type)] - -struct Foo; -//~^ ERROR `[u8; 0]` is forbidden - -struct Bar; -//~^ ERROR `()` is forbidden -#[derive(PartialEq, Eq)] -struct No; - -struct Fez; -//~^ ERROR `No` is forbidden - -struct Faz; -//~^ ERROR `&'static u8` is forbidden - -struct Fiz; -//~^ ERROR `!` is forbidden - -enum Goo { A, B } -//~^ ERROR `()` is forbidden - -union Boo { a: () } -//~^ ERROR `()` is forbidden - - -fn main() {} 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 deleted file mode 100644 index 4ddbadb54..000000000 --- a/src/test/ui/const-generics/min_const_generics/complex-types.stderr +++ /dev/null @@ -1,65 +0,0 @@ -error: `[u8; 0]` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:3:21 - | -LL | struct Foo; - | ^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `()` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:6:21 - | -LL | struct Bar; - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `No` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:11:21 - | -LL | struct Fez; - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:14:21 - | -LL | struct Faz; - | ^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `!` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:17:21 - | -LL | struct Fiz; - | ^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `()` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:20:19 - | -LL | enum Goo { A, B } - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `()` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:23:20 - | -LL | union Boo { a: () } - | ^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 7 previous errors - diff --git a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs deleted file mode 100644 index e9d868093..000000000 --- a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs +++ /dev/null @@ -1,35 +0,0 @@ -// check-pass -// compile-flags: -Zdeduplicate-diagnostics=yes -#![allow(dead_code)] - -fn foo() { - [0; std::mem::size_of::<*mut T>()]; - //~^ WARN cannot use constants which depend on generic parameters in types - //~| WARN this was previously accepted by the compiler but is being phased out -} - -struct Foo(T); - -impl Foo { - const ASSOC: usize = 4; - - fn test() { - let _ = [0; Self::ASSOC]; - //~^ WARN cannot use constants which depend on generic parameters in types - //~| WARN this was previously accepted by the compiler but is being phased out - } -} - -struct Bar; - -impl Bar { - const ASSOC: usize = 4; - - fn test() { - let _ = [0; Self::ASSOC]; - //~^ 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/min_const_generics/const-evaluatable-unchecked.stderr b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr deleted file mode 100644 index 8003dfa40..000000000 --- a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr +++ /dev/null @@ -1,30 +0,0 @@ -warning: cannot use constants which depend on generic parameters in types - --> $DIR/const-evaluatable-unchecked.rs:6:9 - | -LL | [0; std::mem::size_of::<*mut T>()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = 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 - = note: `#[warn(const_evaluatable_unchecked)]` on by default - -warning: cannot use constants which depend on generic parameters in types - --> $DIR/const-evaluatable-unchecked.rs:17:21 - | -LL | let _ = [0; Self::ASSOC]; - | ^^^^^^^^^^^ - | - = 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: cannot use constants which depend on generic parameters in types - --> $DIR/const-evaluatable-unchecked.rs:29:21 - | -LL | let _ = [0; Self::ASSOC]; - | ^^^^^^^^^^^ - | - = 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: 3 warnings emitted - diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs deleted file mode 100644 index fac3777cf..000000000 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.rs +++ /dev/null @@ -1,47 +0,0 @@ -fn foo() {} - -const BAR: usize = 42; - -fn a() { - foo(); //~ ERROR comparison operators cannot be chained -} -fn b() { - foo(); //~ ERROR comparison operators cannot be chained -} -fn c() { - foo<3 + 3>(); //~ ERROR comparison operators cannot be chained -} -fn d() { - foo(); //~ ERROR comparison operators cannot be chained -} -fn e() { - foo(); //~ ERROR comparison operators cannot be chained -} -fn f() { - foo<100 - BAR>(); //~ ERROR comparison operators cannot be chained -} -fn g() { - foo()>(); //~ ERROR comparison operators cannot be chained - //~^ ERROR expected one of `;` or `}`, found `>` -} -fn h() { - foo()>(); //~ ERROR comparison operators cannot be chained -} -fn i() { - foo() + BAR>(); //~ ERROR comparison operators cannot be chained -} -fn j() { - foo() - BAR>(); //~ ERROR comparison operators cannot be chained -} -fn k() { - foo()>(); //~ ERROR comparison operators cannot be chained -} -fn l() { - foo()>(); //~ ERROR comparison operators cannot be chained -} - -const fn bar() -> usize { - C -} - -fn main() {} diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr deleted file mode 100644 index a6825b845..000000000 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr +++ /dev/null @@ -1,140 +0,0 @@ -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:6:8 - | -LL | foo(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:9:8 - | -LL | foo(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:12:8 - | -LL | foo<3 + 3>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::<3 + 3>(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:15:8 - | -LL | foo(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:18:8 - | -LL | foo(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:21:8 - | -LL | foo<100 - BAR>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::<100 - BAR>(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:8 - | -LL | foo()>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::()>(); - | ++ - -error: expected one of `;` or `}`, found `>` - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:19 - | -LL | foo()>(); - | ^ expected one of `;` or `}` - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:28:8 - | -LL | foo()>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::()>(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:31:8 - | -LL | foo() + BAR>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::() + BAR>(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:34:8 - | -LL | foo() - BAR>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::() - BAR>(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:37:8 - | -LL | foo()>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::()>(); - | ++ - -error: comparison operators cannot be chained - --> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:40:8 - | -LL | foo()>(); - | ^ ^ - | -help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments - | -LL | foo::()>(); - | ++ - -error: aborting due to 13 previous errors - diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs deleted file mode 100644 index e12e07a28..000000000 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.rs +++ /dev/null @@ -1,51 +0,0 @@ -fn foo() {} - -const BAR: usize = 42; - -fn a() { - foo::(); //~ ERROR expected one of -} -fn b() { - // FIXME(const_generics): these diagnostics are awful, because trait objects without `dyn` were - // a terrible mistake. - foo::(); - //~^ ERROR expected trait, found constant `BAR` - //~| ERROR expected trait, found constant `BAR` - //~| ERROR type provided when a constant was expected -} -fn c() { - foo::<3 + 3>(); //~ ERROR expressions must be enclosed in braces -} -fn d() { - foo::(); //~ ERROR expected one of -} -fn e() { - foo::(); //~ ERROR expected one of -} -fn f() { - foo::<100 - BAR>(); //~ ERROR expressions must be enclosed in braces -} -fn g() { - foo::()>(); //~ ERROR expected one of -} -fn h() { - foo::()>(); //~ ERROR expected one of -} -fn i() { - foo::() + BAR>(); //~ ERROR expected one of -} -fn j() { - foo::() - BAR>(); //~ ERROR expected one of -} -fn k() { - foo::()>(); //~ ERROR expected one of -} -fn l() { - foo::()>(); //~ ERROR expected one of -} - -const fn bar() -> usize { - C -} - -fn main() {} diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr deleted file mode 100644 index d9bcc523b..000000000 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr +++ /dev/null @@ -1,143 +0,0 @@ -error: expected one of `,` or `>`, found `3` - --> $DIR/const-expression-suggest-missing-braces.rs:6:17 - | -LL | foo::(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ BAR + 3 }>(); - | + + - -error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/const-expression-suggest-missing-braces.rs:17:11 - | -LL | foo::<3 + 3>(); - | ^^^^^ - | -help: enclose the `const` expression in braces - | -LL | foo::<{ 3 + 3 }>(); - | + + - -error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:20:15 - | -LL | foo::(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ BAR - 3 }>(); - | + + - -error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:23:15 - | -LL | foo::(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ BAR - BAR }>(); - | + + - -error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/const-expression-suggest-missing-braces.rs:26:11 - | -LL | foo::<100 - BAR>(); - | ^^^^^^^^^ - | -help: enclose the `const` expression in braces - | -LL | foo::<{ 100 - BAR }>(); - | + + - -error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:29:19 - | -LL | foo::()>(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar() }>(); - | + + - -error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:32:21 - | -LL | foo::()>(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar::() }>(); - | + + - -error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:35:21 - | -LL | foo::() + BAR>(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar::() + BAR }>(); - | + + - -error: expected one of `,` or `>`, found `(` - --> $DIR/const-expression-suggest-missing-braces.rs:38:21 - | -LL | foo::() - BAR>(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ bar::() - BAR }>(); - | + + - -error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:41:15 - | -LL | foo::()>(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ BAR - bar::() }>(); - | + + - -error: expected one of `,` or `>`, found `-` - --> $DIR/const-expression-suggest-missing-braces.rs:44:15 - | -LL | foo::()>(); - | ^ expected one of `,` or `>` - | -help: expressions must be enclosed in braces to be used as const generic arguments - | -LL | foo::<{ BAR - bar::() }>(); - | + + - -error[E0404]: expected trait, found constant `BAR` - --> $DIR/const-expression-suggest-missing-braces.rs:11:11 - | -LL | foo::(); - | ^^^ not a trait - -error[E0404]: expected trait, found constant `BAR` - --> $DIR/const-expression-suggest-missing-braces.rs:11:17 - | -LL | foo::(); - | ^^^ not a trait - -error[E0747]: type provided when a constant was expected - --> $DIR/const-expression-suggest-missing-braces.rs:11:11 - | -LL | foo::(); - | ^^^^^^^^^ - -error: aborting due to 14 previous errors - -Some errors have detailed explanations: E0404, E0747. -For more information about an error, try `rustc --explain E0404`. 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 deleted file mode 100644 index eafafb8a2..000000000 --- a/src/test/ui/const-generics/min_const_generics/const_default_first.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_type = "lib"] -#![allow(dead_code)] - -struct Both { -//~^ ERROR: generic parameters with a default must be - v: T -} 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 deleted file mode 100644 index 0d5a393cb..000000000 --- a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: generic parameters with a default must be trailing - --> $DIR/const_default_first.rs:4:19 - | -LL | struct Both { - | ^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs b/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs deleted file mode 100644 index 0c10af6c4..000000000 --- a/src/test/ui/const-generics/min_const_generics/const_fn_in_generics.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -const fn identity() -> u32 { T } - -#[derive(Eq, PartialEq, Debug)] -pub struct ConstU32; - -pub fn new() -> ConstU32<{ identity::<3>() }> { - ConstU32::<{ identity::<3>() }> -} - -fn main() { - let v = new(); - assert_eq!(v, ConstU32::<3>); -} diff --git a/src/test/ui/const-generics/min_const_generics/default_function_param.rs b/src/test/ui/const-generics/min_const_generics/default_function_param.rs deleted file mode 100644 index 92d495ef6..000000000 --- a/src/test/ui/const-generics/min_const_generics/default_function_param.rs +++ /dev/null @@ -1,4 +0,0 @@ -#![crate_type = "lib"] - -fn foo() {} -//~^ ERROR defaults for const parameters are diff --git a/src/test/ui/const-generics/min_const_generics/default_function_param.stderr b/src/test/ui/const-generics/min_const_generics/default_function_param.stderr deleted file mode 100644 index dedad2880..000000000 --- a/src/test/ui/const-generics/min_const_generics/default_function_param.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - --> $DIR/default_function_param.rs:3:8 - | -LL | fn foo() {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/min_const_generics/default_trait_param.rs b/src/test/ui/const-generics/min_const_generics/default_trait_param.rs deleted file mode 100644 index 9cd5e3279..000000000 --- a/src/test/ui/const-generics/min_const_generics/default_trait_param.rs +++ /dev/null @@ -1,4 +0,0 @@ -// check-pass -trait Foo {} - -fn main() {} 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 deleted file mode 100644 index 6215b7d93..000000000 --- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs +++ /dev/null @@ -1,25 +0,0 @@ -// This test checks that non-static lifetimes are prohibited under `min_const_generics`. It -// currently emits an error with `min_const_generics`. - -fn test() {} - -fn issue_75323_and_74447_1<'a>() -> &'a () { - test::<{ let _: &'a (); 3 },>(); - //~^ ERROR a non-static lifetime is not allowed in a `const` - &() -} - -fn issue_75323_and_74447_2() { - test::<{ let _: &(); 3 },>(); -} - -fn issue_75323_and_74447_3() { - test::<{ let _: &'static (); 3 },>(); -} - -fn issue_73375<'a>() { - [(); (|_: &'a u8| (), 0).1]; - //~^ ERROR a non-static lifetime is not allowed in a `const` -} - -fn main() {} 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 deleted file mode 100644 index 5f641b070..000000000 --- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0658]: a non-static lifetime is not allowed in a `const` - --> $DIR/forbid-non-static-lifetimes.rs:7:22 - | -LL | test::<{ let _: &'a (); 3 },>(); - | ^^ - | - = 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 - | -LL | [(); (|_: &'a u8| (), 0).1]; - | ^^ - | - = 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 - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs deleted file mode 100644 index e1cf7b579..000000000 --- a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.rs +++ /dev/null @@ -1,15 +0,0 @@ -trait AlwaysApplicable { - type Assoc; -} -impl AlwaysApplicable for T { - type Assoc = usize; -} - -trait BindsParam { - type ArrayTy; -} -impl BindsParam for ::Assoc { - type ArrayTy = [u8; Self::MAX]; //~ ERROR generic `Self` types -} - -fn main() {} diff --git a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr b/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr deleted file mode 100644 index bda885970..000000000 --- a/src/test/ui/const-generics/min_const_generics/forbid-self-no-normalize.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/forbid-self-no-normalize.rs:12:25 - | -LL | type ArrayTy = [u8; Self::MAX]; - | ^^^^ - | -note: not a concrete type - --> $DIR/forbid-self-no-normalize.rs:11:27 - | -LL | impl BindsParam for ::Assoc { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/min_const_generics/inferred_const.rs b/src/test/ui/const-generics/min_const_generics/inferred_const.rs deleted file mode 100644 index 57d694158..000000000 --- a/src/test/ui/const-generics/min_const_generics/inferred_const.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(generic_arg_infer)] -// run-pass - -fn foo(_data: [u32; N]) -> [u32; K] { - [0; K] -} -fn main() { - let _a = foo::<_, 2>([0, 1, 2]); -} diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr deleted file mode 100644 index be92429e3..000000000 --- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr +++ /dev/null @@ -1,62 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:29:21 - | -LL | get_flag::(); - | ^^^^ expected `char`, found `u8` - -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:31:14 - | -LL | get_flag::<7, 'c'>(); - | ^ expected `bool`, found integer - -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:33:14 - | -LL | get_flag::<42, 0x5ad>(); - | ^^ expected `bool`, found integer - -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:33:18 - | -LL | get_flag::<42, 0x5ad>(); - | ^^^^^ expected `char`, found `u8` - -error[E0080]: evaluation of constant value failed - --> $DIR/invalid-patterns.rs:38:32 - | -LL | get_flag::(); - | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory - -error[E0080]: it is undefined behavior to use this value - --> $DIR/invalid-patterns.rs:41:14 - | -LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean - | - = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. - = note: the raw bytes of the constant (size: 1, align: 1) { - 42 │ B - } - -error[E0080]: it is undefined behavior to use this value - --> $DIR/invalid-patterns.rs:43:14 - | -LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean - | - = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. - = note: the raw bytes of the constant (size: 1, align: 1) { - 42 │ B - } - -error[E0080]: evaluation of constant value failed - --> $DIR/invalid-patterns.rs:43:58 - | -LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>(); - | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0080, E0308. -For more information about an error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr deleted file mode 100644 index be92429e3..000000000 --- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr +++ /dev/null @@ -1,62 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:29:21 - | -LL | get_flag::(); - | ^^^^ expected `char`, found `u8` - -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:31:14 - | -LL | get_flag::<7, 'c'>(); - | ^ expected `bool`, found integer - -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:33:14 - | -LL | get_flag::<42, 0x5ad>(); - | ^^ expected `bool`, found integer - -error[E0308]: mismatched types - --> $DIR/invalid-patterns.rs:33:18 - | -LL | get_flag::<42, 0x5ad>(); - | ^^^^^ expected `char`, found `u8` - -error[E0080]: evaluation of constant value failed - --> $DIR/invalid-patterns.rs:38:32 - | -LL | get_flag::(); - | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory - -error[E0080]: it is undefined behavior to use this value - --> $DIR/invalid-patterns.rs:41:14 - | -LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean - | - = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. - = note: the raw bytes of the constant (size: 1, align: 1) { - 42 │ B - } - -error[E0080]: it is undefined behavior to use this value - --> $DIR/invalid-patterns.rs:43:14 - | -LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean - | - = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. - = note: the raw bytes of the constant (size: 1, align: 1) { - 42 │ B - } - -error[E0080]: evaluation of constant value failed - --> $DIR/invalid-patterns.rs:43:58 - | -LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>(); - | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0080, E0308. -For more information about an error, try `rustc --explain E0080`. diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs b/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs deleted file mode 100644 index 13b2cca2f..000000000 --- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs +++ /dev/null @@ -1,47 +0,0 @@ -// stderr-per-bitwidth -use std::mem::transmute; - -fn get_flag() -> Option { - if FlagSet { - Some(ShortName) - } else { - None - } -} - -union CharRaw { - byte: u8, - character: char, -} - -union BoolRaw { - byte: u8, - boolean: bool, -} - -const char_raw: CharRaw = CharRaw { byte: 0xFF }; -const bool_raw: BoolRaw = BoolRaw { byte: 0x42 }; - -fn main() { - // Test that basic cases don't work - assert!(get_flag::().is_some()); - assert!(get_flag::().is_none()); - get_flag::(); - //~^ ERROR mismatched types - get_flag::<7, 'c'>(); - //~^ ERROR mismatched types - get_flag::<42, 0x5ad>(); - //~^ ERROR mismatched types - //~| ERROR mismatched types - - - get_flag::(); - //~^ ERROR evaluation of constant value failed - //~| uninitialized - get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>(); - //~^ ERROR it is undefined behavior - get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>(); - //~^ ERROR evaluation of constant value failed - //~| uninitialized - //~| ERROR it is undefined behavior -} diff --git a/src/test/ui/const-generics/min_const_generics/macro-fail.rs b/src/test/ui/const-generics/min_const_generics/macro-fail.rs deleted file mode 100644 index 7fb69032e..000000000 --- a/src/test/ui/const-generics/min_const_generics/macro-fail.rs +++ /dev/null @@ -1,39 +0,0 @@ -struct Example; - -macro_rules! external_macro { - () => {{ - //~^ ERROR expected type - const X: usize = 1337; - X - }} -} - -trait Marker {} -impl Marker for Example {} - -fn make_marker() -> impl Marker { - //~^ ERROR: type provided when a constant was expected - Example:: -} - -fn from_marker(_: impl Marker<{ - #[macro_export] - macro_rules! inline { () => {{ 3 }} }; inline!() -}>) {} - -fn main() { - let _ok = Example::<{ - #[macro_export] - macro_rules! gimme_a_const { - ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} - //~^ ERROR expected type - //~| ERROR expected type - }; - gimme_a_const!(run) - }>; - - let _fail = Example::; - - let _fail = Example::; - //~^ ERROR unexpected end of macro invocation -} diff --git a/src/test/ui/const-generics/min_const_generics/macro-fail.stderr b/src/test/ui/const-generics/min_const_generics/macro-fail.stderr deleted file mode 100644 index 9f73b91aa..000000000 --- a/src/test/ui/const-generics/min_const_generics/macro-fail.stderr +++ /dev/null @@ -1,71 +0,0 @@ -error: expected type, found `{` - --> $DIR/macro-fail.rs:28:27 - | -LL | fn make_marker() -> impl Marker { - | ---------------------- - | | - | this macro call doesn't expand to a type - | in this macro invocation -... -LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type - | - = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: expected type, found `{` - --> $DIR/macro-fail.rs:28:27 - | -LL | Example:: - | ---------------------- - | | - | this macro call doesn't expand to a type - | in this macro invocation -... -LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type - | - = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: expected type, found `{` - --> $DIR/macro-fail.rs:4:10 - | -LL | () => {{ - | __________^ -LL | | -LL | | const X: usize = 1337; -LL | | X -LL | | }} - | |___^ expected type -... -LL | let _fail = Example::; - | ----------------- - | | - | this macro call doesn't expand to a type - | in this macro invocation - | - = note: this error originates in the macro `external_macro` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: unexpected end of macro invocation - --> $DIR/macro-fail.rs:37:25 - | -LL | macro_rules! gimme_a_const { - | -------------------------- when calling this macro -... -LL | let _fail = Example::; - | ^^^^^^^^^^^^^^^^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$rusty:ident` - --> $DIR/macro-fail.rs:28:8 - | -LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} - | ^^^^^^^^^^^^^ - -error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:14:33 - | -LL | fn make_marker() -> impl Marker { - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/min_const_generics/macro.rs b/src/test/ui/const-generics/min_const_generics/macro.rs deleted file mode 100644 index 9b63f7698..000000000 --- a/src/test/ui/const-generics/min_const_generics/macro.rs +++ /dev/null @@ -1,55 +0,0 @@ -// run-pass -struct Example; - -macro_rules! external_macro { - () => {{ - const X: usize = 1337; - X - }} -} - -trait Marker {} -impl Marker for Example {} - -fn make_marker() -> impl Marker<{ - #[macro_export] - macro_rules! const_macro { () => {{ 3 }} } inline!() -}> { - Example::<{ const_macro!() }> -} - -fn from_marker(_: impl Marker<{ - #[macro_export] - macro_rules! inline { () => {{ 3 }} } inline!() -}>) {} - -fn main() { - let _ok = Example::<{ - #[macro_export] - macro_rules! gimme_a_const { - ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} - } - gimme_a_const!(run) - }>; - - let _ok = Example::<{ external_macro!() }>; - - let _ok: [_; gimme_a_const!(blah)] = [0,0,0]; - let _ok: [[u8; gimme_a_const!(blah)]; gimme_a_const!(blah)]; - let _ok: [u8; gimme_a_const!(blah)]; - - let _ok: [u8; { - #[macro_export] - macro_rules! const_two { () => {{ 2 }} } - const_two!() - }]; - - let _ok = [0; { - #[macro_export] - macro_rules! const_three { () => {{ 3 }} } - const_three!() - }]; - let _ok = [0; const_three!()]; - - from_marker(make_marker()); -} diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs deleted file mode 100644 index 9ef619365..000000000 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.rs +++ /dev/null @@ -1,25 +0,0 @@ -trait Foo { - fn t1() -> [u8; std::mem::size_of::()]; //~ERROR generic parameters -} - -struct Bar(T); - -impl Bar { - fn t2() -> [u8; std::mem::size_of::()] { todo!() } // ok -} - -impl Bar { - fn t3() -> [u8; std::mem::size_of::()] {} //~ERROR generic `Self` -} - -trait Baz { - fn hey(); -} - -impl Baz for u16 { - fn hey() { - let _: [u8; std::mem::size_of::()]; // ok - } -} - -fn main() {} 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 deleted file mode 100644 index 16a7687c0..000000000 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: generic parameters may not be used in const operations - --> $DIR/self-ty-in-const-1.rs:2:41 - | -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(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 - | -LL | fn t3() -> [u8; std::mem::size_of::()] {} - | ^^^^ - | -note: not a concrete type - --> $DIR/self-ty-in-const-1.rs:11:9 - | -LL | impl Bar { - | ^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs deleted file mode 100644 index 286ec2d24..000000000 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.rs +++ /dev/null @@ -1,19 +0,0 @@ -struct Bar(T); - -trait Baz { - fn hey(); -} - -impl Baz for u16 { - fn hey() { - let _: [u8; std::mem::size_of::()]; // ok - } -} - -impl Baz for Bar { - fn hey() { - let _: [u8; std::mem::size_of::()]; //~ERROR generic `Self` - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr deleted file mode 100644 index 41546292c..000000000 --- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-2.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: generic `Self` types are currently not permitted in anonymous constants - --> $DIR/self-ty-in-const-2.rs:15:41 - | -LL | let _: [u8; std::mem::size_of::()]; - | ^^^^ - | -note: not a concrete type - --> $DIR/self-ty-in-const-2.rs:13:17 - | -LL | impl Baz for Bar { - | ^^^^^^ - -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 deleted file mode 100644 index fa119c59f..000000000 --- a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs +++ /dev/null @@ -1,25 +0,0 @@ -// run-pass -#![allow(dead_code)] - -struct Both { - arr: [T; N] -} - -trait BothTrait {} - -enum BothEnum { - Dummy([T; N]) -} - -struct OppOrder { - arr: [T; N] -} - -fn main() { - let _ = OppOrder::<3, u32> { - arr: [0,0,0], - }; - let _ = Both:: { - arr: [0], - }; -} diff --git a/src/test/ui/const-generics/nested-type.full.stderr b/src/test/ui/const-generics/nested-type.full.stderr deleted file mode 100644 index 6d9f44065..000000000 --- a/src/test/ui/const-generics/nested-type.full.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0015]: cannot call non-const fn `Foo::{constant#0}::Foo::<17>::value` in constants - --> $DIR/nested-type.rs:15:5 - | -LL | Foo::<17>::value() - | ^^^^^^^^^^^^^^^^^^ - | - = note: calls in constants are limited to constant functions, tuple structs and tuple variants - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/const-generics/nested-type.min.stderr b/src/test/ui/const-generics/nested-type.min.stderr deleted file mode 100644 index 276ebf31f..000000000 --- a/src/test/ui/const-generics/nested-type.min.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: `[u8; _]` is forbidden as the type of a const generic parameter - --> $DIR/nested-type.rs:6:21 - | -LL | struct Foo; -LL | | -LL | | impl Foo { -... | -LL | | -LL | | }]>; - | |__^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/nested-type.rs b/src/test/ui/const-generics/nested-type.rs deleted file mode 100644 index 742340f43..000000000 --- a/src/test/ui/const-generics/nested-type.rs +++ /dev/null @@ -1,19 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Foo; - - impl Foo { - fn value() -> usize { - N - } - } - - Foo::<17>::value() - //[full]~^ ERROR cannot call non-const fn -}]>; - -fn main() {} diff --git a/src/test/ui/const-generics/occurs-check/bind-param.rs b/src/test/ui/const-generics/occurs-check/bind-param.rs deleted file mode 100644 index ee4244051..000000000 --- a/src/test/ui/const-generics/occurs-check/bind-param.rs +++ /dev/null @@ -1,17 +0,0 @@ -// build-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// This test does not use any "unevaluated" consts, so it should compile just fine. - -fn bind(value: [u8; N]) -> [u8; N] { - todo!() -} - -fn sink(_: [u8; 5]) {} - -fn main() { - let mut arr = Default::default(); - arr = bind(arr); - sink(arr); -} diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs b/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs deleted file mode 100644 index e6f8e4ad3..000000000 --- a/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] //~ WARN the feature `generic_const_exprs` is incomplete - - -fn bind(value: [u8; N + 2]) -> [u8; N * 2] { - todo!() -} - -fn main() { - let mut arr = Default::default(); - arr = bind::<2>(arr); -} diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr deleted file mode 100644 index fe3f24a67..000000000 --- a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr +++ /dev/null @@ -1,11 +0,0 @@ -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(generic_const_exprs)] - | ^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #76560 for more information - = note: `#[warn(incomplete_features)]` on by default - -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 deleted file mode 100644 index c6324bca1..000000000 --- a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// This test would tries to unify `N` with `N + 1` which must fail the occurs check. - -fn bind(value: [u8; N]) -> [u8; N + 1] { - todo!() -} - -fn sink(_: [u8; 5]) {} - -fn main() { - let mut arr = Default::default(); - 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 deleted file mode 100644 index 6b8e688fb..000000000 --- a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/unify-n-nplusone.rs:14:11 - | -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 deleted file mode 100644 index 9d12250c9..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-1.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -trait Bar {} -impl Bar for A<{ 6 + 1 }> {} - -struct A -where - A: Bar; - -fn main() { - let _ = A; //~ERROR the trait bound -} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr deleted file mode 100644 index a3c011d92..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0277]: the trait bound `A<_>: Bar<_>` is not satisfied - --> $DIR/unused-substs-1.rs:12:13 - | -LL | let _ = A; - | ^ the trait `Bar<_>` is not implemented for `A<_>` - | - = help: the trait `Bar` is implemented for `A<7>` -note: required by a bound in `A` - --> $DIR/unused-substs-1.rs:9:11 - | -LL | struct A - | - required by a bound in this -LL | where -LL | A: Bar; - | ^^^^^^ required by this bound in `A` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. 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 deleted file mode 100644 index 9b1212694..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst. -// -// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty` we introduced an -// artificial inference cycle. -struct Foo; - -trait Bind { - fn bind() -> (T, Self); -} - -// `N` has to be `ConstKind::Unevaluated`. -impl Bind for Foo<{ 6 + 1 }> { - fn bind() -> (T, Self) { - (panic!(), Foo) - } -} - -fn main() { - let (mut t, foo) = Foo::bind(); - // `t` is `ty::Infer(TyVar(_#1t))` - // `foo` contains `ty::Infer(TyVar(_#1t))` in its substs - t = foo; - //~^ ERROR mismatched types - //~| NOTE cyclic type -} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-2.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-2.stderr deleted file mode 100644 index 9532fc21a..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/unused-substs-2.rs:25:9 - | -LL | t = foo; - | ^^^ cyclic type of infinite size - -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-3.rs b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs deleted file mode 100644 index d5aeab47e..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst. -// -// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty` we introduced an -// artificial inference cycle. -fn bind() -> (T, [u8; 6 + 1]) { - todo!() -} - -fn main() { - let (mut t, foo) = bind(); - // `t` is `ty::Infer(TyVar(_#1t))` - // `foo` contains `ty::Infer(TyVar(_#1t))` in its substs - t = foo; - //~^ ERROR mismatched types - //~| NOTE cyclic type -} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr deleted file mode 100644 index fd8f8b269..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/unused-substs-3.rs:16:9 - | -LL | t = foo; - | ^^^- help: try using a conversion method: `.to_vec()` - | | - | cyclic type of infinite size - -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-4.rs b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs deleted file mode 100644 index 03c2f5486..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-4.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -fn bind(value: [u8; N]) -> [u8; 3 + 4] { - todo!() -} - -fn main() { - let mut arr = Default::default(); - arr = bind(arr); //~ ERROR mismatched type -} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-4.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-4.stderr deleted file mode 100644 index 5685eedbd..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-4.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/unused-substs-4.rs:10:11 - | -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-5.rs b/src/test/ui/const-generics/occurs-check/unused-substs-5.rs deleted file mode 100644 index 383ab4cd8..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-5.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -// `N + 1` also depends on `T` here even if it doesn't use it. -fn q(_: T) -> [u8; N + 1] { - todo!() -} - -fn supplier() -> T { - todo!() -} - -fn catch_me() where [u8; N + 1]: Default { - let mut x = supplier(); - x = q::<_, N>(x); //~ ERROR mismatched types -} - -fn main() { - catch_me::<3>(); -} diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr deleted file mode 100644 index be289f44f..000000000 --- a/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/unused-substs-5.rs:15:9 - | -LL | x = q::<_, N>(x); - | ^^^^^^^^^^^^- help: try using a conversion method: `.to_vec()` - | | - | cyclic type of infinite size - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/outer-lifetime-in-const-generic-default.rs b/src/test/ui/const-generics/outer-lifetime-in-const-generic-default.rs deleted file mode 100644 index 3018439af..000000000 --- a/src/test/ui/const-generics/outer-lifetime-in-const-generic-default.rs +++ /dev/null @@ -1,10 +0,0 @@ -struct Foo< - 'a, - const N: usize = { - let x: &'a (); - //~^ ERROR use of non-static lifetime `'a` in const generic - 3 - }, ->(&'a ()); - -fn main() {} diff --git a/src/test/ui/const-generics/outer-lifetime-in-const-generic-default.stderr b/src/test/ui/const-generics/outer-lifetime-in-const-generic-default.stderr deleted file mode 100644 index 9d9555d3f..000000000 --- a/src/test/ui/const-generics/outer-lifetime-in-const-generic-default.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0771]: use of non-static lifetime `'a` in const generic - --> $DIR/outer-lifetime-in-const-generic-default.rs:4:17 - | -LL | let x: &'a (); - | ^^ - | - = note: for more information, see issue #74052 - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0771`. diff --git a/src/test/ui/const-generics/overlapping_impls.rs b/src/test/ui/const-generics/overlapping_impls.rs deleted file mode 100644 index e599eadd8..000000000 --- a/src/test/ui/const-generics/overlapping_impls.rs +++ /dev/null @@ -1,36 +0,0 @@ -// check-pass -#![allow(incomplete_features)] -#![feature(adt_const_params)] -#![feature(generic_const_exprs)] -use std::marker::PhantomData; - -struct Foo {} - -const ONE: i32 = 1; -const TWO: i32 = 2; - -impl Foo { - pub fn foo() {} -} - -impl Foo { - pub fn foo() {} -} - - -pub struct Foo2 { - _marker: PhantomData, -} - -#[derive(PartialEq, Eq)] -pub enum Protocol { - Variant1, - Variant2, -} - -pub trait Bar {} - -impl Bar for Foo2<{ Protocol::Variant1 }, T> {} -impl Bar for Foo2<{ Protocol::Variant2 }, T> {} - -fn main() {} diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr deleted file mode 100644 index 9f0b2efae..000000000 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: generic parameters with a default must be trailing - --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:12 - | -LL | struct Bar(T); - | ^ - -error[E0128]: generic parameters with a default cannot use forward declared identifiers - --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21 - | -LL | struct Bar(T); - | ^ defaulted generic parameters cannot be forward declared - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0128`. 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 deleted file mode 100644 index a5e70f6b9..000000000 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error: generic parameters with a default must be trailing - --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:12 - | -LL | struct Bar(T); - | ^ - -error: generic parameters may not be used in const operations - --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:5:44 - | -LL | struct Foo()]>(T, U); - | ^ 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[E0128]: generic parameters with a default cannot use forward declared identifiers - --> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21 - | -LL | struct Bar(T); - | ^ defaulted generic parameters cannot be forward declared - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0128`. 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 deleted file mode 100644 index b24a7afab..000000000 --- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs +++ /dev/null @@ -1,12 +0,0 @@ -// revisions: full min -#![cfg_attr(full, feature(generic_const_exprs))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Foo()]>(T, U); -//[min]~^ ERROR generic parameters may not be used in const operations - -struct Bar(T); -//~^ ERROR generic parameters with a default cannot use forward declared identifiers -//~| ERROR generic parameters with a default - -fn main() {} diff --git a/src/test/ui/const-generics/parent_generics_of_encoding.rs b/src/test/ui/const-generics/parent_generics_of_encoding.rs deleted file mode 100644 index b87e3960f..000000000 --- a/src/test/ui/const-generics/parent_generics_of_encoding.rs +++ /dev/null @@ -1,25 +0,0 @@ -// aux-build:generics_of_parent.rs -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -extern crate generics_of_parent; - -use generics_of_parent::{Foo, S}; - -fn main() { - // regression test for #87603 - const N: usize = 2; - let x: S = S::test(); -} - -// regression test for #87674 -fn new(a: U) -> U { - a -} -fn foo(bar: &mut Foo) -where - [(); N + 1]: , -{ - *bar = new(loop {}); -} 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 deleted file mode 100644 index 7a78e0f10..000000000 --- a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:generics_of_parent_impl_trait.rs -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -extern crate generics_of_parent_impl_trait; - -fn main() { - // check for `impl Trait<{ const }>` which has a parent of a `DefKind::TyParam` - generics_of_parent_impl_trait::foo([()]); - //~^ error: type annotations needed -} diff --git a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr deleted file mode 100644 index 87ff7babe..000000000 --- a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0284]: type annotations needed - --> $DIR/parent_generics_of_encoding_impl_trait.rs:9:5 - | -LL | generics_of_parent_impl_trait::foo([()]); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `foo` - | -note: required by a bound in `foo` - --> $DIR/auxiliary/generics_of_parent_impl_trait.rs:6:48 - | -LL | pub fn foo(foo: impl Into<[(); N + 1]>) { - | ^^^^^ required by this bound in `foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0284`. diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.rs b/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.rs deleted file mode 100644 index 99d8e9dea..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.rs +++ /dev/null @@ -1,16 +0,0 @@ -trait Foo { - fn do_x(&self) -> [u8; N]; -} - -struct Bar; - -const T: usize = 42; - -impl Foo for Bar { -//~^ERROR expected lifetime, type, or constant, found keyword `const` - fn do_x(&self) -> [u8; 3] { - [0u8; 3] - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.stderr b/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.stderr deleted file mode 100644 index 1de24bff4..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-assoc.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: expected lifetime, type, or constant, found keyword `const` - --> $DIR/issue-89013-no-assoc.rs:9:10 - | -LL | impl Foo for Bar { - | ^^^^^ - | -help: the `const` keyword is only needed in the definition of the type - | -LL - impl Foo for Bar { -LL + impl Foo<3> for Bar { - | - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs b/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs deleted file mode 100644 index b126b2485..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs +++ /dev/null @@ -1,18 +0,0 @@ -trait Foo { - fn do_x(&self) -> [u8; N]; -} - -struct Bar; - -const T: usize = 42; - -impl Foo for Bar { -//~^ ERROR this trait takes 1 generic argument but 0 generic arguments were supplied -//~| ERROR associated type bindings are not allowed here -//~| ERROR associated const equality is incomplete - fn do_x(&self) -> [u8; 3] { - [0u8; 3] - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr b/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr deleted file mode 100644 index acfdde8e1..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0658]: associated const equality is incomplete - --> $DIR/issue-89013-no-kw.rs:9:10 - | -LL | impl Foo for Bar { - | ^^^^^ - | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable - -error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied - --> $DIR/issue-89013-no-kw.rs:9:6 - | -LL | impl Foo for Bar { - | ^^^ expected 1 generic argument - | -note: trait defined here, with 1 generic parameter: `N` - --> $DIR/issue-89013-no-kw.rs:1:7 - | -LL | trait Foo { - | ^^^ -------------- -help: add missing generic argument - | -LL | impl Foo for Bar { - | ++ - -error[E0229]: associated type bindings are not allowed here - --> $DIR/issue-89013-no-kw.rs:9:10 - | -LL | impl Foo for Bar { - | ^^^^^ associated type not allowed here - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0107, E0229, E0658. -For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013-type.rs b/src/test/ui/const-generics/parser-error-recovery/issue-89013-type.rs deleted file mode 100644 index 0ec6762b6..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013-type.rs +++ /dev/null @@ -1,16 +0,0 @@ -trait Foo { - fn do_x(&self) -> [u8; N]; -} - -struct Bar; - -const T: usize = 42; - -impl Foo for Bar { -//~^ERROR missing type to the right of `=` - fn do_x(&self) -> [u8; 3] { - [0u8; 3] - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013-type.stderr b/src/test/ui/const-generics/parser-error-recovery/issue-89013-type.stderr deleted file mode 100644 index f0d0d90c7..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013-type.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: missing type to the right of `=` - --> $DIR/issue-89013-type.rs:9:13 - | -LL | impl Foo for Bar { - | ^---- expected type, found keyword `type` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013.rs b/src/test/ui/const-generics/parser-error-recovery/issue-89013.rs deleted file mode 100644 index 9431779fa..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013.rs +++ /dev/null @@ -1,19 +0,0 @@ -trait Foo { - fn do_x(&self) -> [u8; N]; -} - -struct Bar; - -const T: usize = 42; - -impl Foo for Bar { -//~^ ERROR expected lifetime, type, or constant, found keyword `const` -//~| ERROR this trait takes 1 generic -//~| ERROR associated type bindings are not allowed here -//~| ERROR associated const equality is incomplete - fn do_x(&self) -> [u8; 3] { - [0u8; 3] - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/parser-error-recovery/issue-89013.stderr b/src/test/ui/const-generics/parser-error-recovery/issue-89013.stderr deleted file mode 100644 index 583749a85..000000000 --- a/src/test/ui/const-generics/parser-error-recovery/issue-89013.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error: expected lifetime, type, or constant, found keyword `const` - --> $DIR/issue-89013.rs:9:14 - | -LL | impl Foo for Bar { - | ^^^^^ - | -help: the `const` keyword is only needed in the definition of the type - | -LL - impl Foo for Bar { -LL + impl Foo for Bar { - | - -error[E0658]: associated const equality is incomplete - --> $DIR/issue-89013.rs:9:10 - | -LL | impl Foo for Bar { - | ^^^^^^^^^^^ - | - = note: see issue #92827 for more information - = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable - -error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied - --> $DIR/issue-89013.rs:9:6 - | -LL | impl Foo for Bar { - | ^^^ expected 1 generic argument - | -note: trait defined here, with 1 generic parameter: `N` - --> $DIR/issue-89013.rs:1:7 - | -LL | trait Foo { - | ^^^ -------------- -help: add missing generic argument - | -LL | impl Foo for Bar { - | ++ - -error[E0229]: associated type bindings are not allowed here - --> $DIR/issue-89013.rs:9:10 - | -LL | impl Foo for Bar { - | ^^^^^^^^^^^ associated type not allowed here - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0107, E0229, E0658. -For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/const-generics/projection-as-arg-const.rs b/src/test/ui/const-generics/projection-as-arg-const.rs deleted file mode 100644 index 903548c75..000000000 --- a/src/test/ui/const-generics/projection-as-arg-const.rs +++ /dev/null @@ -1,20 +0,0 @@ -// This is currently not possible to use projections as const generics. -// More information about this available here: -// https://github.com/rust-lang/rust/pull/104443#discussion_r1029375633 - -pub trait Identity { - type Identity; -} - -impl Identity for T { - type Identity = Self; -} - -pub fn foo::Identity>() { -//~^ ERROR - assert!(X == 12); -} - -fn main() { - foo::<12>(); -} diff --git a/src/test/ui/const-generics/projection-as-arg-const.stderr b/src/test/ui/const-generics/projection-as-arg-const.stderr deleted file mode 100644 index 803ed9c95..000000000 --- a/src/test/ui/const-generics/projection-as-arg-const.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `::Identity` is forbidden as the type of a const generic parameter - --> $DIR/projection-as-arg-const.rs:13:21 - | -LL | pub fn foo::Identity>() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/promotion.rs b/src/test/ui/const-generics/promotion.rs deleted file mode 100644 index ce9a1a0fe..000000000 --- a/src/test/ui/const-generics/promotion.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-pass -// tests that promoting expressions containing const parameters is allowed. -fn promotion_test() -> &'static usize { - &(3 + N) -} - -fn main() { - assert_eq!(promotion_test::<13>(), &16); -} diff --git a/src/test/ui/const-generics/raw-ptr-const-param-deref.full.stderr b/src/test/ui/const-generics/raw-ptr-const-param-deref.full.stderr deleted file mode 100644 index 657eee2be..000000000 --- a/src/test/ui/const-generics/raw-ptr-const-param-deref.full.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0741]: using raw pointers as const generic parameters is forbidden - --> $DIR/raw-ptr-const-param-deref.rs:9:23 - | -LL | struct Const; - | ^^^^^^^^^^ - -error[E0741]: using raw pointers as const generic parameters is forbidden - --> $DIR/raw-ptr-const-param-deref.rs:11:15 - | -LL | impl Const

{ - | ^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/raw-ptr-const-param-deref.min.stderr b/src/test/ui/const-generics/raw-ptr-const-param-deref.min.stderr deleted file mode 100644 index 04bc46cb4..000000000 --- a/src/test/ui/const-generics/raw-ptr-const-param-deref.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: using raw pointers as const generic parameters is forbidden - --> $DIR/raw-ptr-const-param-deref.rs:9:23 - | -LL | struct Const; - | ^^^^^^^^^^ - -error: using raw pointers as const generic parameters is forbidden - --> $DIR/raw-ptr-const-param-deref.rs:11:15 - | -LL | impl Const

{ - | ^^^^^^^^^^ - -error: aborting due to 2 previous errors - 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 deleted file mode 100644 index 65595f07d..000000000 --- a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Checks that pointers must not be used as the type of const params. -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -const A: u32 = 3; - -struct Const; //~ ERROR: using raw pointers as const generic parameters - -impl Const

{ //~ ERROR: using raw pointers as const generic parameters - fn get() -> u32 { - unsafe { - *P - } - } -} - -fn main() { - assert_eq!(Const::<{&A as *const _}>::get(), 3) -} diff --git a/src/test/ui/const-generics/raw-ptr-const-param.full.stderr b/src/test/ui/const-generics/raw-ptr-const-param.full.stderr deleted file mode 100644 index 69f1aae56..000000000 --- a/src/test/ui/const-generics/raw-ptr-const-param.full.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0741]: using raw pointers as const generic parameters is forbidden - --> $DIR/raw-ptr-const-param.rs:6:23 - | -LL | struct Const; - | ^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0741`. diff --git a/src/test/ui/const-generics/raw-ptr-const-param.min.stderr b/src/test/ui/const-generics/raw-ptr-const-param.min.stderr deleted file mode 100644 index 310422aaf..000000000 --- a/src/test/ui/const-generics/raw-ptr-const-param.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: using raw pointers as const generic parameters is forbidden - --> $DIR/raw-ptr-const-param.rs:6:23 - | -LL | struct Const; - | ^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/raw-ptr-const-param.rs b/src/test/ui/const-generics/raw-ptr-const-param.rs deleted file mode 100644 index 27ef9e7d9..000000000 --- a/src/test/ui/const-generics/raw-ptr-const-param.rs +++ /dev/null @@ -1,11 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Const; //~ ERROR: using raw pointers as const generic parameters - -fn main() { - let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>; - let _: Const<{ 10 as *const _ }> = Const::<{ 10 as *const _ }>; -} diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.full.stderr b/src/test/ui/const-generics/slice-const-param-mismatch.full.stderr deleted file mode 100644 index 80dd1be33..000000000 --- a/src/test/ui/const-generics/slice-const-param-mismatch.full.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/slice-const-param-mismatch.rs:14:35 - | -LL | let _: ConstString<"Hello"> = ConstString::<"World">; - | -------------------- ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"` - | | - | expected due to this - | - = note: expected struct `ConstString<"Hello">` - found struct `ConstString<"World">` - -error[E0308]: mismatched types - --> $DIR/slice-const-param-mismatch.rs:16:33 - | -LL | let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; - | ------------------- ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"` - | | - | expected due to this - | - = note: expected struct `ConstString<"ℇ㇈↦">` - found struct `ConstString<"ℇ㇈↥">` - -error[E0308]: mismatched types - --> $DIR/slice-const-param-mismatch.rs:18:33 - | -LL | let _: ConstBytes = ConstBytes::; - | ------------------ ^^^^^^^^^^^^^^^^^^^^ expected `b"AAA"`, found `b"BBB"` - | | - | expected due to this - | - = note: expected struct `ConstBytes` - found struct `ConstBytes` - -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/slice-const-param-mismatch.min.stderr b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr deleted file mode 100644 index fed802f6a..000000000 --- a/src/test/ui/const-generics/slice-const-param-mismatch.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-mismatch.rs:7:29 - | -LL | struct ConstString; - | ^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `&'static [u8]` is forbidden as the type of a const generic parameter - --> $DIR/slice-const-param-mismatch.rs:9:28 - | -LL | struct ConstBytes; - | ^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 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 deleted file mode 100644 index 7127323e5..000000000 --- a/src/test/ui/const-generics/slice-const-param-mismatch.rs +++ /dev/null @@ -1,19 +0,0 @@ -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - - -struct ConstString; -//[min]~^ ERROR -struct ConstBytes; -//[min]~^ ERROR - -pub fn main() { - let _: ConstString<"Hello"> = ConstString::<"Hello">; - let _: ConstString<"Hello"> = ConstString::<"World">; //[full]~ ERROR mismatched types - let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↦">; - let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; //[full]~ ERROR mismatched types - let _: ConstBytes = ConstBytes::<{&[0x41, 0x41, 0x41]}>; - let _: ConstBytes = ConstBytes::; //[full]~ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/slice-const-param.rs b/src/test/ui/const-generics/slice-const-param.rs deleted file mode 100644 index 05d21e08d..000000000 --- a/src/test/ui/const-generics/slice-const-param.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-pass - -#![feature(adt_const_params)] -#![allow(incomplete_features)] - -pub fn function_with_str() -> &'static str { - STRING -} - -pub fn function_with_bytes() -> &'static [u8] { - BYTES -} - -pub fn main() { - assert_eq!(function_with_str::<"Rust">(), "Rust"); - assert_eq!(function_with_str::<"ℇ㇈↦">(), "ℇ㇈↦"); - assert_eq!(function_with_bytes::(), &[0x41, 0x41, 0x41, 0x41]); - assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA"); -} diff --git a/src/test/ui/const-generics/sneaky-array-repeat-expr.rs b/src/test/ui/const-generics/sneaky-array-repeat-expr.rs deleted file mode 100644 index b147c246b..000000000 --- a/src/test/ui/const-generics/sneaky-array-repeat-expr.rs +++ /dev/null @@ -1,32 +0,0 @@ -trait Trait { - const Assoc: usize; -} - -impl Trait for () { - const Assoc: usize = 1; -} - - -pub const fn foo() where (): Trait { - let bar = [(); <()>::Assoc]; - //~^ error: constant expression depends on a generic parameter -} - -trait Trait2 { - const Assoc2: usize; -} - -impl Trait2 for () { - const Assoc2: usize = N - 1; -} - - -pub const fn foo2() where (): Trait2 { - let bar2 = [(); <()>::Assoc2]; - //~^ error: constant expression depends on a generic parameter -} - -fn main() { - foo::<0>(); - foo2::<0>(); -} diff --git a/src/test/ui/const-generics/sneaky-array-repeat-expr.stderr b/src/test/ui/const-generics/sneaky-array-repeat-expr.stderr deleted file mode 100644 index 5c77375d3..000000000 --- a/src/test/ui/const-generics/sneaky-array-repeat-expr.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: constant expression depends on a generic parameter - --> $DIR/sneaky-array-repeat-expr.rs:11:20 - | -LL | let bar = [(); <()>::Assoc]; - | ^^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error: constant expression depends on a generic parameter - --> $DIR/sneaky-array-repeat-expr.rs:25:21 - | -LL | let bar2 = [(); <()>::Assoc2]; - | ^^^^^^^^^^^^ - | - = 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/std/const-generics-range.min.stderr b/src/test/ui/const-generics/std/const-generics-range.min.stderr deleted file mode 100644 index d4b2ad6fd..000000000 --- a/src/test/ui/const-generics/std/const-generics-range.min.stderr +++ /dev/null @@ -1,56 +0,0 @@ -error: `std::ops::Range` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:7:24 - | -LL | struct _Range>; - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `RangeFrom` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:12:28 - | -LL | struct _RangeFrom>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `RangeFull` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:17:28 - | -LL | struct _RangeFull; - | ^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `RangeInclusive` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:23:33 - | -LL | struct _RangeInclusive>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `RangeTo` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:28:26 - | -LL | struct _RangeTo>; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: `RangeToInclusive` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:33:35 - | -LL | struct _RangeToInclusive>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 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 deleted file mode 100644 index 46c06f312..000000000 --- a/src/test/ui/const-generics/std/const-generics-range.rs +++ /dev/null @@ -1,37 +0,0 @@ -// [full] check-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -// `Range` should be usable within const generics: -struct _Range>; -//[min]~^ ERROR `std::ops::Range` is forbidden -const RANGE : _Range<{ 0 .. 1000 }> = _Range; - -// `RangeFrom` should be usable within const generics: -struct _RangeFrom>; -//[min]~^ ERROR `RangeFrom` is forbidden -const RANGE_FROM : _RangeFrom<{ 0 .. }> = _RangeFrom; - -// `RangeFull` should be usable within const generics: -struct _RangeFull; -//[min]~^ ERROR `RangeFull` is forbidden -const RANGE_FULL : _RangeFull<{ .. }> = _RangeFull; - -// Regression test for #70155 -// `RangeInclusive` should be usable within const generics: -struct _RangeInclusive>; -//[min]~^ ERROR `RangeInclusive` is forbidden -const RANGE_INCLUSIVE : _RangeInclusive<{ 0 ..= 999 }> = _RangeInclusive; - -// `RangeTo` should be usable within const generics: -struct _RangeTo>; -//[min]~^ ERROR `RangeTo` is forbidden -const RANGE_TO : _RangeTo<{ .. 1000 }> = _RangeTo; - -// `RangeToInclusive` should be usable within const generics: -struct _RangeToInclusive>; -//[min]~^ ERROR `RangeToInclusive` is forbidden -const RANGE_TO_INCLUSIVE : _RangeToInclusive<{ ..= 999 }> = _RangeToInclusive; - -pub fn main() {} 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 deleted file mode 100644 index be1c4b0e8..000000000 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Checks that a const param cannot be stored in a struct. - -struct S(C); //~ ERROR expected type, found const parameter - -fn main() {} 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 deleted file mode 100644 index 67f497af5..000000000 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0573]: expected type, found const parameter `C` - --> $DIR/struct-with-invalid-const-param.rs:3: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/suggest_const_for_array.rs b/src/test/ui/const-generics/suggest_const_for_array.rs deleted file mode 100644 index f3e5a3186..000000000 --- a/src/test/ui/const-generics/suggest_const_for_array.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_type = "lib"] - -fn example() {} - -fn other() { - example::<[usize; 3]>(); - //~^ ERROR type provided when a const - example::<[usize; 4+5]>(); - //~^ ERROR type provided when a const -} diff --git a/src/test/ui/const-generics/suggest_const_for_array.stderr b/src/test/ui/const-generics/suggest_const_for_array.stderr deleted file mode 100644 index a617bf2bb..000000000 --- a/src/test/ui/const-generics/suggest_const_for_array.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0747]: type provided when a constant was expected - --> $DIR/suggest_const_for_array.rs:6:13 - | -LL | example::<[usize; 3]>(); - | ^^^^^^^^^^ help: array type provided where a `usize` was expected, try: `{ 3 }` - -error[E0747]: type provided when a constant was expected - --> $DIR/suggest_const_for_array.rs:8:13 - | -LL | example::<[usize; 4+5]>(); - | ^^^^^^^^^^^^ help: array type provided where a `usize` was expected, try: `{ 4+5 }` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/trait-const-args.rs b/src/test/ui/const-generics/trait-const-args.rs deleted file mode 100644 index 2cdef3fb4..000000000 --- a/src/test/ui/const-generics/trait-const-args.rs +++ /dev/null @@ -1,27 +0,0 @@ -// check-pass - -struct Const; -trait Foo {} - -impl Foo for Const {} - -fn foo_impl(_: impl Foo<3>) {} - -fn foo_explicit>(_: T) {} - -fn foo_where(_: T) -where - T: Foo<3>, -{ -} - -fn main() { - foo_impl(Const); - foo_impl(Const::<3>); - - foo_explicit(Const); - foo_explicit(Const::<3>); - - foo_where(Const); - foo_where(Const::<3>); -} 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 deleted file mode 100644 index 039c4276c..000000000 --- a/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: `&'static ()` is forbidden as the type of a const generic parameter - --> $DIR/transmute-const-param-static-reference.rs:7:23 - | -LL | struct Const; - | ^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to previous error - diff --git a/src/test/ui/const-generics/transmute-const-param-static-reference.rs b/src/test/ui/const-generics/transmute-const-param-static-reference.rs deleted file mode 100644 index 6b443c8bd..000000000 --- a/src/test/ui/const-generics/transmute-const-param-static-reference.rs +++ /dev/null @@ -1,16 +0,0 @@ -// revisions: full min -//[full] check-pass - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Const; -//[min]~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter - -fn main() { - const A: &'static () = unsafe { - std::mem::transmute(10 as *const ()) - }; - - let _ = Const::<{A}>; -} diff --git a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs deleted file mode 100644 index 926e807fe..000000000 --- a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -// revisions: full min - -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -use std::mem::MaybeUninit; - -#[repr(transparent)] -pub struct MaybeUninitWrapper(MaybeUninit<[u64; N]>); - -fn main() {} diff --git a/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs b/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs deleted file mode 100644 index 2ae0ae70d..000000000 --- a/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs +++ /dev/null @@ -1,33 +0,0 @@ -// check-pass -#![feature(generic_const_exprs)] -#![allow(incomplete_features)] - -struct Num; - -trait NumT { - const VALUE: usize; -} - -impl NumT for Num { - const VALUE: usize = N; -} - -struct Foo<'a, N: NumT>(&'a [u32; N::VALUE]) where [(); N::VALUE]:; - -trait Bar { - type Size: NumT; - - fn bar<'a>(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: { - todo!(); - } -} - -trait Baz<'a> { - type Size: NumT; - - fn baz(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: { - todo!(); - } -} - -fn main() {} diff --git a/src/test/ui/const-generics/type-after-const-ok.min.stderr b/src/test/ui/const-generics/type-after-const-ok.min.stderr deleted file mode 100644 index ad38754c7..000000000 --- a/src/test/ui/const-generics/type-after-const-ok.min.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: type parameters must be declared prior to const parameters - --> $DIR/type-after-const-ok.rs:8: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/type-after-const-ok.rs b/src/test/ui/const-generics/type-after-const-ok.rs deleted file mode 100644 index f37b0b102..000000000 --- a/src/test/ui/const-generics/type-after-const-ok.rs +++ /dev/null @@ -1,6 +0,0 @@ -// run-pass -// Verifies that having generic parameters after constants is permitted -#[allow(dead_code)] -struct A(T); - -fn main() {} 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 deleted file mode 100644 index 5dfcbba0e..000000000 --- a/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub struct Struct(()); - -impl Struct { - pub fn new() -> Self { - Struct(()) - } - - pub fn same_ty(&self) -> (usize, usize) { - (N, M) - } - - pub fn different_ty(&self) -> (usize, u8) { - (N, M) - } - - pub fn containing_ty(&self) -> (usize, u8) { - (std::mem::size_of::() + N, M) - } - - pub fn we_have_to_go_deeper(&self) -> Struct { - Struct(()) - } -} - -pub trait Foo { - fn foo(&self) -> usize; -} - -impl Foo for Struct<7> { - fn foo(&self) -> usize { - M - } -} 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 deleted file mode 100644 index e84414834..000000000 --- a/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -// revisions: full min -#![cfg_attr(full, feature(generic_const_exprs))] -#![allow(incomplete_features)] - -struct Foo; - -impl Foo { - fn foo(&self) -> usize { - let f = self; - f.bar::<{ - let f = Foo; - f.bar::<7>() - }>() + N - } - - const fn bar(&self) -> usize { - M - } -} - -fn main() { - let f = Foo; - - assert_eq!(f.foo::<13>(), 20) -} diff --git a/src/test/ui/const-generics/type-dependent/issue-61936.rs b/src/test/ui/const-generics/type-dependent/issue-61936.rs deleted file mode 100644 index 7216b25f0..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-61936.rs +++ /dev/null @@ -1,47 +0,0 @@ -// run-pass - -trait SliceExt { - fn array_windows_example<'a, const N: usize>(&'a self) -> ArrayWindowsExample<'a, T, N>; -} - -impl SliceExt for [T] { - fn array_windows_example<'a, const N: usize>(&'a self) -> ArrayWindowsExample<'a, T, N> { - ArrayWindowsExample{ idx: 0, slice: &self } - } -} - -struct ArrayWindowsExample<'a, T, const N: usize> { - slice: &'a [T], - idx: usize, -} - -impl <'a, T: Clone, const N: usize> Iterator for ArrayWindowsExample<'a, T, N> { - type Item = [T; N]; - fn next(&mut self) -> Option { - // Note: this is unsound for some `T` and not meant as an example - // on how to implement `ArrayWindows`. - let mut res = unsafe{ std::mem::zeroed() }; - let mut ptr = &mut res as *mut [T; N] as *mut T; - - for i in 0..N { - match self.slice[self.idx..].get(i) { - None => return None, - Some(elem) => unsafe { std::ptr::write_volatile(ptr, elem.clone())}, - }; - ptr = ptr.wrapping_add(1); - self.idx += 1; - } - - Some(res) - } -} - -const FOUR: usize = 4; - -fn main() { - let v: Vec = vec![0; 100]; - - for array in v.as_slice().array_windows_example::() { - assert_eq!(array, [0, 0, 0, 0]) - } -} diff --git a/src/test/ui/const-generics/type-dependent/issue-63695.rs b/src/test/ui/const-generics/type-dependent/issue-63695.rs deleted file mode 100644 index 08b6d4bf5..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-63695.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -trait T { - fn test(&self) -> i32 { A } -} - -struct S(); - -impl T for S {} - -fn main() { - let foo = S(); - assert_eq!(foo.test::<8i32>(), 8); - assert_eq!(foo.test::<16i32>(), 16); -} 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 deleted file mode 100644 index 27dd51de2..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-67144-1.rs +++ /dev/null @@ -1,25 +0,0 @@ -// check-pass -struct X; - -impl X { - pub fn getn(&self) -> [u8; N] { - getn::() - } -} - -fn getn() -> [u8; N] { - unsafe { - std::mem::zeroed() - } -} - -fn main() { - // works - let [a,b,c] = getn::<3>(); - - // cannot pattern-match on an array without a fixed length - let [a,b,c] = X.getn::<3>(); - - // mismatched types, expected array `[u8; 3]` found array `[u8; _]` - let arr: [u8; 3] = X.getn::<3>(); -} 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 deleted file mode 100644 index b26f551eb..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-67144-2.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-pass -struct A; - -struct X; - -impl X { - fn inner() -> A { - outer::() - } -} - -fn outer() -> A { - A -} - -fn main() { - let i: A<3usize> = outer::<3usize>(); - let o: A<3usize> = X::inner::<3usize>(); -} diff --git a/src/test/ui/const-generics/type-dependent/issue-69816.rs b/src/test/ui/const-generics/type-dependent/issue-69816.rs deleted file mode 100644 index cbb6b398e..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-69816.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -trait IterExt: Sized + Iterator { - fn default_for_size(self) -> [Self::Item; N] - where - [Self::Item; N]: Default, - { - Default::default() - } -} - -impl IterExt for T {} - -fn main(){ - const N: usize = 10; - let arr = (0u32..10).default_for_size::(); - assert_eq!(arr, [0; 10]); -} diff --git a/src/test/ui/const-generics/type-dependent/issue-70217.rs b/src/test/ui/const-generics/type-dependent/issue-70217.rs deleted file mode 100644 index 933ca0276..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-70217.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass - -struct Struct; - -impl Struct { - fn method(&self) {} -} - -fn test(x: Struct) { - Struct::::method::(&x); - x.method::(); -} - -fn main() {} diff --git a/src/test/ui/const-generics/type-dependent/issue-70507.rs b/src/test/ui/const-generics/type-dependent/issue-70507.rs deleted file mode 100644 index c72d9fbec..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-70507.rs +++ /dev/null @@ -1,45 +0,0 @@ -// run-pass - -trait ConstChunksExactTrait { - fn const_chunks_exact(&self) -> ConstChunksExact<'_, T, {N}>; -} - -impl ConstChunksExactTrait for [T] { - fn const_chunks_exact(&self) -> ConstChunksExact<'_, T, {N}> { - assert!(N != 0); - let rem = self.len() % N; - let len = self.len() - rem; - let (fst, _) = self.split_at(len); - ConstChunksExact { v: fst, } - } -} - -struct ConstChunksExact<'a, T: 'a, const N: usize> { - v: &'a [T], -} - -impl <'a, T: std::fmt::Debug, const N: usize> Iterator for ConstChunksExact<'a, T, {N}> { - type Item = &'a [T; N]; - - fn next(&mut self) -> Option { - if self.v.len() < N { - None - } else { - let (fst, snd) = self.v.split_at(N); - - self.v = snd; - let ptr = fst.as_ptr() as *const _; - Some(unsafe { &*ptr}) - } - } -} - -fn main() { - let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - - let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); - - for a in slice.const_chunks_exact::<3>() { - assert_eq!(a, iter.next().unwrap()); - } -} diff --git a/src/test/ui/const-generics/type-dependent/issue-70586.rs b/src/test/ui/const-generics/type-dependent/issue-70586.rs deleted file mode 100644 index 346ac4b72..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-70586.rs +++ /dev/null @@ -1,30 +0,0 @@ -// check-pass -use std::marker::PhantomData; - -// This namespace is necessary for the ICE to trigger -struct Namespace; - -impl Namespace { - pub fn const_chunks_exact() -> ConstChunksExact<'static, T, N> { - ConstChunksExact { inner: PhantomData } - } -} - - -#[derive(Debug)] -pub struct ConstChunksExact<'a, T, const N: usize> { - inner: PhantomData<&'a T> -} - -impl <'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, { N }> { - type Item = &'a [T; N]; - - fn next(&mut self) -> Option { - unreachable!() - } -} - -fn main() { - let mut chunks = Namespace::const_chunks_exact::(); - let _next: &[i32; 3] = chunks.next().unwrap(); -} 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 deleted file mode 100644 index b8fbb3979..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/issue-71348.rs:10:24 - | -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(adt_const_params)]` - -error: `&'static str` is forbidden as the type of a const generic parameter - --> $DIR/issue-71348.rs:18:25 - | -LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a >::Target - | ^^^^^^^^^^^^ - | - = note: the only supported types are integers, `bool` and `char` - = help: more complex types are supported with `#![feature(adt_const_params)]` - -error: aborting due to 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 deleted file mode 100644 index 2ef2f066a..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71348.rs +++ /dev/null @@ -1,38 +0,0 @@ -// [full] run-pass -// revisions: full min -#![cfg_attr(full, feature(adt_const_params))] -#![cfg_attr(full, allow(incomplete_features))] - -struct Foo { - i: i32, -} - -trait Get<'a, const N: &'static str> { - //[min]~^ ERROR `&'static str` is forbidden as the type of a const generic parameter - type Target: 'a; - - fn get(&'a self) -> &'a Self::Target; -} - -impl Foo { - fn ask<'a, const N: &'static str>(&'a self) -> &'a >::Target - //[min]~^ ERROR `&'static str` is forbidden as the type of a const generic parameter - where - Self: Get<'a, N>, - { - self.get() - } -} - -impl<'a> Get<'a, "int"> for Foo { - type Target = i32; - - fn get(&'a self) -> &'a Self::Target { - &self.i - } -} - -fn main() { - let foo = Foo { i: 123 }; - assert_eq!(foo.ask::<"int">(), &123); -} diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.rs b/src/test/ui/const-generics/type-dependent/issue-71382.rs deleted file mode 100644 index 1c4073e36..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71382.rs +++ /dev/null @@ -1,21 +0,0 @@ -struct Test; - -fn pass() -> u8 { - 42 -} - -impl Test { - pub fn call_me(&self) -> u8 { - self.test::() - } - - fn test u8>(&self) -> u8 { - //~^ ERROR using function pointers as const generic parameters is forbidden - FN() - } -} - -fn main() { - let x = Test; - assert_eq!(x.call_me(), 42); -} diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.stderr deleted file mode 100644 index ad522aead..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71382.stderr +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 060b89964..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-71805.rs +++ /dev/null @@ -1,38 +0,0 @@ -// run-pass -use std::mem::MaybeUninit; - -trait CollectSlice<'a>: Iterator { - fn inner_array(&mut self) -> [Self::Item; N]; - - fn collect_array(&mut self) -> [Self::Item; N] { - let result = self.inner_array(); - assert!(self.next().is_none()); - result - } -} - -impl<'a, I: ?Sized> CollectSlice<'a> for I -where - I: Iterator, -{ - fn inner_array(&mut self) -> [Self::Item; N] { - let mut result: [MaybeUninit; N] = - unsafe { MaybeUninit::uninit().assume_init() }; - - let mut count = 0; - for (dest, item) in result.iter_mut().zip(self) { - *dest = MaybeUninit::new(item); - count += 1; - } - - assert_eq!(N, count); - - let temp_ptr: *const [MaybeUninit; N] = &result; - unsafe { std::ptr::read(temp_ptr as *const [Self::Item; N]) } - } -} - -fn main() { - let mut foos = [0u64; 9].iter().cloned(); - let _bar: [u64; 9] = foos.collect_array::<9_usize>(); -} diff --git a/src/test/ui/const-generics/type-dependent/issue-73730.rs b/src/test/ui/const-generics/type-dependent/issue-73730.rs deleted file mode 100644 index 5e1b8c635..000000000 --- a/src/test/ui/const-generics/type-dependent/issue-73730.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass -trait Foo<'a, A>: Iterator { - fn bar(&mut self) -> *const [A; N]; -} - -impl<'a, A, I: ?Sized> Foo<'a, A> for I where I: Iterator { - fn bar(&mut self) -> *const [A; N] { - std::ptr::null() - } -} - -fn main() { - (0_u8 .. 10).bar::<10_usize>(); -} diff --git a/src/test/ui/const-generics/type-dependent/non-local.rs b/src/test/ui/const-generics/type-dependent/non-local.rs deleted file mode 100644 index b755de30b..000000000 --- a/src/test/ui/const-generics/type-dependent/non-local.rs +++ /dev/null @@ -1,21 +0,0 @@ -// aux-build:type_dependent_lib.rs -// run-pass -extern crate type_dependent_lib; - -use type_dependent_lib::*; - -fn main() { - let s = Struct::<42>::new(); - assert_eq!(s.same_ty::<7>(), (42, 7)); - assert_eq!(s.different_ty::<19>(), (42, 19)); - assert_eq!(Struct::<1337>::new().different_ty::<96>(), (1337, 96)); - assert_eq!( - Struct::<18>::new() - .we_have_to_go_deeper::<19>() - .containing_ty::, 3>(), - (27, 3), - ); - - let s = Struct::<7>::new(); - assert_eq!(s.foo::<18>(), 18); -} diff --git a/src/test/ui/const-generics/type-dependent/qpath.rs b/src/test/ui/const-generics/type-dependent/qpath.rs deleted file mode 100644 index 2d678d0ac..000000000 --- a/src/test/ui/const-generics/type-dependent/qpath.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-pass -struct A; -impl A { - fn foo() -> usize { N + 1 } -} - -fn main() { - assert_eq!(A::foo::<7>(), 8); -} diff --git a/src/test/ui/const-generics/type-dependent/simple.rs b/src/test/ui/const-generics/type-dependent/simple.rs deleted file mode 100644 index 1b13133b5..000000000 --- a/src/test/ui/const-generics/type-dependent/simple.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-pass -struct R; - -impl R { - fn method(&self) -> u8 { N } -} -fn main() { - assert_eq!(R.method::<1u8>(), 1); -} 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 deleted file mode 100644 index 70bc64057..000000000 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:8:27 - | -LL | assert_eq!(R.method::<1u16>(), 1); - | ^^^^ expected `u8`, found `u16` - | -help: change the type of the numeric literal from `u16` to `u8` - | -LL | assert_eq!(R.method::<1u8>(), 1); - | ~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. 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 deleted file mode 100644 index 70bc64057..000000000 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:8:27 - | -LL | assert_eq!(R.method::<1u16>(), 1); - | ^^^^ expected `u8`, found `u16` - | -help: change the type of the numeric literal from `u16` to `u8` - | -LL | assert_eq!(R.method::<1u8>(), 1); - | ~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.rs b/src/test/ui/const-generics/type-dependent/type-mismatch.rs deleted file mode 100644 index 3335ab870..000000000 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.rs +++ /dev/null @@ -1,10 +0,0 @@ -// revisions: full min -struct R; - -impl R { - fn method(&self) -> u8 { N } -} -fn main() { - assert_eq!(R.method::<1u16>(), 1); - //~^ ERROR mismatched types -} diff --git a/src/test/ui/const-generics/type_mismatch.rs b/src/test/ui/const-generics/type_mismatch.rs deleted file mode 100644 index 4a7534e37..000000000 --- a/src/test/ui/const-generics/type_mismatch.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn foo() -> [u8; N] { - bar::() //~ ERROR mismatched types -} - -fn bar() -> [u8; N] {} -//~^ ERROR mismatched types -//~| ERROR mismatched types - -fn main() {} diff --git a/src/test/ui/const-generics/type_mismatch.stderr b/src/test/ui/const-generics/type_mismatch.stderr deleted file mode 100644 index 8d779bee2..000000000 --- a/src/test/ui/const-generics/type_mismatch.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/type_mismatch.rs:2:11 - | -LL | bar::() - | ^ expected `u8`, found `usize` - -error[E0308]: mismatched types - --> $DIR/type_mismatch.rs:5:26 - | -LL | fn bar() -> [u8; N] {} - | --- ^^^^^^^ expected array `[u8; N]`, found `()` - | | - | implicitly returns `()` as its body has no tail or `return` expression - -error[E0308]: mismatched types - --> $DIR/type_mismatch.rs:5:31 - | -LL | fn bar() -> [u8; N] {} - | ^ expected `usize`, found `u8` - -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/type_not_in_scope.rs b/src/test/ui/const-generics/type_not_in_scope.rs deleted file mode 100644 index 593370180..000000000 --- a/src/test/ui/const-generics/type_not_in_scope.rs +++ /dev/null @@ -1,11 +0,0 @@ -impl X { - //~^ ERROR cannot find type - fn getn() -> [u8; N] { - getn::() - } -} -fn getn() -> [u8; N] {} -//~^ ERROR expected type, found built-in attribute `cfg_attr` -//~| ERROR mismatched types - -fn main() {} diff --git a/src/test/ui/const-generics/type_not_in_scope.stderr b/src/test/ui/const-generics/type_not_in_scope.stderr deleted file mode 100644 index 16796acb3..000000000 --- a/src/test/ui/const-generics/type_not_in_scope.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0412]: cannot find type `X` in this scope - --> $DIR/type_not_in_scope.rs:1:6 - | -LL | impl X { - | ^ not found in this scope - -error[E0573]: expected type, found built-in attribute `cfg_attr` - --> $DIR/type_not_in_scope.rs:7:18 - | -LL | fn getn() -> [u8; N] {} - | ^^^^^^^^ not a type - -error[E0308]: mismatched types - --> $DIR/type_not_in_scope.rs:7:33 - | -LL | fn getn() -> [u8; N] {} - | ---- ^^^^^^^ expected array `[u8; N]`, found `()` - | | - | implicitly returns `()` as its body has no tail or `return` expression - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0308, E0412, E0573. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/const-generics/type_of_anon_const.rs b/src/test/ui/const-generics/type_of_anon_const.rs deleted file mode 100644 index fb0d688a8..000000000 --- a/src/test/ui/const-generics/type_of_anon_const.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -trait T { - fn l() -> usize; - fn r() -> bool; -} - -struct S; - -impl T for S { - fn l() -> usize { N } - fn r() -> bool { M } -} - -fn main() { - assert_eq!(>::l::(), 123); - assert!(>::r::()); -} 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 deleted file mode 100644 index b6a22df74..000000000 --- a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:14:41 - | -LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4` - | - = note: expected constant `2` - found constant `4` - -error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:16:41 - | -LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` - | | - | expected due to this - | - = note: expected struct `A<'a, u16, _, _>` - found struct `A<'b, u32, _, _>` - -error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:18:41 - | -LL | let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` - | | - | expected due to this - | - = note: expected struct `A<'a, u16, 4, _>` - found struct `A<'b, u32, 2, _>` - -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/types-mismatch-const-args.min.stderr b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr deleted file mode 100644 index 6ac93a08d..000000000 --- a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:14:41 - | -LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4` - | | - | expected due to this - | - = note: expected struct `A<'_, _, 2, _>` - found struct `A<'_, _, 4, _>` - -error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:16:41 - | -LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` - | | - | expected due to this - | - = note: expected struct `A<'a, u16, _, _>` - found struct `A<'b, u32, _, _>` - -error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:18:41 - | -LL | let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` - | | - | expected due to this - | - = note: expected struct `A<'a, u16, 4, _>` - found struct `A<'b, u32, 2, _>` - -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/types-mismatch-const-args.rs b/src/test/ui/const-generics/types-mismatch-const-args.rs deleted file mode 100644 index 43ef28b26..000000000 --- a/src/test/ui/const-generics/types-mismatch-const-args.rs +++ /dev/null @@ -1,22 +0,0 @@ -// revisions: full min -#![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. - -use std::marker::PhantomData; - -struct A<'a, T, const X: u32, const Y: u32> { - data: PhantomData<&'a T> -} - -fn a<'a, 'b>() { - 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 - let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - //~^ ERROR mismatched types -} - -pub fn main() {} 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 deleted file mode 100644 index c7270e835..000000000 --- a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -use std::fmt; - -struct Array([T; N]); - -impl fmt::Debug for Array { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_list().entries(self.0.iter()).finish() - } -} - -fn main() { - assert_eq!(format!("{:?}", Array([1, 2, 3])), "[1, 2, 3]"); -} 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 deleted file mode 100644 index 191caa78f..000000000 --- a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -use std::fmt; - -struct Array(T); - -impl fmt::Debug for Array<[T; N]> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_list().entries((&self.0 as &[T]).iter()).finish() - } -} - -fn main() { - assert_eq!(format!("{:?}", Array([1, 2, 3])), "[1, 2, 3]"); -} diff --git a/src/test/ui/const-generics/unknown_adt.rs b/src/test/ui/const-generics/unknown_adt.rs deleted file mode 100644 index 8cdd28a8c..000000000 --- a/src/test/ui/const-generics/unknown_adt.rs +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index 0f462dd47..000000000 --- a/src/test/ui/const-generics/unknown_adt.stderr +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index c7f74cfac..000000000 --- a/src/test/ui/const-generics/unused-const-param.rs +++ /dev/null @@ -1,5 +0,0 @@ -// check-pass - -struct A; // ok - -fn main() {} diff --git a/src/test/ui/const-generics/unused-type-param-suggestion.rs b/src/test/ui/const-generics/unused-type-param-suggestion.rs deleted file mode 100644 index 2251512c4..000000000 --- a/src/test/ui/const-generics/unused-type-param-suggestion.rs +++ /dev/null @@ -1,4 +0,0 @@ -#![crate_type="lib"] - -struct Example; -//~^ ERROR parameter diff --git a/src/test/ui/const-generics/unused-type-param-suggestion.stderr b/src/test/ui/const-generics/unused-type-param-suggestion.stderr deleted file mode 100644 index 807065ca1..000000000 --- a/src/test/ui/const-generics/unused-type-param-suggestion.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0392]: parameter `N` is never used - --> $DIR/unused-type-param-suggestion.rs:3:16 - | -LL | struct Example; - | ^ unused parameter - | - = help: consider removing `N`, referring to it in a field, or using a marker such as `PhantomData` - = help: if you intended `N` to be a const parameter, use `const N: usize` instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/const-generics/unused_braces.fixed b/src/test/ui/const-generics/unused_braces.fixed deleted file mode 100644 index d080c210e..000000000 --- a/src/test/ui/const-generics/unused_braces.fixed +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass -// run-rustfix -#![warn(unused_braces)] - -struct A; - -fn main() { - let _: A<7>; // ok - let _: A<7>; //~ WARN unnecessary braces - let _: A<{ 3 + 5 }>; // ok -} diff --git a/src/test/ui/const-generics/unused_braces.full.fixed b/src/test/ui/const-generics/unused_braces.full.fixed deleted file mode 100644 index 46d57e0dc..000000000 --- a/src/test/ui/const-generics/unused_braces.full.fixed +++ /dev/null @@ -1,16 +0,0 @@ -// 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() { - let _: A<7>; // ok - let _: A<7>; //~ WARN unnecessary braces - let _: A<{ 3 + 5 }>; // ok -} diff --git a/src/test/ui/const-generics/unused_braces.min.fixed b/src/test/ui/const-generics/unused_braces.min.fixed deleted file mode 100644 index 46d57e0dc..000000000 --- a/src/test/ui/const-generics/unused_braces.min.fixed +++ /dev/null @@ -1,16 +0,0 @@ -// 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() { - let _: A<7>; // ok - let _: A<7>; //~ WARN unnecessary braces - let _: A<{ 3 + 5 }>; // ok -} diff --git a/src/test/ui/const-generics/unused_braces.rs b/src/test/ui/const-generics/unused_braces.rs deleted file mode 100644 index 47f0f8c1c..000000000 --- a/src/test/ui/const-generics/unused_braces.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass -// run-rustfix -#![warn(unused_braces)] - -struct A; - -fn main() { - let _: A<7>; // ok - let _: A<{ 7 }>; //~ WARN unnecessary braces - let _: A<{ 3 + 5 }>; // ok -} diff --git a/src/test/ui/const-generics/unused_braces.stderr b/src/test/ui/const-generics/unused_braces.stderr deleted file mode 100644 index 553a3a0f8..000000000 --- a/src/test/ui/const-generics/unused_braces.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: unnecessary braces around const expression - --> $DIR/unused_braces.rs:9:14 - | -LL | let _: A<{ 7 }>; - | ^^ ^^ - | -note: the lint level is defined here - --> $DIR/unused_braces.rs:3:9 - | -LL | #![warn(unused_braces)] - | ^^^^^^^^^^^^^ -help: remove these braces - | -LL - let _: A<{ 7 }>; -LL + let _: A<7>; - | - -warning: 1 warning emitted - diff --git a/src/test/ui/const-generics/where-clauses.rs b/src/test/ui/const-generics/where-clauses.rs deleted file mode 100644 index aa3ca1cf6..000000000 --- a/src/test/ui/const-generics/where-clauses.rs +++ /dev/null @@ -1,30 +0,0 @@ -// check-pass -trait Bar { fn bar() {} } -trait Foo: Bar {} - -fn test() where T: Foo { - >::bar(); -} - -struct Faz; - -impl Faz { - fn test() where T: Foo { - >::bar() - } -} - -trait Fiz { - fn fiz() where T: Foo { - >::bar(); - } -} - -impl Bar for u8 {} -impl Foo for u8 {} -impl Fiz for u8 {} -fn main() { - test::(); - Faz::<3>::test::(); - >::fiz::(); -} -- cgit v1.2.3