summary refs log tree commit diff
path: root/src/test/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
2018-05-25prohibit turbofish in `impl Trait` methodsNiko Matsakis-0/+36
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-20/+15
2018-03-26Stabilize universal_impl_traitTaylor Cramer-11/+5
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-1/+3
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-21use subtyping when we create a closure instead of for upvar typesNiko Matsakis-0/+31
We used to make the upvar types in the closure `==` but that was stronger than we needed. Subtyping suffices, since we are copying the upvar value into the closure field. This in turn allows us to infer smaller lifetimes in captured values in some cases (like the example here), avoiding errors.
2018-03-21report an error if we see an unexpected lifetime in impl TraitNiko Matsakis-0/+89
But leave closure substs alone.
2018-03-16Update testsJohn Kåre Alsaker-1/+3
2018-03-14update testsGuillaume Gomez-14/+12
2018-02-26Update UI testsVadim Petrochenkov-14/+14
2018-02-26Update UI testsVadim Petrochenkov-67/+67
2018-02-25Update ui testsGuillaume Gomez-0/+14
2018-02-10Change error message for E0391 to "cyclic dependency detected"John Kåre Alsaker-2/+2
2018-02-07Rollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakisManish Goregaokar-2/+2
Add filtering options to `rustc_on_unimplemented` - Add filtering options to `rustc_on_unimplemented` for local traits, filtering on `Self` and type arguments. - Add a way to provide custom notes. - Tweak binops text. - Add filter to detect wether `Self` is local or belongs to another crate. - Add filter to `Iterator` diagnostic for `&str`. Partly addresses #44755 with a different syntax, as a first approach. Fixes #46216, fixes #37522, CC #34297, #46806.
2018-02-03Auto merge of #47791 - estebank:mismatched-trait-impl, r=nikomatsakisbors-2/+2
Tweak presentation on lifetime trait mismatch - On trait/impl method discrepancy, add label pointing at trait signature. - Point only at method definition when referring to named lifetimes on lifetime mismatch. - When the sub and sup expectations are the same, tweak the output to avoid repeated spans. Fix #30790, CC #18759.
2018-02-01Add filter to detect local crates for rustc_on_unimplementedEsteban Küber-1/+1
2018-02-01Change rustc_on_unimplemented for Iterator and binopsEsteban Küber-2/+10
2018-02-01Add filtering options to `rustc_on_unimplemented`Esteban Küber-11/+3
- filter error on the evaluated value of `Self` - filter error on the evaluated value of the type arguments - add argument to include custom note in diagnostic - allow the parser to parse `Self` when processing attributes - add custom message to binops
2018-01-28Point only at method signatures and point at traitEsteban Küber-2/+2
- On mismatch between impl and trait method, point at the trait signature. - Point only at the method signature instead of the whole body on trait/impl mismatch errors.
2018-01-27Make `+` in `impl/dyn Trait` non-associativeVadim Petrochenkov-0/+127
2018-01-22Do not suggest private traits that have missing methodEsteban Küber-8/+4
When encountering a method call for an ADT that doesn't have any implementation of it, we search for traits that could be implemented that do have that method. Filter out private non-local traits that would not be able to be implemented. This doesn't account for public traits that are in a private scope, but works as a first approximation and is a more correct behavior than the current one.
2018-01-15On E0283, point at method with the requirementsEsteban Küber-2/+10
On required type annotation diagnostic error, point at method with the requirements if the span is available.
2017-12-19Point at def span in "missing in impl" errorEsteban Küber-1/+1
2017-12-14Remove NOTE/HELP annotations from UI testsVadim Petrochenkov-113/+77
2017-11-27Make main span in impl-trait ciclic reference point to def_spanEsteban Küber-8/+2
2017-11-26Make impl-trait ciclical reference error point to def_spanEsteban Küber-16/+4
2017-11-26Move "auto trait leak" impl-trait cycle dependency test to uiEsteban Küber-0/+139
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-154/+129
2017-11-23Auto merge of #46024 - estebank:no-variant, r=petrochenkovbors-0/+15
Use the proper term when using non-existing variant When using a non-existing variant, function or associated item, refer to the proper term, instead of defaulting to "associated item" in diagnostics. Fix #28972. ``` error[E0599]: no variant named `Quux` found for type `Foo` in the current scope --> file.rs:7:9 | 7 | Foo::Quux(..) =>(), | ^^^^^^^^^^^^^ ```
2017-11-20Add structured suggestions for trait importsOliver Schneider-18/+36
2017-11-16Use local spans onlyEsteban Küber-136/+57
2017-11-16Remove left over dead code from suggestion diagnostic refactoringOliver Schneider-2/+0
2017-11-15Point to ADT definition when not finding variant, method, assoc typeEsteban Küber-56/+150
2017-11-15add a new test featuring two impl traits to show what it looks likeNiko Matsakis-0/+32
2017-11-15Add/Fix stderr references for impl Trait ui testsChristopher Vittal-1/+31
2017-11-15some tests featuring multiple bounds, other errorsNiko Matsakis-0/+26
2017-11-15add a UI test showing the current output from an impl trait typeNiko Matsakis-0/+32
2017-08-29remove the hacky selection impl in `method::probe`Ariel Ben-Yehuda-0/+4
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-4/+4
Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed. This changes the compiler driver API to handle errors more smoothly, and therefore is a compiler-api-[breaking-change]. Fixes #42793.
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-1/+1
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-05Auto merge of #42383 - estebank:candidate-newline, r=arielb1bors-0/+494
Use multiline note for trait suggestion
2017-06-04Separate suggestion in a `help` and a `note`Esteban Küber-20/+40
2017-06-04Show trait method signature when impl differsEsteban Küber-0/+65
When the trait's span is available, it is already being used, add a `note` for the cases where the span isn't available: ``` error[E0053]: method `fmt` has an incompatible type for trait --> $DIR/trait_type.rs:17:4 | 17 | fn fmt(&self, x: &str) -> () { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected type `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` found type `fn(&MyType, &str)` error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2 --> $DIR/trait_type.rs:21:11 | 21 | fn fmt(&self) -> () { } | ^^^^^ expected 2 parameters, found 1 | = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl --> $DIR/trait_type.rs:25:4 | 25 | fn fmt() -> () { } | ^^^^^^^^^^^^^^^^^^ expected `&self` in impl | = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` error[E0046]: not all trait items implemented, missing: `fmt` --> $DIR/trait_type.rs:28:1 | 28 | impl std::fmt::Display for MyType4 {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation | = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` ```
2017-06-02Use multiline note for trait suggestionEsteban Küber-0/+474
2017-06-01tests: fix fallout from changing the span of binop errors.Eduard-Mihai Burtescu-2/+2
2017-05-24Rollup merge of #42150 - citizen428:feature/error-count-messages, ↵Mark Simulacrum-1/+1
r=Mark-Simulacrum Change error count messages See #33525 for details. r? @Mark-Simulacrum
2017-05-24Change error count messagesMichael Kohl-1/+1
See #33525 for details.
2017-05-17Add better error message when == operator is badly usedGuillaume Gomez-2/+2
2017-04-10Explicit help message for binop type missmatchEsteban Küber-0/+127
When trying to do a binary operation with missing implementation, for example `1 + Some(2)`, provide an explicit help message: ``` note: no implementation for `{integer} + std::option::Option<{integer}>` ``` Use `rustc_on_unimplemented` for the suggestions. Move cfail test to ui.