| Age | Commit message (Collapse) | Author | Lines |
|
`MiscObligation`
|
|
r=cjgillot
Replace some `guess_head_span` with `def_span`
This patch fixes a part of #97417.
r? `@cjgillot`
|
|
|
|
|
|
macros: `LintDiagnostic` derive
- Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it.
- Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning).
- Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`).
- Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery.
~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~
r? `@oli-obk`
|
|
Split TypeVisitable from TypeFoldable
Impl of rust-lang/compiler-team#520 following MCP approval.
r? `@ghost`
|
|
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #98860 (adjust dangling-int-ptr error message)
- #98888 (interpret: fix CheckedBinOp behavior when overflow checking is disabled)
- #98889 (Add regression test for #79467)
- #98895 (bootstrap.py: Always use `.exe` for Windows)
- #98920 (adapt issue-37945 codegen test to accept any order of ops)
- #98921 (Refactor: remove a redundant mutable variable)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=Dylan-DPC
Refactor: remove a redundant mutable variable
|
|
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
continue nll transition by removing stuff
r? `@jackh726` for now
building on #98641
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
trait predicate
|
|
|
|
|
|
hidden types for opaque types
|
|
r=Dylan-DPC
Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label`
This patch removes some`&str` to `String` conversions with `MultiSpan::push_span_label`.
|
|
Erase regions in New Abstract Consts
When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile.
Fixes #98452
r? ```@lcnr```
|
|
|
|
Update `smallvec` to 1.8.1.
This pulls in https://github.com/servo/rust-smallvec/pull/282, which
gives some small wins for rustc.
r? `@lqd`
|
|
Rollup of 7 pull requests
Successful merges:
- #97423 (Simplify memory ordering intrinsics)
- #97542 (Use typed indices in argument mismatch algorithm)
- #97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths)
- #98277 (Fix trait object reborrow suggestion)
- #98525 (Add regression test for #79224)
- #98549 (interpret: do not prune requires_caller_location stack frames quite so early)
- #98603 (Some borrowck diagnostic fixes)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Make empty bounds lower to `WellFormed` and make `WellFormed` coinductive
r? rust-lang/types
|
|
Currently, `search_for_structural_match_violation` constructs an `infcx`
from a `tcx` and then only uses the `tcx` within the `infcx`. This is
wasteful because `infcx` is a big type.
This commit changes it to use the `tcx` directly. When compiling
`pest-2.1.3`, this changes the memcpy stats reported by DHAT for a `check full`
build from this:
```
433,008,916 bytes (100%, 99,787.93/Minstr) in 2,148,668 blocks (100%, 495.17/Minstr), avg size 201.52 bytes
```
to this:
```
101,422,347 bytes (99.98%, 25,243.59/Minstr) in 1,318,407 blocks (99.96%, 328.15/Minstr), avg size 76.93 bytes
```
This translates to a 4.3% reduction in instruction counts.
|
|
Because the `infcx` isn't needed. This removes one lifetime from
`Search`.
|
|
|
|
|
|
Remove a back-compat hack on lazy TAIT
This PR's motivation is here: https://github.com/rust-lang/rust/issues/72614#issuecomment-1134595446
~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~
r? ``@oli-obk``
|
|
|
|
|
|
small regions refactoring
these commits should be fairly self-contained
r? rust-lang/types
|
|
Fix span issues in object safety suggestions
Fixes #98500
|
|
see comment added to the field in `VerifyBoundCx`.
|
|
|
|
Perform coherence checking per impl.
r? `@ghost`
|
|
This pulls in https://github.com/servo/rust-smallvec/pull/282, which
gives some small wins for rustc.
|
|
|
|
Reverse folder hierarchy
#91318 introduced a trait for infallible folders distinct from the fallible version. For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible. Moreover the `Error` associated type was defined on the infallible trait! It's so absurd that it has me questioning whether I was entirely sane.
This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation). This of course makes much more sense! It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs.
There is one downside however: folders expose a `tcx` accessor method. Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate. Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate. If desired, I can submit that as a separate PR.
r? ````@jackh726````
|
|
r=eholk
Address review comments from #98259
It got approved so fast I didn't have time to make changes xD
r? ``@eholk``
|
|
Greatly improve error reporting for futures and generators in `note_obligation_cause_code`
Most futures don't go through this code path, because they're caught by
`maybe_note_obligation_cause_for_async_await`. But all generators do,
and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses.
At some point, we may want to consider unifying this with the code for `maybe_note_async_await`,
so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points.
But both functions are quite complicated, and it's not clear to me how to combine them;
this seems like a good incremental improvement.
Helps with https://github.com/rust-lang/rust/issues/97332.
r? ``@estebank`` cc ``@eholk`` ``@compiler-errors``
|
|
|
|
|