about summary refs log tree commit diff
path: root/src/test/ui/suggestions
AgeCommit message (Collapse)AuthorLines
2019-09-23Add parser recovery for `const $ident = $expr;`.Mazdak Farrokhzad-0/+84
Then use the diagnostics-stealing API to stash parser errors and enrich them with type information in typeck.
2019-09-22On obligation errors point at the unfulfilled binding when possibleEsteban Küber-3/+3
2019-09-22Point at definition when misusing ADTEsteban Küber-0/+6
When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-19When possible, suggest fn callEsteban Küber-6/+8
2019-09-19When possible point at argument causing item obligation failureEsteban Küber-6/+6
2019-09-15resolve: Tweak "cannot find" wording for attributesVadim Petrochenkov-6/+6
2019-09-08Give method not found a primary span labelEsteban Küber-4/+4
2019-09-05Opaque type locations in error message for clarity.Giles Cope-2/+2
2019-09-01review commentEsteban Küber-2/+2
2019-08-31Suggest call fn ctor passed as arg to fn with type param boundsEsteban Küber-0/+56
2019-08-31Use span label instead of note for cause in E0631Esteban Küber-5/+3
2019-08-29Rollup merge of #63811 - estebank:impl-trait-arg, r=cramertjMazdak Farrokhzad-0/+55
Correctly suggest adding bounds to `impl Trait` argument Fix #63706.
2019-08-25Rollup merge of #63833 - estebank:suggest-closure-call, r=petrochenkovMazdak Farrokhzad-1/+17
Suggest calling closure with resolved return type when appropriate Follow up to #63337. CC #63100. ``` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:46:20 | LL | let closure = || 42; | -- closure defined here LL | let _: usize = closure; | ^^^^^^^ | | | expected usize, found closure | help: use parentheses to call this closure: `closure()` | = note: expected type `usize` found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]` ```
2019-08-25Rollup merge of #63813 - estebank:int-from, r=varkorMazdak Farrokhzad-0/+12
Do not suggest `.try_into()` on `i32::from(x)` Fix #63697.
2019-08-23Suggest calling closure with resolved return type when appropriateEsteban Küber-1/+17
2019-08-22Do not suggest `.try_into()` on `i32::from(x)`Esteban Küber-0/+12
2019-08-22Correctly suggest adding bounds to `impl Trait` argumentEsteban Küber-0/+55
2019-08-21review comments: reword and add testEsteban Küber-0/+44
2019-08-19Cherry-pick src/test changes with Centril's changessd234678-7/+7
2019-08-15Do not suggest `try_into` for base types inside of macro expansionsEsteban Küber-0/+14
2019-08-14Rollup merge of #63507 - estebank:type-inference-error, r=CentrilMazdak Farrokhzad-0/+88
When needing type annotations in local bindings, account for impl Trait and closures Fix https://github.com/rust-lang/rust/issues/46680, fix https://github.com/rust-lang/rust/issues/63504, fix https://github.com/rust-lang/rust/issues/63506, fix #40014, cc https://github.com/rust-lang/rust/issues/63502.
2019-08-13Suggest giving return type to closures on E0282Esteban Küber-0/+48
2019-08-13review commentsEsteban Küber-2/+2
2019-08-13review comment: remove unecessary error in testEsteban Küber-12/+4
2019-08-12Do not ICE when synthesizing spans falling inside unicode charsEsteban Küber-0/+22
2019-08-12Suggest `Box::new` when appropriateEsteban Küber-0/+40
When encountering a boxed value as expected and a stack allocated value that could be boxed to fulfill the expectation, like in the following snippet, suggest `Box::new` wrapping.
2019-08-10diagnostics: Describe crate root modules in `DefKind::Mod` as "crate"Vadim Petrochenkov-2/+2
2019-08-10Rollup merge of #63399 - estebank:vec-in-pat, r=CentrilMazdak Farrokhzad-0/+31
More explicit diagnostic when using a `vec![]` in a pattern ``` error: unexpected `(` after qualified path --> $DIR/vec-macro-in-pattern.rs:3:14 | LL | Some(vec![x]) => (), | ^^^^^^^ | | | unexpected `(` after qualified path | in this macro invocation | use a slice pattern here instead | = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) ``` Fix #61933.
2019-08-09review comments: use structured suggestionEsteban Küber-6/+16
2019-08-09More explicit diagnostic when using a `vec![]` in a patternEsteban Küber-0/+21
``` error: unexpected `(` after qualified path --> $DIR/vec-macro-in-pattern.rs:3:14 | LL | Some(vec![x]) => (), | ^^^^^^^ | | | unexpected `(` after qualified path | in this macro invocation | use a slice pattern here instead | = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) ```
2019-08-09review comments: typo and rewordingEsteban Küber-3/+3
2019-08-09Extend suggestion support for traits and foreign itemsEsteban Küber-16/+137
2019-08-09Differentiate between tuple structs and tuple variantsEsteban Küber-8/+39
2019-08-09Recover parser from `foo(_, _)`Esteban Küber-0/+57
2019-08-09When suggesting fn call use an appropriate number of placeholder argumentsEsteban Küber-0/+113
2019-07-27Rollup merge of #63014 - davidtwco:rustfix-incorrect-dyn-suggestion, r=estebankMazdak Farrokhzad-0/+119
Stop bare trait lint applying to macro call sites Fixes #61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way. r? @estebank
2019-07-26lowering: Omit bare trait lint on macro call sitesDavid Wood-9/+2
This commit implements a hacky fix for detecting when a span is pointing at a macro call site so that bare trait lints are not made incorrectly.
2019-07-25Add note suggesting to borrow a String argument to findEsteban Küber-0/+18
2019-07-24Rollup merge of #62772 - estebank:trait-bound, r=matthewjasperMazdak Farrokhzad-0/+40
Suggest trait bound on type parameter when it is unconstrained Given ``` trait Foo { fn method(&self) {} } fn call_method<T>(x: &T) { x.method() } ``` suggest constraining `T` with `Foo`. Fix #21673, fix #41030.
2019-07-23Rollup merge of #62817 - estebank:variant-sp, r=matthewjasperMark Rousskov-3/+1
Tweak span for variant not found error
2019-07-23Rollup merge of #62791 - estebank:type-ascription, r=petrochenkovMark Rousskov-4/+10
Handle more cases of typos misinterpreted as type ascription Fix #60933, #54516. CC #47666, #34255, #48016.
2019-07-20tests: Add minimal reproduction of #61963.David Wood-0/+126
This commit adds a reproduction of the error reported in servo which demonstrates the current, incorrect behaviour. Co-authored-by: Rémy Rakić <remy.rakic@gmail.com>
2019-07-19Tweak span for variant not found errorEsteban Küber-3/+1
2019-07-19Handle more cases of typos misinterpreted as type ascriptionEsteban Küber-4/+10
2019-07-18Suggest trait bound on type parameter when it is unconstrainedEsteban Küber-0/+40
Given ``` mented on Jan 26, 2015 • trait Foo { fn method(&self) {} } fn call_method<T>(x: &T) { x.method() } ``` suggest constraining `T` with `Foo`.
2019-07-18resolve: Visit all scopes to collect suggestion candidates for unresolved macrosVadim Petrochenkov-3/+3
2019-07-18resolve: Use `feature(custom_attribute)` fallback only if the feature is enabledVadim Petrochenkov-17/+8
Normally `#![feature(...)]` shouldn't change behavior, but custom attributes in particular are in the process of retirement, and we should not produce a message telling to enable them. It also helps with unifying diagnostics for unresolved macros.
2019-07-13Suggest assoc type on type not found in trait method definitionEsteban Küber-0/+16
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-4/+4
https://github.com/rust-lang/rust/issues/60532
2019-07-05Rollup merge of #62133 - petrochenkov:norustc, r=eddybMazdak Farrokhzad-15/+22
Feature gate `rustc` attributes harder Fixes https://github.com/rust-lang/rust/issues/62116