Skip to content

Commit e8c48c6

Browse files
committed
Fix review comments
1 parent d9ec1ae commit e8c48c6

6 files changed

Lines changed: 76 additions & 78 deletions

File tree

compiler/rustc_expand/src/proc_macro_server.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -566,19 +566,19 @@ impl server::Server for Rustc<'_, '_> {
566566
diag.emit();
567567
}
568568

569-
fn tt_drop(&mut self, stream: Self::TokenStream) {
569+
fn ts_drop(&mut self, stream: Self::TokenStream) {
570570
drop(stream);
571571
}
572572

573-
fn tt_clone(&mut self, stream: &Self::TokenStream) -> Self::TokenStream {
573+
fn ts_clone(&mut self, stream: &Self::TokenStream) -> Self::TokenStream {
574574
stream.clone()
575575
}
576576

577-
fn tt_is_empty(&mut self, stream: &Self::TokenStream) -> bool {
577+
fn ts_is_empty(&mut self, stream: &Self::TokenStream) -> bool {
578578
stream.is_empty()
579579
}
580580

581-
fn tt_from_str(&mut self, src: &str) -> Self::TokenStream {
581+
fn ts_from_str(&mut self, src: &str) -> Self::TokenStream {
582582
unwrap_or_emit_fatal(source_str_to_stream(
583583
self.psess(),
584584
FileName::proc_macro_source_code(src),
@@ -587,11 +587,11 @@ impl server::Server for Rustc<'_, '_> {
587587
))
588588
}
589589

590-
fn tt_to_string(&mut self, stream: &Self::TokenStream) -> String {
590+
fn ts_to_string(&mut self, stream: &Self::TokenStream) -> String {
591591
pprust::tts_to_string(stream)
592592
}
593593

594-
fn tt_expand_expr(&mut self, stream: &Self::TokenStream) -> Result<Self::TokenStream, ()> {
594+
fn ts_expand_expr(&mut self, stream: &Self::TokenStream) -> Result<Self::TokenStream, ()> {
595595
// Parse the expression from our tokenstream.
596596
let expr: PResult<'_, _> = try {
597597
let mut p = Parser::new(self.psess(), stream.clone(), Some("proc_macro expand expr"));
@@ -652,14 +652,14 @@ impl server::Server for Rustc<'_, '_> {
652652
}
653653
}
654654

655-
fn tt_from_token_tree(
655+
fn ts_from_token_tree(
656656
&mut self,
657657
tree: TokenTree<Self::TokenStream, Self::Span, Self::Symbol>,
658658
) -> Self::TokenStream {
659659
Self::TokenStream::new((tree, &mut *self).to_internal().into_iter().collect::<Vec<_>>())
660660
}
661661

662-
fn tt_concat_trees(
662+
fn ts_concat_trees(
663663
&mut self,
664664
base: Option<Self::TokenStream>,
665665
trees: Vec<TokenTree<Self::TokenStream, Self::Span, Self::Symbol>>,
@@ -673,7 +673,7 @@ impl server::Server for Rustc<'_, '_> {
673673
stream
674674
}
675675

676-
fn tt_concat_streams(
676+
fn ts_concat_streams(
677677
&mut self,
678678
base: Option<Self::TokenStream>,
679679
streams: Vec<Self::TokenStream>,
@@ -685,7 +685,7 @@ impl server::Server for Rustc<'_, '_> {
685685
stream
686686
}
687687

688-
fn tt_into_trees(
688+
fn ts_into_trees(
689689
&mut self,
690690
stream: Self::TokenStream,
691691
) -> Vec<TokenTree<Self::TokenStream, Self::Span, Self::Symbol>> {

library/proc_macro/src/bridge/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl !Sync for TokenStream {}
2525
// Forward `Drop::drop` to the inherent `drop` method.
2626
impl Drop for TokenStream {
2727
fn drop(&mut self) {
28-
Methods::tt_drop(TokenStream { handle: self.handle });
28+
Methods::ts_drop(TokenStream { handle: self.handle });
2929
}
3030
}
3131

@@ -75,7 +75,7 @@ impl<S> Decode<'_, '_, S> for Span {
7575

7676
impl Clone for TokenStream {
7777
fn clone(&self) -> Self {
78-
Methods::tt_clone(self)
78+
Methods::ts_clone(self)
7979
}
8080
}
8181

library/proc_macro/src/bridge/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ macro_rules! with_api {
5656
fn literal_from_str(s: &str) -> Result<Literal<$S::Span, $S::Symbol>, ()>;
5757
fn emit_diagnostic(diagnostic: Diagnostic<$S::Span>);
5858

59-
fn tt_drop(stream: $S::TokenStream);
60-
fn tt_clone(stream: &$S::TokenStream) -> $S::TokenStream;
61-
fn tt_is_empty(stream: &$S::TokenStream) -> bool;
62-
fn tt_expand_expr(stream: &$S::TokenStream) -> Result<$S::TokenStream, ()>;
63-
fn tt_from_str(src: &str) -> $S::TokenStream;
64-
fn tt_to_string(stream: &$S::TokenStream) -> String;
65-
fn tt_from_token_tree(
59+
fn ts_drop(stream: $S::TokenStream);
60+
fn ts_clone(stream: &$S::TokenStream) -> $S::TokenStream;
61+
fn ts_is_empty(stream: &$S::TokenStream) -> bool;
62+
fn ts_expand_expr(stream: &$S::TokenStream) -> Result<$S::TokenStream, ()>;
63+
fn ts_from_str(src: &str) -> $S::TokenStream;
64+
fn ts_to_string(stream: &$S::TokenStream) -> String;
65+
fn ts_from_token_tree(
6666
tree: TokenTree<$S::TokenStream, $S::Span, $S::Symbol>,
6767
) -> $S::TokenStream;
68-
fn tt_concat_trees(
68+
fn ts_concat_trees(
6969
base: Option<$S::TokenStream>,
7070
trees: Vec<TokenTree<$S::TokenStream, $S::Span, $S::Symbol>>,
7171
) -> $S::TokenStream;
72-
fn tt_concat_streams(
72+
fn ts_concat_streams(
7373
base: Option<$S::TokenStream>,
7474
streams: Vec<$S::TokenStream>,
7575
) -> $S::TokenStream;
76-
fn tt_into_trees(
76+
fn ts_into_trees(
7777
stream: $S::TokenStream
7878
) -> Vec<TokenTree<$S::TokenStream, $S::Span, $S::Symbol>>;
7979

0 commit comments

Comments
 (0)