diff options
| author | bors <bors@rust-lang.org> | 2018-10-27 00:39:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-10-27 00:39:11 +0000 |
| commit | 10f42cbde015c44a019e8b6dceca472a1532f36a (patch) | |
| tree | f3be514f7f0d9d31f457bf1643683dc9f5b20c2b /src/rustllvm/RustWrapper.cpp | |
| parent | fa45602b71c59c6315fdb07e925dec61f5827ad9 (diff) | |
| parent | 639a3ffadcfec5165d434cbbf320678f69b01a5b (diff) | |
| download | rust-10f42cbde015c44a019e8b6dceca472a1532f36a.tar.gz rust-10f42cbde015c44a019e8b6dceca472a1532f36a.zip | |
Auto merge of #55274 - pnkfelix:issue-54570-proj-path-into-pats-with-type-take-2, r=nikomatsakis
Handle bindings in substructure of patterns with type ascriptions This attempts to follow the outline described by @nikomatsakis [here](https://github.com/rust-lang/rust/issues/47184#issuecomment-420041056). Its a bit more complicated than expected for two reasons: 1. In general it handles sets of type ascriptions, because such ascriptions can be nested within patterns 2. It has a separate types in the HAIR, `PatternTypeProjections` and `PatternTypeProjection`, which are analogues to the corresponding types in the MIR. The main reason I added the new HAIR types was because I am worried that the current implementation is inefficent, and asymptotically so: It makes copies of vectors as it descends the patterns, even when those accumulated vectors are never used. Longer term, I would like to used a linked tree structure for the `PatternTypeProjections` and `PatternTypeProjection`, and save the construction of standalone vectors for the MIR types. I didn't want to block landing this on that hypoethetical revision; but I figured I could at least make the future change easier by differentiating between the two types now. Oh, one more thing: This doesn't attempt to handle `ref x` (in terms of ensuring that any necessary types are ascribed to `x` in that scenario as well). We should open an issue to investigate supporting that as well. But I didn't want to block this PR on that future work. Fix #54570
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
