summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
2022-09-02CTFE: more informative error message on ReadPointerAsBytes troubleRalf Jung-0/+216
2022-07-26bless tests, remove nonexistent E0395Deadbeef-10/+41
2022-07-22Rollup merge of #99393 - ↵Dylan DPC-2/+2
Logarithmus:feature/99255-omit-const-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes #99255
2022-07-20bless some testsRalf Jung-52/+39
2022-07-20make use of symbolic vtables in interpreterRalf Jung-160/+175
2022-07-19Mention first and last macro in backtraceMichael Goulet-38/+38
2022-07-19feat: omit suffixes in const generics (e.g. `1_i32`)Artur Sinila-2/+2
Closes #99255
2022-07-09Partially stabilize const_slice_from_raw_partsKonrad Borowski-1/+0
This doesn't stabilize methods working on mutable pointers.
2022-07-06blessRalf Jung-4/+4
2022-07-05Rollup merge of #98860 - RalfJung:dangling-int-ptr, r=davidtwcoMatthias Krüger-6/+6
adjust dangling-int-ptr error message based on suggestions by `@saethlin` in https://github.com/rust-lang/miri/issues/2163 Fixes https://github.com/rust-lang/miri/issues/2163 I also did a bit of refactoring on this, so we have a helper method to create a `Pointer` with `None` provenance.
2022-07-05adjust dangling-int-ptr error messageRalf Jung-6/+6
2022-07-05Rollup merge of #98624 - davidtwco:translation-on-lints, r=compiler-errorsDylan DPC-2/+2
lints: mostly translatable diagnostics As lints are created slightly differently than other diagnostics, intended to try make them translatable first and then look into the applicability of diagnostic structs but ended up just making most of the diagnostics in the crate translatable (which will still be useful if I do make a lot of them structs later anyway). r? ``@compiler-errors``
2022-07-01Shorten def_span for more items.Camille GILLOT-1041/+614
2022-06-30lint: port non-fmt-panic diagnosticsDavid Wood-2/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-29interpret: adjust error from constructing an invalid valueRalf Jung-132/+132
2022-06-28Rollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, ↵Matthias Krüger-0/+17
r=Mark-Simulacrum Add regression test for #85907 closes #85907
2022-06-27add regression test for #85907Takayuki Maeda-0/+17
2022-06-25bless after rebaseRalf Jung-22/+598
2022-06-25make const_err show up in future breakage reportsRalf Jung-0/+1246
2022-06-19Mention formatting macros when encountering ArgumentV1::new in constMichael Goulet-0/+99
2022-06-19Bless 32bit ui tests.Camille GILLOT-12/+12
2022-06-19Make some lints incremental.Camille GILLOT-12/+12
2022-06-14rebaseb-naber-32/+104
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-8/+19
2022-06-05interpret: better control over whether we read data with provenance, and ↵Ralf Jung-355/+388
implicit provenance stripping where possible
2022-05-19bless 32bitRalf Jung-10/+10
2022-05-19interpret/validity: separately control checking numbers for being init and ↵Ralf Jung-23/+23
non-ptr
2022-05-17bless 32bitRalf Jung-1/+1
2022-05-17interpret/validity: reject references to uninhabited typesRalf Jung-1/+1
2022-04-30Also report the call site of PME errors locally.Oli Scherer-0/+12
Note this does not produce a full stack all the way to the first call that specifies all monomorphic parameters, it's just shallowly mentioning the last call site.
2022-04-21Update `validate_uninhabited_zsts.rs` test after MIR building changesTomasz Miąsko-34/+55
to ensure that it still tests validation, instead of failing earlier on during evaluation.
2022-04-20Rollup merge of #93313 - tmiasko:uninhabited, r=tmandryDylan DPC-47/+21
Check if call return type is visibly uninhabited when building MIR The main motivation behind the change is to expose information about diverging calls to the generator transform and match the precision of drop range tracking which already understands that call expressions with visibly uninhabited types diverges. This change should also accept strictly more programs than before. That is programs that were previously rejected due to errors raised by control-flow sensitive checks in a code that is no longer considered reachable. Fixes #93161.
2022-04-11Add const eval tests ensuring padding gets correctly marked as deinit on ↵Jakob Degen-0/+37
deaggregation
2022-04-11Bless tests that broke in a trivial way due to change in deaggregationJakob Degen-8/+8
2022-04-04Refer to the TraitRef::identity in the message to be clearerEsteban Kuber-2/+2
2022-04-04Dedup logic and improve output for other types that impl traitEsteban Kuber-10/+10
2022-04-04Fix list lengthEsteban Kuber-0/+8
2022-04-04Mention implementers of unsatisfied traitEsteban Kuber-0/+12
When encountering an unsatisfied trait bound, if there are no other suggestions, mention all the types that *do* implement that trait: ``` error[E0277]: the trait bound `f32: Foo` is not satisfied --> $DIR/impl_wf.rs:22:6 | LL | impl Baz<f32> for f32 { } | ^^^^^^^^ the trait `Foo` is not implemented for `f32` | = help: the following other types implement trait `Foo`: Option<T> i32 str note: required by a bound in `Baz` --> $DIR/impl_wf.rs:18:31 | LL | trait Baz<U: ?Sized> where U: Foo { } | ^^^ required by this bound in `Baz` ``` Mention implementers of traits in `ImplObligation`s. Do not mention other `impl`s for closures, ranges and `?`.
2022-04-02diagnostics: add test case for bogus T:Sized suggestionMichael Howell-0/+24
Closes #69228
2022-04-02Rollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnrDylan DPC-1/+1
Handle rustc_const_stable attribute in library feature collector The library feature collector in [compiler/rustc_passes/src/lib_features.rs](https://github.com/rust-lang/rust/blob/551b4fa395fa588d91cbecfb0cdfe1baa02670cf/compiler/rustc_passes/src/lib_features.rs) has only been looking at `#[stable(…)]`, `#[unstable(…)]`, and `#[rustc_const_unstable(…)]` attributes, while ignoring `#[rustc_const_stable(…)]`. The consequences of this were: - When any const feature got stabilized (changing one or more `rustc_const_unstable` to `rustc_const_stable`), users who had previously enabled that unstable feature using `#![feature(…)]` would get told "unknown feature", rather than rustc's nicer "the feature … has been stable since … and no longer requires an attribute to enable". This can be seen in the way that https://github.com/rust-lang/rust/pull/93957#issuecomment-1079794660 failed after rebase: ```console error[E0635]: unknown feature `const_ptr_offset` --> $DIR/offset_from_ub.rs:1:35 | LL | #![feature(const_ptr_offset_from, const_ptr_offset)] | ^^^^^^^^^^^^^^^^ ``` - We weren't enforcing that a particular feature is either stable everywhere or unstable everywhere, and that a feature that has been stabilized has the same stabilization version everywhere, both of which we enforce for the other stability attributes. This PR updates the library feature collector to handle `rustc_const_stable`, and fixes places in the standard library and test suite where `rustc_const_stable` was being used in a way that does not meet the rules for a stability attribute.
2022-03-31Adjust feature names that disagree on const stabilization versionDavid Tolnay-1/+1
2022-03-31catch overflow in slice size computationRalf Jung-42/+67
2022-03-24Check if call return type is visibly uninhabited when building MIRTomasz Miąsko-47/+21
2022-03-24Auto merge of #94934 - Lireer:const-prop-lint, r=oli-obkbors-16/+162
Separate const prop lints from optimizations r? `@oli-obk` Separates lints and optimizations during const prop by moving the lints into their own file and checking them during post borrowck cleanup. Thanks to `@oli-obk` for mentoring me.
2022-03-23separate const prop lint from optimizationsCarl Scherer-16/+162
2022-03-22bless 32bitRalf Jung-1/+1
2022-03-22interpret/memory: simplify check_and_deref_ptrRalf Jung-3/+3
2022-03-09keep ERROR in messageb-naber-3/+3
2022-03-09manually bless 32-bit stderrb-naber-1/+0
2022-03-09normalization change and rebaseb-naber-18/+8