| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Some more `EarlyBinder` cleanups
First commit has a couple unrelated cleanups, but otherwise each commit is self-explanatory
r? rust-lang/types
|
|
|
|
|
|
|
|
Fix duplicated type annotation suggestion
Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.
This fixes #93506 .
|
|
|
|
r=lcnr
Do not mention private types from other crates as impl candidates
Fixes #99080
|
|
Deny float const params even when `adt_const_params` is enabled
Supersedes #98825
Fixes #98813
r? ``@oli-obk``
|
|
|
|
|
|
|
|
Remove duplicate notes from error on inter-crate ambiguous impl of traits
Fixes #99092
|
|
|
|
|
|
Avoid some `&str` to `String` conversions
This patch removes some `&str` to `String` conversions.
|
|
(fix #99092)
|
|
|
|
There are several indications that we should not ZST as a ScalarInt:
- We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it.
`ValTree::zst()` used the former, but the latter could possibly arise as well.
- Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`.
- LLVM codegen already had to special-case ZST ScalarInt.
So instead add new ZST variants to those types that did not have other variants
which could be used for this purpose.
|
|
Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.
This fixes #93506 .
|
|
Track implicit `Sized` obligations in type params
When we evaluate `ty::GenericPredicates` we introduce the implicit
`Sized` predicate of type params, but we do so with only the `Predicate`
its `Span` as context, we don't have an `Obligation` or
`ObligationCauseCode` we could influence. To try and carry this
information through, we add a new field to `ty::GenericPredicates` that
tracks both which predicates come from a type param and whether that
param has any bounds already (to use in suggestions).
We also suggest adding a `?Sized` bound if appropriate on E0599.
Address part of #98539.
|
|
don't succeed `evaluate_obligation` query if new opaque types were registered
fixes #98608
fixes #98604
The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked.
I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this.
Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
|
|
r=michaelwoerister
Highlight conflicting param-env candidates
This could probably be further improved by noting _why_ equivalent param-env candidates (modulo regions) leads to ambiguity.
Fixes #98786
|
|
An optimization for `pest-2.1.3`
An easy win I found while looking at a profile of `pest-2.1.3`. It's also a small code cleanup.
r? `@pnkfelix`
|
|
|
|
|
|
|
|
`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
|
|
|
|
|