-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syntax: ABI-oblivious grammar #65884
Conversation
This comment has been minimized.
This comment has been minimized.
Abi::C | | ||
Abi::System => {} | ||
abi => { | ||
self.parse_sess.span_diagnostic.delay_span_bug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The purpose of doing this is so that if we add a new ABI but forget to feature gate it, an ICE will occur and it won't pass CI.)
Assigning myself as well, I had some plans in this area. |
This comment has been minimized.
This comment has been minimized.
07e5ff6
to
f8a588b
Compare
I think @oli-obk moved |
This comment has been minimized.
This comment has been minimized.
👍 from me |
My argument would be that it's confusing to have two copies of the same type. |
@@ -561,6 +561,7 @@ symbols! { | |||
rust_2018_preview, | |||
rust_begin_unwind, | |||
rustc, | |||
Rust, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦀
f66f4a1
to
9a46580
Compare
This comment has been minimized.
This comment has been minimized.
r=me after addressing the remaining comments, unless varkor wants to review as well. |
7e42b47
to
0997975
Compare
@bors r=petrochenkov |
📌 Commit 09979759ba46574d39d8ab0c4dc14566b918e949 has been approved by |
This comment has been minimized.
This comment has been minimized.
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
0997975
to
55f76cd
Compare
@bors r=petrochenkov |
📌 Commit 55f76cd has been approved by |
…chenkov syntax: ABI-oblivious grammar This PR has the following effects: 1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal. 2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate. 3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place. 4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat. cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :) r? @varkor
Rollup of 5 pull requests Successful merges: - #59789 (Revert two unapproved changes to rustc_typeck.) - #65752 (Use structured suggestions for missing associated items) - #65884 (syntax: ABI-oblivious grammar) - #65974 (A scheme for more macro-matcher friendly pre-expansion gating) - #66017 (Add future incompatibility lint for `array.into_iter()`) Failed merges: - #66056 (rustc_metadata: Some reorganization of the module structure) r? @ghost
rustc_target: inline abi::FloatTy into abi::Primitive. This effectively undoes a small part of @oli-obk's rust-lang#50967, now that the rest of the compiler doesn't use the `FloatTy` definition from `rustc_target`, post-rust-lang#65884.
This PR has the following effects:
extern $lit
is now legal where$lit:literal
and$lit
is substituted for a string literal.extern "abi_that_does_not_exist"
is now syntactically legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate.ast::FloatTy
is now distinct fromrustc_target::abi::FloatTy
. The former is used substantially more and the translation between them is only necessary in a single place.As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat.
cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :)
r? @varkor