about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
AgeCommit message (Collapse)AuthorLines
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-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-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-116/+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
2022-06-15Remove unused item_generics_num_lifetimes.Camille GILLOT-2/+0
2022-06-15Rollup merge of #98087 - TaKO8Ki:suggest-adding-macro-export, r=oli-obkYuki Okushi-25/+55
Suggest adding a `#[macro_export]` to a private macro fixes #97628
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-15box `diagnostic_metadata` fieldTakayuki Maeda-2/+2
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-14/+46
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-91/+42
2022-06-14Separate Definitions and CrateStore from ResolverOutputs.Camille GILLOT-12/+13
2022-06-15implement `MacroData`Takayuki Maeda-28/+34
2022-06-14suggest adding a `#[macro_export]` to a private macroTakayuki Maeda-6/+30
2022-06-13remove unnecessary `to_string` and `String::new` for `tool_only_span_suggestion`Takayuki Maeda-7/+2
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-24/+19
2022-06-11Auto merge of #97903 - est31:unused_macro_rules_compile_error, r=petrochenkovbors-4/+4
Never regard macro rules with compile_error! invocations as unused The very point of compile_error! is to never be reached, and one of the use cases of the macro, currently also listed as examples in the documentation of compile_error, is to create nicer errors for wrong macro invocations. Thus, we should never warn about unused macro arms that contain invocations of compile_error. See also https://github.com/rust-lang/rust/pull/96150#issuecomment-1126599107 and the discussion after that. Furthermore, the PR also contains two commits to silence `unused_macro_rules` when a macro has an invalid rule, and to add a test that `unused_macros` does not behave badly in the same situation. r? `@petrochenkov` as I've talked to them about this
2022-06-11Rollup merge of #97812 - TaKO8Ki:suggest-to-swap-struct-and-trait, r=estebankDylan DPC-1/+41
Suggest to swap a struct and a trait in trait impls closes #89590
2022-06-10Rollup merge of #97927 - cjgillot:issue-97836, r=petrochenkovYuki Okushi-1/+6
Do not introduce bindings for types and consts in HRTB. Fixes https://github.com/rust-lang/rust/issues/97836 r? `@petrochenkov`
2022-06-09Never regard macro rules with compile_error! invocations as unusedest31-4/+4
The very point of compile_error! is to never be reached, and one of the use cases of the macro, currently also listed as examples in the documentation of compile_error, is to create nicer errors for wrong macro invocations. Thus, we shuuld never warn about unused macro arms that contain invocations of compile_error.
2022-06-09Do not introduce bindings for types and consts in HRTB.Camille GILLOT-1/+6
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