| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Suggest removing `?` to resolve type errors.
Fixes #59756.
|
|
This commit adds a suggestion to remove the `?` from expressions if
removing the `?` would resolve a type error.
|
|
destructors
|
|
|
|
|
|
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
|
|
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
|
|
|
|
|
|
Tweak "incompatible match arms" error
- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitly stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
match, treat as implicit block error to give a more appropriate error.
Fix #46776, fix #57206.
CC #24157, #38234.
|
|
|
|
|
|
|
|
- Point at the body expression of the match arm with the type error.
- Point at the prior match arms explicitely stating the evaluated type.
- Point at the entire match expr in a secondary span, instead of primary.
- For type errors in the first match arm, the cause is outside of the
match, treat as implicit block error to give a more appropriate error.
|
|
|
|
|
|
|
|
|
|
|
|
Previously, evaluation ignored outlives relationships. Since we using
evaluation to skip the "normal" trait selection (which enforces
outlives relationships) this led to incorrect results in some cases.
|
|
|
|
|
|
|
|
Fixes #55097.
|
|
|
|
The future-compat warnings break code that assumes that `dyn Send + Sync !=
dyn Sync + Send`, and are the first step in making them equal. cc #33140.
It should be possible to revert this commit when we're done with the
warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implement trait aliases (RFC 1733)
Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733.
CC @durka @nikomatsakis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The normalization of type-outlives predicates can depend on misc.
environment predicates, but not the other way around. Inferred lifetime
bounds can propagate type-outlives bounds far and wide, so their
normalization needs to work well.
Fixes #54467
|
|
Add a per-tree error cache to the obligation forest
This implements part of what @nikomatsakis mentioned in https://github.com/rust-lang/rust/pull/30533#issuecomment-170705871:
> 1. If you find that a new obligation is a duplicate of one already in the tree, the proper processing is:
> * if that other location is your parent, you should abort with a cycle error (or accept it, if coinductive)
> * if that other location is not an ancestor, you can safely ignore the new obligation
In particular it implements the "if that other location is your parent accept it, if coinductive" part. This fixes #40827.
I have to say that I'm not 100% confident that this is rock solid. This is my first pull request :tada:, and I didn't know anything about the trait resolver before this. In particular I'm not totally sure that comparing predicates is enough (for instance, do we need to compare `param_env` as well?). Also, I'm not sure what @nikomatsakis mentions [here](https://github.com/rust-lang/rust/issues/30977#issue-127091096), but it might be something that affects this PR:
> In particular, I am wary of getting things wrong around inference variables! We can always add things to the set in their current state, and if unifications occur then the obligation is just kind of out-of-date, but I want to be sure we don't accidentally fail to notice that something is our ancestor. I decided this was subtle enough to merit its own PR.
Anyway, go ahead and review :slightly_smiling_face:.
Ref #30977.
# Performance
We are now copying vectors around, so I decided to do some benchmarking. A simple benchmark shows that this does not seem to affect performance in a measurable way:
I ran `cargo clean && cargo build` 20 times on actix-web (84b27db) and these are the results:
```text
rustc master:
Mean Std.Dev. Min Median Max
real 66.637 2.996 57.220 67.714 69.314
user 307.293 14.741 258.093 312.209 320.702
sys 12.524 0.653 10.499 12.726 13.193
rustc fix-bug-overflow-send:
Mean Std.Dev. Min Median Max
real 66.297 4.310 53.532 67.516 70.348
user 306.812 22.371 236.917 314.748 326.229
sys 12.757 0.952 9.671 13.125 13.544
```
I will do a more comprehensive benchmark (compiling rustc stage1) and post the results.
r? @nikomatsakis, @nnethercote
PS: It is better to review this commit-by-commit.
|
|
|
|
This seemed like a good way to kick the tires on the
elided-lifetimes-in-paths lint (#52069)—seems to work! This was also
pretty tedious—it sure would be nice if `cargo fix` worked on this
codebase (#53896)!
|
|
|
|
Hopefully this will help clarify the behavior in the various borrowck
modes
|
|
|