about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-05-14Rollup merge of #72194 - doctorn:dispatch-from-dyn-ice, r=estebankDylan DPC-0/+29
Don't ICE on missing `Unsize` impl Previously code of the form ```rust #![feature(unsize, dispatch_from_dyn)] use std::marker::Unsize; use std::ops::DispatchFromDyn; pub struct Foo<'a, T: ?Sized> { _inner: &'a &'a T, } impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {} ``` would generate an ICE due to the missing `Unsize` impl being run through the `suggest_change_mut` suggestion. This PR adds an early exit and a pointer to the appropriate docs regarding `Unsize` instead: ``` error[E0277]: the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied --> src/test/ui/issues/issue-71036.rs:11:1 | 11 | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unsize<&'a U>` is not implemented for `&'a T` | = note: all implementations of `Unsize` are provided automatically by the compiler, see <https://doc.rust-lang.org/stable/std/marker/trait.Unsize.html> for more information = note: required because of the requirements on the impl of `std::ops::DispatchFromDyn<&'a &'a U>` for `&'a &'a T` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. ``` r? @estebank Resolves #71036
2020-05-14Rollup merge of #72127 - jademcgough:long-error-explanation-E0228, ↵Dylan DPC-2/+7
r=petrochenkov add long error explanation for E0228 Add long explanation for the E0228 error code Part of #61137 Let me know if this is wrong at all (or can be written more clearly), I'm still learning Rust.
2020-05-14Rollup merge of #72087 - matthewjasper:regionck-hang, r=nikomatsakisDylan DPC-0/+7
Fix hang in lexical_region_resolve Regionck was stuck in a loop where a region value was changing between two equal regions. Closes #72051
2020-05-14Rollup merge of #71910 - mibac138:necessary-paren, r=cuviperDylan DPC-0/+23
Fix unused_parens false positive when using binary operations Fixes #71290 r? @cuviper who provided instructions
2020-05-14Don't ICE on missing `Unsize` implNathan Corbyn-0/+29
2020-05-14Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obkRalf Jung-14/+14
Pointer printing: do not print 0 offset r? @eddyb Cc @oli-obk
2020-05-13Auto merge of #71451 - estebank:suggest-super-trait-constraint, r=nikomatsakisbors-92/+226
Suggest adding super trait constraints
2020-05-13Auto merge of #70416 - mzohreva:mz/sgx-test, r=nikomatsakisbors-0/+32
Process termination test for SGX The issue is described in https://github.com/fortanix/rust-sgx/issues/109 cc @jethrogb
2020-05-12add long error explanation for E0228Jade McGough-2/+7
2020-05-12fix test output after rebaseEsteban Küber-1/+1
2020-05-12Increase verbosity of bound restriction suggestionsEsteban Küber-119/+207
- Make the bound restriction suggestion `span_suggestion_verbose`. - Fix whitespace typo.
2020-05-12Suggest adding super trait constraintsEsteban Küber-9/+55
2020-05-12Pointer printing: do not print 0 offsetRalf Jung-14/+14
2020-05-12strings do not have to be valid UTF-8 any moreRalf Jung-8/+8
2020-05-11Rollup merge of #72067 - jonas-schievink:fuel-warn, r=varkorDylan DPC-6/+10
Emit a warning when optimization fuel runs out `eprintln!` gets swallowed by Cargo too easily.
2020-05-11Rollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morseDylan DPC-13/+13
display `ConstKind::Param`
2020-05-11Rollup merge of #72019 - matthewjasper:dont-skip-binder, r=davidtwcoDylan DPC-0/+36
Fix debug assertion in error code Closes #70813
2020-05-11Fix hang in lexical_region_resolveMatthew Jasper-0/+7
2020-05-10Emit a warning when optimization fuel runs outJonas Schievink-6/+10
`eprintln!` gets swallowed by Cargo too easily.
2020-05-10Auto merge of #71775 - petrochenkov:crtcfg, r=matthewjasperbors-5/+2
Enable `cfg` predicate for `target_feature = "crt-static"` only if the target supports it That's what all other `target_feature`s do.
2020-05-10Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obkbors-0/+51
Fix ICE for broken or-pattern in async fn closes #71297
2020-05-09display `ConstKind::Param`Bastian Kauschke-13/+13
2020-05-09Rollup merge of #71185 - JohnTitor:run-fail, r=petrochenkovRalf Jung-0/+1869
Move tests from `test/run-fail` to UI Fixes #65440 cc #65865 #65506 r? @nikomatsakis
2020-05-09Rollup merge of #69406 - jackh726:chalk-upgrade, r=nikomatsakisRalf Jung-0/+579
upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir Reintegrate chalk into rustc. r? @nikomatsakis cc. @rust-lang/wg-traits
2020-05-09Rollup merge of #71947 - mibac138:dead-code, r=cramertjDylan DPC-2/+54
Dead-code pass highlights too much of impl functions Fixes #66627. Previous diagnostic: ``` error: method is never used: `unused_impl_fn_3` --> src/main.rs:28:5 | 28 | / fn unused_impl_fn_3( 29 | | var: i32, 30 | | ) { 31 | | println!("bar {}", var); 32 | | } | |_____^ ``` New diagnostic: ``` error: associated function is never used: `unused_impl_fn_3` --> $DIR/lint-dead-code-6.rs:13:8 | LL | fn unused_impl_fn_3( | ^^^^^^^^^^^^^^^^ ``` This makes associated functions in line with free-standing functions.
2020-05-09Rollup merge of #71839 - LG3696:master, r=cramertjDylan DPC-0/+9
Make BTreeMap::new and BTreeSet::new const
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-08Fix debug assertion in error codeMatthew Jasper-0/+36
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-07Reintegrate chalk using chalk-solveJack Huey-0/+579
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 #71952 - JohnTitor:add-tests, r=Dylan-DPCDylan DPC-0/+82
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-08Skip tests on emscriptenYuki Okushi-0/+118
2020-05-07use hex for pointers in Miri error messages; refine vtable error messageRalf Jung-3/+3
2020-05-06Fix bind address in process-termination-blocking-io testMohsen Zohrevandi-1/+1
2020-05-07reword "possible candidate" import suggestionAndy Russell-97/+97
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 #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-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-35/+410
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