| Age | Commit message (Collapse) | Author | Lines |
|
|
|
relying on the span making it obvious
|
|
available
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #91880 (fix clippy::single_char_pattern perf findings)
- #91885 (Remove `in_band_lifetimes` from `rustc_codegen_ssa`)
- #91898 (Make `TyS::is_suggestable` check for non-suggestable types structually)
- #91915 (Add another regression test for unnormalized fn args with Self)
- #91916 (Fix a bunch of typos)
- #91918 (Constify `bool::then{,_some}`)
- #91920 (Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
When encountering a binop where the types would have been accepted, if
all the predicates had been fulfilled, include information about the
predicates and suggest appropriate `#[derive]`s if possible.
Point at trait(s) that needs to be `impl`emented.
|
|
* Highlight the whole pattern if it has no fields
* Highlight the whole definition if it has no fields
* Only highlight the pattern name if the pattern is multi-line
* Determine whether a pattern is multi-line based on distance from name
to last field, rather than first field
|
|
|
|
As suggested in #86307.
|
|
* On suggestions that include deletions, use a diff inspired output format
* When suggesting addition, use `+` as underline
* Color highlight modified span
|
|
|
|
Account for parser recovered struct and tuple patterns to avoid invalid
suggestion.
Follow up to #81103.
|
|
In #76612, suggestions were added for missing fields in
patterns. However, the suggestions are being inserted just at the end
of the last field in the pattern—before any trailing comma after the
last field. This resulted in the "if you don't care about missing
fields" suggestion to recommend code with a trailing comma after the
field ellipsis (`..,`), which is actually not legal ("`..` must be at
the end and cannot have a trailing comma")!
Incidentally, the doc-comment on `error_unmentioned_fields` was using
`you_cant_use_this_field` as an example field name (presumably
copy-paste inherited from the description of Issue #76077), but
the present author found this confusing, because unmentioned fields
aren't necessarily unusable.
The suggested code in the diff this commit introduces to
`destructuring-assignment/struct_destructure_fail.stderr` doesn't
work, but it didn't work beforehand, either (because of the "found
reserved identifier `_`" thing), so you can't really call it a
regression; it could be fixed in a separate PR.
Resolves #78511.
|
|
|
|
|
|
|
|
|
|
|
|
For example, this code:
struct S(i32, f32);
let S(x) = S(0, 1.0);
will make the compiler suggest either:
let S(x, _) = S(0, 1.0);
or:
let S(x, ..) = S(0, 1.0);
|
|
|
|
Co-authored-by: varkor <github@varkor.com>
|
|
Co-authored-by: varkor <github@varkor.com>
|
|
Co-authored-by: varkor <github@varkor.com>
|
|
Update tests
Extend to other operations
Refractor check in a separate function
Fix more tests
|
|
|