about summary refs log tree commit diff
path: root/src/librustc/hir/map
AgeCommit message (Collapse)AuthorLines
2019-04-25Auto merge of #59042 - ljedrz:HirIdification_rework_map, r=Zoxcbors-175/+160
HirIdification: rework Map The next iteration of HirIdification (#57578). - remove `NodeId` from `Entry` - change `Map::map` to an `FxHashMap<HirId, Entry>` - base the `NodeId` `Map` methods on `HirId` ones (reverses the current state) - HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s) The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s). r? @Zoxc
2019-04-24hir: make NodeId methods depend on HirId onesljedrz-118/+102
2019-04-24hir: remove NodeId from Entry & simplify Mapljedrz-78/+79
2019-04-23Rollup merge of #59823 - davidtwco:issue-54716, r=cramertjMazdak Farrokhzad-12/+27
[wg-async-await] Drop `async fn` arguments in async block Fixes #54716. This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body. ``` async fn foo(<pattern>: <type>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern>: <ty> = __arg0; } // <-- dropped as you "exit" the async block } ``` However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this. r? @cramertj cc @nikomatsakis
2019-04-21Move `async fn` arguments into closure.David Wood-10/+24
This commit takes advantage of `AsyncArgument` type that was added in a previous commit to replace the arguments of the `async fn` in the HIR and add statements to move the bindings from the new arguments to the pattern from the old argument. For example, the async function `foo` below: async fn foo((x, _y): (T, V)) { async move { } } becomes: async fn foo(__arg0: (T, V)) { async move { let (x, _y) = __arg0; } }
2019-04-21Add `AsyncArgument` to AST.David Wood-3/+4
This commit adds an `AsyncArgument` struct to the AST that contains the generated argument and statement that will be used in HIR lowering, name resolution and def collection.
2019-04-21Remove mutability from `Def::Static`Vadim Petrochenkov-2/+2
2019-04-20Refactor some existing methodsvarkor-15/+3
2019-04-14HirIdify hir::Defljedrz-3/+2
2019-03-28Rollup merge of #59091 - Zoxc:eval_always, r=michaelwoeristerMazdak Farrokhzad-1/+1
Combine input and eval_always query types Hardcoding `Krate` as a dependency of `eval_always` queries doesn't really make sense if we want to use the query system before HIR lowering / hashing. Without that hardcoding they become pretty much identical to `input` queries, so I combined them to a single type. This will regress the `clean` incremental scenario, but that isn't terribly common. r? @michaelwoerister
2019-03-28Rollup merge of #59413 - Zoxc:hirid, r=oli-obkMazdak Farrokhzad-2/+2
HirIdify hir::ItemId Version of https://github.com/rust-lang/rust/pull/59092. r? @oli-obk
2019-03-26Combine input and eval_always query typesJohn Kåre Alsaker-1/+1
2019-03-25Make more lints incrementalJohn Kåre Alsaker-1/+2
2019-03-25Make some lints incrementalJohn Kåre Alsaker-4/+4
2019-03-25hir: replace NodeId with HirId in ItemIdljedrz-2/+2
2019-03-24Re-order fields in `Def::Ctor`.David Wood-1/+1
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-2/+2
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24Remove `CtorOf` from `Node::Ctor`.David Wood-13/+15
This commit removes `CtorOf` from `Node::Ctor` as the parent of the constructor can be determined by looking at the node's parent in the few places where knowing this is necessary.
2019-03-24Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`Vadim Petrochenkov-16/+6
2019-03-24Separate variant id and variant constructor id.David Wood-27/+50
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-23Auto merge of #59068 - ljedrz:kill_off_NodeId_stragglers, r=Zoxcbors-14/+1
HirIdification: kill off NodeId stragglers The final stages of HirIdification (#57578). This PR, along with https://github.com/rust-lang/rust/pull/59042, should finalize the HirIdification process (at least the more straightforward bits). - replace `NodeId` with `HirId` in `trait_impls` - remove all `NodeId`s from `borrowck` - remove all `NodeId`s from `typeck` - remove all `NodeId`s from `mir` - remove `trait_auto_impl` (unused) I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel` and `hir::ItemId`, but I don't know if this is feasible. I'll be happy to do more if I've missed anything.
2019-03-16Rollup merge of #59118 - seanmonstar:alias-where-self-ice, r=alexregkennytm-2/+4
rustc: fix ICE when trait alias has bare Self Fixes https://github.com/rust-lang/rust/issues/59029
2019-03-15rustc: provide DisambiguatedDefPathData in ty::print.Eduard-Mihai Burtescu-3/+3
2019-03-15rustc: replace node_path_str with uses of def_path_str.Eduard-Mihai Burtescu-1/+2
2019-03-14Auto merge of #58176 - Zoxc:lint-levels, r=oli-obkbors-0/+1
Only insert nodes which changes lint levels in the LintLevelMap r? @eddyb
2019-03-12rustc: fix ICE when trait alias has bare SelfSean McArthur-2/+4
2019-03-10hir: remove trait_auto_implljedrz-13/+0
2019-03-10hir: replace NodeId with HirId in trait_implsljedrz-1/+1
2019-03-07hir: remove some obsolete NodeId methodsljedrz-34/+20
2019-03-07hir: remove NodeId from PatKindljedrz-1/+1
2019-03-07HirIdification: replace NodeId method callsljedrz-11/+11
2019-03-05Only insert nodes which changes lint levels in the LintLevelMapJohn Kåre Alsaker-0/+1
2019-03-02hir: HirIdify Impl&TraitItemIdljedrz-4/+4
2019-03-02hir: remove NodeId from VariantDataljedrz-2/+2
2019-03-02hir: remove NodeId from Itemljedrz-2/+2
2019-03-02hir: remove NodeId from ForeignItemljedrz-1/+1
2019-03-01hir: remove NodeId from ImplItemljedrz-2/+2
2019-03-01hir: remove NodeId from TraitItemljedrz-2/+2
2019-03-01hir: remove NodeId from Localljedrz-1/+1
2019-02-27Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkorMazdak Farrokhzad-5/+5
Deny `async fn` in 2015 edition This commit prevents code using `async fn` from being compiled in Rust 2015 edition. Compiling code of the form: ```rust async fn foo() {} ``` Will now result in the error: ``` error[E0670]: `async fn` is not permitted in the 2015 edition --> async.rs:1:1 | 1 | async fn foo() {} | ^^^^^ error: aborting due to error For more information about an error, try `rustc --explain E0670`. ``` This resolves #58652 and also resolves #53714. r? @varkor
2019-02-24Deny `async fn` in 2015 editionNathan Corbyn-5/+5
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
2019-02-24hir: remove NodeId from Exprljedrz-13/+16
2019-02-24hir: remove NodeId from MacroDefljedrz-2/+3
2019-02-24hir: remove NodeId from GenericParamljedrz-3/+8
2019-02-24Auto merge of #58232 - ljedrz:HirIdification_continued, r=Zoxcbors-92/+89
HirId-ify intravisit A big step towards https://github.com/rust-lang/rust/pull/57578. This affects mostly `hir::{collector, intravisit}` and `rustc::lint`.
2019-02-23Rollup merge of #58476 - nnethercote:rm-LazyTokenStream, r=petrochenkovMazdak Farrokhzad-1/+1
Remove `LazyTokenStream`. `LazyTokenStream` was added in #40939. Perhaps it was an effective optimization then, but no longer. This PR removes it, making the code both simpler and faster. r? @alexcrichton
2019-02-20adjust intravisit HirIdificationljedrz-16/+12
2019-02-20hir: remove parent_node from NodeCollectorljedrz-24/+17
2019-02-20hir: change HirIdValidator.hir_ids_seen to a setljedrz-10/+15
2019-02-20hir: add and use hir_to_node_id in NodeCollectorljedrz-32/+34