about summary refs log tree commit diff
path: root/src/test/ui/const-eval
AgeCommit message (Collapse)AuthorLines
2018-08-20Moved issue-53157.rs into src/test/ui/consts/const-eval/thedarkula-23/+0
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-2187/+0
2018-08-08Auto merge of #53163 - oli-obk:const_prop_ice, r=nikomatsakisbors-0/+23
Remove an overly pedantic and wrong assertion fixes #53157 fixes #53087
2018-08-07Fix tidyOliver Schneider-1/+1
2018-08-07Remove an overly pedantic and wrong assertionOliver Schneider-0/+23
2018-08-07Fix tidyOliver Schneider-2/+2
2018-08-07Make sure the feature gate actually works and never allows promoting these ↵Oliver Schneider-0/+116
operations
2018-08-07Rebase fallout: new tests need updated ui outputOliver Schneider-6/+8
2018-08-07Don't accidentally promote union access in MIROliver Schneider-11/+0
2018-08-07Add feature gate checksOliver Schneider-0/+33
2018-08-07Place unions, pointer casts and pointer derefs behind extra feature gatesOliver Schneider-2/+19
2018-08-02Reading values should not be looking at the variantOliver Schneider-4/+5
2018-08-01Fallout from fixing `try_read_value` to work with enumsOliver Schneider-22/+18
2018-08-01Fix `try_read_value` not working for enumsOliver Schneider-0/+16
2018-07-29Move a test that depends on the arch bitwidth to compile-failOliver Schneider-132/+0
2018-07-29Sanity-check all constantsOliver Schneider-13/+549
2018-07-26Auto merge of #52673 - oli-obk:mutable_promoted, r=nagisa,cramertj,estebankbors-0/+17
Try to fix an ICE might fix #52671
2018-07-250-length arrays can even be mutably promotedOliver Schneider-0/+17
2018-07-25Hide some lints which are not quite right the way they are reported to the userOliver Schneider-0/+24
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-142/+12
2018-07-23Auto merge of #52568 - oli-obk:span_bug_error, r=varkorbors-0/+91
Fix loop label resolution around constants And make `delay_span_bug` a little more helpful r? @varkor fixes #52442 fixes #52443
2018-07-22Auto merge of #52394 - estebank:println, r=oli-obkbors-30/+12
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
2018-07-20Properly scope label resolutionOliver Schneider-0/+91
2018-07-19Improve suggestion for missing fmt str in printlnEsteban Küber-30/+12
Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal.
2018-07-18Const-propagate castsOliver Schneider-0/+21
2018-07-15fix line numbersRalf Jung-3/+3
2018-07-15add license textRalf Jung-0/+10
2018-07-15add test caseRalf Jung-0/+42
2018-07-11Auto merge of #51702 - ecstatic-morse:infinite-loop-detection, r=oli-obkbors-0/+66
Infinite loop detection for const evaluation Resolves #50637. An `EvalContext` stores the transient state (stack, heap, etc.) of the MIRI virtual machine while it executing code. As long as MIRI only executes pure functions, we can detect if a program is in a state where it will never terminate by periodically taking a "snapshot" of this transient state and comparing it to previous ones. If any two states are exactly equal, the machine must be in an infinite loop. Instead of fully cloning a snapshot every time the detector is run, we store a snapshot's hash. Only when a hash collision occurs do we fully clone the interpreter state. Future snapshots which cause a collision will be compared against this clone, causing the interpreter to abort if they are equal. At the moment, snapshots are not taken until MIRI has progressed a certain amount. After this threshold, snapshots are taken every `DETECTOR_SNAPSHOT_PERIOD` steps. This means that an infinite loop with period `P` will be detected after a maximum of `2 * P * DETECTOR_SNAPSHOT_PERIOD` interpreter steps. The factor of 2 arises because we only clone a snapshot after it causes a hash collision.
2018-07-04Shorten error message and add link to testDylan MacKenzie-4/+4
Implements @bjorn3's suggestions.
2018-07-04Explain reason behind error spanDylan MacKenzie-1/+1
We can't expand the span of the error reliably according to @oli-obk, so just mention why it points to this particular expression.
2018-07-04Add a UI test for #50637Dylan MacKenzie-0/+66
This test relies on the fact that restrictions on expressions in `const fn` do not apply when computing array lengths. It is more difficult to statically analyze than the simple `loop{}` mentioned in #50637. This test should be updated to ignore the warning after #49980 is resolved.
2018-07-03Deduplicate error reports for staticsOliver Schneider-11/+2
2018-06-28Rollup merge of #51839 - oli-obk:const_shift_overflow, r=nikomatsakisMark Rousskov-0/+28
Detect overflows of non u32 shifts
2018-06-28Turn the use of erroneous constants into errors againOliver Schneider-19/+19
2018-06-28Don't const propagate the body of constantsOliver Schneider-126/+73
2018-06-27Don't use `ParamEnv::reveal_all()` if there is a real one availableOliver Schneider-0/+28
2018-06-27Detect overflows of non u32 shiftsOliver Schneider-0/+28
2018-06-26migrate codebase to `..=` inclusive range patternsZack M. Davis-4/+4
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
2018-06-05Rebase falloutOliver Schneider-3/+12
2018-06-05Satisfy the untiring tidyOliver Schneider-2/+2
2018-06-05Properly report transitive errorsOliver Schneider-8/+194
2018-06-05Referring to erroneous constants in promoteds must abort the buildOliver Schneider-31/+277
2018-06-05Refactor the const eval diagnostic APIOliver Schneider-32/+31
2018-06-05Fix tidyFabian Zaiser-1/+1
2018-06-05Propagate uses of constants correctly so that array index checks workFabian Zaiser-10/+21
2018-06-04Auto merge of #51307 - oli-obk:miri_fixes, r=eddybbors-0/+41
ScalarPairs are offset==0 field + other non-zst field r? @eddyb fixes #51300
2018-06-03Do not promote union field accessesOliver Schneider-0/+38
2018-06-02Correctly access ScalarPair fields during const evalOliver Schneider-0/+41
2018-05-25Auto merge of #50967 - oli-obk:miri_api_refactor, r=eddybbors-0/+68
Miri api refactor r? @eddyb cc @Zoxc based on https://github.com/rust-lang/rust/pull/50916