about summary refs log tree commit diff
path: root/src/test/run-pass/ctfe
AgeCommit message (Collapse)AuthorLines
2019-01-12Rollup merge of #57175 - oli-obk:const_let_stabilization, r=nikomatsakisMazdak Farrokhzad-9/+8
Stabilize `let` bindings and destructuring in constants and const fn r? @Centril This PR stabilizes the following features in constants and `const` functions: * irrefutable destructuring patterns (e.g. `const fn foo((x, y): (u8, u8)) { ... }`) * `let` bindings (e.g. `let x = 1;`) * mutable `let` bindings (e.g. `let mut x = 1;`) * assignment (e.g. `x = y`) and assignment operator (e.g. `x += y`) expressions, even where the assignment target is a projection (e.g. a struct field or index operation like `x[3] = 42`) * expression statements (e.g. `3;`) This PR does explicitly *not* stabilize: * mutable references (i.e. `&mut T`) * dereferencing mutable references * refutable patterns (e.g. `Some(x)`) * operations on `UnsafeCell` types (as that would need raw pointers and mutable references and such, not because it is explicitly forbidden. We can't explicitly forbid it as such values are OK as long as they aren't mutated.) * We are not stabilizing `let` bindings in constants that use `&&` and `||` short circuiting operations. These are treated as `&` and `|` inside `const` and `static` items right now. If we stopped treating them as `&` and `|` after stabilizing `let` bindings, we'd break code like `let mut x = false; false && { x = true; false };`. So to use `let` bindings in constants you need to change `&&` and `||` to `&` and `|` respectively.
2019-01-09const fn feature gate is not needed anymore in a lot of testsOliver Scherer-4/+7
2019-01-09Stabilize `let` bindings and destructuring in constants and const fnOliver Scherer-6/+2
2018-12-31const-stabilize const_int_ops + reverse_bitsMazdak Farrokhzad-3/+3
2018-12-25Remove licensesMark Rousskov-200/+0
2018-12-18Auto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakisbors-26/+0
Fix various aspects around `let` bindings inside const functions * forbid `let` bindings in const contexts that use short circuiting operators * harden analysis code against derefs of mutable references Initially this PR was about stabilizing `let` bindings, but too many flaws were exposed that need some more testing on nightly
2018-12-13Update tests to show diagnosticsOliver Scherer-1/+1
2018-12-11Diagnostics improvement!Oliver Scherer-1/+2
2018-11-30Improve the diagnostic messageOliver Scherer-1/+1
2018-11-30Reenable `const_let` feature gateOliver Scherer-1/+5
2018-11-30Allow `let` bindings everywhereOliver Scherer-5/+1
2018-11-30Remove a bunch of now-unnecessary `const_let` feature gatesOliver Scherer-27/+1
2018-10-05Stabilize `min_const_fn`Oliver Schneider-5/+0
2018-09-26Add `#![allow(..)]` as necessary to get re-migrated run-pass tests compiling ↵Felix S. Klock II-0/+10
with clean stderr again. Most were added mechanically.
2018-09-26Migrate `src/test/ui/run-pass/*` back to `src/test/run-pass/`.Felix S. Klock II-0/+898
Fix #54047
2018-09-06Migrated remaining `src/test/run-pass/` subdirectories to ↵Felix S. Klock II-855/+0
`src/test/ui/run-pass/`.
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-3/+3
2018-08-30Made std::intrinsics::transmute() const fn.thedarkula-0/+22
2018-08-28restructure unary_op to also dispatch on type first; fix promotion with ↵Ralf Jung-0/+8
unary '-' overflowing
2018-06-03Deduplicate and fix a testOliver Schneider-45/+0
2018-05-31Add test for intrinsics::bswapLinus Färnstrand-0/+23
2018-05-22Fix a typo in a commentOliver Schneider-1/+1
2018-05-22Report let bindings and statements as unstableOliver Schneider-1/+1
2018-05-22Allow let bindings in const fn and constantsOliver Schneider-0/+118
2018-05-16Stabilize num::NonZeroU*Simon Sapin-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-16Make core::nonzero privateSimon Sapin-4/+3
It is now an implementation detail of ptr::NonNull and num::NonZero*
2018-03-22Fix the conversion between bit representations and i128 representationsOliver Schneider-0/+27
2018-03-08Fix mozjs crater failureOliver Schneider-0/+37
2018-03-08Add regression testOliver Schneider-0/+34
2018-03-08Add regression testsOliver Schneider-0/+45
2018-03-08Reduce noise in error reportingOliver Schneider-0/+17
2018-03-08Add test for #45044Oliver Schneider-0/+20
2018-03-08Add InterpretInterner to StableHashingContext for AllocId serializationOliver Schneider-0/+34
2018-03-08Add tests for fixed issuesOliver Schneider-0/+489
2017-10-25Add a regression test for the const eval type resolutionOliver Schneider-0/+28