summary refs log tree commit diff
path: root/src/test/ui/consts
AgeCommit message (Collapse)AuthorLines
2022-12-07Make -Zsimulate-remapped-rust-src-base reproducible on CIOli Scherer-6/+6
2022-12-07Avoid remapping paths back to `$SRC_DIR` in CIOli Scherer-6/+6
2022-12-06Filter out precise alloc ids from diagnosticsOli Scherer-2/+3
2022-12-06Bless 32 bit testsOli Scherer-5/+10
2022-12-06Properly indent messagesOli Scherer-5/+7
2022-12-06Change CTFE backtraces to use `note` instead of `label` to preserve their orderOli Scherer-367/+1007
labels are reordered within the file in which they are reported, which can mess up the stack trace
2022-12-06Remove now-redundant file/line info from const backtracesOli Scherer-214/+214
2022-12-06Start emitting labels even if their pointed to file is not available locallyOli Scherer-0/+49
2022-12-05Tweak "the following other types implement trait"Esteban Küber-16/+6
When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types. fix fmt
2022-12-02Rollup merge of #104614 - Nilstrieb:type-ascribe!, r=TaKO8KiMatthias Krüger-2/+2
Add `type_ascribe!` macro as placeholder syntax for type ascription This makes it still possible to test the internal semantics of type ascription even once the `:`-syntax is removed from the parser. The macro now gets used in a bunch of UI tests that test the semantics and not syntax of type ascription. I might have forgotten a few tests but this should hopefully be most of them. The remaining ones will certainly be found once type ascription is removed from the parser altogether. Part of #101728
2022-12-01rustc_ast_lowering: Stop lowering imports into multiple itemsVadim Petrochenkov-2/+2
Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-11-25Add a test for scalar pair layout validationOli Scherer-3/+32
2022-11-25Print a trace through types to show how to get to the problematic typeOli Scherer-0/+10
2022-11-24Rollup merge of #104782 - oli-obk:const_eval_limit_bump, r=pnkfelixMatthias Krüger-4/+4
Bump the const eval step limit fixes https://github.com/rust-lang/rust/issues/103814 https://github.com/rust-lang/rust/pull/103877 has too much of an impact to beta backport. So let's just increase the limit, avoiding the immediate breakage. r? ``@pnkfelix``
2022-11-24make `error_reported` check for delayed bugsBoxy-0/+16
2022-11-23Bump the const eval step limitOli Scherer-4/+4
2022-11-21Do not check transmute if has non region inferhi-rustin-0/+19
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-11-19Use `type_ascribe!` in many UI testsNilstrieb-2/+2
Use it in all UI tests that are about the semantics and not the syntax of type ascription.
2022-11-16fix #104390, fix ICE in in_operand for ty erroryukang-0/+75
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-278/+405
2022-11-15Auto merge of #101168 - jachris:dataflow-const-prop, r=oli-obkbors-6/+6
Add new MIR constant propagation based on dataflow analysis The current constant propagation in `rustc_mir_transform/src/const_prop.rs` fails to handle many cases that would be expected from a constant propagation optimization. For example: ```rust let x = if true { 0 } else { 0 }; ``` This pull request adds a new constant propagation MIR optimization pass based on the existing dataflow analysis framework. Since most of the analysis is not unique to constant propagation, a generic framework has been extracted. It works on top of the existing framework and could be reused for other optimzations. Closes #80038. Closes #81605. ## Todo ### Essential - [x] [Writes to inactive enum variants](https://github.com/rust-lang/rust/pull/101168#pullrequestreview-1089493974). Resolved by rejecting the registration of places with downcast projections for now. Could be improved by flooding other variants if mutable access to a variant is observed. - [X] Handle [`StatementKind::CopyNonOverlapping`](https://github.com/rust-lang/rust/pull/101168#discussion_r957774914). Resolved by flooding the destination. - [x] Handle `UnsafeCell` / `!Freeze` correctly. - [X] Overflow propagation of `CheckedBinaryOp`: Decided to not propagate if overflow flag is `true` (`false` will still be propagated) - [x] More documentation in general. - [x] Arguments for correctness, documentation of necessary assumptions. - [x] Better performance, or alternatively, require `-Zmir-opt-level=3` for now. ### Extra - [x] Add explicit unreachability, i.e. upgrading the lattice from $\mathbb{P} \to \mathbb{V}$ to $\set{\bot} \cup (\mathbb{P} \to \mathbb{V})$. - [x] Use storage statements to improve precision. - [ ] Consider opening issue for duplicate diagnostics: https://github.com/rust-lang/rust/pull/101168#issuecomment-1276609950 - [ ] Flood moved-from places with $\bot$ (requires some changes for places with tracked projections). - [ ] Add downcast projections back in. - [ ] [Algebraic simplifications](https://github.com/rust-lang/rust/pull/101168#discussion_r957967878) (possibly with a shared API; done by old const prop). - [ ] Propagation through slices / arrays. - [ ] Find other optimizations that are done by old `const_prop.rs`, but not by this one.
2022-11-12Partially revert 74d53abJannis Christopher Köhl-3/+3
2022-11-12Require -Zmir-opt-level >= 3 for nowJannis Christopher Köhl-20/+6
2022-11-11Don't ICE with inline const errors during MIR buildMichael Goulet-0/+21
2022-11-10Don't ICE when encountering ConstKind::Error in RequiredConstsVisitorMichael Goulet-0/+14
2022-11-09Rollup merge of #103307 - b4den:master, r=estebankManish Goregaokar-80/+80
Add context to compiler error message Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`.
2022-11-09Rollup merge of #104125 - ink-feather-org:const_cmp_tuples, r=fee1-deadDylan DPC-11/+8
Const Compare for Tuples Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`. behind the `#![feature(const_cmp)]` gate. ~~Do not merge before #104113 is merged because I want to use this feature to clean up the new test that I added there.~~ r? ``@fee1-dead``
2022-11-09Cleanup fn trait ref testonestacked-11/+8
2022-11-09Auto merge of #104180 - fee1-dead-contrib:fix-wf-fndef, r=oli-obkbors-0/+5
Use `nominal_obligations_without_const` in wf for FnDef Fixes #104155.
2022-11-09Use `nominal_obligations_without_const` in wf for FnDefDeadbeef-0/+5
2022-11-08Rollup merge of #104113 - ink-feather-org:fix_const_fn_ref_impls, ↵Guillaume Gomez-0/+80
r=compiler-errors Fix `const_fn_trait_ref_impl`, add test for it #99943 broke `#[feature(const_fn_trait_ref_impl)]`, this PR fixes this and adds a test for it. r? ````@fee1-dead````
2022-11-07Reworked const fn ref testsonestacked-14/+59
2022-11-07Fix `const_fn_trait_ref_impl`, add test for itonestacked-0/+35
2022-11-07Rollup merge of #104003 - c410-f3r:moar-errors, r=petrochenkovDylan DPC-0/+53
Move some tests to more reasonable directories r? `@petrochenkov`
2022-11-07Update issue-50814.rs test resultJannis Christopher Köhl-9/+23
2022-11-05Move some tests to more reasonable directoriesCaio-0/+53
2022-11-05use spans in TypeTest rather than mir::LocationAli MJ Al-Nasrawy-20/+8
Spans are independent of the body being borrow-checked, so they don't need remapping when promoting type-tests and they yield more specific error spans inside bodies of closures/inline consts.
2022-11-02return const_error when ty has errorsTakayuki Maeda-0/+75
2022-10-23Add normalize hack backMichael Goulet-0/+31
2022-10-20Do not suggest trivially false const predicatesMichael Goulet-28/+0
2022-10-20Update tests to match error message changesb4den-80/+80
2022-10-14Rollup merge of #102938 - c410-f3r:here-we-go-again, r=petrochenkovDylan DPC-0/+21
Move some tests to more reasonable directories r? ``@petrochenkov``
2022-10-13Move some tests to more reasonable directoriesCaio-0/+21
2022-10-12Rollup merge of #102187 - b-naber:inline-const-source-info, r=eholkDylan DPC-0/+67
Use correct location for type tests in promoted constants Previously we forgot to remap the location in a type test collected when visiting the body of a promoted constant back to the usage location, causing an ICE when trying to get span information for that type test. Fixes https://github.com/rust-lang/rust/issues/102117
2022-10-10Rollup merge of #102275 - Urgau:stabilize-half_open_range_patterns, r=cjgillotYuki Okushi-1/+1
Stabilize `half_open_range_patterns` This PR stabilize `feature(half_open_range_patterns)`: ``` Allows using `..=X` as a pattern. ``` And adds a new `feature(half_open_range_patterns_in_slices)` for the slice part, https://github.com/rust-lang/rust/pull/102275#issuecomment-1267422806. The FCP was completed in https://github.com/rust-lang/rust/issues/67264.
2022-10-08Auto merge of #102315 - RalfJung:assert_unsafe_precondition, r=thomccbors-5/+5
add a few more assert_unsafe_precondition Add debug-assertion checking for `ptr.read()`, `ptr.write(_)`, and `unreachable_unchecked.` This is quite useful for [cargo-careful](https://github.com/RalfJung/cargo-careful).
2022-10-08Split slice part of feature(half_open_range_patterns) to [...]_in_slicesUrgau-1/+1
2022-10-07make const_err a hard errorRalf Jung-4743/+1156
2022-10-07add a few more assert_unsafe_preconditionRalf Jung-5/+5
2022-10-07Rollup merge of #102720 - lyming2007:issue-102397-fix, r=compiler-errorsMatthias Krüger-1/+1
do not reverse the expected type and found type for ObligationCauseCo… …de of IfExpressionWithNoElse this will fix #102397