about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-09-23Auto merge of #76659 - simonvandel:76432, r=oli-obkbors-0/+132
SimplifyComparisonIntegral: fix miscompilation Fixes #76432 Only insert StorageDeads if we actually removed one. Fixes an issue where we added StorageDead to a place with no StorageLive r? `@oli-obk`
2020-09-22Bless compile-failDylan MacKenzie-3/+1
2020-09-22Bless testsDylan MacKenzie-159/+200
2020-09-21Rollup merge of #77032 - lcnr:visit-all-the-item-likes, r=davidtwcoecstatic-morse-2/+37
lint missing docs for extern items fixes #76991
2020-09-21Rollup merge of #76914 - lcnr:path-no-more, r=ecstatic-morseecstatic-morse-0/+53
extend `Ty` and `TyCtxt` lints to self types blocked on #76891 r? @ecstatic-morse cc @Aaron1011
2020-09-21Rollup merge of #76807 - ecstatic-morse:const-checking-staged-api, r=oli-obkecstatic-morse-6/+63
Use const-checking to forbid use of unstable features in const-stable functions First step towards #76618. Currently this code isn't ever hit because `qualify_min_const_fn` runs first and catches pretty much everything. One exception is `const_precise_live_drops`, which does not use the newly added code since it runs as part of a separate pass. Also contains some unrelated refactoring, which is split into separate commits. r? @oli-obk
2020-09-21Rollup merge of #76581 - lcnr:bound-too-generic, r=eddybecstatic-morse-0/+124
do not ICE on bound variables, return `TooGeneric` instead fixes #73260, fixes #74634, fixes #76595 r? @nikomatsakis
2020-09-21Rollup merge of #76489 - GuillaumeGomez:add-explanation-e0756, r=jyn514ecstatic-morse-0/+1
Add explanation for E0756 r? @pickfire
2020-09-22lint missing docs for extern itemsBastian Kauschke-2/+37
2020-09-21Run the test with explicit -O such that Add is generated instead of CheckedAddSimon Vandel Sillesen-197/+198
This makes the test run deterministic regardless of noopt testruns
2020-09-21Add optimization to avoid load of addressSimon Vandel Sillesen-10/+390
2020-09-21Add explanation for E0756Guillaume Gomez-0/+1
2020-09-21add testBastian Kauschke-0/+53
2020-09-21Auto merge of #77013 - RalfJung:rollup-84ut0xq, r=RalfJungbors-0/+31
Rollup of 10 pull requests Successful merges: - #76439 (Add error explanation for E0755) - #76521 (Fix segfault if pthread_getattr_np fails) - #76835 (make replace_prefix only take &str as arguments ) - #76967 (Revert adding Atomic::from_mut.) - #76977 (Add a regression test for copy propagation miscompilation) - #76981 (liballoc bench use imported path Bencher) - #76983 (BTreeMap: extra testing & fixed comments) - #76996 (Fix typo in rustc_lexer docs) - #77009 (Dogfood total_cmp in the test crate) - #77012 (update Miri for another bugfix) Failed merges: - #76489 (Add explanation for E0756) r? `@ghost`
2020-09-21Rollup merge of #76977 - tmiasko:issue-76740, r=wesleywiserRalf Jung-0/+30
Add a regression test for copy propagation miscompilation
2020-09-21Rollup merge of #76439 - GuillaumeGomez:add-error-explanation-e0755, ↵Ralf Jung-0/+1
r=pickfire,jyn514 Add error explanation for E0755 r? @pickfire
2020-09-21Auto merge of #74040 - lcnr:const-occurs-check, r=nikomatsakisbors-0/+205
fix unification of const variables r? `@nikomatsakis` `@varkor` `@eddyb` let's just ping everyone here :sweat_smile:
2020-09-21add testsBastian Kauschke-0/+205
2020-09-21Auto merge of #77004 - RalfJung:rollup-usac4nv, r=RalfJungbors-14/+16
Rollup of 13 pull requests Successful merges: - #76135 (Stabilize some Option methods as const) - #76628 (Add sample defaults for config.toml ) - #76846 (Avoiding unnecesary allocations at rustc_errors) - #76867 (Use intra-doc links in core/src/iter when possible) - #76868 (Finish moving to intra doc links for std::sync) - #76872 (Remove DeclareMethods) - #76936 (Add non-`unsafe` `.get_mut()` for `Unsafecell`) - #76958 (Replace manual as_nanos and as_secs_f64 reimplementations) - #76959 (Replace write_fmt with write!) - #76961 (Add test for issue #34634) - #76962 (Use const_cstr macro in consts.rs) - #76963 (Remove unused static_assert macro) - #77000 (update Miri) Failed merges: r? `@ghost`
2020-09-21Rollup merge of #76961 - bugadani:test-34634, r=Mark-SimulacrumRalf Jung-0/+16
Add test for issue #34634 Closes #34634
2020-09-21Rollup merge of #76135 - CDirkx:const-option, r=dtolnay,oli-obkRalf Jung-14/+0
Stabilize some Option methods as const Stabilize the following methods of `Option` as const: - `is_some` - `is_none` - `as_ref` These methods are currently const under the unstable feature `const_option` (tracking issue: #67441). I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463). Related: #76225
2020-09-21Auto merge of #76843 - kornelski:longtypetofile, r=ecstatic-morsebors-14/+31
Let user see the full type of type-length limit error Seeing the full type of the error is sometimes essential to diagnosing the problem, but the type itself is too long to be displayed in the terminal in a useful fashion. This change solves this dilemma by writing the full offending type name to a file, and displays this filename as a note. > note: the full type name been written to '$TEST_BUILD_DIR/issues/issue-22638/issue-22638.long-type.txt' Closes #76777
2020-09-21Auto merge of #76295 - mati865:remove-mmx, r=Amanieu,oli-obkbors-33/+4
Remove MMX from Rust Follow-up to https://github.com/rust-lang/stdarch/pull/890 This removes most of MMX from Rust (tests pass with small changes), keeping stable `is_x86_feature_detected!("mmx")` working.
2020-09-21Let user see the full type of type-length limit errorKornel Lesiński-14/+31
2020-09-20Auto merge of #76544 - Mark-Simulacrum:less-python, r=alexcrichtonbors-3/+3
De-couple Python and bootstrap slightly This revises rustbuild's entry points from Python to rely less on magic environment variables, preferring to use Cargo-provided environment variables where feasible. Notably, BUILD_DIR and BOOTSTRAP_CONFIG are *not* moved, because both more-or-less have some non-trivial discovery logic and replicating it in rustbuild seems unfortunate; if it moved to Cargo that would be a different story. Best reviewed by-commit.
2020-09-20Move const tests for `Option` to `library\core`Christiaan Dirkx-12/+0
Part of #76268
2020-09-20Stabilize some Option methods as constCDirkx-2/+0
Stabilize the following methods of `Option` as const: - `is_some` - `is_none` - `as_ref` Possible because of stabilization of #49146 (Allow if and match in constants).
2020-09-20Provide bootstrap tools with RUSTC in environmentMark Rousskov-3/+3
2020-09-20Auto merge of #75119 - simonvandel:early-otherwise, r=oli-obkbors-0/+1046
New MIR optimization pass to reduce branches on match of tuples of enums Fixes #68867 by adding a new pass that turns something like ```rust let x: Option<()>; let y: Option<()>; match (x,y) { (Some(_), Some(_)) => {0}, _ => {1} } ``` into something like ```rust let x: Option<()>; let y: Option<()>; let discriminant_x = // get discriminant of x let discriminant_y = // get discriminant of x if discriminant_x != discriminant_y {1} else {0} ``` The opt-diffs still have the old basic blocks like ``` bb3: { _8 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early-otherwise-branch-68867.rs:21:21: 21:30 switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early-otherwise-branch-68867.rs:21:21: 21:30 } bb4: { _9 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early-otherwise-branch-68867.rs:22:23: 22:34 switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early-otherwise-branch-68867.rs:22:23: 22:34 } bb5: { _10 = discriminant((*(_4.1: &ViewportPercentageLength))); // scope 0 at $DIR/early-otherwise-branch-68867.rs:23:23: 23:34 switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early-otherwise-branch-68867.rs:23:23: 23:34 } ``` These do get removed on later passes. I'm not sure if I should include those passes in the test to make it clear?
2020-09-20emit diff after SimplifyBranches-after-copy-propSimon Vandel Sillesen-168/+480
2020-09-20Rollup merge of #76940 - Aaron1011:fix/trait-on-tait, r=oli-obkRalf Jung-0/+37
Don't allow implementing trait directly on type-alias-impl-trait This is specifically disallowed by the RFC, but we never added a check for it. Fixes #76202
2020-09-20Remove MMX from RustMateusz Mikuła-33/+4
2020-09-20add cleanup of cfgSimon Vandel Sillesen-104/+103
2020-09-20insert storageDead for not equal tempSimon Vandel Sillesen-0/+10
2020-09-20correct commentSimon Vandel Sillesen-992/+0
2020-09-20blessSimon Vandel Sillesen-349/+265
2020-09-20replace usize with u32 to make it easier to blessSimon Vandel Sillesen-18/+15
2020-09-20New MIR optimization pass to reduce branches on match of tuples of enumsSimon Vandel Sillesen-0/+1804
2020-09-20Add test for issue #34634Dániel Buga-0/+16
2020-09-20Auto merge of #74949 - oli-obk:validate_const_eval_raw, r=RalfJungbors-160/+136
Validate constants during `const_eval_raw` This PR implements the groundwork for https://github.com/rust-lang/rust/issues/72396 * constants are now validated during `const_eval_raw` * to prevent cycle errors, we do not validate references to statics anymore beyond the fact that they are not dangling * the `const_eval` query ICEs if used on `static` items * as a side effect promoteds are now evaluated to `ConstValue::Scalar` again (since they are just a reference to the actual promoted allocation in most cases).
2020-09-20update stderr fileBastian Kauschke-2/+1
2020-09-20Make codegen test bitwidth-independentOliver Scherer-2/+2
2020-09-20do not ICE on `ty::Bound` in Layout::computeBastian Kauschke-0/+39
2020-09-20miri: correctly deal with `ConstKind::Bound`Bastian Kauschke-0/+86
2020-09-20Auto merge of #76411 - RalfJung:promote-in-const-fn, r=ecstatic-morsebors-15/+55
Some promotion cleanup Based on top of both https://github.com/rust-lang/rust/pull/75502 and https://github.com/rust-lang/rust/pull/75585, this does some cleanup of the promotion code. The last 2 commits are new. * Remove the remaining cases where `const fn` is treated different from `fn`. This means no longer promoting ptr-to-int casts, raw ptr operations, and union field accesses in `const fn` -- or anywhere, for that matter. These are all unstable in const-context so this should not break any stable code. Fixes https://github.com/rust-lang/rust/issues/75586. * ~~Promote references to statics even outside statics (i.e., in functions) for consistency.~~ * Promote `&mut []` everywhere, not just in non-`const` functions, for consistency. * Explain why we do not promote deref's of statics outside statics. ~~(This is the only remaining direct user of `const_kind`.)~~ This can only land once the other two PRs land; I am mostly putting this up already because I couldn't wait ;) and to get some feedback from `@rust-lang/wg-const-eval` .
2020-09-20Auto merge of #75346 - ↵bors-2/+2
davidtwco:issue-69925-polymorphic-instancedef-fnptrshim, r=nikomatsakis shim: monomorphic `FnPtrShim`s during construction Fixes #69925. This PR adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`). r? `@eddyb`
2020-09-20Auto merge of #72632 - jonas-schievink:dest-prop, r=oli-obkbors-455/+852
Implement a generic Destination Propagation optimization on MIR This takes the work that was originally started by `@eddyb` in https://github.com/rust-lang/rust/pull/47954, and then explored by me in https://github.com/rust-lang/rust/pull/71003, and implements it in a general (ie. not limited to acyclic CFGs) and dataflow-driven way (so that no additional infrastructure in rustc is needed). The pass is configured to run at `mir-opt-level=2` and higher only. To enable it by default, some followup work on it is still needed: * Performance needs to be evaluated. I did some light optimization work and tested against `tuple-stress`, which caused trouble in my last attempt, but didn't go much in depth here. * We can also enable the pass only at `opt-level=2` and higher, if it is too slow to run in debug mode, but fine when optimizations run anyways. * Debuginfo needs to be fixed after locals are merged. I did not look into what is required for this. * Live ranges of locals (aka `StorageLive` and `StorageDead`) are currently deleted. We either need to decide that this is fine, or if not, merge the variable's live ranges (or remove these statements entirely – https://github.com/rust-lang/rust/issues/68622). Some benchmarks of the pass were done in https://github.com/rust-lang/rust/pull/72635.
2020-09-20Add a regression test for copy propagation miscompilationTomasz Miąsko-0/+30
2020-09-19Don't allow implementing trait directly on type-alias-impl-traitAaron Hill-0/+37
This is specifically disallowed by the RFC, but we never added a check for it. Fixes #76202
2020-09-19cleanup promotion const_kind checksRalf Jung-15/+55
in particular allow a few more promotions for consistency when they were already allowed in other contexts