rust/src/test/ui/consts
Mazdak Farrokhzad 141fa859b8
Rollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelix
Fix evaluating trivial drop glue in constants

```rust
struct A;
impl Drop for A {
    fn drop(&mut self) {}
}

const FOO: Option<A> = None;

const BAR: () = (FOO, ()).1;
```

was erroring with

```
error: any use of this value will cause an error
 --> src/lib.rs:9:1
  |
9 | const BAR: () = (FOO, ()).1;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^
  |                           |
  |                           calling non-const function `std::ptr::real_drop_in_place::<(std::option::Option<A>, ())> - shim(Some((std::option::Option<A>, ())))`
  |
  = note: #[deny(const_err)] on by default

error: aborting due to previous error
```

before this PR. According to godbolt this last compiled successfully in 1.27
2019-01-25 16:59:27 +01:00
..
auxiliary Remove licenses 2018-12-25 21:08:33 -07:00
const-eval Rollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obk 2019-01-22 12:20:36 +01:00
min_const_fn Declare some unconst operations as unsafe in const fn 2019-01-21 16:01:57 +01:00
std
const_fn_return_nested_fn_ptr.rs
const_let_assign2.rs const fn feature gate is not needed anymore in a lot of tests 2019-01-09 10:20:44 +01:00
const_let_assign3.rs const fn feature gate is not needed anymore in a lot of tests 2019-01-09 10:20:44 +01:00
const_let_assign3.stderr const fn feature gate is not needed anymore in a lot of tests 2019-01-09 10:20:44 +01:00
const_let_assign.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const_let_eq_float.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const_let_eq.rs const fn feature gate is not needed anymore in a lot of tests 2019-01-09 10:20:44 +01:00
const_let_irrefutable.rs Fix irrefutable slice patterns in const fn 2019-01-09 11:32:56 +01:00
const_let_refutable.rs Fix irrefutable slice patterns in const fn 2019-01-09 11:32:56 +01:00
const_let_refutable.stderr Fix irrefutable slice patterns in const fn 2019-01-09 11:32:56 +01:00
const_short_circuit.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const_short_circuit.stderr
const-array-oob-arith.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-array-oob-arith.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-array-oob.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-array-oob.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-block-non-item-statement.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const-call.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-call.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-cast-different-types.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-cast-different-types.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-cast-wrong-type.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-cast-wrong-type.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-deref-ptr.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-deref-ptr.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-err2.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-err2.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-err4.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-err4.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-err-early.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-err-early.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-err-multi.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-err-multi.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-err.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-err.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-expr-addr-operator.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-fn-destructuring-arg.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const-fn-mismatch.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-fn-mismatch.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-fn-not-in-trait.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-fn-not-in-trait.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-fn-not-safe-for-const.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const-fn-not-safe-for-const.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
const-fn-stability-calls-3.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-int-conversion.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-conversion.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-int-conversion.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-overflowing.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-overflowing.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-int-overflowing.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-rotate.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-rotate.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-int-rotate.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-sign.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-sign.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-int-sign.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-unchecked.rs unchecked_{shl,shr}: extend const tests. 2018-12-31 03:36:46 +01:00
const-int-unchecked.stderr unchecked_{shl,shr}: extend const tests. 2018-12-31 03:36:46 +01:00
const-int-wrapping.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-int-wrapping.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-int-wrapping.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-integer-bool-ops.rs Improve type mismatch error messages 2018-12-31 20:43:08 -05:00
const-integer-bool-ops.stderr Improve type mismatch error messages 2018-12-31 20:43:08 -05:00
const-len-underflow-separate-spans.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-len-underflow-separate-spans.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-len-underflow-subspans.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-len-underflow-subspans.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-match-check.eval1.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-match-check.eval2.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-match-check.matchck.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-match-check.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-match-pattern-arm.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-match-pattern-arm.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-nonzero.rs Update src/test/ui/consts/const-nonzero.rs 2018-12-28 17:45:49 +05:30
const-pattern-irrefutable.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-pattern-irrefutable.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-pattern-not-const-evaluable.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-prop-ice2.rs
const-prop-ice2.stderr
const-prop-ice.rs
const-prop-ice.stderr
const-size_of-cycle.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-size_of-cycle.stderr Remove unnecessary dummy span checks 2019-01-20 13:29:03 -08:00
const-slice-oob.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-slice-oob.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-tup-index-span.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-tup-index-span.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-type-mismatch.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-type-mismatch.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-typeid-of.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-typeid-of.stderr Remove licenses 2018-12-25 21:08:33 -07:00
const-unsized.rs Remove licenses 2018-12-25 21:08:33 -07:00
const-unsized.stderr Fix broken links to second edition TRPL. 2019-01-01 12:53:07 -05:00
const-validation-fail-55455.rs
dangling_raw_ptr.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
dangling_raw_ptr.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
dangling-alloc-id-ice.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
dangling-alloc-id-ice.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
drop_none.rs Allow evaluating trivial drop glue in constants 2019-01-18 13:31:05 +01:00
int_ptr_for_zst_slices.rs
issue-54224.rs
issue-54224.stderr
issue-56164.rs
issue-56164.stderr
match_ice.rs Add regression test 2019-01-22 17:22:30 +01:00
match_ice.stderr Add regression test 2019-01-22 17:22:30 +01:00
partial_qualif.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
partial_qualif.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
projection_qualif.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
projection_qualif.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
promote_const_let.nll.stderr const_let: --bless with --compare-mode=nll 2019-01-12 10:32:27 +01:00
promote_const_let.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
promote_const_let.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
promote_fn_calls_std.rs
promote_fn_calls.rs
promoted_regression.rs
promoted-validation-55454.rs
qualif_overwrite_2.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
qualif_overwrite_2.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
qualif_overwrite.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
qualif_overwrite.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
single_variant_match_ice.rs
single_variant_match_ice.stderr
static_mut_containing_mut_ref2.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
static_mut_containing_mut_ref2.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
static_mut_containing_mut_ref3.rs Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
static_mut_containing_mut_ref3.stderr Stabilize let bindings and destructuring in constants and const fn 2019-01-09 10:20:12 +01:00
static_mut_containing_mut_ref.rs
validate_never_arrays.rs
validate_never_arrays.stderr