| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
This is first step in implementing RFC 3216.
- Parse `for<'a>` before closures in ast
- Error in lowering
- Add `closure_lifetime_binder` feature
|
|
Create fresh lifetime parameters for bare fn trait too
The current code fails to account for the equivalence between `dyn FnMut(&mut u8)` and bare `FnMut(&mut u8)`, and treated them differently.
This PR introduces a special case for `Fn` traits, which are always fully resolved.
Fixes #98616
Fixes #98726
This will require a beta-backport, as beta contains that bug.
r? `@petrochenkov`
|
|
Implement `SourceMap::is_span_accessible`
This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.
|
|
|
|
|
|
Avoid some `&str` to `String` conversions
This patch removes some `&str` to `String` conversions.
|
|
|
|
Adding suggestion for E0530
Closes #98974
|
|
|
|
|
|
|
|
|
|
|
|
Return a FxIndexSet in is_late_bound query.
This return value is iterated upon by borrowck, hence the need to preserve
a deterministic iteration order.
Fixes https://github.com/rust-lang/rust/issues/98890
Affects https://github.com/rust-lang/rust/issues/96655
I don't know if this supersedes https://github.com/rust-lang/rust/pull/98924 or fixes an unrelated bug.
r? `@michaelwoerister`
This may deserve a backport.
|
|
Mainly intended as a small typo fix ("aliass" -> "aliases") for
the case where a type cannot be found in scope, and there are
multiple inaccessible type aliases that match the missing type.
In general this change would use the correct plural form in
this scenario for words that end with 's'.
|
|
This return value is iterated upon by borrowck, hence the need to preserve
a deterministic iteration order.
|
|
|
|
Bump bootstrap compiler
r? `@Mark-Simulacrum`
|
|
Avoid unnecessary work in `finalize_resolutions_in`.
If `module.opt_def_id()` returns `None`, we can skip most of the work.
r? `@lqd`
|
|
|
|
|
|
For diagnostic information of Boolean, remind it as use the type: 'bool'
Fixes #98492.
It helps programmers coming from other languages
modified: compiler/rustc_resolve/src/late/diagnostics.rs
|
|
It helps programmers coming from other languages
modified: compiler/rustc_resolve/src/late/diagnostics.rs
modified: src/test/ui/lint/recommend-literal.rs
modified: src/test/ui/lint/recommend-literal.stderr
modified: compiler/rustc_resolve/src/late/diagnostics.rs
modified: src/test/ui/lint/recommend-literal.rs
modified: src/test/ui/lint/recommend-literal.stderr
modified: compiler/rustc_resolve/src/late/diagnostics.rs
modified: src/test/ui/lint/recommend-literal.rs
modified: src/test/ui/lint/recommend-literal.stderr
|
|
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`.
|
|
|
|
If `module.opt_def_id()` returns `None`, we can skip most of the work.
|
|
This pulls in https://github.com/servo/rust-smallvec/pull/282, which
gives some small wins for rustc.
|
|
Remove excess rib while resolving closures
I've mentioned this on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60ClosureOrAsyncRibKind.60.20weirdness/near/286982959), in `rustc_resolve`, while resolving closures we add an excess `ClosureOrAsyncRibKind`. It's excess because we later add another one in `visit_fn`.
I couldn't find a way in which removing this will break anything, all test seem to pass, etc.
r? ``@compiler-errors``
cc ``@davidtwco``
|
|
r=petrochenkov
Provide a `PathSegment.res` in more cases
I find that in many cases, the `res` associated with a `PathSegment` is `Res::Err` even though the path was fully resolved. A few diagnostics use this `res` and their error messages suffer because of the lack of resolved segment.
This fixes it a bit, but it's obviously not complete and I'm not exactly sure if it's correct.
|
|
|
|
Create elided lifetime parameters for function-like types
Split from https://github.com/rust-lang/rust/pull/97720
This PR refactor lifetime generic parameters in bare function types and parenthesized traits to introduce the additional required lifetimes as fresh parameters in a `for<>` bound.
This PR does the same to lifetimes appearing in closure signatures, and as-if introducing `for<>` bounds on closures (without the associated change in semantics).
r? `@petrochenkov`
|
|
|
|
|
|
Arms are about TAIT and RPIT, as the variants clearly show.
|
|
|
|
Don't omit comma when suggesting wildcard arm after macro expr
* Also adds `Span::eq_ctxt` to consolidate the various usages of `span.ctxt() == other.ctxt()`
* Also fixes an unhygenic usage of spans which caused the suggestion to render weirdly when we had one arm match in a macro
* Also always suggests a comma (i.e. even after a block) if we're rendering a wildcard arm in a single-line match (looks prettier :rose:)
Fixes #94866
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Split up `Definitions` and `ResolverAstLowering`.
Split off https://github.com/rust-lang/rust/pull/95573
r? `@michaelwoerister`
|
|
|