about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-05-08Rollup merge of #71710 - workingjubilee:jubilee-readd-test, r=nikomatsakisDylan DPC-0/+40
Test for zero-sized function items not ICEing Closes #30276. Again. Please give rustcake with no icing!
2020-05-08Rollup merge of #72008 - lcnr:patch-3, r=varkorDylan DPC-0/+29
Add const-generics test Taken from #71973 as this apparently already compiles. r? @varkor
2020-05-08add const-generics testBastian Kauschke-0/+29
2020-05-08Fix some tests failing in `--pass check` modeVadim Petrochenkov-5/+5
2020-05-07Rollup merge of #71960 - estebank:fix-E0284, r=davidtwcoDylan DPC-23/+64
Fix E0284 to not use incorrect wording Fix #71584, fix #69683.
2020-05-07Rollup merge of #71903 - euclio:reword-possible-better, r=petrochenkovDylan DPC-97/+97
reword "possible candidate" import suggestion This suggestion has always read a bit awkwardly to me, particularly the "possible better candidate" variant. This commit rewords the suggestion to be more concise and mention the kind of the suggested item. There isn't a nice way to label individual suggestions, so I opted to use "items" in the case of multiple suggestions.
2020-05-07Rollup merge of #71783 - estebank:async-block-2015, r=tmandryDylan DPC-18/+80
Detect errors caused by `async` block in 2015 edition Fix #67204.
2020-05-07Fix E0284 to not use incorrect wordingEsteban Küber-23/+64
Fix #71584, fix #69683.
2020-05-07Rollup merge of #71972 - RalfJung:miri-validity-error-refine, r=oli-obkDylan DPC-3/+3
use hex for pointers in Miri error messages Also refine vtable error message: distinguish between "drop fn does not point to a function" and "drop fn points to a function with the wrong signature".
2020-05-07Rollup merge of #71959 - petrochenkov:chelpers, r=Mark-SimulacrumDylan DPC-0/+2
tests: Fix warnings in `rust_test_helpers.c` MSVC is silly and doesn't recognize `assert` as diverging.
2020-05-07Rollup merge of #71952 - JohnTitor:add-tests, r=Dylan-DPCDylan DPC-0/+107
Add some regression tests Closes #29988 Closes #34979 Pick up two snippets that have been fixed from #67945 (shouldn't be closed yet!)
2020-05-08Add some skip flagsYuki Okushi-1/+4
2020-05-07use hex for pointers in Miri error messages; refine vtable error messageRalf Jung-3/+3
2020-05-07reword "possible candidate" import suggestionAndy Russell-97/+97
2020-05-06test: Fix warnings in `rust_test_helpers.c`Vadim Petrochenkov-0/+2
2020-05-06Rollup merge of #71950 - RalfJung:try-validation-cleanup, r=oli-obkDylan DPC-10/+50
Miri validation error handling cleanup Slightly expand @jumbatm's pattern macro and use it throughout validation. This ensures we never incorrectly swallow `InvalidProgram` errors or ICE when they occur. Fixes https://github.com/rust-lang/rust/issues/71353 r? @oli-obk
2020-05-06Rollup merge of #71918 - GuillaumeGomez:rename-methods-section, r=Dylan-DPCDylan DPC-12/+21
Rename methods section Fixes https://github.com/rust-lang/rust/issues/70475. It renames the section [methods](https://doc.rust-lang.org/nightly/std/string/struct.String.html#methods) into "Implementations". However, I didn't not update the title in the sidebar considering that it only lists methods under (even though I updated the link of the "methods" to make it point to the "implementations" section. r? @kinnison cc @rust-lang/rustdoc
2020-05-06Rollup merge of #70908 - estebank:suggest-add, r=nikomatsakisDylan DPC-9/+200
Provide suggestions for type parameters missing bounds for associated types When implementing the binary operator traits it is easy to forget to restrict the `Output` associated type. `rustc` now accounts for different cases to lead users in the right direction to add the necessary restrictions. The structured suggestions in the following output are new: ``` error: equality constraints are not yet supported in `where` clauses --> $DIR/missing-bounds.rs:37:33 | LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B { | ^^^^^^^^^^^^^^^^^^^^^^ not supported | = note: see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information help: if `Output` is an associated type you're trying to set, use the associated type binding syntax | LL | impl<B: Add> Add for E<B> where B: Add<Output = B> { | ^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/missing-bounds.rs:11:11 | 7 | impl<B> Add for A<B> where B: Add { | - this type parameter ... 11 | A(self.0 + rhs.0) | ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<B as std::ops::Add>::Output` help: consider further restricting this bound | 7 | impl<B> Add for A<B> where B: Add + std::ops::Add<Output = B> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot add `B` to `B` --> $DIR/missing-bounds.rs:31:21 | 31 | Self(self.0 + rhs.0) | ------ ^ ----- B | | | B | help: consider restricting type parameter `B` | 27 | impl<B: std::ops::Add<Output = B>> Add for D<B> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` That output is given for the following cases: ```rust struct A<B>(B); impl<B> Add for A<B> where B: Add { type Output = Self; fn add(self, rhs: Self) -> Self { A(self.0 + rhs.0) //~ ERROR mismatched types } } struct D<B>(B); impl<B> Add for D<B> { type Output = Self; fn add(self, rhs: Self) -> Self { Self(self.0 + rhs.0) //~ ERROR cannot add `B` to `B` } } struct E<B>(B); impl<B: Add> Add for E<B> where <B as Add>::Output = B { type Output = Self; fn add(self, rhs: Self) -> Self { Self(self.0 + rhs.0) } } ```
2020-05-07Add some tests for #67945Yuki Okushi-0/+59
2020-05-07Add test for #34979Yuki Okushi-0/+23
2020-05-07Add test for #29988Yuki Okushi-0/+22
2020-05-06Rollup merge of #71937 - mzohreva:mz/ui-tests-ignore-sgx, r=nikomatsakisDylan DPC-61/+71
Ignore SGX on a few ui tests cc @jethrogb
2020-05-06Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikicDylan DPC-41/+416
Define UB in float-to-int casts to saturate This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.
2020-05-06Fixup tests to test both const-eval and runtimeMark Rousskov-99/+22
2020-05-06Pull in miri test casesMark Rousskov-5/+458
2020-05-06Define UB in float-to-int casts to saturateMark Rousskov-7/+6
- Round to zero, and representable values cast directly. - `NaN` goes to 0 - Values beyond the limits of the type are saturated to the "nearest value" (essentially rounding to zero, in some sense) in the integral type, so e.g. `f32::INFINITY` would go to `{u,i}N::MAX.`
2020-05-06more precise vtable errorsRalf Jung-9/+9
2020-05-06Rollup merge of #71727 - hbina:simplified_usage, r=Mark-SimulacrumDylan DPC-3/+3
SipHasher with keys initialized to 0 should just use new() I believe that is what the `new()` is for, for good reasons.
2020-05-06convert remaining try_validation to new macroRalf Jung-5/+35
2020-05-05Detect errors caused by `async` block in 2015 editionEsteban Küber-18/+80
2020-05-05Ignore SGX on a few ui testsMohsen Zohrevandi-61/+71
2020-05-06add test for insufficiently aligned vtableRalf Jung-6/+16
2020-05-05Add test for new implementations section titleGuillaume Gomez-0/+9
2020-05-05Update testsGuillaume Gomez-12/+12
2020-05-05Rollup merge of #71894 - mibac138:semicolon-not-always-helpful, r=estebankDylan DPC-3/+27
Suggest removing semicolon in last expression only if it's type is known Fixes #67971 Is there a syntax for explicitly checking if a note doesn't exist in test output? Something like `//~ !NOTE ...` I believe r? @estebank deals with diagnostics.
2020-05-05Rollup merge of #69984 - lenary:lenary/force-uwtables, r=hanna-kruppeDylan DPC-0/+28
Add Option to Force Unwind Tables When panic != unwind, `nounwind` is added to all functions for a target. This can cause issues when a panic happens with RUST_BACKTRACE=1, as there needs to be a way to reconstruct the backtrace. There are three possible sources of this information: forcing frame pointers (for which an option exists already), debug info (for which an option exists), or unwind tables. Especially for embedded devices, forcing frame pointers can have code size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads). In production code, it can be the case that debug info is not kept, so it is useful to provide this third option, unwind tables, that users can use to reconstruct the call stack. Reconstructing this stack is harder than with frame pointers, but it is still possible. --- This came up in discussion on #69890, and turned out to be a fairly simple addition. r? @hanna-kruppe
2020-05-05Auto merge of #71846 - petrochenkov:fresh2, r=davidtwcobors-0/+1
resolve: Relax fresh binding disambiguation slightly to fix regression Fixes https://github.com/rust-lang/rust/issues/71765
2020-05-05Suggest removing semicolon in last expression only if it's type is knownmibac138-3/+27
2020-05-05Rollup merge of #71902 - mibac138:const-feature-diag, r=varkorDylan DPC-0/+67
Suggest to add missing feature when using gated const features Fixes #71797
2020-05-05Rollup merge of #71711 - Mark-Simulacrum:deignore-tests, r=nikomatsakisDylan DPC-34/+7
Updates to some ignored tests This removes or fixes some ignored test cases. cc #13745
2020-05-05Rollup merge of #71587 - matthewjasper:promoted-move-errors, r=nikomatsakisDylan DPC-0/+51
Report cannot move errors in promoted MIR Closes #70934
2020-05-04Suggest to add missing feature when using gated const featuresmibac138-0/+67
2020-05-04review comments and rebase fixEsteban Küber-3/+9
2020-05-04On incorrect equality constraint likely to be assoc type, suggest ↵Esteban Küber-1/+51
appropriate syntax When encountering `where <A as Foo>::Bar = B`, it is possible that `Bar` is an associated type. If so, suggest `where A: Foo<Bar = B>`. CC #20041.
2020-05-04Suggest restricting type param when it doesn't satisfy projectionEsteban Küber-3/+129
When encountering a projection that isn't satisfied by a type parameter, suggest constraining the type parameter.
2020-05-04Handle binop on unbound type paramEsteban Küber-3/+12
When encountering a binary operation involving a type parameter that has no bindings, suggest adding the appropriate bound.
2020-05-04Rollup merge of #71810 - estebank:issue-71798, r=davidtwcoDylan DPC-0/+27
Do not try to find binop method on RHS `TyErr` Fix #71798.
2020-05-04Rollup merge of #71697 - felix91gr:new_prop_into_fn_call, r=wesleywiserDylan DPC-5/+30
Added MIR constant propagation of Scalars into function call arguments Now for the function call arguments! Caveats: 1. It's only being enabled at `mir-opt-2` or higher, because currently codegen gives performance regressions with this optimization. 2. Only propagates Scalars. Tuples and references (references are `Indirect`, right??) are not being propagated into as of this PR. 3. Maybe more tests would be nice? 4. I need (shamefully) to ask @wesleywiser to write in his words (or explain to me, and then I can write it down) why we want to ignore propagation into `ScalarPairs` and `Indirect` arguments. r? @wesleywiser
2020-05-04Rollup merge of #71038 - lcnr:dyn_trait_structural_match, r=pnkfelixDylan DPC-0/+50
forbid `dyn Trait` in patterns Do not allow `&dyn Trait` as a generic const parameters. This also changes dyn trait in pattern from ICE to error. closes #63322 closes #70972 r? @eddyb
2020-05-04Add Option to Force Unwind TablesSam Elliott-0/+28
When panic != unwind, `nounwind` is added to all functions for a target. This can cause issues when a panic happens with RUST_BACKTRACE=1, as there needs to be a way to reconstruct the backtrace. There are three possible sources of this information: forcing frame pointers (for which an option exists already), debug info (for which an option exists), or unwind tables. Especially for embedded devices, forcing frame pointers can have code size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads). In code, it can be the case that debug info is not kept, so it is useful to provide this third option, unwind tables, that users can use to reconstruct the call stack. Reconstructing this stack is harder than with frame pointers, but it is still possible. This commit adds a compiler option which allows a user to force the addition of unwind tables. Unwind tables cannot be disabled on targets that require them for correctness, or when using `-C panic=unwind`.