| Age | Commit message (Collapse) | Author | Lines |
|
|
|
normalize before handling simple checks for evaluatability of `ty::Const`
`{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.
|
|
|
|
|
|
r=fee1-dead
Make `note_obligation_cause_code` take a `impl ToPredicate` for predicate
The only usecase that wasn't `impl ToPredicate` was noting overflow errors while revealing opaque types, which passed in an `Obligation<'tcx, Ty<'tcx>>`... Since this only happens in a `RevealAll` environment, which is after typeck (and probably primarily within `normalize_erasing_regions`) we're unlikely to display anything useful while noting this code, evidenced by the lack of UI test changes.
|
|
Avoid ICE by accounting for missing type
Fix #105330
|
|
support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`
Fixes #105205
Currently we haven't implemented a way to evaluate `ConstKind::Expr(Expr::Binop(Add, 1, 2))` so I just left that with a `FIXME` and a `delay_span_bug` since I have no idea how to do that and it would make this a much larger (and more complicated) PR :P
|
|
Fix #105330
|
|
Tweak "the following other types implement trait"
When *any* of the suggested impls is an exact match, *only* show the exact matches. This is particularly relevant for integer types.
r? `@compiler-errors`
|
|
r=jackh726
Point at GAT `where` clause when an obligation is unsatisfied
Slightly helps with #105306
|
|
reveal overflow
|
|
|
|
|
|
When *any* of the suggested impls is an exact match, *only* show the
exact matches. This is particularly relevant for integer types.
fix fmt
|
|
|
|
|
|
Avoid some `InferCtxt::build` calls
Either because we're inside of an `InferCtxt` already, or because we're not in a place where we'd ever see inference vars.
r? types
|
|
Make sure async constructs do not `impl Generator`
Async lowering turns async functions and blocks into generators internally.
Though these special kinds of generators should not `impl Generator` themselves.
The other way around, normal generators should not `impl Future`.
This was discovered in https://github.com/rust-lang/rust/pull/105082#issuecomment-1332210907 and is a regression from https://github.com/rust-lang/rust/pull/104321.
r? `@compiler-errors`
|
|
|
|
Keep track of the start of the argument block of a closure
This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417.
VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem.
r? `@cjgillot`
|
|
Don't add a note for implementing a trait if its inner type is erroneous
Fix #105138
|
|
spastorino:consolidate-normalize-in-report_projection_error, r=lcnr
Use ocx.normalize in report_projection_error
r? `@lcnr`
cc `@compiler-errors`
|
|
|
|
|
|
|
|
|
|
Async lowering turns async functions and blocks into generators internally.
Though these special kinds of generators should not `impl Generator` themselves.
The other way around, normal generators should not `impl Future`.
|
|
Some initial normalization method changes
1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`)
2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`)
3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize`
4. Remove some unused other normalization fns in `Inherited` and `FnCtxt`
Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic.
Stacked on top of #104835 for convenience.
r? types
|
|
move `candidate_from_obligation` out of assembly
it doesn't belong there as it also does winnowing
r? `@compiler-errors`
|
|
it doesn't belong there as it also does winnowing
|
|
|
|
Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`)
r? `@oli-obk` you've asked for this >:)
|
|
Revert #104269 (to avoid spurious hang/test failure in CI)
Causes hangs/memory overflows in the test suite apparently :cry:
Reopens #104225
Fixes #104957
r? ``@lcnr``
|
|
Adds a helper method around `generator_kind` that makes matching async constructs simpler.
|
|
|
|
|
|
|
|
|
|
...it's just `mk_const` but without the sparcles
|
|
`mk_const(ty::ConstKind::X(...), ty)` can now be simplified to
`mk_cosnt(..., ty)`.
I searched with the following regex: \mk_const\([\n\s]*(ty::)?ConstKind\
I've left `ty::ConstKind::{Bound, Error}` as-is, they seem clearer this
way.
|
|
Remove `SelectionContext::infcx()` in favor of field access
Encapsulation doesn't seem particularly important here, and having two choices is always more confusing than having one.
r? types
|
|
Refactor `ty::ClosureKind` related stuff
I've tried to fix all duplication and weirdness, but if I missed something do tell :p
r? `@compiler-errors`
|
|
|
|
Prefer doc comments over `//`-comments in compiler
Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
|
|
Pretty-print generators with their `generator_kind`
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally.
This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
|
|
|
|
|
|
|
|
…in favour of `TyCtxt::fn_trait_kind_from_def_id`
|
|
|