diff options
| author | bors <bors@rust-lang.org> | 2018-11-13 22:17:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-11-13 22:17:46 +0000 |
| commit | f1d61837d1cf058cfbd0902b0bf79a2657b81187 (patch) | |
| tree | 21c9d58f3ee5f7799f5079b0527013712b52e7b9 /src/libsyntax | |
| parent | 9fefb67669f00c25b476e7a80c9c9300a987d517 (diff) | |
| parent | 7921572acf98d573464eae4aad73112a0d3d6f82 (diff) | |
| download | rust-f1d61837d1cf058cfbd0902b0bf79a2657b81187.tar.gz rust-f1d61837d1cf058cfbd0902b0bf79a2657b81187.zip | |
Auto merge of #55912 - kennytm:rollup, r=kennytm
Rollup of 20 pull requests Successful merges: - #55136 (Remove short doc where it starts with a codeblock) - #55711 (Format BtreeMap::range_mut example) - #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters) - #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err) - #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to) - #55805 (Move `static_assert!` into librustc_data_structures) - #55837 (Make PhantomData #[structural_match]) - #55840 (Fix TLS errors when downloading stage0) - #55843 (add FromIterator<A> to Box<[A]>) - #55858 (Small fixes on code blocks in rustdoc) - #55863 (Fix a typo in std::panic) - #55870 (Fix typos.) - #55874 (string: Add documentation for `From` impls) - #55879 (save-analysis: Don't panic for macro-generated use globs) - #55882 (Reference count `crate_inherent_impls`s return value.) - #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra) - #55889 (global allocators: add a few comments) - #55896 (Document optimizations enabled by FusedIterator) - #55905 (Change `Lit::short_name` to `Lit::literal_name`.) - #55908 (Fix their/there grammar nit)
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/quoted.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 14 |
5 files changed, 16 insertions, 10 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 2f17bc0548c..808e19d6f12 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -20,6 +20,8 @@ use print::pprust; use ptr::P; use rustc_data_structures::indexed_vec; use rustc_data_structures::indexed_vec::Idx; +#[cfg(target_arch = "x86_64")] +use rustc_data_structures::static_assert; use rustc_target::spec::abi::Abi; use source_map::{dummy_spanned, respan, Spanned}; use symbol::{keywords, Symbol}; @@ -924,6 +926,10 @@ pub struct Expr { pub attrs: ThinVec<Attribute>, } +// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger. +#[cfg(target_arch = "x86_64")] +static_assert!(MEM_SIZE_OF_EXPR: std::mem::size_of::<Expr>() == 88); + impl Expr { /// Whether this expression would be valid somewhere that expects a value, for example, an `if` /// condition. diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 7a0a764d463..f31d80acbfa 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -122,7 +122,7 @@ impl<'tt> TokenTreeOrTokenTreeSlice<'tt> { } } - /// The the `index`-th token tree of `self`. + /// The `index`-th token tree of `self`. fn get_tt(&self, index: usize) -> TokenTree { match *self { TtSeq(ref v) => v[index].clone(), diff --git a/src/libsyntax/ext/tt/quoted.rs b/src/libsyntax/ext/tt/quoted.rs index 74363f3e5f7..21848674831 100644 --- a/src/libsyntax/ext/tt/quoted.rs +++ b/src/libsyntax/ext/tt/quoted.rs @@ -496,7 +496,7 @@ where return (None, KleeneOp::ZeroOrMore); } - // #2 is a Kleene op, which is the the only valid option + // #2 is a Kleene op, which is the only valid option Ok(Ok((op, _))) => { // Warn that `?` as a separator will be deprecated sess.buffer_lint( diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 68e7e40c43e..d90ec4ea081 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1956,7 +1956,7 @@ impl<'a> Parser<'a> { if suffix_illegal { let sp = self.span; - self.expect_no_suffix(sp, &format!("{} literal", lit.short_name()), suf) + self.expect_no_suffix(sp, lit.literal_name(), suf) } result.unwrap() diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 01bc7f6ad30..1c6fc1ac185 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -79,14 +79,14 @@ pub enum Lit { } impl Lit { - crate fn short_name(&self) -> &'static str { + crate fn literal_name(&self) -> &'static str { match *self { - Byte(_) => "byte", - Char(_) => "char", - Integer(_) => "integer", - Float(_) => "float", - Str_(_) | StrRaw(..) => "string", - ByteStr(_) | ByteStrRaw(..) => "byte string" + Byte(_) => "byte literal", + Char(_) => "char literal", + Integer(_) => "integer literal", + Float(_) => "float literal", + Str_(_) | StrRaw(..) => "string literal", + ByteStr(_) | ByteStrRaw(..) => "byte string literal" } } |
