about summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2020-08-31Revert #75463Dylan MacKenzie-15/+0
This was approved by me prematurely. It needs T-libs approval.
2020-08-31Auto merge of #75463 - CDirkx:ordering-const, r=CDirkxbors-0/+15
Make some Ordering methods const Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Possible because of #49146 (Allow `if` and `match` in constants). Tracking issue: #76113
2020-08-30Stabilize feature `const_ordering`CDirkx-2/+0
2020-08-30Add unstable `const_ordering` feature, and some tests.CDirkx-0/+17
2020-08-27Abort when catch_unwind catches a foreign exceptionAmanieu d'Antras-0/+2
2020-08-23Auto merge of #72449 - ecstatic-morse:const-float-bitcast, r=RalfJungbors-0/+170
Const floating point bitcasts and classification Makes the `f32` and `f64` methods described in #72447 and #72505 unstably const. r? @RalfJung
2020-08-23Fix `compile-flags` directiveecstatic-morse-2/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-08-22Test new floating point bit castsDylan MacKenzie-0/+170
2020-08-22remove feature gate from testsRalf Jung-13/+10
2020-08-22Rollup merge of #75771 - tmiasko:const-eval-query-stack-normalize, ↵Dylan DPC-2/+3
r=jonas-schievink Extend normalization in const-eval-query-stack test Builds with debuginfo have additional information in backtrace.
2020-08-21Suppress "const" prefix of FnDef in MIR dumpLzu Tao-11/+11
2020-08-21Extend normalization in const-eval-query-stack testTomasz Miąsko-2/+3
Builds with debuginfo have additional information in backtrace.
2020-08-20Set RUST_BACKTRACE env variableThibsG-1/+2
2020-08-19Fix bad printing of const-eval queriesThibsG-0/+38
2020-08-18Rollup merge of #75578 - 5M1Sec:master, r=oli-obkYuki Okushi-12/+15
Allowing raw ptr dereference in const fn Reflect on issue #75340 Discussion in previous PR #75425 ## Updates Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs Remove `unsafe` in min_const_fn_unsafe_bad.rs Bless min_const_fn Add the test case from issue 75340 *** Sorry for the chaos. I messed up and ended up deleting the repo in the last PR. I have to create a new PR for the new repo. I will make a feature branch next time. I will edit the old PR once I receive the commends. @RalfJung Thank you all for your replies. They are helpful! r? @oli-obk
2020-08-17Auto merge of #74940 - oli-obk:const_is_null, r=RalfJungbors-0/+141
Make `<*const T>::is_null` const fn r? @RalfJung cc @rust-lang/wg-const-eval tracking issue: #74939
2020-08-17Make a test platform independentOliver Scherer-7/+11
2020-08-16Allowing raw ptr dereference in const fn5M1Sec-12/+15
Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs Remove unsafe in min_const_fn_unsafe_bad.rs Bless min_const_fn Add the test case from issue 75340 Co-authored-by: lzutao <taolzu@gmail.com>
2020-08-12fix span of stack size errorRalf Jung-7/+6
2020-08-12more precise span for erroneous consts during CTFE/MiriRalf Jung-16/+18
2020-08-12bless testsRalf Jung-17/+13
2020-08-11Make `<*const T>::is_null` const fnOliver Scherer-0/+137
2020-08-10add test for unused erroneous const in CTFERalf Jung-0/+63
2020-08-04Forbid non-derefable types explicitly in unsizing castsYuki Okushi-0/+22
2020-08-02fix typosliuzhenyu-2/+2
2020-07-31Rename HAIR to THIR (Typed HIR).Valentin Lazureanu-1/+1
2020-07-31Auto merge of #74956 - ecstatic-morse:const-option-unwrap, r=oli-obkbors-0/+34
Make `Option::unwrap` unstably const This is lumped into the `const_option` feature gate (#67441), which enables a potpourri of `Option` methods. cc @rust-lang/wg-const-eval r? @oli-obk
2020-07-30Test `Option::unwrap` in a const contextDylan MacKenzie-0/+34
2020-07-30Rollup merge of #74934 - nbdd0121:issue-73976, r=ecstatic-morseManish Goregaokar-8/+8
Improve diagnostics when constant pattern is too generic This PR is a follow-up to PR #74538 and issue #73976 When constants queries Layout, TypeId or type_name of a generic parameter, instead of emitting `could not evaluate constant pattern`, we will instead emit a more detailed message `constant pattern depends on a generic parameter`.
2020-07-30Fix ui testsGary Guo-8/+8
2020-07-29Test `{align,size}_of_val` in a const contextDylan MacKenzie-0/+79
2020-07-28update stderr for polymorphic ui testAshley Mannix-4/+4
2020-07-28remove unstable const_type_id featureAshley Mannix-2/+0
2020-07-28stabilize const_type_id featureAshley Mannix-19/+0
2020-07-27mv std libs to library/mark-38/+38
2020-07-27Rollup merge of #73858 - tspiteri:const-methods, r=oli-obkManish Goregaokar-8/+0
Make more primitive integer methods const Now that #72437 has been merged and `const_if_match` is stable, these methods can be stabilized const. The methods are grouped in commits according to feature names: * `const_nonzero_int_methods` - `NonZero*::new` * some `const_checked_int_methods` - `{i*,u*}::checked_add` - `{i*,u*}::checked_sub` - `{i*,u*}::checked_mul` - `{i*,u*}::checked_neg` - `{i*,u*}::checked_shl` - `{i*,u*}::checked_shr` - `i*::checked_abs` * `const_saturating_int_methods` - `{i*,u*}::saturating_add` - `{i*,u*}::saturating_sub` - `{i*,u*}::saturating_mul` - `i*::saturating_neg` - `i*::saturating_abs` * `const_int_sign` - `i*::signum` * `const_ascii_ctype_on_intrinsics` - `{char,u8}::is_ascii_alphabetic` - `{char,u8}::is_ascii_uppercase` - `{char,u8}::is_ascii_lowercase` - `{char,u8}::is_ascii_alphanumeric` - `{char,u8}::is_ascii_digit` - `{char,u8}::is_ascii_hexdigit` - `{char,u8}::is_ascii_punctuation` - `{char,u8}::is_ascii_graphic` - `{char,u8}::is_ascii_whitespace` - `{char,u8}::is_ascii_control`
2020-07-27Auto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obkbors-1/+19
Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id We only have to call `extern_static_alloc_id` when a `Pointer` is "imported" from the `tcx` to the machine, not on each access. Also drop the old hook for TLS handling, it is not needed any more. The Miri side of this is at https://github.com/rust-lang/miri/pull/1489. Fixes https://github.com/rust-lang/rust/issues/71194 r? @oli-obk
2020-07-26check that even referencing a TLS static during CTFE failsRalf Jung-1/+19
2020-07-26Auto merge of #74060 - kpp:remove_length_at_most_32, r=dtolnaybors-7/+16
Remove trait LengthAtMost32 This is a continuation of https://github.com/rust-lang/rust/pull/74026 preserving the original burrbull's commit. I talked to @burrbull, he suggested me to finish his PR.
2020-07-24Rollup merge of #74491 - xldenis:constant-binop-opt, r=oli-obkManish Goregaokar-3/+4
Optimize away BitAnd and BitOr when possible This PR lets `const_prop` optimize away `a | true == true` , `a & false == false` and `a * 0 = 0`. While I was writing this I've realized that constant propagation misses a lot of opportunities. For example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2a4b45e772f214210a36749b27223bb0 Constant propagation doesn't seem to... propagate constants, additionally the way constant propagation is currently setup makes it tricky to add cases like `a | false == a`. I tried to organize `eval_rvalue_with_identities` to make the pattern of the optimizations easier to see but it still obscurs what should be a simple peephole optmization. cc @oli-obk
2020-07-22Optimize away BitAnd and BitOr when possibleXavier Denis-3/+4
2020-07-21Expand test to cover type_name and monomorphic useGary Guo-15/+77
2020-07-19Guard against non-monomorphized type_id intrinsic callGary Guo-0/+40
2020-07-18Rollup merge of #74459 - canova:const-unreachable-unchecked, r=oli-obkManish Goregaokar-0/+81
Make unreachable_unchecked a const fn This PR makes `std::hint::unreachable_unchecked` a const fn so we can use it inside a const function. r? @RalfJung Fixes #53188.
2020-07-18Update UB test to fail during build with contant errorsNazım Can Altınova-5/+34
2020-07-17Rollup merge of #73930 - a1phyr:feature_const_option, r=dtolnayManish Goregaokar-0/+14
Make some Option methods const Tracking issue: #67441 Constantify the following methods of `Option`: - `as_ref` - `is_some` - `is_none` - `iter` (not sure about this one, but it is possible, and will be useful when const traits are a thing) cc @rust-lang/wg-const-eval @rust-lang/libs
2020-07-17Add a test for const unsafe_unreachable that triggers UBNazım Can Altınova-0/+35
2020-07-17Add a passing test for const unsafe_unreachableNazım Can Altınova-0/+17
2020-07-15Constify most non-trait `Duration` methods as described in #72440marmeladema-0/+57
2020-07-14Remove `Sized` `on_unimplemented` noteEsteban Küber-4/+0