diff options
| author | bors <bors@rust-lang.org> | 2020-11-28 07:48:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-28 07:48:56 +0000 |
| commit | 4ae328bef47dffcbf363e5ae873f419c06a5511d (patch) | |
| tree | a4638ba9c7a64bae7fa30ec681219ef1a00dc3d3 /library/alloc/tests/vec.rs | |
| parent | f8e5209a21c698398a0f8c04af55e2ad6cbd113c (diff) | |
| parent | 92bfa05b07090be1b3bf32af0c8947a0f0b387e8 (diff) | |
Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov
Properly handle attributes on statements
We now collect tokens for the underlying node wrapped by `StmtKind`
nstead of storing tokens directly in `Stmt`.
`LazyTokenStream` now supports capturing a trailing semicolon after it
is initially constructed. This allows us to avoid refactoring statement
parsing to wrap the parsing of the semicolon in `parse_tokens`.
Attributes on item statements
(e.g. `fn foo() { #[bar] struct MyStruct; }`) are now treated as
item attributes, not statement attributes, which is consistent with how
we handle attributes on other kinds of statements. The feature-gating
code is adjusted so that proc-macro attributes are still allowed on item
statements on stable.
Two built-in macros (`#[global_allocator]` and `#[test]`) needed to be
adjusted to support being passed `Annotatable::Stmt`.
Diffstat (limited to 'library/alloc/tests/vec.rs')
| -rw-r--r-- | library/alloc/tests/vec.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs index 47ebe56f9fd..e19406d7a06 100644 --- a/library/alloc/tests/vec.rs +++ b/library/alloc/tests/vec.rs @@ -919,7 +919,7 @@ fn test_from_iter_partially_drained_in_place_specialization() { #[test] fn test_from_iter_specialization_with_iterator_adapters() { - fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {}; + fn assert_in_place_trait<T: InPlaceIterable>(_: &T) {} let src: Vec<usize> = vec![0usize; 256]; let srcptr = src.as_ptr(); let iter = src @@ -1198,7 +1198,7 @@ fn drain_filter_consumed_panic() { struct Check { index: usize, drop_counts: Rc<Mutex<Vec<usize>>>, - }; + } impl Drop for Check { fn drop(&mut self) { @@ -1250,7 +1250,7 @@ fn drain_filter_unconsumed_panic() { struct Check { index: usize, drop_counts: Rc<Mutex<Vec<usize>>>, - }; + } impl Drop for Check { fn drop(&mut self) { |
