summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
2020-03-08fix some cases of unexpected exceptions leaving validationRalf Jung-24/+44
2020-03-08fix type size mismatch on 32bitRalf Jung-20/+19
2020-03-06please tidyRalf Jung-13/+14
2020-03-06better error messages for invalid boxes (and a few more tests)Ralf Jung-17/+39
2020-03-06test some more kinds of enums with uninhabited variantsRalf Jung-11/+77
2020-03-06test that we validate boxesRalf Jung-4/+49
2020-03-06const validation ub tests: use transmute instead of unionsRalf Jung-221/+165
2020-03-06miri value visitor: detect primitives by type, not layoutRalf Jung-2/+2
2020-03-02Auto merge of #69257 - RalfJung:layout-visitor, r=eddybbors-25/+25
Adjust Miri value visitor, and doc-comment layout components I realized that I still didn't have quite the right intuition for how our `LayoutDetails` work, so I had to adjust the Miri value visitor to the things I understood better now. I also added some doc-comments to `LayoutDetails` as a hopefully canonical place to note such things. The main visitor change is that we *first* look at all the fields (according to `FieldPlacement`), and *then* check the variants and handle `Multiple` appropriately. I did not quite realize how orthogonal "fields" and "variants" are. I also moved the check for the scalar ABI to *after* checking all the fields; this leads to better (more type-driven) error messages. And it looks like we can finally remove that magic hack for `ty::Generator`. :D r? @oli-obk for the Miri/visitor changes and @eddyb for the layout docs The Miri PR is at: https://github.com/rust-lang/miri/pull/1178
2020-02-26miri: validity visitor comments and path printing improvementsRalf Jung-2/+2
2020-02-19avoid excessive number of revisionsRalf Jung-73/+1
2020-02-18better lint namesRalf Jung-32/+32
2020-02-18more English grammarRalf Jung-7/+7
2020-02-18miri value visitor: fix some wrong assumptions about layout; improve error ↵Ralf Jung-20/+20
messages
2020-02-15more revisions and use them for another testRalf Jung-3/+75
2020-02-15fix tests, and use variants to test debug and release builds togetherRalf Jung-163/+246
2020-02-09--bless --compare-mode=nllMatthias Prechtl-14/+14
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-16/+16
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-16/+16
2020-01-24Normalise notes with the/isvarkor-14/+14
2020-01-18Fix some tests failing in `--pass check` modeVadim Petrochenkov-21/+23
2020-01-16Rollup merge of #68096 - varkor:diagnostic-cleanup, r=CentrilDylan DPC-2/+2
Clean up some diagnostics by making them more consistent In general: - Diagnostic should start with a lowercase letter. - Diagnostics should not end with a full stop. - Ellipses contain three dots. - Backticks should encode Rust code. I also reworded a couple of messages to make them read more clearly. It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics. r? @Centril
2020-01-14perf: eagerly convert literals to consts, this avoids creating loads on ↵Ben Lewis-1/+1
unevaluated consts which requires a lot of unnecessary work to evaluate them further down the line.
2020-01-12Add backticks in appropriate placesvarkor-1/+1
2020-01-12Diagnostics should start lowercasevarkor-1/+1
2020-01-10Errors in promoteds may only cause lints not hard errorsOliver Scherer-136/+107
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-20/+98
2020-01-09Update testsVadim Petrochenkov-3/+17
2019-12-30Auto merge of #67667 - wesleywiser:speed_up_trivially_valid_constants, r=oli-obkbors-0/+76
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-29Resolve long compile times when evaluating always valid constantsWesley Wiser-0/+76
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-25Use the correct type for static qualifsMatthew Jasper-0/+14
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-23Rollup merge of #67466 - oli-obk:const_intrinsic, r=CentrilMazdak Farrokhzad-0/+4
Require const stability attributes on intrinsics to be able to use them in constant contexts r? @Centril finally fixes #61495 cc @RalfJung
2019-12-22Auto merge of #67505 - Centril:rollup-7win7ty, r=Centrilbors-3/+3
Rollup of 6 pull requests Successful merges: - #67148 ( Refactor type & bounds parsing thoroughly) - #67410 (Reenable static linking of libstdc++ on windows-gnu) - #67439 (Cleanup `lower_pattern_unadjusted` & Improve slice pat typeck) - #67480 (Require issue = "none" over issue = "0" in unstable attributes) - #67500 (Tweak non_shorthand_field_patterns' suggestion) - #67504 (Warn against relying on ?Sized being last) Failed merges: r? @ghost
2019-12-21fix rebase falloutMazdak Farrokhzad-8/+9
2019-12-21rework run-fail and support check,build-failMazdak Farrokhzad-46/+67
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-3/+3
2019-12-20Require const stability attributes on intrinsics to be able to use them in ↵Oliver Scherer-0/+4
constant contexts
2019-12-18Update test now that reference to pointer casts have more checksMatthew Jasper-23/+46
2019-12-15Auto merge of #67216 - ecstatic-morse:const-loop, r=oli-obkbors-9/+26
Enable `loop` and `while` in constants behind a feature flag This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways. `while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user. r? @oli-obk cc @rust-lang/wg-const-eval
2019-12-14Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, ↵bors-8/+11
r=centril Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14add `#![feature(never_type)]` to tests as neededNiko Matsakis-8/+11
2019-12-13Bless unrelated tests with new help messageDylan MacKenzie-9/+26
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-2/+2
functions with a `const` modifier
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-2/+2
2019-12-11Rollup merge of #67164 - matthewjasper:never-remove-const, r=oli-obkMazdak Farrokhzad-0/+114
Ensure that panicking in constants eventually errors based on #67134 closes #66975 r? @oli-obk
2019-12-09Ensure that unevaluated constants of type `!` are present in the MIRMatthew Jasper-0/+114
2019-12-07Auto merge of #65881 - anp:implicit-caller-location, r=eddyb,oli-obkbors-23/+0
Implement #[track_caller] attribute. (RFC 2091 4/N) Implements the `#[track_caller]` attribute in both const and codegen contexts. The const implementation walks up the stack to find the nearest untracked callsite. The codegen implementation adds an implicit argument to tracked function calls, and populates it with either a call to the previously-landed intrinsic or if the caller has `#[track_caller]` with a copy of the location passed to the current function. Also includes a little cleanup and a few comments in the other caller location areas. [Depends on: 65664](https://github.com/rust-lang/rust/pull/65664) [RFC 2091 text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) [Tracking issue](https://github.com/rust-lang/rust/issues/47809) [Tracking doc](https://paper.dropbox.com/doc/track_rfc_2091_impl-notes--Anf1NwnIb0xcRv31YLIadyj0Ag-rwCdRc2fi2yvRZ7syGZ9q#:uid=863513134494965680023183&h2=TODO-actually-pass-location-to)