Skip to content

Commit 32507d6

Browse files
committed
Fix tests
1 parent 7bf21d4 commit 32507d6

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

src/librustc_ast_pretty/pprust/tests.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ use rustc_ast::ast;
44
use rustc_ast::with_default_globals;
55
use rustc_span;
66
use rustc_span::source_map::respan;
7+
use rustc_span::symbol::Ident;
78

89
fn fun_to_string(
910
decl: &ast::FnDecl,
1011
header: ast::FnHeader,
11-
name: ast::Ident,
12+
name: Ident,
1213
generics: &ast::Generics,
1314
) -> String {
1415
to_string(|s| {
@@ -26,7 +27,7 @@ fn variant_to_string(var: &ast::Variant) -> String {
2627
#[test]
2728
fn test_fun_to_string() {
2829
with_default_globals(|| {
29-
let abba_ident = ast::Ident::from_str("abba");
30+
let abba_ident = Ident::from_str("abba");
3031

3132
let decl =
3233
ast::FnDecl { inputs: Vec::new(), output: ast::FnRetTy::Default(rustc_span::DUMMY_SP) };
@@ -41,7 +42,7 @@ fn test_fun_to_string() {
4142
#[test]
4243
fn test_variant_to_string() {
4344
with_default_globals(|| {
44-
let ident = ast::Ident::from_str("principal_skinner");
45+
let ident = Ident::from_str("principal_skinner");
4546

4647
let var = ast::Variant {
4748
ident,

src/librustc_expand/mut_visit/tests.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use crate::tests::{matches_codepattern, string_to_crate};
22

3-
use rustc_ast::ast::{self, Ident};
3+
use rustc_ast::ast;
44
use rustc_ast::mut_visit::{self, MutVisitor};
55
use rustc_ast::with_default_globals;
66
use rustc_ast_pretty::pprust;
7+
use rustc_span::symbol::Ident;
78

89
// This version doesn't care about getting comments or doc-strings in.
910
fn fake_print_crate(s: &mut pprust::State<'_>, krate: &ast::Crate) {
@@ -14,7 +15,7 @@ fn fake_print_crate(s: &mut pprust::State<'_>, krate: &ast::Crate) {
1415
struct ToZzIdentMutVisitor;
1516

1617
impl MutVisitor for ToZzIdentMutVisitor {
17-
fn visit_ident(&mut self, ident: &mut ast::Ident) {
18+
fn visit_ident(&mut self, ident: &mut Ident) {
1819
*ident = Ident::from_str("zz");
1920
}
2021
fn visit_mac(&mut self, mac: &mut ast::MacCall) {

src/librustc_expand/parse/tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::tests::{matches_codepattern, string_to_stream, with_error_checking_parse};
22

3-
use rustc_ast::ast::{self, Name, PatKind};
3+
use rustc_ast::ast::{self, PatKind};
44
use rustc_ast::ptr::P;
55
use rustc_ast::token::{self, Token};
66
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
@@ -100,12 +100,12 @@ fn string_to_tts_1() {
100100

101101
let expected = TokenStream::new(vec![
102102
TokenTree::token(token::Ident(kw::Fn, false), sp(0, 2)).into(),
103-
TokenTree::token(token::Ident(Name::intern("a"), false), sp(3, 4)).into(),
103+
TokenTree::token(token::Ident(Symbol::intern("a"), false), sp(3, 4)).into(),
104104
TokenTree::Delimited(
105105
DelimSpan::from_pair(sp(5, 6), sp(13, 14)),
106106
token::DelimToken::Paren,
107107
TokenStream::new(vec![
108-
TokenTree::token(token::Ident(Name::intern("b"), false), sp(6, 7)).into(),
108+
TokenTree::token(token::Ident(Symbol::intern("b"), false), sp(6, 7)).into(),
109109
TokenTree::token(token::Colon, sp(8, 9)).into(),
110110
TokenTree::token(token::Ident(sym::i32, false), sp(10, 13)).into(),
111111
])
@@ -116,7 +116,7 @@ fn string_to_tts_1() {
116116
DelimSpan::from_pair(sp(15, 16), sp(20, 21)),
117117
token::DelimToken::Brace,
118118
TokenStream::new(vec![
119-
TokenTree::token(token::Ident(Name::intern("b"), false), sp(17, 18)).into(),
119+
TokenTree::token(token::Ident(Symbol::intern("b"), false), sp(17, 18)).into(),
120120
TokenTree::token(token::Semi, sp(18, 19)).into(),
121121
])
122122
.into(),

src/librustc_expand/tokenstream/tests.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use crate::tests::string_to_stream;
22

3-
use rustc_ast::ast::Name;
43
use rustc_ast::token;
54
use rustc_ast::tokenstream::{TokenStream, TokenStreamBuilder, TokenTree};
65
use rustc_ast::with_default_globals;
7-
use rustc_span::{BytePos, Span};
6+
use rustc_span::{BytePos, Span, Symbol};
87
use smallvec::smallvec;
98

109
fn string_to_ts(string: &str) -> TokenStream {
@@ -87,7 +86,7 @@ fn test_is_empty() {
8786
with_default_globals(|| {
8887
let test0: TokenStream = Vec::<TokenTree>::new().into_iter().collect();
8988
let test1: TokenStream =
90-
TokenTree::token(token::Ident(Name::intern("a"), false), sp(0, 1)).into();
89+
TokenTree::token(token::Ident(Symbol::intern("a"), false), sp(0, 1)).into();
9190
let test2 = string_to_ts("foo(bar::baz)");
9291

9392
assert_eq!(test0.is_empty(), true);

src/librustdoc/clean/cfg/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::*;
33
use rustc_ast::ast::*;
44
use rustc_ast::attr;
55
use rustc_ast::with_default_globals;
6-
use rustc_span::symbol::Symbol;
6+
use rustc_span::symbol::{Ident, Symbol};
77
use rustc_span::DUMMY_SP;
88

99
fn word_cfg(s: &str) -> Cfg {

src/test/ui-fulldeps/pprust-expr-roundtrip.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use rustc_parse::new_parser_from_source_str;
3232
use rustc_session::parse::ParseSess;
3333
use rustc_span::source_map::{Spanned, DUMMY_SP, FileName};
3434
use rustc_span::source_map::FilePathMapping;
35+
use rustc_span::symbol::Ident;
3536
use rustc_ast::ast::*;
3637
use rustc_ast::mut_visit::{self, MutVisitor, visit_clobber};
3738
use rustc_ast::ptr::P;

0 commit comments

Comments
 (0)