about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src/late
AgeCommit message (Collapse)AuthorLines
2022-08-03Make object_lifetime_defaults a cross-crate query.Camille GILLOT-41/+19
2022-07-28Remove guess_head_span.Camille GILLOT-6/+1
2022-07-27Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkovGuillaume Gomez-512/+56
Clean up HIR-based lifetime resolution Based on https://github.com/rust-lang/rust/pull/97313. Fixes #98932. r? `@petrochenkov`
2022-07-26Pacify tidy.Camille GILLOT-1/+0
2022-07-26Stop creating anonymous late lifetimes.Camille GILLOT-36/+1
2022-07-26Remove resolve_elided_lifetimes.Camille GILLOT-53/+6
2022-07-26Stop resolving lifetime elision on HIR.Camille GILLOT-425/+52
2022-07-26Replace LifetimeRes::Anonymous by LifetimeRes::Infer.Camille GILLOT-2/+2
2022-07-26Remove the distinction between LifetimeName::Implicit and ↵Camille GILLOT-4/+4
LifetimeName::Underscore.
2022-07-26Rollup merge of #99729 - cjgillot:rm-unused-tuple, r=michaelwoeristerMatthias Krüger-1/+1
Remove unused tuple fields Found by https://github.com/rust-lang/rust/pull/95977
2022-07-25Unused tuple fields in rustc_resolve.Camille GILLOT-1/+1
2022-07-25Update file description.Camille GILLOT-5/+6
2022-07-25Report elision failures on the AST.Camille GILLOT-758/+317
2022-07-19Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercoteMatthias Krüger-8/+13
Avoid `Symbol` to `&str` conversions `Symbol::as_str` is a slowish operation, so this patch removes some usages of it.
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-8/+13
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-3/+85
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-13Add feature gate.Camille GILLOT-1/+16
2022-07-12Add an indirection for closures in `hir::ExprKind`Maybe Waffle-1/+4
This helps bring `hir::Expr` size down, `Closure` was the biggest variant, especially after `for<>` additions.
2022-07-12make for<> in closures a possible place to suggest adding named lifetimeMaybe Waffle-4/+36
2022-07-12Lower closure binders to hir & properly check themMaybe Waffle-1/+48
2022-07-10avoid some `&str` to `String` conversionsTakayuki Maeda-4/+2
2022-07-05Return a FxIndexSet in is_late_bound query.Camille GILLOT-2/+2
This return value is iterated upon by borrowck, hence the need to preserve a deterministic iteration order.
2022-06-30Rollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnrMatthias Krüger-0/+2
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
2022-06-30For diagnostic information of Boolean, remind it as use the type: 'bool'Yiming Lei-0/+2
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
2022-06-29avoid many `&str` to `String` conversions with `MultiSpan::push_span_label`Takayuki Maeda-9/+4
2022-06-22Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkovbors-41/+47
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`
2022-06-21Use CreateParameter mode for closures too.Camille GILLOT-37/+32
2022-06-21Always create parameters for functions-like types.Camille GILLOT-4/+15
2022-06-21This comment is out dated and misleadingSantiago Pastorino-3/+0
Arms are about TAIT and RPIT, as the variants clearly show.
2022-06-20Rollup merge of #98267 - compiler-errors:suggest-wildcard-arm, r=oli-obkMatthias Krüger-1/+1
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
2022-06-19Don't suggest adding Self as a type parameterMichael Goulet-1/+1
2022-06-19Mention what item is using an invalid `Self` typeMichael Goulet-0/+19
2022-06-19Use `Span::eq_ctxt` method instead of `.ctxt() == .ctxt()`Michael Goulet-1/+1
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-1/+0
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-15Rollup merge of #97822 - compiler-errors:hesitate-to-suggest-intrinsics, ↵Yuki Okushi-1/+13
r=oli-obk Filter out intrinsics if we have other import candidates to suggest Fixes #97618 Also open to just sorting these candidates to be last. Pretty easy to modify the code to do that, too.
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-1/+0
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-12/+12
2022-06-11Rollup merge of #97812 - TaKO8Ki:suggest-to-swap-struct-and-trait, r=estebankDylan DPC-0/+33
Suggest to swap a struct and a trait in trait impls closes #89590
2022-06-09move suggestions to its own methodTakayuki Maeda-19/+31
2022-06-07Don't suggest adding let in certain if conditionsMichael Goulet-7/+15
2022-06-07Filter out intrinsics if we have other import candidates to suggestMichael Goulet-1/+13
2022-06-07suggest swapping a struct and a traitTakayuki Maeda-0/+21
fmt
2022-06-06Rollup merge of #97312 - cjgillot:no-path-in-scope, r=compiler-errorsDylan DPC-97/+8
Compute lifetimes in scope at diagnostic time The set of available lifetimes is currently computed during lifetime resolution on HIR. It is only used for one diagnostic. In this PR, HIR lifetime resolution just reports whether elided lifetimes are well-defined at the place of use. The diagnostic code is responsible for building a list of lifetime names if elision is not allowed. This will allow to remove lifetime resolution on HIR eventually.
2022-06-04Completely remove LifetimeScopeForPath.Camille GILLOT-83/+5
2022-06-04Compute lifetimes in scope at diagnostic time.Camille GILLOT-22/+11
2022-06-03Fail gracefully when encountering an HRTB in APIT.Camille GILLOT-7/+64
2022-06-03Compute `is_late_bound` in a separate query.Camille GILLOT-68/+24
The computation is actually much simpler, and can be done by directly fetching the HIR for the `FnDecl` and its generics.
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-89/+87
2022-06-03Use the same message as type & const generics.Camille GILLOT-23/+8
2022-06-03Reuse resolve_label to check lifetime shadowing.Camille GILLOT-7/+9