Add a static size assertion for MatcherPos
.
This commit is contained in:
parent
11c565f14b
commit
b9fabc3f9c
1 changed files with 4 additions and 0 deletions
|
@ -207,6 +207,10 @@ struct MatcherPos<'root, 'tt> {
|
||||||
stack: SmallVec<[MatcherTtFrame<'tt>; 1]>,
|
stack: SmallVec<[MatcherTtFrame<'tt>; 1]>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This type is used a lot. Make sure it doesn't unintentionally get bigger.
|
||||||
|
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
|
||||||
|
rustc_data_structures::static_assert_size!(MatcherPos<'_, '_>, 192);
|
||||||
|
|
||||||
impl<'root, 'tt> MatcherPos<'root, 'tt> {
|
impl<'root, 'tt> MatcherPos<'root, 'tt> {
|
||||||
/// Adds `m` as a named match for the `idx`-th metavar.
|
/// Adds `m` as a named match for the `idx`-th metavar.
|
||||||
fn push_match(&mut self, idx: usize, m: NamedMatch) {
|
fn push_match(&mut self, idx: usize, m: NamedMatch) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue