about summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2020-01-13Add additional regression testAaron Hill-0/+20
2020-01-12Turn off const propagation of ref takingWesley Wiser-0/+77
Fixes #67529 Fixes #67640 Fixes #67641 Fixes #67862
2020-01-12Add backticks in appropriate placesvarkor-1/+1
2020-01-12Diagnostics should not end with a full stopvarkor-2/+2
2020-01-12Diagnostics should start lowercasevarkor-1/+1
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-114/+184
Promote references to constants instead of statics r? @oli-obk
2020-01-11Rollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=CentrilMazdak Farrokhzad-31/+27
Don't require `allow_internal_unstable` unless `staged_api` is enabled. #63770 changed `qualify_min_const_fn` to require `allow_internal_unstable` for *all* crates that used an unstable feature, regardless of whether `staged_api` was enabled or the `fn` that used that feature was stably const. In practice, this meant that every crate in the ecosystem that wanted to use nightly features added `#![feature(const_fn)]`, which skips `qualify_min_const_fn` entirely. After this PR, crates that do not have `#![feature(staged_api)]` will only need to enable the feature they are interested in. For example, `#![feature(const_if_match)]` will be enough to enable `if` and `match` in constants. Crates with `staged_api` (e.g., `libstd`) require `#[allow_internal_unstable]` to be added to a function if it uses nightly features unless that function is also marked `#[rustc_const_unstable]`. This prevents proliferation of `#[allow_internal_unstable]` into functions that are not callable in a `const` context on stable. r? @oli-obk (author of #63770) cc @Centril
2020-01-11Rollup merge of #68079 - varkor:E0013-clarify, r=CentrilMazdak Farrokhzad-2/+6
Clarify suggestion for E0013 Fixes https://github.com/rust-lang/rust/issues/68038.
2020-01-10Remove unnecessary `const_fn` feature gatesDylan MacKenzie-31/+27
This flag opts out of the min-const-fn checks entirely, which is usually not what we want. The few cases where the flag is still necessary have been annotated.
2020-01-11Rollup merge of #68014 - estebank:unify-e0599, r=cramertjYuki Okushi-1/+1
Unify output of "variant not found" errors Fix #49566.
2020-01-10Clarify suggestion for E0013varkor-2/+6
2020-01-10Errors in promoteds may only cause lints not hard errorsOliver Scherer-162/+136
2020-01-10Promoteds also need param envs.Oliver Scherer-1/+1
This also allows us to use the `const_eval` query again without causing cycles
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-27/+123
2020-01-10Rollup merge of #68073 - Centril:fix-68062, r=estebankMazdak Farrokhzad-0/+41
expect `fn` after `const unsafe` / `const extern` Fixes #68062 r? @estebank @petrochenkov cc @Aaron1011
2020-01-09expect `fn` after `const unsafe` / `const extern`Mazdak Farrokhzad-0/+41
2020-01-09Update testsVadim Petrochenkov-11/+64
2020-01-08Remove `-Z continue-parse-after-error`Vadim Petrochenkov-1/+1
2020-01-08Unify output of "variant not found" errorsEsteban Küber-1/+1
2020-01-05Add backticks to various diagnosticsvarkor-3/+3
2020-01-04Rollup merge of #67709 - petrochenkov:nodedup2, r=CentrilDylan DPC-1/+1
Introduce an option for disabling deduplication of diagnostics With the intent of using it in UI tests (https://github.com/rust-lang/rust/pull/67122). The option is boolean (`-Z deduplicate-diagnostics=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z deduplicate-diagnostics=no -Z deduplicate-diagnostics=yes` == `-Z deduplicate-diagnostics=yes`), so it can be set in a hierarchical way, e.g. UI testing infra may disable the deduplication by default with specific tests being able to enable it back.
2020-01-03Introduce an option for disabling deduplication of diagnosticsVadim Petrochenkov-1/+1
2020-01-02Revert `const_err` lint checking of castsWesley Wiser-27/+11
Reverts part of #67676
2019-12-30Lint overflowing integer casts in const propWesley Wiser-0/+31
This extends the invalid cases we catch in const prop to include overflowing integer casts using the same machinery as the overflowing binary and unary operation logic.
2019-12-30Auto merge of #67667 - wesleywiser:speed_up_trivially_valid_constants, r=oli-obkbors-0/+87
Resolve long compile times when evaluating always valid constants This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539 r? @oli-obk cc @RalfJung @spastorino
2019-12-30Auto merge of #67631 - oli-obk:polymorphic_promotion, r=wesleywiserbors-0/+65
Work around a resolve bug in const prop r? @wesleywiser @anp This isn't exposed right now, but further changes to rustc may start causing bugs without this.
2019-12-29Resolve long compile times when evaluating always valid constantsWesley Wiser-0/+87
This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539
2019-12-28Ignore i586-unknown-linux-gnu and i586-unknown-musl in testsEsteban Küber-20/+29
2019-12-28Rollup merge of #67621 - matthewjasper:correct-static-type, r=oli-obkOliver Scherer-0/+14
Use the correct type for static qualifs Closes #67609
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-0/+65
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901
2019-12-26Make ui test bitwidth independentOliver Scherer-7/+11
2019-12-26Remove unintended noisy log statementOliver Scherer-108/+0
2019-12-26Add regression test for ZST statics being allowed to "read" from themselvesOliver Scherer-0/+7
2019-12-26Prevent an ICE on invalid transmutesOliver Scherer-0/+151
2019-12-26Don't ICE on the use of integer addresses for ZST constants in pattern matchingOliver Scherer-0/+13
2019-12-26A cycle error on a diverging function is now a const stack overflow againOliver Scherer-16/+91
2019-12-26Auto merge of #67580 - RalfJung:miri-unleash-tests, r=oli-obkbors-17/+61
test the unleashed Miri In particular, test what happens when we try to drop something. Cc https://github.com/rust-lang/const-eval/issues/17 r? @oli-obk
2019-12-25Use the correct type for static qualifsMatthew Jasper-0/+14
2019-12-25use error-patternRalf Jung-2/+2
2019-12-24Deprecate Error::description for realDavid Tolnay-1/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-24Auto merge of #67445 - llogiq:todo, r=dtolnaybors-3/+3
Differentiate todo! and unimplemented! This updates the panic message and docs to make it clear that `todo!` is for unfinished code and `unimplemented!` is for partial trait or enum impls. r? @Centril
2019-12-24Differentiate todo! and unimplemented!Andre Bogus-3/+3
2019-12-24this has sysroot spans to let's ignore it the usual wayRalf Jung-3/+4
2019-12-24better variable namesRalf Jung-17/+17
2019-12-24add test for dropping in constRalf Jung-0/+43
2019-12-24Rollup merge of #67337 - oli-obk:no_mut_static_ref_from_const, r=RalfJungMazdak Farrokhzad-3/+225
Ensure that evaluating or validating a constant never reads from a static r? @RalfJung as per https://github.com/rust-lang/rust/pull/66302#issuecomment-554663387 This does not yet address the fact that evaluation of a constant can read from a static (under unleash-miri)
2019-12-23Bless testsOliver Scherer-1/+1
2019-12-23Rollup merge of #67546 - oli-obk:slice_pattern_ice, r=varkorMazdak Farrokhzad-0/+9
Fix ICE in mir interpretation Indices from the end start at 1 so you can immediately subtract them from the length to get the index instead of having to do an additional `-1`. Kinda documented in https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/enum.ProjectionElem.html#variant.ConstantIndex
2019-12-23Rollup merge of #67466 - oli-obk:const_intrinsic, r=CentrilMazdak Farrokhzad-0/+5
Require const stability attributes on intrinsics to be able to use them in constant contexts r? @Centril finally fixes #61495 cc @RalfJung
2019-12-23Show `const_err` lintsOliver Scherer-8/+45