rust/src/test/ui/consts
ecstatic-morse 60b99015e9
Rollup merge of #76807 - ecstatic-morse:const-checking-staged-api, r=oli-obk
Use const-checking to forbid use of unstable features in const-stable functions

First step towards #76618.

Currently this code isn't ever hit because `qualify_min_const_fn` runs first and catches pretty much everything. One exception is `const_precise_live_drops`, which does not use the newly added code since it runs as part of a separate pass.

Also contains some unrelated refactoring, which is split into separate commits.

r? @oli-obk
2020-09-21 20:40:53 -07:00
..
auxiliary
const_constructor
const_in_pattern pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
const_limit
const-eval Reflect the "do not call this query directly" mentality in its name 2020-09-19 10:57:14 +02:00
const-extern-fn Suppress "const" prefix of FnDef in MIR dump 2020-08-21 00:36:49 +00:00
const-mut-refs
control-flow
min_const_fn Suppress "const" prefix of FnDef in MIR dump 2020-08-21 00:36:49 +00:00
miri_unleashed Bless miri-unleashed tests 2020-09-16 14:17:51 -07:00
rfc-2203-const-array-repeat-exprs pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
std Make Ipv4Addr and Ipv6Addr const tests unit tests under library 2020-09-03 23:17:21 +02:00
array-literal-index-oob.rs
array-literal-index-oob.stderr
array-to-slice-cast.rs
ascii_ctype.rs
assoc_const_generic_impl.rs
assoc_const_generic_impl.stderr
assoc-const.rs
associated_const_generic.rs
bswap-const.rs
cast-discriminant-zst-enum.rs add missing feature flag 2020-09-07 13:05:59 +02:00
chained-constants-stackoverflow.rs
const_arg_local.rs
const_arg_local.stderr
const_arg_promotable2.rs
const_arg_promotable2.stderr
const_arg_promotable.rs
const_arg_promotable.stderr
const_arg_wrapper.rs
const_arg_wrapper.stderr
const_discriminant.rs Separate feature flags 2020-09-07 13:04:41 +02:00
const_fn_return_nested_fn_ptr.rs
const_forget.rs
const_let_assign2.rs
const_let_assign3.rs
const_let_assign3.stderr
const_let_assign.rs
const_let_eq_float.rs
const_let_eq.rs
const_let_irrefutable.rs
const_let_promote.rs
const_let_refutable.rs
const_let_refutable.stderr
const_prop_slice_pat_ice.rs
const_short_circuit.rs
const_unsafe_unreachable_ub.rs
const_unsafe_unreachable_ub.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
const_unsafe_unreachable.rs
const-address-of-interior-mut.rs
const-address-of-interior-mut.stderr
const-address-of-mut.rs
const-address-of-mut.stderr
const-address-of.rs
const-adt-align-mismatch.rs
const-array-oob-arith.rs
const-array-oob-arith.stderr
const-array-oob.rs
const-array-oob.stderr
const-autoderef.rs
const-big-enum.rs
const-binops.rs
const-bitshift-rhs-inference.rs
const-block-cross-crate-fn.rs
const-block-item-macro-codegen.rs
const-block-item.rs
const-block-non-item-statement-3.rs
const-block-non-item-statement-rpass.rs
const-block-non-item-statement.rs
const-block.rs
const-bound.rs
const-byte-str-cast.rs
const-call.rs
const-call.stderr
const-cast-different-types.rs
const-cast-different-types.stderr
const-cast-ptr-int.rs
const-cast-wrong-type.rs
const-cast-wrong-type.stderr
const-cast.rs
const-const.rs
const-contents.rs
const-cross-crate-const.rs
const-cross-crate-extern.rs
const-deref-ptr.rs
const-deref-ptr.stderr
const-deref.rs
const-endianess.rs
const-enum-byref-self.rs
const-enum-byref.rs
const-enum-cast.rs
const-enum-ptr.rs
const-enum-struct2.rs
const-enum-struct.rs
const-enum-structlike.rs
const-enum-tuple2.rs
const-enum-tuple.rs
const-enum-tuplestruct2.rs
const-enum-tuplestruct.rs
const-enum-vec-index.rs
const-enum-vec-ptr.rs
const-enum-vector.rs
const-err2.noopt.stderr
const-err2.opt_with_overflow_checks.stderr
const-err2.opt.stderr
const-err2.rs
const-err4.rs
const-err4.stderr
const-err-early.rs
const-err-early.stderr
const-err-multi.rs
const-err-multi.stderr
const-err-rpass.rs
const-err.rs
const-err.stderr
const-expr-addr-operator.rs
const-expr-in-fixed-length-vec.rs
const-expr-in-vec-repeat.rs
const-extern-function.rs
const-external-macro-const-err.rs
const-external-macro-const-err.stderr
const-fields-and-indexing.rs
const-float-bits-conv.rs Fix compile-flags directive 2020-08-23 10:45:26 -07:00
const-float-classify.rs Fix compile-flags directive 2020-08-23 10:45:26 -07:00
const-fn-const-eval.rs
const-fn-destructuring-arg.rs
const-fn-feature-flags.rs
const-fn-method.rs
const-fn-mismatch.rs
const-fn-mismatch.stderr
const-fn-nested.rs
const-fn-not-in-trait.rs
const-fn-not-in-trait.stderr
const-fn-not-safe-for-const.rs
const-fn-not-safe-for-const.stderr
const-fn-stability-calls-3.rs
const-fn-stability-calls.rs
const-fn-type-name-any.rs
const-fn-type-name.rs
const-fn-val.rs
const-fn-zst-args.rs
const-fn.rs
const-index-feature-gate.rs
const-int-arithmetic-overflow.rs
const-int-arithmetic.rs
const-int-conversion-rpass.rs
const-int-conversion.rs
const-int-conversion.stderr
const-int-overflowing-rpass.rs
const-int-overflowing.rs
const-int-overflowing.stderr
const-int-pow-rpass.rs
const-int-rotate-rpass.rs
const-int-rotate.rs
const-int-rotate.stderr
const-int-saturating-arith.rs
const-int-sign-rpass.rs
const-int-sign.rs
const-int-sign.stderr
const-int-unchecked.rs
const-int-unchecked.stderr
const-int-wrapping-rpass.rs
const-int-wrapping.rs
const-int-wrapping.stderr
const-integer-bool-ops.rs
const-integer-bool-ops.stderr
const-labeled-break.rs
const-len-underflow-separate-spans.rs
const-len-underflow-separate-spans.stderr
const-len-underflow-subspans.rs
const-len-underflow-subspans.stderr
const-match-check.eval1.stderr
const-match-check.eval2.stderr
const-match-check.matchck.stderr
const-match-check.rs
const-match-pattern-arm.rs
const-meth-pattern.rs
const-multi-ref.rs
const-multi-ref.stderr
const-needs_drop.rs
const-negation.rs
const-negative.rs
const-nullary-enum.rs
const-nullary-univariant-enum.rs
const-pattern-irrefutable.rs
const-pattern-irrefutable.stderr
const-pattern-not-const-evaluable.rs
const-pattern-variant.rs
const-points-to-static.rs
const-points-to-static.stderr
const-prop-ice2.rs
const-prop-ice2.stderr
const-prop-ice3.rs
const-prop-ice.rs
const-prop-ice.stderr
const-prop-overflowing-casts.rs
const-prop-read-static-in-const.rs
const-prop-read-static-in-const.stderr
const-ptr-nonnull-rpass.rs
const-ptr-nonnull.rs
const-ptr-nonnull.stderr
const-ptr-unique-rpass.rs
const-ptr-unique.rs
const-ptr-unique.stderr
const-rec-and-tup.rs
const-region-ptrs-noncopy.rs
const-region-ptrs.rs
const-repeated-values.rs
const-size_of_val-align_of_val-extern-type.rs
const-size_of_val-align_of_val-extern-type.stderr
const-size_of_val-align_of_val.rs
const-size_of-align_of.rs
const-size_of-cycle.rs
const-size_of-cycle.stderr Address review comments 2020-09-19 10:36:36 +02:00
const-slice-oob.rs
const-slice-oob.stderr
const-str-ptr.rs
const-struct-offsets.rs
const-struct.rs
const-trait-to-trait.rs
const-tup-index-span.rs
const-tup-index-span.stderr
const-tuple-struct.rs
const-type-mismatch.rs
const-type-mismatch.stderr
const-typeid-of-rpass.rs
const-unit-struct.rs
const-unsafe-fn.rs
const-unsized.rs
const-unsized.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
const-unwrap.rs
const-unwrap.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
const-validation-fail-55455.rs
const-variant-count.rs
const-vec-of-fns.rs
const-vec-syntax.rs
const-vecs-and-slices.rs
const.rs
consts-in-patterns.rs
dangling_raw_ptr.rs
dangling_raw_ptr.stderr
dangling-alloc-id-ice.rs
dangling-alloc-id-ice.stderr
deref_in_pattern.rs
drop_none.rs
enum-discr-type-err.rs
enum-discr-type-err.stderr
huge-values.rs
ice-48279.rs
ice-zst-static-access.rs
inline_asm.rs
inline_asm.stderr
int_ptr_for_zst_slices.rs
invalid_promotion.rs
issue-37550.rs
issue-51559.rs
issue-51559.stderr
issue-52432.rs
issue-52432.stderr
issue-54224.rs
issue-54224.stderr
issue-56164.rs
issue-56164.stderr
issue-62045.rs
issue-63226.rs
issue-63952.rs
issue-63952.stderr
issue-64059.rs
issue-64506.rs
issue-64662.rs
issue-64662.stderr
issue-65348.rs
issue-66342.rs
issue-66345.rs
issue-66397.rs
issue-66787.rs
issue-67529.rs
issue-67640.rs
issue-67641.rs
issue-67696-const-prop-ice.rs
issue-67862.rs
issue-68264-overflow.rs
issue-68542-closure-in-array-len.rs
issue-68542-closure-in-array-len.stderr
issue-68684.rs
issue-69191-ice-on-uninhabited-enum-field.rs
issue-69310-array-size-lit-wrong-ty.rs
issue-69310-array-size-lit-wrong-ty.stderr
issue-69312.rs
issue-70773-mir-typeck-lt-norm.rs
issue-70942-trait-vs-impl-mismatch.rs
issue-70942-trait-vs-impl-mismatch.stderr
issue-73976-monomorphic.rs
issue-73976-polymorphic.rs
issue-73976-polymorphic.stderr
issue-broken-mir.rs
locals-in-const-fn.rs
match_ice.rs
match_ice.stderr
match-const-fn-structs.rs
mozjs-error.rs
non-scalar-cast.rs
offset_from_ub.rs remove feature gate from tests 2020-08-22 15:07:32 +02:00
offset_from_ub.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
offset_from.rs remove feature gate from tests 2020-08-22 15:07:32 +02:00
offset_ub.rs
offset_ub.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
offset.rs remove feature gate from tests 2020-08-22 15:07:32 +02:00
packed_pattern2.rs
packed_pattern2.stderr
packed_pattern.rs
packed_pattern.stderr
partial_qualif.rs
partial_qualif.stderr
projection_qualif.mut_refs.stderr
projection_qualif.rs
projection_qualif.stock.stderr
promote_borrowed_field.rs
promote_const_let.rs
promote_const_let.stderr
promote_evaluation_unused_result.rs
promote_fn_calls_std.rs
promote_fn_calls.rs
promote-not.rs cleanup promotion const_kind checks 2020-09-19 22:14:17 +02:00
promote-not.stderr cleanup promotion const_kind checks 2020-09-19 22:14:17 +02:00
promoted_div_by_zero.rs
promoted_regression.rs
promoted-validation-55454.rs
promotion-mutable-ref.rs add compile-fail test for &mut promotion 2020-09-06 14:14:31 +02:00
promotion.rs cleanup promotion const_kind checks 2020-09-19 22:14:17 +02:00
ptr_comparisons.rs
ptr_comparisons.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
ptr_is_null.rs
qualif_overwrite_2.rs
qualif_overwrite_2.stderr
qualif_overwrite.rs
qualif_overwrite.stderr
raw_pointer_promoted.rs
raw-ptr-const.rs
raw-ptr-const.stderr
read_from_static_mut_ref.rs
read_from_static_mut_ref.stderr
recursive-zst-static.default.stderr Address review comments 2020-09-19 10:36:36 +02:00
recursive-zst-static.rs Address review comments 2020-09-19 10:36:36 +02:00
recursive-zst-static.unleash.stderr Address review comments 2020-09-19 10:36:36 +02:00
references.rs
repeat_match.rs
return-in-const-fn.rs
self_normalization2.rs
self_normalization.rs
signed_enum_discr.rs
stable-precise-live-drops-in-libcore.rs Test that const_precise_live_drops can't be depended upon stably 2020-09-16 14:17:51 -07:00
stable-precise-live-drops-in-libcore.stderr Test that const_precise_live_drops can't be depended upon stably 2020-09-16 14:17:51 -07:00
static_mut_containing_mut_ref2.mut_refs.stderr
static_mut_containing_mut_ref2.rs
static_mut_containing_mut_ref2.stock.stderr
static_mut_containing_mut_ref3.rs
static_mut_containing_mut_ref3.stderr
static_mut_containing_mut_ref.rs
static-cycle-error.rs
static-raw-pointer-interning2.rs
static-raw-pointer-interning.rs
too_generic_eval_ice.rs
too_generic_eval_ice.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
trait_specialization.rs
trait_specialization.stderr
transmute-const.rs
transmute-size-mismatch-before-typeck.rs
transmute-size-mismatch-before-typeck.stderr
tuple-struct-constructors.rs
underscore_const_names.rs
uninhabited-const-issue-61744.rs
uninhabited-const-issue-61744.stderr
union_constant.rs
unsizing-cast-non-null.rs
unsizing-cast-non-null.stderr
unstable-const-fn-in-libcore.rs
unstable-const-fn-in-libcore.stderr
unstable-precise-live-drops-in-libcore.rs Test that const_precise_live_drops can't be depended upon stably 2020-09-16 14:17:51 -07:00
validate_never_arrays.rs
validate_never_arrays.stderr
zst_no_llvm_alloc.rs