view-types: store view types in the AST#156016
view-types: store view types in the AST#156016scrabsha wants to merge 2 commits intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
52c4eee to
2bafb0c
Compare
This comment has been minimized.
This comment has been minimized.
2bafb0c to
7f6749b
Compare
7f6749b to
77bdbc2
Compare
This comment has been minimized.
This comment has been minimized.
d9ef8d8 to
ec789ac
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
view-types: store borrows of view types in the AST
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (9d3dea7): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.1%, secondary -2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 503.61s -> 496.571s (-1.40%) |
This comment has been minimized.
This comment has been minimized.
ec789ac to
93208f2
Compare
|
^
r? nikomatsakis |
|
The Rustfmt subtree was changed cc @rust-lang/rustfmt The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease Changes to the size of AST and/or HIR nodes. cc @nnethercote The Clippy subtree was changed cc @rust-lang/clippy Some changes occurred in compiler/rustc_builtin_macros/src/autodiff.rs cc @ZuseZ4 |
661a680 to
6035af1
Compare
| Ptr(MutTy), | ||
| /// A reference (`&'a T` or `&'a mut T`). | ||
| Ref(#[visitable(extra = LifetimeCtxt::Ref)] Option<Lifetime>, MutTy), | ||
| Ref(#[visitable(extra = LifetimeCtxt::Ref)] Option<Lifetime>, MutTy, ViewKind), |
There was a problem hiding this comment.
This is not the right model. The view is not attached to the reference but rather to the path type. You can have a view type without any reference at all (e.g., Foo.{F1, F2}).
There was a problem hiding this comment.
hi! Unless you have an objection, i would like to go with the following:
- Have a
TyKind::View(Box<Ty>, ThinVec<Ident>)variant (instead of the change you highlight) - Parse any
$ty.{ $( $ident ),* } - Check later in the compilation that
$tyis a kind of type we expect
Unless I have missed something, this is functionally identical to what you suggest, but leaves more room for nice error messages to be added.
I just pushed a commit that does what I just described, let me know what you think :)
|
Reminder, once the PR becomes ready for a review, use |
6035af1 to
9bdbdb2
Compare
9bdbdb2 to
7b29ee5
Compare
56b58a1 to
b103cec
Compare
This comment has been minimized.
This comment has been minimized.
b103cec to
f0d6895
Compare
|
@rustbot ready |
View all comments
Tracking issue: #155938.
Instead of discarding view types, we store them in the AST now!