Commit Graph

17 Commits

Author SHA1 Message Date
Matthew Jasper 5b279c8016 Check opaque types satisfy their bounds 2020-10-06 11:19:30 +01:00
csmoe 9be635306c resolve error code e0760 2020-06-04 09:37:32 +08:00
csmoe 2f311b07c8 Merge branch 'master' into issue-69276 2020-05-19 11:02:29 +08:00
csmoe 8841ede364 bless suggestion on spell out 2020-05-18 08:44:38 +08:00
Ralf Jung 6a8cf4a17c adjust tests 2020-05-09 14:40:17 +02:00
Esteban Küber 3a795fba03 On type mismatch involving associated type, suggest constraint
When an associated type is found when a specific type was expected, if
possible provide a structured suggestion constraining the associated
type in a bound.

```
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
  --> $DIR/associated-types-multiple-types-one-trait.rs:13:5
   |
LL |     want_y(t);
   |     ^^^^^^ expected `i32`, found associated type
...
LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
   |                 ----- required by this bound in `want_y`
   |
   = note:         expected type `i32`
           found associated type `<T as Foo>::Y`
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
   |
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
   |                             ^^^^^^^^^
```

```
error[E0308]: mismatched types
  --> $DIR/trait-with-missing-associated-type-restriction.rs:12:9
   |
LL |     qux(x.func())
   |         ^^^^^^^^ expected `usize`, found associated type
   |
   = note:         expected type `usize`
           found associated type `<impl Trait as Trait>::A`
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
   |
LL | fn foo(x: impl Trait<A = usize>) {
   |                     ^^^^^^^^^^
```
2020-05-02 18:23:46 -07:00
RoccoDev b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
Tyler Lanphear f6c3894724 compiletest: error if `compile-fail` header in ui test. 2020-02-02 02:08:30 -05:00
Esteban Küber 6f8f70624b Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
Esteban Küber 83ffda5216 Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
Esteban Küber 479ce39939 Add explanation to type mismatch involving type params and assoc types 2019-09-18 17:30:35 -07:00
Mazdak Farrokhzad 21476e7d6c --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
sd234678 b7b4c3a9aa Update stderr files with --bless 2019-08-16 10:54:20 +01:00
David Wood 861d1bb365
typeck: Prohibit RPIT types that inherit lifetimes
This commit prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.
2019-08-12 19:04:11 +01:00
varkor fc48541ab1 Update syntax in existing tests 2019-08-02 02:44:35 +01:00
Mazdak Farrokhzad 24a178e397 --bless tests due to INCOMPLETE_FEATURES being a lint. 2019-07-30 10:43:32 +02:00
Jonas Schievink 769b1cfd03 Normalize projections in opaque types 2019-07-03 22:21:34 +02:00