| Age | Commit message (Collapse) | Author | Lines |
|
r=estebank
Fix #58270, fix off-by-one error in error diagnostics.
This fixes #58270 by checking if two diagnostics overlap completely when we're calculating the line offset for each message.
|
|
|
|
|
|
|
|
Correct unused parameter diagnostic
The message was incorrect for unused lifetime parameters. There's no need to be specific.
|
|
|
|
|
|
|
|
|
|
check when optional.
|
|
|
|
|
|
|
|
One surprise: old-lub-glb-object.rs, may indicate a bug
|
|
We equate the type in the annotation with the inferred type first so
that we have a fully inferred type to perform the well-formedness check
on.
|
|
|
|
Use structured suggestions for nonstandard style lints
This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered.
Fixes #48103.
Fixes #52414.
|
|
|
|
Use a structured suggestion and tighten the span to just the identifier.
|
|
Still not great, but good enough to land this PR.
|
|
Fixes #33684
|
|
|
|
This commit stops well-formedness checking applying to unreachable code
and therefore stops some of the ICEs that the intended solution taken by
this PR causes.
By disabling these checks, we can land the other fixes and larger
refactors that this PR includes.
|
|
This commit moves well-formedness check for the
`UserTypeAnnotation::Ty(..)` case from always running to only when the
code is reachable. This solves the ICE that resulted from
`src/test/ui/issue-54943-1.rs` (a minimal repro of `dropck-eyepatch`
run-pass tests that failed).
The main well-formedness check that was intended to be run despite
unreachable code still is, that being the
`UserTypeAnnotation::TypeOf(..)` case. Before this PR, the other case
wasn't being checked at all.
It is possible to fix this ICE while still always checking
well-formedness for the `UserTypeAnnotation::Ty(..)` case but that
solution will ICE in unreachable code for that case, the diff for
that change [can be found here](0).
[0]: https://gist.github.com/davidtwco/f9751ffd9c0508f7251c0f17adc3af53
|
|
This commit uses the map introduced by the previous commit to ensure
that types are always checked for well-formedness by the NLL type check.
Previously, without the map introduced by the previous commit, types
would not be checked for well-formedness if the `AscribeUserType`
statement that would trigger that check was removed as unreachable code.
|
|
|
|
|
|
previously not in test suite.
|
|
|
|
|
|
|
|
I also added `// skip-codegen` to each one, to address potential concerns
that this change would otherwise slow down our test suite spending time
generating code for files that are really just meant to be checks of
compiler diagnostics.
(However, I will say: My preference is to not use `// skip-codegen` if
one can avoid it. We can use all the testing of how we drive LLVM that
we can get...)
(Updated post rebase.)
|
|
|
|
Rewrite the `UnconditionalRecursion` lint to use MIR
Part of #51002
r? @eddyb
|
|
Add regression tests for #55219 and #55241
Also another test where a duplicate-like error appears to have been
suppressed; I'm not 100% sure why this output changes, though I could
imagine that some duplicate suppression is enabled by this PR.
|
|
In particular, after the first for a given region variable. This
suppresses a lot of duplicate errors.
|
|
This gives at least some explanation for why a borrow is expected to
last for a certain free region. Also:
* Reports E0373: "closure may outlive the current function" with NLL.
* Special cases the case of returning a reference to (or value
referencing) a local variable or temporary (E0515).
* Special case assigning a reference to a local variable in a closure
to a captured variable.
|
|
This commit updates the test output for the updated NLL compare mode
that uses `-Z borrowck=migrate` rather than `-Z borrowck=mir`. The
previous commit changes `compiletest` and this commit only updates
`.nll.stderr` files.
|
|
[NLL] Check user types are well-formed
Also contains a change of span for AscribeUserType.
I'm not quite sure if this was what @nikomatsakis was thinking.
Closes #54620
r? @nikomatsakis
|
|
Also update some tests so that they don't have user types on `_` in
unreachable code.
|
|
Also change the order of the fake read for let and the AscribeUserType,
so that we use the better span and message from the fake read in errors.
|
|
Now when a `FnMut` closure is returning a closure that contains a
reference to a captured variable, we provide an error that makes it more
clear what is happening.
|
|
This commit improves the errors for `FnMut` closures where a reference
to a captured variable is escaping.
|
|
Now use the category and span that are associated to the most
interesting bound that led to the closure bound.
|
|
Part of #51002
|
|
Give a special message when the later use is from a call. Use the span
of the callee instead of the whole expression. For conflicting borrow
messages say that the later use is of the first borrow.
|
|
These tests were disabled due to NLL bugs that have since been fixed.
|
|
We used to apply it repeatedly as we went, relying on the current
value of the `region_bound_pairs_accum` vector. But now we save those
values into a map, so we can just process all the registered region
obligations at the end.
|
|
|
|
Issue #54131
|