diff options
| author | Laurențiu Nicola <lnicola@users.noreply.github.com> | 2024-12-23 10:12:23 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-23 10:12:23 +0000 |
| commit | 8dbdcc03ebfd5d3c21671d8a021669dc79d93038 (patch) | |
| tree | e61d058d30fdd35c4a306fde5be669b08092a4fd /compiler/rustc_parse/src/parser/tokenstream | |
| parent | 63a3c394617b114a8fa6e54401700b3adee65a7d (diff) | |
| parent | 0180d2d16f5f5d60384a594568a98a6e6f8eea59 (diff) | |
| download | rust-8dbdcc03ebfd5d3c21671d8a021669dc79d93038.tar.gz rust-8dbdcc03ebfd5d3c21671d8a021669dc79d93038.zip | |
Merge pull request #18746 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'compiler/rustc_parse/src/parser/tokenstream')
| -rw-r--r-- | compiler/rustc_parse/src/parser/tokenstream/tests.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/tokenstream/tests.rs b/compiler/rustc_parse/src/parser/tokenstream/tests.rs index efe266f5290..037b5b1a9de 100644 --- a/compiler/rustc_parse/src/parser/tokenstream/tests.rs +++ b/compiler/rustc_parse/src/parser/tokenstream/tests.rs @@ -1,3 +1,5 @@ +#![cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))] + use rustc_ast::token::{self, IdentIsRaw}; use rustc_ast::tokenstream::{TokenStream, TokenTree}; use rustc_span::{BytePos, Span, Symbol, create_default_session_globals_then}; @@ -21,8 +23,8 @@ fn test_concat() { let mut eq_res = TokenStream::default(); eq_res.push_stream(test_fst); eq_res.push_stream(test_snd); - assert_eq!(test_res.trees().count(), 5); - assert_eq!(eq_res.trees().count(), 5); + assert_eq!(test_res.iter().count(), 5); + assert_eq!(eq_res.iter().count(), 5); assert_eq!(test_res.eq_unspanned(&eq_res), true); }) } @@ -31,7 +33,7 @@ fn test_concat() { fn test_to_from_bijection() { create_default_session_globals_then(|| { let test_start = string_to_ts("foo::bar(baz)"); - let test_end = test_start.trees().cloned().collect(); + let test_end = test_start.iter().cloned().collect(); assert_eq!(test_start, test_end) }) } @@ -103,6 +105,6 @@ fn test_dotdotdot() { stream.push_tree(TokenTree::token_joint(token::Dot, sp(1, 2))); stream.push_tree(TokenTree::token_alone(token::Dot, sp(2, 3))); assert!(stream.eq_unspanned(&string_to_ts("..."))); - assert_eq!(stream.trees().count(), 1); + assert_eq!(stream.iter().count(), 1); }) } |
