about summary refs log tree commit diff
path: root/compiler/rustc_resolve
AgeCommit message (Collapse)AuthorLines
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-8/+90
2022-07-12Parse closure bindersMaybe Waffle-2/+2
This is first step in implementing RFC 3216. - Parse `for<'a>` before closures in ast - Error in lowering - Add `closure_lifetime_binder` feature
2022-07-11Auto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkovbors-0/+24
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`
2022-07-11Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-deadDylan DPC-1/+1
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.
2022-07-11rename a methodTakayuki Maeda-1/+1
2022-07-11implement `is_accessible_span`Takayuki Maeda-1/+1
2022-07-10Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obkMatthias Krüger-8/+3
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
2022-07-10avoid some `&str` to `String` conversionsTakayuki Maeda-8/+3
2022-07-09Rollup merge of #99008 - obeis:issue-98974, r=compiler-errorsDylan DPC-13/+28
Adding suggestion for E0530 Closes #98974
2022-07-08Update ui test for the new E0530 suggestionObei Sideg-2/+1
2022-07-08Check if E0530 is `rustc_resolve::late::PatternSource::Match` to emit suggestionObei Sideg-11/+14
2022-07-08Check if E0530 is `tuple variant` or `tuple struct` to emit suggestionObei Sideg-11/+17
2022-07-07Adding suggestion for E0530Obei Sideg-0/+7
2022-07-07suggest adding a derive for #[default] applied to variantsDeadbeef-4/+10
2022-07-06Auto merge of #98959 - cjgillot:late-bound-order, r=michaelwoeristerbors-2/+2
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.
2022-07-05fix typo in note about multiple inaccessible type aliasesClementTsang-1/+3
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'.
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-07-04suggest `#[derive(Default)]` to enums with `#[default]`Takayuki Maeda-0/+9
2022-07-03Auto merge of #98673 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrumbors-1/+0
Bump bootstrap compiler r? `@Mark-Simulacrum`
2022-07-02Auto merge of #98569 - nnethercote:finalize_resolutions_id, r=cjgillotbors-23/+23
Avoid unnecessary work in `finalize_resolutions_in`. If `module.opt_def_id()` returns `None`, we can skip most of the work. r? `@lqd`
2022-07-02Handle fresh lifetimes on bare trait objects.Camille GILLOT-0/+24
2022-07-01update cfg(bootstrap)sPietro Albini-1/+0
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-29Rollup merge of #98668 - TaKO8Ki:avoid-many-&str-to-string-conversions, ↵Matthias Krüger-10/+5
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`.
2022-06-29avoid many `&str` to `String` conversions with `MultiSpan::push_span_label`Takayuki Maeda-10/+5
2022-06-29Avoid unnecessary work in `finalize_resolutions_in`.Nicholas Nethercote-23/+23
If `module.opt_def_id()` returns `None`, we can skip most of the work.
2022-06-27Update `smallvec` to 1.8.1.Nicholas Nethercote-1/+1
This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc.
2022-06-24Rollup merge of #98419 - WaffleLapkin:remove_excess_rib, r=compiler-errorsYuki Okushi-1/+3
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``
2022-06-23Rollup merge of #98269 - compiler-errors:provide-more-segment-res, ↵Michael Goulet-0/+1
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.
2022-06-23Remove excess rib while resolving closuresMaybe Waffle-1/+3
2022-06-22Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkovbors-414/+551
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-42/+42
2022-06-21Always create parameters for functions-like types.Camille GILLOT-57/+155
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-20Provide a segment res in more casesMichael Goulet-0/+1
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/+21
2022-06-19Use `Span::eq_ctxt` method instead of `.ctxt() == .ctxt()`Michael Goulet-1/+1
2022-06-19Leave the responsibility to create `Fresh` lifetimes to lowering.Camille GILLOT-23/+11
2022-06-19Make matches exhaustive.Camille GILLOT-3/+9
2022-06-19Remove the `region` terminology.Camille GILLOT-9/+9
2022-06-18Separate `AnonymousCreateParameter` and `ReportElidedInPath`.Camille GILLOT-62/+93
2022-06-18Refactor visit_fn.Camille GILLOT-65/+96
2022-06-18Rustfmt resolve_implementation.Camille GILLOT-39/+57
2022-06-18Extract AssocItem handling.Camille GILLOT-166/+131
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-117/+106
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-15Consume resolutions for lowering separately.Camille GILLOT-4/+12