| Age | Commit message (Collapse) | Author | Lines |
|
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
|
|
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.
|
|
|
|
|
|
|
|
|
|
This checks `static mut` as well for E0017, and blesses tests now that
we emit an error for a mut deref.
|
|
This error code is never emitted, and the contents of this test are
identical to that of `E0017.rs`.
|
|
|
|
Specific labels when referring to "expected" and "found" types
|
|
|
|
|
|
|
|
|
|
|
|
Remove cannot mutate statics in initializer of another static error
r? @oli-obk
This is just a refactoring. As the removed code itself said, it only a heuristic catching a few cases early instead of leaving it all to const eval. It's easy to work around the static check and then run into the miri-engine check.
|
|
|
|
Tweak non-char/numeric in range pattern diagnostic
Fixes #66283
r? @estebank
|
|
|
|
|
|
|
|
r=nikomatsakis
Stabilize the `re_rebalance_coherence` feature
This PR stabilizes [RFC 2451](https://rust-lang.github.io/rfcs/2451-re-rebalancing-coherence.html), re-rebalance coherence.
Changes include removing the attribute from tests which tested both the old and new behavior, moving the feature to `accepted` and removing the old logic.
I'll also open a [PR](https://github.com/rust-lang-nursery/reference/pull/703) against the reference, updating it with the content of the RFC.
Closes #63599
r? @nikomatsakis
|
|
|
|
|
|
Improve the "try using a variant of the expected type" hint.
Fix https://github.com/rust-lang/rust/issues/65494.
- Change type-printing output.
- Use `span_to_snippet` when possible.
- Change the message to `try using a variant of the expected enum`
|
|
Call out the types that are non local on E0117
CC #24745.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Point at the span for the definition of ADTs internal to the current
crate.
Look at the leading char of the ident to determine whether we're
expecting a likely fn or any of a fn, a tuple struct or a tuple variant.
Turn fn `add_typo_suggestion` into a `Resolver` method.
|
|
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
|
|
|
|
|
|
Bring attention to suggestions when the only difference is capitalization
CC #65386.
|
|
Print lifetimes with backticks
Fixes #65287
r? @varkor
|
|
|
|
Suggest `if let` on `let` refutable binding
Fix #58385.
|
|
|
|
|
|
|
|
See #64931.
|
|
Reword E0392 slightly
Make it clearer that a type or lifetime argument not being used can be
fixed by referencing it in a struct's fields, not just using `PhathomData`.
CC #53589.
|
|
|
|
Make it clearer that a type or lifetime argument not being used can be
fixed by referencing it in a struct's fields, not just using `PhathomData`.
|
|
Point at definition when misusing ADT
When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
|
|
Remove redundancy from the implementation of C variadics.
This cleanup was first described in https://github.com/rust-lang/rust/issues/44930#issuecomment-497163539:
* AST doesn't track `c_variadic: bool` anymore, relying solely on a trailing `CVarArgs` type in fn signatures
* HIR doesn't have a `CVarArgs` anymore, relying solely on `c_variadic: bool`
* same for `ty::FnSig` (see tests for diagnostics improvements from that)
* `{hir,mir}::Body` have one extra argument than the signature when `c_variadic == true`
* `rustc_typeck` and `rustc_mir::{build,borrowck}` need to give that argument the right type (which no longer uses a lifetime parameter, but a function-internal scope)
* `rustc_target::abi::call` doesn't need special hacks anymore (since it never sees the `VaListImpl` now, it's all inside the body)
r? @nagisa / @rkruppe cc @dlrobertson @oli-obk
|
|
|