about summary refs log tree commit diff
path: root/src/test/ui/error-codes
AgeCommit message (Collapse)AuthorLines
2020-02-02Point at arguments or output when fn obligations come from them, or ident ↵Esteban Küber-2/+2
when they don't
2020-02-02move_ref_patterns: introduce testsMazdak Farrokhzad-20/+0
bindings_after_at: harden tests
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-2/+2
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-25Don't use spaces before type ascription like colonsOliver Scherer-1/+1
2020-01-24Normalise notes with the/isvarkor-2/+2
2020-01-19review commentsEsteban Küber-4/+4
2020-01-19When encountering an expected named lifetime and none are present, suggest ↵Esteban Küber-5/+29
adding one
2020-01-19When encountering an undefined named lifetime, point to where it can beEsteban Küber-1/+5
This doesn't mention that using an existing lifetime is possible, but that would hopefully be clear as always being an option. The intention of this is to teach newcomers what the lifetime syntax is.
2020-01-18slice_patterns: remove gates in testsMazdak Farrokhzad-3/+1
2020-01-17Rollup merge of #68195 - estebank:impl-trait-2000, r=CentrilDylan DPC-0/+63
Account for common `impl Trait`/`dyn Trait` return type errors - When all return paths have the same type, suggest `impl Trait`. - When all return paths implement the expected `trait`, suggest `Box<dyn Trait>` and mention using an `enum`. - When multiple different types are returned and `impl Trait` is expected, extend the explanation. - When return type is `impl Trait` and the return paths do not implement `Trait`, point at the returned values. - Split `src/librustc/traits/error_reporting.rs` into multiple files to keep size under control. Fix #68110, cc #66523.
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-1/+7
2020-01-16review commentsEsteban Küber-4/+4
2020-01-16Add E0746 explanation to the indexEsteban Küber-0/+1
2020-01-16Make `impl Trait` suggestion in E0746 `MachineApplicable`Esteban Küber-2/+22
2020-01-16Elide E0308 errors in favor of E0746Esteban Küber-41/+4
When a type error involves a `dyn Trait` as the return type, do not emit the type error, as the "return type is not `Sized`" error will provide enough information to the user.
2020-01-16Specific error for unsized `dyn Trait` return typeEsteban Küber-0/+79
Suggest `impl Trait` when possible, and `Box<dyn Trait>` otherwise.
2020-01-16Rollup merge of #68265 - JohnTitor:fix-issue-number, r=Dylan-DPCDylan DPC-1/+1
Fix some issue numbers of unstable features Looking into the unstable book, some issue numbers are outdated.
2020-01-16Fix issue number of `repr128`Yuki Okushi-1/+1
2020-01-12Diagnostics should not end with a full stopvarkor-2/+2
2020-01-11Ban `...X` pats, harden tests, and improve diagnostics.Mazdak Farrokhzad-3/+3
Also fix a bug with the span passed in `mk_range`.
2020-01-11Rollup merge of #68014 - estebank:unify-e0599, r=cramertjYuki Okushi-1/+1
Unify output of "variant not found" errors Fix #49566.
2020-01-09Update testsVadim Petrochenkov-6/+82
2020-01-08Unify output of "variant not found" errorsEsteban Küber-1/+1
2020-01-05Add backticks to various diagnosticsvarkor-1/+1
2020-01-03clarify that `Drop` can be implemented for enums and unions tooAndy Russell-6/+5
2019-12-31Rollup merge of #67730 - Centril:typeck-pat-cleanup, r=estebankMazdak Farrokhzad-1/+1
Cleanup pattern type checking, fix diagnostics bugs (+ improvements) r? @estebank
2019-12-31Auto merge of #67597 - estebank:placeholder-type, r=oli-obkbors-1/+1
Suggest type param when encountering `_` in item signatures Fix #27435.
2019-12-30MatchExpressionArmPattern: Use more generic wording.Mazdak Farrokhzad-1/+1
The existing wording was inappropriate for e.g. `if let Ok(_) = expr { .. }`. The diagnostic would leak the fact that we desugar to a `match`.
2019-12-29clean up logicEsteban Küber-1/+1
2019-12-29Suggest type param when encountering `_` in fn defsEsteban Küber-1/+1
When encountering `_` type placeholder in fn arguments and return type, suggest using generic type parameters. Expand what counts as an inferable return type to slice, array and tuples of `_`.
2019-12-30note other end-point when typeck range patsMazdak Farrokhzad-2/+4
2019-12-24Fix suggestion span for typo in associated type nameEsteban Küber-2/+2
2019-12-24Fix case in `associated-type-projection-from-multiple-supertraits.rs`Esteban Küber-2/+2
This still doesn't handle the case entirely correctly, requiring a more targeted approach with a better suggestion, but at least now the suggested syntax makes *some* sense.
2019-12-24Tweak errors for missing associated types and type parametersEsteban Küber-15/+26
2019-12-23Auto merge of #66296 - Centril:bindings_after_at-init, r=pnkfelixbors-39/+7
Initial implementation of `#![feature(bindings_after_at)]` Following up on #16053, under the gate `#![feature(bindings_after_at)]`, `x @ Some(y)` is allowed subject to restrictions necessary for soundness. The implementation and test suite should be fairly complete now. One aspect that is not covered is the interaction with nested `#![feature(or_patterns)]`. This is not possible to test at the moment in a good way because that feature has not progressed sufficiently and has fatal errors in MIR building. We should make sure to add such tests before we stabilize both features (but shipping one of them is fine). r? @pnkfelix cc @nikomatsakis @matthewjasper @pcwalton cc https://github.com/rust-lang/rust/issues/65490
2019-12-23Remove `bindings_after_at` from `INCOMPLETE_FEATURES`.Mazdak Farrokhzad-11/+2
2019-12-23check_legality_of_move_bindings: generalize diagnostics & add commentsMazdak Farrokhzad-1/+1
2019-12-23Introduce `#![feature(bindings_after_at)]`.Mazdak Farrokhzad-38/+15
Under the gate, `x @ Some(y)` is allowed. This is subject to various restrictions for soundness.
2019-12-23Add span information to `ExprKind::Assign`varkor-6/+6
2019-12-23Improve invalid assignment errorvarkor-9/+17
2019-12-21rework run-fail and support check,build-failMazdak Farrokhzad-1/+3
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-14Indicate origin of where type parameter for uninferred typesOhad Ravid-1/+1
2019-12-13Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakisbors-3/+5
Point at method call when type annotations are needed - Point at method call instead of whole expression when type annotations are needed. - Suggest use of turbofish on function and methods. Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082. Fixes https://github.com/rust-lang/rust/issues/40015 r? @nikomatsakis
2019-12-13Rollup merge of #67026 - Nadrieril:improve-usefulness-empty, ↵Mazdak Farrokhzad-2/+2
r=varkor,Centril,estebank Improve diagnostics and code for exhaustiveness of empty matches There was a completely separate check and diagnostics for the case of an empty match. This led to slightly different error messages and duplicated code. This improves code reuse and generally clarifies what happens for empty matches. This also clarifies the action of the `exhaustive_patterns` feature, and ensures that this feature doesn't change diagnostics in places it doesn't need to.
2019-12-11review commentsEsteban Küber-4/+4
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