about summary refs log tree commit diff
path: root/src/test/ui/traits
AgeCommit message (Collapse)AuthorLines
2020-02-02Wording changes to object unsafe trait errorsEsteban Küber-13/+33
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
2020-02-02Slight rewording of diagnostic messageEsteban Küber-1/+1
2020-02-02Use more accurate failed predicate spansEsteban Küber-5/+4
2020-02-02Point at arguments or output when fn obligations come from them, or ident ↵Esteban Küber-8/+8
when they don't
2020-02-02compiletest: error if `compile-fail` header in ui test.Tyler Lanphear-13/+7
2020-01-12Diagnostics should start lowercasevarkor-3/+3
2020-01-08Unify output of "variant not found" errorsEsteban Küber-14/+14
2019-12-28Ignore i586-unknown-linux-gnu and i586-unknown-musl in testsEsteban Küber-8/+11
2019-12-24Tweak errors for missing associated types and type parametersEsteban Küber-11/+11
2019-12-20Rollup merge of #67285 - ohadravid:indicate-origin-of-where-type-parameter, ↵Mazdak Farrokhzad-1/+1
r=estebank Indicate origin of where type parameter for uninferred types Based on #65951 (which is not merge yet), fixes #67277. This PR improves a little the diagnostic for code like: ``` async fn foo() { bar().await; } async fn bar<T>() -> () {} ``` by showing: ``` error[E0698]: type inside `async fn` body must be known in this context --> unresolved_type_param.rs:9:5 | 9 | bar().await; | ^^^ cannot infer type for type parameter `T` declared on the function `bar` | ... ``` (The ``` declared on the function `bar` ``` part is new) A small side note: `Vec` and `slice` seem to resist this change, because querying `item_name()` panics, and `get_opt_name()` returns `None`. r? @estebank
2019-12-20Rollup merge of #67127 - estebank:disambiguate-suggestion, r=varkorMazdak Farrokhzad-2/+8
Use structured suggestion for disambiguating method calls Fix #65635.
2019-12-19Rollup merge of #67189 - LeSeulArtichaut:binop-wording, r=estebankMazdak Farrokhzad-2/+2
Unify binop wording Closes #60497 r? @estebank
2019-12-17Revert "Auto merge of #67362 - Mark-Simulacrum:par-4-default, r=alexcrichton"Mark Rousskov-2/+18
This reverts commit 3ed3b8bb7b100afecf7d5f52eafbb70fec27f537, reversing changes made to 99b89533d4cdf7682ea4054ad0ee36c351d05df1. We will reland a similar patch at a future date but for now we should get a nightly released in a few hours with the parallel patch, so this should be reverted to make sure that the next nightly is not parallel-enabled.
2019-12-16Always build and ship parallel-enabled compilersMark Rousskov-18/+2
This also removes the unused NO_PARALLEL_COMPILER flag; if we want that functionality we can readd it but this makes sure we really are parallel everywhere. This also patches a test that has differing output in the parallel case (hopefully deterministically so!).
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-1/+1
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-12-14Indicate origin of where type parameter for uninferred typesOhad Ravid-1/+1
2019-12-12Update testsLeSeulArtichaut-1/+1
2019-12-12Update UI test expectationsLeSeulArtichaut-1/+1
2019-12-11Use structured suggestion for disambiguating method callsEsteban Küber-2/+8
Fix #65635.
2019-12-11Add more context for type parametersEsteban Küber-1/+1
2019-12-10Deduplicate logicEsteban Küber-2/+4
2019-12-05Rollup merge of #67011 - Aaron1011:fix/expected-found-span, r=Dylan-DPCMazdak Farrokhzad-3/+7
Include a span in more `expected...found` notes In most places, we use a span when emitting `expected...found` errors. However, there were a couple of places where we didn't use any span, resulting in hard-to-interpret error messages. This commit attaches the relevant span to these notes, and additionally switches over to using `note_expected_found` instead of manually formatting the message
2019-12-04Auto merge of #66408 - nnethercote:greedy-process_obligations, r=nmatsakisbors-1/+3
Make `process_obligations()` greedier. `process_obligations()` adds new nodes, but it does not process these new nodes until the next time it is called. This commit changes it so that it does process these new nodes within the same call. This change reduces the number of calls to `process_obligations()` required to complete processing, sometimes giving significant speed-ups. The change required some changes to tests. - The output of `cycle-cache-err-60010.rs` is slightly different. - The unit tests required extra cases to handle the earlier processing of the added nodes. I mostly did these in the simplest possible way, by making the added nodes be ignored, thus giving outcomes the same as with the old behaviour. But I changed `success_in_grandchildren()` more extensively so that some obligations are completed earlier than they used to be. r? @nikomatsakis
2019-12-03Include a span in more `expected...found` notesAaron Hill-3/+7
In most places, we use a span when emitting `expected...found` errors. However, there were a couple of places where we didn't use any span, resulting in hard-to-interpret error messages. This commit attaches the relevant span to these notes, and additionally switches over to using `note_expected_found` instead of manually formatting the message
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-24fixup! Add negative tests where the diagnostic message would be wrongTimo Freiberg-14/+103
2019-11-24Add version mismatch help message for unimplemented traitTimo Freiberg-7/+48
Issue #22750 The error reporting for E0277 (the trait `X` is not implemented for `Foo`) now checks whether `Foo` implements a trait with the same path as `X`, which probably means that the programmer wanted to actually use only one version of the trait `X` instead of the two.
2019-11-21Auto merge of #66610 - alexreg:trait-upcasting-cosmetic, r=Centrilbors-2/+2
Aggregation of drive-by cosmetic changes for trait-upcasting PR Cherry-picked from #60900. As requested by @Centril (and @nikomatsakis, I believe). r? @Centril
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-2/+2
2019-11-21Auto merge of #66389 - estebank:type-err-labels, r=petrochenkovbors-15/+12
Specific labels when referring to "expected" and "found" types
2019-11-21Remove `#![feature(never_type)]` from tests.Mazdak Farrokhzad-1/+1
Also remove `never_type` the feature-gate test.
2019-11-18Surround types with backticks in type errorsEsteban Küber-2/+2
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-3/+0
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-10/+10
2019-11-16Account for `rustc_on_unimplemented`Esteban Küber-4/+6
2019-11-16Remove unnecessary noteEsteban Küber-2/+0
2019-11-16Modify primary label message to be inline with error messageEsteban Küber-2/+2
2019-11-16Suggest borrowing when it would satisfy an unmet trait boundEsteban Küber-6/+12
When there are multiple implementors for the same trait that is present in an unmet binding, modify the E0277 error to refer to the parent obligation and verify whether borrowing the argument being passed in would satisfy the unmet bound. If it would, suggest it.
2019-11-15Make `process_obligations()` greedier.Nicholas Nethercote-1/+3
`process_obligations()` adds new nodes, but it does not process these new nodes until the next time it is called. This commit changes it so that it does process these new nodes within the same call. This change reduces the number of calls to `process_obligations()` required to complete processing, sometimes giving significant speed-ups. The change required some changes to tests. - The output of `cycle-cache-err-60010.rs` is slightly different. - The unit tests required extra cases to handle the earlier processing of the added nodes. I mostly did these in the simplest possible way, by making the added nodes be ignored, thus giving outcomes the same as with the old behaviour. But I changed `success_in_grandchildren()` more extensively so that some obligations are completed earlier than they used to be.
2019-11-08Rollup merge of #66049 - RalfJung:missing-spans, r=alexcrichtonYuki Okushi-9/+8
consistent handling of missing sysroot spans Due to https://github.com/rust-lang/rust/issues/53081, sysroot spans (pointing to code in libcore/libstd/...) fails to print on some x86 runners. This consolidates the ignore directives for that and references the relevant issue. I also did that for the generated derive-error-span tests -- but there the script and the tests were not entirely in sync any more since https://github.com/rust-lang/rust/pull/64151. Cc @estebank @varkor
2019-11-04Use check-pass in ui tests where appropriateTomasz Miąsko-1/+1
2019-11-02consistent handling of missing sysroot spansRalf Jung-9/+8
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-2/+6
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-27Auto merge of #65288 - estebank:point-at-assoc-type, r=nikomatsakisbors-4/+9
Point at associated type for some obligations Partially address #57663.
2019-10-26Rollup merge of #65773 - estebank:sugg-whitespace, r=CentrilMazdak Farrokhzad-0/+1
Increase spacing for suggestions in diagnostics Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages. r? @Centril
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+1
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-24syntax: reject `trait Foo: Bar = Baz;`.Mazdak Farrokhzad-5/+20
Add test for rejecting `trait A: B1 = B2;`. Also test rejection of `trait A: = B;`.
2019-10-23Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakisbors-0/+2
Object safe for dispatch cc #43561
2019-10-22review comments: move code, fix indentation and change spanEsteban Küber-7/+6
2019-10-22Point at associated type for some obligationsEsteban Küber-5/+11