about summary refs log tree commit diff
path: root/src/test/ui/suggestions
AgeCommit message (Collapse)AuthorLines
2020-05-22Bless other example of #71394Dylan MacKenzie-1/+0
2020-05-22Add regression test for #71394Dylan MacKenzie-0/+16
2020-05-22Rollup merge of #72306 - Aaron1011:feature/turbo-spacing, r=petrochenkovRalf Jung-2/+9
Break tokens before checking if they are 'probably equal' Fixes #68489 Fixes #70987 When checking two `TokenStreams` to see if they are 'probably equal', we ignore the `IsJoint` information associated with each `TokenTree`. However, the `IsJoint` information determines whether adjacent tokens will be 'glued' (if possible) when construction the `TokenStream` - e.g. `[Gt Gt]` can be 'glued' to `BinOp(Shr)`. Since we are ignoring the `IsJoint` information, 'glued' and 'unglued' tokens are equivalent for determining if two `TokenStreams` are 'probably equal'. Therefore, we need to 'unglue' all tokens in the stream to avoid false negatives (which cause us to throw out the cached tokens, losing span information).
2020-05-21Rollup merge of #72149 - estebank:icemation, r=eddybRalf Jung-10/+28
Don't `type_of` on trait assoc ty without default Fix #72076.
2020-05-20Fix testsAaron Hill-2/+9
2020-05-14Rollup merge of #72127 - jademcgough:long-error-explanation-E0228, ↵Dylan DPC-1/+1
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-12add long error explanation for E0228Jade McGough-1/+1
2020-05-12Increase verbosity of bound restriction suggestionsEsteban Küber-14/+20
- Make the bound restriction suggestion `span_suggestion_verbose`. - Fix whitespace typo.
2020-05-12Don't `type_of` on trait assoc ty without defaultEsteban Küber-10/+28
Fix #72076.
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-08Fix debug assertion in error codeMatthew Jasper-0/+36
2020-05-07reword "possible candidate" import suggestionAndy Russell-2/+2
2020-05-03fix rebaseEsteban Küber-2/+0
2020-05-02When a projection is expected, suggest constraining or calling methodEsteban Küber-14/+31
2020-05-02On type mismatch involving associated type, suggest constraintEsteban Küber-2/+309
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-01Uncomment test code for failure to use `Box::pin`Esteban Küber-16/+95
Close #69083.
2020-04-28Rollup merge of #71311 - estebank:fn-type-param, r=varkorDylan DPC-0/+16
On `FnDef` type annotation suggestion, use fn-pointer output Address the last point in #71209.
2020-04-22Revert old span changeEsteban Küber-4/+4
2020-04-22Tweak wordingEsteban Küber-17/+17
2020-04-22Tweak `'static` suggestion codeEsteban Küber-3/+337
Fix #71196.
2020-04-18On `FnDef` type annotation suggestion, use fn-pointer outputEsteban Küber-0/+16
Partly addresses #71209.
2020-04-18Add label to item source of bound obligationEsteban Küber-3/+3
2020-04-18Do not emit note for projected derived obligationsEsteban Küber-1/+0
2020-04-18Remove `AssocTypeBound` and propagate bound `Span`sEsteban Küber-6/+8
2020-04-13Remove `FnCtxt::impl_self_ty`Yuki Okushi-1/+1
2020-04-11fix rebaseEsteban Küber-5/+5
2020-04-11Try to use the first char in the trait name as type paramEsteban Küber-6/+6
2020-04-11Account for existing names when suggesting adding a type paramEsteban Küber-5/+27
2020-04-11Account for type params with boundsEsteban Küber-1/+24
2020-04-11Handle `impl Trait` where `Trait` has an assoc type with missing boundsEsteban Küber-0/+77
Fix #69638.
2020-04-10Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddybMazdak Farrokhzad-17/+31
Use `PredicateObligation`s instead of `Predicate`s Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations. Subset of #69709. r? @eddyb
2020-04-08Small tweaks to required bound spanEsteban Küber-13/+13
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-4/+18
Keep more information about trait binding failures.
2020-04-08Rollup merge of #70912 - estebank:reduce-type-param-sugg-verbosity, r=davidtwcoDylan DPC-4/+0
Do not suggest adding type param when `use` is already suggested Fix #70365, cc #70572.
2020-04-07Do not suggest adding type param when `use` is already suggestedEsteban Küber-4/+0
Fix #70365, cc #70572.
2020-04-06Rollup merge of #70519 - estebank:constraints-before-args-spans, r=CentrilMazdak Farrokhzad-42/+66
Tweak output of type params and constraints in the wrong order r? @Centril @varkor
2020-04-05Reduce the visual clutterEsteban Küber-54/+20
Using a single label for constraints and generic arguments.
2020-04-03Auto merge of #70642 - eddyb:remap-sysroot-src, r=Mark-Simulacrumbors-22/+9
Translate the virtual `/rustc/$hash` prefix back to a real directory. Closes #53486 and fixes #53081, by undoing the remapping to `/rustc/$hash` on the fly, when appropriate (e.g. our testsuites, or user crates that depend on `libstd`), but not during the Rust build itself (as that could leak the absolute build directory into the artifacts, breaking deterministic builds). Tested locally by setting `remap-debuginfo = true` in `config.toml`, which without these changes, was causing 56 tests to fail (see https://github.com/rust-lang/rust/issues/53081#issuecomment-606703215 for more details). cc @Mark-Simulacrum @alexcrichton @ehuss
2020-04-02unerase regions in `infer_placeholder_type`Matthew Jasper-3/+14
2020-04-02tests: remove ignore directives from tests that mention core/alloc/std spans.Eduard-Mihai Burtescu-22/+9
2020-03-29Tweak `suggest_constraining_type_param`Esteban Küber-24/+18
Some of the bound restriction structured suggestions were incorrect while others had subpar output.
2020-03-29review comment: wordingEsteban Küber-20/+20
2020-03-29Suggest correct order for arguments when encountering early constraintsEsteban Küber-18/+18
When encountering constraints before type arguments or lifetimes, suggest the correct order.
2020-03-28Suggest correct order for args and constraintsEsteban Küber-0/+40
2020-03-28Point at all constraints before argsEsteban Küber-39/+57
2020-03-28Auto merge of #70261 - Centril:angle-args-partition, r=varkorbors-64/+70
Move arg/constraint partition check to validation & improve recovery - In the first commit, we move the check rejecting e.g., `<'a, Item = u8, String>` from the parser into AST validation. - We then use this to improve the code for parsing generic arguments. - And we add recovery for e.g., `<Item = >` (missing), `<Item = 42>` (constant), and `<Item = 'a>` (lifetime). This is also preparatory work for supporting https://github.com/rust-lang/rust/issues/70256. r? @varkor
2020-03-27add the label back but make it shorterMazdak Farrokhzad-15/+31
2020-03-27address some review commentsMazdak Farrokhzad-64/+40
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-65/+79
2020-03-27non-exhastive diagnostic: add note re. scrutinee typeMazdak Farrokhzad-0/+2