about summary refs log tree commit diff
path: root/src/test/ui/consts/const-eval
AgeCommit message (Collapse)AuthorLines
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)
2019-12-07Auto merge of #66927 - RalfJung:engines-dont-panic, r=oli-obkbors-44/+16
Miri core engine: use throw_ub instead of throw_panic See https://github.com/rust-lang/rust/issues/66902 for context: panicking is not really an "interpreter error", but just part of a normal Rust execution. This is a first step towards removing the `InterpError::Panic` variant: the core Miri engine does not use it any more. ConstProp and ConstEval still use it, though. This will be addressed in future PRs. From what I can tell, all the error messages this removes are actually duplicates. r? @oli-obk @wesleywiser
2019-12-06Rollup merge of #66606 - christianpoveda:mut-refs-in-const-fn, r=oli-obkMazdak Farrokhzad-3/+6
Add feature gate for mut refs in const fn r? @oli-obk
2019-12-05Rename test filename to match others.Adam Perry-41/+0
2019-12-05Implement #[track_caller] in const.Adam Perry-9/+27
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-0/+19
2019-12-02Suggest feature for const_mut_refs errorsChristian Poveda-3/+6
2019-12-02Move and rewrite tests to use &mut in constantsChristian Poveda-19/+0
2019-12-02Add tests for mutable borrows in const fnsChristian Poveda-0/+19
2019-12-01Miri core engine: use throw_ub instead of throw_panicRalf Jung-44/+16
2019-11-21Reorganize, bless and add tests for const control flowDylan MacKenzie-4/+10
This creates a new test directory, `ui/consts/control-flow` to hold tests related to control flow in a const context. It also blesses all existing tests with the new error messages, and adds new tests for the `const_if_match` feature.
2019-11-18Surround types with backticks in type errorsEsteban Küber-5/+5