summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2022-09-02CTFE: more informative error message on ReadPointerAsBytes troubleRalf Jung-5/+237
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-6/+8
2022-07-28Remove guess_head_span.Camille GILLOT-3/+3
2022-07-27Rollup merge of #99651 - compiler-errors:fn-and-raw-ptr-in-const-generics, ↵Guillaume Gomez-4/+17
r=oli-obk Deeply deny fn and raw ptrs in const generics I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter. We now reject both of these in the same way: ``` #![feature(adt_const_params)] #[derive(Eq, PartialEq)] struct Wrapper(); fn foo<const W: Wrapper>() {} fn foo2<const F: fn()>() {} ``` This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place. cc: ``@b-naber`` who introduced that test^ fixes #99641
2022-07-26Fix diagnostics for unfulfilled obligationsDeadbeef-10/+0
2022-07-26bless tests, remove nonexistent E0395Deadbeef-43/+83
2022-07-25Deeply deny fn and raw ptrs in const genericsMichael Goulet-4/+17
2022-07-24interpret, ptr_offset_from: refactor and test too-far-apart checkRalf Jung-18/+99
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-166/+181
2022-07-19Mention first and last macro in backtraceMichael Goulet-49/+49
2022-07-19feat: omit suffixes in const generics (e.g. `1_i32`)Artur Sinila-2/+2
Closes #99255
2022-07-15Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, ↵bors-6/+6
r=cjgillot gather body owners Issue #96341
2022-07-13add array tests, cleanup, tidy, and blessRalf Jung-3/+3
2022-07-13remove untagged_union feature gateRalf Jung-16/+18
2022-07-09Partially stabilize const_slice_from_raw_partsKonrad Borowski-2/+0
This doesn't stabilize methods working on mutable pointers.
2022-07-09Rollup merge of #98980 - RalfJung:const-prop-ice, r=oli-obkDylan DPC-0/+18
fix ICE in ConstProp Fixes https://github.com/rust-lang/rust/issues/96169
2022-07-08Auto merge of #98816 - estebank:implicit-sized, r=oli-obkbors-1/+1
Track implicit `Sized` obligations in type params When we evaluate `ty::GenericPredicates` we introduce the implicit `Sized` predicate of type params, but we do so with only the `Predicate` its `Span` as context, we don't have an `Obligation` or `ObligationCauseCode` we could influence. To try and carry this information through, we add a new field to `ty::GenericPredicates` that tracks both which predicates come from a type param and whether that param has any bounds already (to use in suggestions). We also suggest adding a `?Sized` bound if appropriate on E0599. Address part of #98539.
2022-07-07Tweak wording and spansEsteban Küber-3/+3
2022-07-07On partial uninit error point at where we need initEsteban Küber-3/+5
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-07-07Track implicit `Sized` obligations in type paramsEsteban Küber-1/+1
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting the HIR Generics. (Fix #98539)
2022-07-06update testMiguel Guarniz-6/+6
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-06blessRalf Jung-7/+7
2022-07-06fix ICE in ConstPropRalf Jung-0/+18
2022-07-05add testRalf Jung-0/+15
2022-07-05Rollup merge of #98860 - RalfJung:dangling-int-ptr, r=davidtwcoMatthias Krüger-21/+21
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-21/+21
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-02Rollup merge of #98701 - TaKO8Ki:add-regression-test-for-50439, ↵Ralf Jung-0/+39
r=Mark-Simulacrum Add regression test for #50439 closes #50439
2022-07-01Shorten def_span for more items.Camille GILLOT-1439/+829
2022-06-30lint: port non-fmt-panic diagnosticsDavid Wood-2/+2
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30add regression test for #50439Takayuki Maeda-0/+39
2022-06-29fix stderr by hand since that test is not run on my systemRalf Jung-4/+4
2022-06-29interpret: adjust error from constructing an invalid valueRalf Jung-164/+164
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-26Rollup merge of #97743 - RalfJung:const-err-future-breakage, r=estebankMatthias Krüger-0/+2697
make const_err show up in future breakage reports As tracked in https://github.com/rust-lang/rust/issues/71800, const_err should become a hard error Any Day Now (TM). I'd love to move forward with that sooner rather than later; it has been deny-by-default for many years and a future incompat lint since https://github.com/rust-lang/rust/pull/80394 (landed more than a year ago). Some CTFE errors are already hard errors since https://github.com/rust-lang/rust/pull/86194. But before we truly make it a hard error in all cases, we now have one more intermediate step we can take -- to make it show up in future breakage reports. Cc `````@rust-lang/wg-const-eval`````
2022-06-25bless after rebaseRalf Jung-23/+711
2022-06-25bless remaining testsRalf Jung-0/+53
2022-06-25make const_err show up in future breakage reportsRalf Jung-0/+1956
2022-06-25Rollup merge of #98298 - TaKO8Ki:point-to-type-param-definition, ↵Matthias Krüger-1/+1
r=compiler-errors Point to type parameter definition when not finding variant, method and associated item fixes #77391
2022-06-22point to type param definition when not finding variant, method and assoc typeTakayuki Maeda-1/+1
use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span` use `body_id.owner` directly add description to label
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-15/+41
2022-06-15Rollup merge of #98026 - c410-f3r:z-errors, r=petrochenkovYuki Okushi-0/+20
Move some tests to more reasonable directories r? ```@petrochenkov```
2022-06-14rebaseb-naber-32/+104
2022-06-14address reviewb-naber-1/+1
2022-06-14bless 32-bit ui testsb-naber-4/+10