about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-01 03:56:21 +0000
committerbors <bors@rust-lang.org>2022-10-01 03:56:21 +0000
commitde341fe668fd821f701ca970c897d167104f0a17 (patch)
tree90b54768b33cc51c02935bc4fe79b1ec13d85371 /compiler/rustc_parse/src
parentc5b105dc9a14116248512ba6fec8d3f0f4f24f0f (diff)
parent2fadfe0284370a31a453b8e90b9eb357475164f5 (diff)
downloadrust-de341fe668fd821f701ca970c897d167104f0a17.tar.gz
rust-de341fe668fd821f701ca970c897d167104f0a17.zip
Auto merge of #102526 - matthiaskrgr:rollup-9o6p98c, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #102361 (Fix ICE in const_trait check code)
 - #102373 (Flush delayed bugs before codegen)
 - #102483 (create def ids for impl traits during ast lowering)
 - #102490 (Generate synthetic region from `impl` even in closure body within an associated fn)
 - #102492 (Don't lower assoc bindings just to deny them)
 - #102493 (Group together more size assertions.)
 - #102521 (rustdoc: add missing margin to no-docblock methods)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/attr_wrapper.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs
index 86c386b94c8..0dc05475ce9 100644
--- a/compiler/rustc_parse/src/parser/attr_wrapper.rs
+++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs
@@ -32,11 +32,6 @@ pub struct AttrWrapper {
     start_pos: usize,
 }
 
-// This struct is passed around very frequently,
-// so make sure it doesn't accidentally get larger
-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
-rustc_data_structures::static_assert_size!(AttrWrapper, 16);
-
 impl AttrWrapper {
     pub(super) fn new(attrs: AttrVec, start_pos: usize) -> AttrWrapper {
         AttrWrapper { attrs, start_pos }
@@ -96,9 +91,6 @@ struct LazyAttrTokenStreamImpl {
     replace_ranges: Box<[ReplaceRange]>,
 }
 
-#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
-rustc_data_structures::static_assert_size!(LazyAttrTokenStreamImpl, 144);
-
 impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
     fn to_attr_token_stream(&self) -> AttrTokenStream {
         // The token produced by the final call to `{,inlined_}next` was not
@@ -461,3 +453,13 @@ fn make_token_stream(
     }
     AttrTokenStream::new(final_buf.inner)
 }
+
+// Some types are used a lot. Make sure they don't unintentionally get bigger.
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+mod size_asserts {
+    use super::*;
+    use rustc_data_structures::static_assert_size;
+    // These are in alphabetical order, which is easy to maintain.
+    static_assert_size!(AttrWrapper, 16);
+    static_assert_size!(LazyAttrTokenStreamImpl, 144);
+}