| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
r=cramertj
Remove blanket silencing of "type annotation needed" errors
Remove blanket check for existence of other errors before emitting "type annotation needed" errors, and add some eager checks to avoid adding obligations when they refer to types that reference `[type error]` in order to reduce unneeded errors.
Fix #64084.
|
|
|
|
Remove blanket check for existence of other errors before emitting
"type annotation needed" errors, and add some eager checks to avoid
adding obligations when they refer to types that reference
`[type error]` in order to reduce unneded errors.
|
|
|
|
|
|
Give method not found a primary span label
|
|
|
|
|
|
r=varkor
Check impl trait substs when checking for recursive types
closes #64004
|
|
Account for arbitrary self types in E0599
Fix https://github.com/rust-lang/rust/issues/62373
|
|
|
|
This prevents mutual `async fn` recursion
|
|
|
|
|
|
|
|
Currently the default is "inherited" from context, so e.g. `&impl
Foo<Item = dyn Bar>` would default to `&'x impl Foo<Item = dyn Bar +
'x>`, but this triggers an ICE and is not very consistent.
This patch doesn't implement what I expect would be the correct
semantics, because those are likely too complex. Instead, it handles
what I'd expect to be the common case -- where the trait has no
lifetime parameters.
|
|
Object-lifetime-default elision is distinct from other forms of
elision; it always refers to some enclosing lifetime *present in the
surrounding type* (e.g., `&dyn Bar` expands to `&'a (dyn Bar + 'a)`.
If there is no enclosing lifetime, then it expands to `'static`.
Therefore, in an `impl Trait<Item = dyn Bar>` setting, we don't expand
to create a lifetime parameter for the `dyn Bar + 'X` bound. It will
just be resolved to `'static`.
Annoyingly, the responsibility for this resolution is spread across
multiple bits of code right now (`middle::resolve_lifetimes`,
`lowering`). The lowering code knows that the default is for an object
lifetime, but it doesn't know what the correct result would be.
Probably this should be fixed, but what we do now is a surgical fix:
we have it generate a different result for elided lifetimes in a
object context, and then we can ignore those results when figuring out
the lifetimes that are captured in the opaque type.
|
|
|
|
|
|
This commit prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.
|
|
Cleanup some surrounding code.
Support resolution of intra doc links in unnamed block scopes.
(Paths from rustdoc now use early resolution and no longer need results of late resolution like all the built ribs.)
Fix one test hitting file path limits on Windows.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
resolve: Improve candidate search for unresolved macro suggestions
Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names.
The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around).
This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086.
r? @davidtwco
|
|
Self-referencial type now called a recursive type
As per Boat's suggestion - #62539, this makes the error message clearer.
|
|
|
|
|
|
Normalize projections appearing in `impl Trait`
Fixes #60414
This does not try to do the same for `existential type`s (which have the same bug), since that always seems to lead to cycle errors.
|
|
|
|
davidtwco:ice-async-await-out-of-range-substitution, r=nikomatsakis
typeck: merge opaque type inference logic
Fixes #55872. See [relevant Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/type.20parameter.20out.20of.20range.20.2355872).
r? @nikomatsakis
|
|
Also change annotations in some tests
|
|
Migrate `compile-pass` annotations to `build-pass`
This is a part of #62277.
As a first step, the `compile-pass` tests are migrated to `build-pass`.
r? @cramertj
cc @Centril
|
|
|
|
This commit merges the logic used for opaque type type inference for
impl Trait and non-impl Trait cases. This fixes an ICE where
existential types used in the return types of functions would be allowed
to have an out-of-scope generic type parameter.
|
|
|
|
|
|
|
|
|
|
Minimizes risk.
|
|
|
|
|
|
Also, thread through better span info to improve the error message to
something tolerable.
|
|
|