summary refs log tree commit diff
path: root/compiler/rustc_hir/src
AgeCommit message (Collapse)AuthorLines
2022-06-22Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkovbors-5/+11
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-2/+7
2022-06-21Always create parameters for functions-like types.Camille GILLOT-2/+1
2022-06-19Leave the responsibility to create `Fresh` lifetimes to lowering.Camille GILLOT-1/+3
2022-06-19Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-seMatthias Krüger-4/+4
once cell renamings This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128 - Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}` - Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}` (I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc) ```@rustbot``` label +T-libs-api -T-libs
2022-06-18Auto merge of #98153 - nnethercote:fix-MissingDoc-quadratic-behaviour, ↵bors-1/+1
r=cjgillot Fix `MissingDoc` quadratic behaviour Best reviewed one commit at a time. r? `@cjgillot`
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-52/+46
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-4/+4
2022-06-16Remove unused `hir_id` arg from `visit_attribute`.Nicholas Nethercote-1/+1
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-13/+18
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-51/+5
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-1/+41
2022-06-11Address commentsMichael Goulet-9/+4
2022-06-11Handle empty where-clause betterMichael Goulet-10/+16
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-13/+18
2022-06-11feat(fix): update some linkskyoto7250-2/+2
2022-06-07Don't suggest adding let in certain if conditionsMichael Goulet-0/+14
2022-06-06Rollup merge of #97312 - cjgillot:no-path-in-scope, r=compiler-errorsDylan DPC-0/+2
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-06Rollup merge of #97683 - cjgillot:no-apit-hrtb, r=nagisaMatthias Krüger-1/+1
Fail gracefully when encountering an HRTB in APIT. Fixes https://github.com/rust-lang/rust/issues/96954 ~The first commit will be merged as part of https://github.com/rust-lang/rust/pull/97415~
2022-06-04Compute lifetimes in scope at diagnostic time.Camille GILLOT-0/+2
2022-06-03Make hir().get_generics and generics_of consistent.Camille GILLOT-12/+9
2022-06-03Fail gracefully when encountering an HRTB in APIT.Camille GILLOT-1/+1
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-24/+36
2022-06-02Rollup merge of #97023 - cjgillot:uniform-anon, r=estebankDylan DPC-0/+11
Diagnose anonymous lifetimes errors more uniformly between async and regular fns Async fns and regular fns are desugared differently. For the former, we create a generic parameter at HIR level. For the latter, we just create an anonymous region for typeck. I plan to migrate regular fns to the async fn desugaring. Before that, this PR attempts to merge the diagnostics for both cases. r? ```@estebank```
2022-05-31Apply track_caller to closure on `expect_non_local()`Yuki Okushi-1/+5
2022-05-30Default methods of traits are also AssocFn defs as they essentially desugar ↵Oli Scherer-0/+1
to a method in a new impl block
2022-05-29Make lifetime errors more precise in the presence of `Fresh` lifetimes.Camille GILLOT-0/+11
2022-05-22Lifetime variance fixes for rustdocMichael Goulet-4/+4
2022-05-22factor out the rvalue lifetime ruleDing Xiang Fei-1/+1
remove region_scope_tree from RegionCtxt Apply suggestions from code review Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2022-05-21Rollup merge of #97223 - cjgillot:linear-hir-tree, r=jackh726Guillaume Gomez-1/+12
Remove quadratic behaviour from -Zunpretty=hir-tree. Closes https://github.com/rust-lang/rust/issues/97115
2022-05-21Auto merge of #97239 - jhpratt:remove-crate-vis, r=joshtriplettbors-2/+1
Remove `crate` visibility modifier FCP to remove this syntax is just about complete in #53120. Once it completes, this should be merged ASAP to avoid merge conflicts. The first two commits remove usage of the feature in this repository, while the last removes the feature itself.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-2/+1
2022-05-20Auto merge of #95418 - cjgillot:more-disk, r=davidtwcobors-4/+4
Cache more queries on disk One of the principles of incremental compilation is to allow saving results on disk to avoid recomputing them. This PR investigates persisting a lot of queries whose result are to be saved into metadata. Some of the queries are cheap reads from HIR, but we may also want to get rid of these reads for incremental lowering.
2022-05-20Remove quadratic behaviour from -Zunpretty=hir-tree.Camille GILLOT-1/+12
2022-05-19Update IfLet syntaxEric Holk-1/+1
2022-05-19Borrow guard patterns for the body of the guardEric Holk-0/+14
2022-05-18Auto merge of #96863 - SparrowLii:let, r=michaelwoeristerbors-5/+3
use `hir::Let` in `hir::Guard::IfLet` This PR fixes the FIXME about using `hir::Let` in `hir::Guard::IfLet`
2022-05-13rename visit item-like methodsMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13update comments about visitor strategyMiguel Guarniz-2/+35
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-92/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13Cache more queries on disk.Camille GILLOT-4/+4
2022-05-12Replace DefPathData::Misc by two appropriately-named variants.Camille GILLOT-6/+8
2022-05-09reviewlcnr-0/+37
2022-05-09use hir::Let in hir::GuardSparrowLii-5/+3
2022-05-08Auto merge of #96770 - flip1995:fix-trait-type-in-bounds, r=cjgillotbors-2/+10
Track if a where bound comes from a impl Trait desugar With https://github.com/rust-lang/rust/pull/93803 `impl Trait` function arguments get desugared to hidden where bounds. However, Clippy needs to know if a bound was originally a `impl Trait` or an actual bound. This adds a field to the `WhereBoundPredicate` struct to keep track of this information during AST->HIR lowering. r? `@cjgillot` cc `@estebank` (as the reviewer of #93803)
2022-05-07Track if a where bound comes from a impl Trait desugarflip1995-2/+10
With #93803 `impl Trait` function arguments get desugared to hidden where bounds. However, Clippy needs to know if a bound was originally a impl Trait or an actual bound. This adds a field to the `WhereBoundPredicate` struct to keep track of this information during HIR lowering.
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-10/+11
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-06Use matches! for YieldSource::is_awaitWei Liu-4/+1
2022-05-06Fix comment for async closure variantWei Liu-1/+1
2022-05-05generalize "incoherent impls" impl for custom typeslcnr-2/+0