Skip to content

Commit 577ef81

Browse files
authored
Update rustc-ap-* crates to 659.0.0 for rustfmt-1.4.15 (#4184)
1 parent a5cb5d2 commit 577ef81

14 files changed

+227
-184
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ matrix:
4747
script:
4848
- |
4949
if [ -z ${INTEGRATION} ]; then
50+
export CFG_RELEASE_CHANNEL=nightly
51+
export CFG_RELEASE=nightly
5052
cargo build
5153
cargo test
5254
cargo test -- --ignored

Cargo.lock

+157-129
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+12-8
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,36 @@ rustc-workspace-hack = "1.0.0"
6565

6666
[dependencies.rustc_ast]
6767
package = "rustc-ap-rustc_ast"
68-
version = "654.0.0"
68+
version = "659.0.0"
6969

7070
[dependencies.rustc_ast_pretty]
7171
package = "rustc-ap-rustc_ast_pretty"
72-
version = "654.0.0"
72+
version = "659.0.0"
73+
74+
[dependencies.rustc_attr]
75+
package = "rustc-ap-rustc_attr"
76+
version = "659.0.0"
7377

7478
[dependencies.rustc_data_structures]
7579
package = "rustc-ap-rustc_data_structures"
76-
version = "654.0.0"
80+
version = "659.0.0"
7781

7882
[dependencies.rustc_errors]
7983
package = "rustc-ap-rustc_errors"
80-
version = "654.0.0"
84+
version = "659.0.0"
8185

8286
[dependencies.rustc_expand]
8387
package = "rustc-ap-rustc_expand"
84-
version = "654.0.0"
88+
version = "659.0.0"
8589

8690
[dependencies.rustc_parse]
8791
package = "rustc-ap-rustc_parse"
88-
version = "654.0.0"
92+
version = "659.0.0"
8993

9094
[dependencies.rustc_session]
9195
package = "rustc-ap-rustc_session"
92-
version = "654.0.0"
96+
version = "659.0.0"
9397

9498
[dependencies.rustc_span]
9599
package = "rustc-ap-rustc_span"
96-
version = "654.0.0"
100+
version = "659.0.0"

appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ install:
4848
build: false
4949

5050
test_script:
51+
- set CFG_RELEASE_CHANNEL=nightly
52+
- set CFG_RELEASE=nightly
5153
- cargo build --verbose
5254
- cargo test
5355
- cargo test -- --ignored

ci/integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -ex
1515
# it again.
1616
#
1717
#which cargo-fmt || cargo install --force
18-
cargo install --path . --force
18+
CFG_RELEASE=nightly CFG_RELEASE_CHANNEL=nightly cargo install --path . --force
1919

2020
echo "Integration tests for: ${INTEGRATION}"
2121
cargo fmt -- --version

src/chains.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ use std::borrow::Cow;
5959
use std::cmp::min;
6060

6161
use rustc_ast::{ast, ptr};
62-
use rustc_span::{BytePos, Span};
62+
use rustc_span::{symbol, BytePos, Span};
6363

6464
use crate::comment::{rewrite_comment, CharClasses, FullCodeCharKind, RichChar};
6565
use crate::config::IndentStyle;
@@ -116,8 +116,8 @@ enum ChainItemKind {
116116
Vec<ast::GenericArg>,
117117
Vec<ptr::P<ast::Expr>>,
118118
),
119-
StructField(ast::Ident),
120-
TupleField(ast::Ident, bool),
119+
StructField(symbol::Ident),
120+
TupleField(symbol::Ident, bool),
121121
Await,
122122
Comment(String, CommentPosition),
123123
}
@@ -234,7 +234,7 @@ impl ChainItem {
234234
}
235235

236236
fn rewrite_method_call(
237-
method_name: ast::Ident,
237+
method_name: symbol::Ident,
238238
types: &[ast::GenericArg],
239239
args: &[ptr::P<ast::Expr>],
240240
span: Span,

src/imports.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ use std::cmp::Ordering;
33
use std::fmt;
44

55
use rustc_ast::ast::{self, UseTreeKind};
6-
use rustc_span::{source_map, symbol::sym, BytePos, Span, DUMMY_SP};
6+
use rustc_span::{
7+
source_map,
8+
symbol::{self, sym},
9+
BytePos, Span, DUMMY_SP,
10+
};
711

812
use crate::comment::combine_strs_with_missing_comments;
913
use crate::config::lists::*;
@@ -20,7 +24,7 @@ use crate::visitor::FmtVisitor;
2024

2125
/// Returns a name imported by a `use` declaration.
2226
/// E.g., returns `Ordering` for `std::cmp::Ordering` and `self` for `std::cmp::self`.
23-
pub(crate) fn path_to_imported_ident(path: &ast::Path) -> ast::Ident {
27+
pub(crate) fn path_to_imported_ident(path: &ast::Path) -> symbol::Ident {
2428
path.segments.last().unwrap().ident
2529
}
2630

src/items.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl<'a> FmtVisitor<'a> {
311311
pub(crate) fn rewrite_fn_before_block(
312312
&mut self,
313313
indent: Indent,
314-
ident: ast::Ident,
314+
ident: symbol::Ident,
315315
fn_sig: &FnSig<'_>,
316316
span: Span,
317317
) -> Option<(String, FnBraceStyle)> {
@@ -335,7 +335,7 @@ impl<'a> FmtVisitor<'a> {
335335
pub(crate) fn rewrite_required_fn(
336336
&mut self,
337337
indent: Indent,
338-
ident: ast::Ident,
338+
ident: symbol::Ident,
339339
sig: &ast::FnSig,
340340
generics: &ast::Generics,
341341
span: Span,
@@ -411,7 +411,7 @@ impl<'a> FmtVisitor<'a> {
411411

412412
pub(crate) fn visit_enum(
413413
&mut self,
414-
ident: ast::Ident,
414+
ident: symbol::Ident,
415415
vis: &ast::Visibility,
416416
enum_def: &ast::EnumDef,
417417
generics: &ast::Generics,
@@ -967,7 +967,7 @@ fn rewrite_trait_ref(
967967

968968
pub(crate) struct StructParts<'a> {
969969
prefix: &'a str,
970-
ident: ast::Ident,
970+
ident: symbol::Ident,
971971
vis: &'a ast::Visibility,
972972
def: &'a ast::VariantData,
973973
generics: Option<&'a ast::Generics>,
@@ -1234,7 +1234,7 @@ impl<'a> Rewrite for TraitAliasBounds<'a> {
12341234

12351235
pub(crate) fn format_trait_alias(
12361236
context: &RewriteContext<'_>,
1237-
ident: ast::Ident,
1237+
ident: symbol::Ident,
12381238
vis: &ast::Visibility,
12391239
generics: &ast::Generics,
12401240
generic_bounds: &ast::GenericBounds,
@@ -1513,7 +1513,7 @@ fn rewrite_type_prefix(
15131513
context: &RewriteContext<'_>,
15141514
indent: Indent,
15151515
prefix: &str,
1516-
ident: ast::Ident,
1516+
ident: symbol::Ident,
15171517
generics: &ast::Generics,
15181518
) -> Option<String> {
15191519
let mut result = String::with_capacity(128);
@@ -1554,7 +1554,7 @@ fn rewrite_type_item<R: Rewrite>(
15541554
indent: Indent,
15551555
prefix: &str,
15561556
suffix: &str,
1557-
ident: ast::Ident,
1557+
ident: symbol::Ident,
15581558
rhs: &R,
15591559
generics: &ast::Generics,
15601560
vis: &ast::Visibility,
@@ -1583,7 +1583,7 @@ fn rewrite_type_item<R: Rewrite>(
15831583
pub(crate) fn rewrite_type_alias(
15841584
context: &RewriteContext<'_>,
15851585
indent: Indent,
1586-
ident: ast::Ident,
1586+
ident: symbol::Ident,
15871587
ty: &ast::Ty,
15881588
generics: &ast::Generics,
15891589
vis: &ast::Visibility,
@@ -1594,7 +1594,7 @@ pub(crate) fn rewrite_type_alias(
15941594
pub(crate) fn rewrite_opaque_type(
15951595
context: &RewriteContext<'_>,
15961596
indent: Indent,
1597-
ident: ast::Ident,
1597+
ident: symbol::Ident,
15981598
generic_bounds: &ast::GenericBounds,
15991599
generics: &ast::Generics,
16001600
vis: &ast::Visibility,
@@ -1709,7 +1709,7 @@ pub(crate) fn rewrite_struct_field(
17091709
pub(crate) struct StaticParts<'a> {
17101710
prefix: &'a str,
17111711
vis: &'a ast::Visibility,
1712-
ident: ast::Ident,
1712+
ident: symbol::Ident,
17131713
ty: &'a ast::Ty,
17141714
mutability: ast::Mutability,
17151715
expr_opt: Option<&'a ptr::P<ast::Expr>>,
@@ -1830,7 +1830,7 @@ fn rewrite_static(
18301830
}
18311831

18321832
pub(crate) fn rewrite_associated_type(
1833-
ident: ast::Ident,
1833+
ident: symbol::Ident,
18341834
ty_opt: Option<&ptr::P<ast::Ty>>,
18351835
generics: &ast::Generics,
18361836
generic_bounds_opt: Option<&ast::GenericBounds>,
@@ -1880,7 +1880,7 @@ impl<'a> Rewrite for OpaqueType<'a> {
18801880

18811881
pub(crate) fn rewrite_opaque_impl_type(
18821882
context: &RewriteContext<'_>,
1883-
ident: ast::Ident,
1883+
ident: symbol::Ident,
18841884
generics: &ast::Generics,
18851885
generic_bounds: &ast::GenericBounds,
18861886
indent: Indent,
@@ -1904,7 +1904,7 @@ pub(crate) fn rewrite_opaque_impl_type(
19041904
}
19051905

19061906
pub(crate) fn rewrite_associated_impl_type(
1907-
ident: ast::Ident,
1907+
ident: symbol::Ident,
19081908
defaultness: ast::Defaultness,
19091909
ty_opt: Option<&ptr::P<ast::Ty>>,
19101910
generics: &ast::Generics,
@@ -2141,7 +2141,7 @@ pub(crate) enum FnBraceStyle {
21412141
fn rewrite_fn_base(
21422142
context: &RewriteContext<'_>,
21432143
indent: Indent,
2144-
ident: ast::Ident,
2144+
ident: symbol::Ident,
21452145
fn_sig: &FnSig<'_>,
21462146
span: Span,
21472147
fn_brace_style: FnBraceStyle,
@@ -2969,7 +2969,7 @@ fn rewrite_comments_before_after_where(
29692969
fn format_header(
29702970
context: &RewriteContext<'_>,
29712971
item_name: &str,
2972-
ident: ast::Ident,
2972+
ident: symbol::Ident,
29732973
vis: &ast::Visibility,
29742974
) -> String {
29752975
format!(

src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::rc::Rc;
2020
use failure::Fail;
2121
use ignore;
2222
use rustc_ast::ast;
23+
use rustc_span::symbol;
2324

2425
use crate::comment::LineClasses;
2526
use crate::emitter::Emitter;
@@ -524,7 +525,7 @@ impl Input {
524525
let file_stem = file.file_stem()?;
525526
if file.parent()?.to_path_buf().join(file_stem).is_dir() {
526527
Some(DirectoryOwnership::Owned {
527-
relative: file_stem.to_str().map(ast::Ident::from_str),
528+
relative: file_stem.to_str().map(symbol::Ident::from_str),
528529
})
529530
} else {
530531
None

src/macros.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ use rustc_ast::tokenstream::{Cursor, TokenStream, TokenTree};
1717
use rustc_ast::{ast, ptr};
1818
use rustc_ast_pretty::pprust;
1919
use rustc_parse::{new_parser_from_tts, parser::Parser};
20-
use rustc_span::{symbol::kw, BytePos, Span, Symbol, DUMMY_SP};
20+
use rustc_span::{
21+
symbol::{self, kw},
22+
BytePos, Span, Symbol, DUMMY_SP,
23+
};
2124

2225
use crate::comment::{
2326
contains_comment, CharClasses, FindUncommented, FullCodeCharKind, LineClasses,
@@ -52,7 +55,7 @@ pub(crate) enum MacroArg {
5255
Ty(ptr::P<ast::Ty>),
5356
Pat(ptr::P<ast::Pat>),
5457
Item(ptr::P<ast::Item>),
55-
Keyword(ast::Ident, Span),
58+
Keyword(symbol::Ident, Span),
5659
}
5760

5861
impl MacroArg {
@@ -137,7 +140,7 @@ fn parse_macro_arg<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
137140
fn rewrite_macro_name(
138141
context: &RewriteContext<'_>,
139142
path: &ast::Path,
140-
extra_ident: Option<ast::Ident>,
143+
extra_ident: Option<symbol::Ident>,
141144
) -> String {
142145
let name = if path.segments.len() == 1 {
143146
// Avoid using pretty-printer in the common case.
@@ -188,7 +191,7 @@ fn return_macro_parse_failure_fallback(
188191

189192
pub(crate) fn rewrite_macro(
190193
mac: &ast::MacCall,
191-
extra_ident: Option<ast::Ident>,
194+
extra_ident: Option<symbol::Ident>,
192195
context: &RewriteContext<'_>,
193196
shape: Shape,
194197
position: MacroPosition,
@@ -230,17 +233,18 @@ fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
230233
})
231234
{
232235
parser.bump();
233-
let macro_arg =
234-
MacroArg::Keyword(ast::Ident::with_dummy_span(keyword), parser.prev_token.span);
235-
return Some(macro_arg);
236+
return Some(MacroArg::Keyword(
237+
symbol::Ident::with_dummy_span(keyword),
238+
parser.prev_token.span,
239+
));
236240
}
237241
}
238242
None
239243
}
240244

241245
fn rewrite_macro_inner(
242246
mac: &ast::MacCall,
243-
extra_ident: Option<ast::Ident>,
247+
extra_ident: Option<symbol::Ident>,
244248
context: &RewriteContext<'_>,
245249
shape: Shape,
246250
position: MacroPosition,
@@ -479,7 +483,7 @@ pub(crate) fn rewrite_macro_def(
479483
shape: Shape,
480484
indent: Indent,
481485
def: &ast::MacroDef,
482-
ident: ast::Ident,
486+
ident: symbol::Ident,
483487
vis: &ast::Visibility,
484488
span: Span,
485489
) -> Option<String> {
@@ -620,7 +624,7 @@ fn replace_names(input: &str) -> Option<(String, HashMap<String, String>)> {
620624
#[derive(Debug, Clone)]
621625
enum MacroArgKind {
622626
/// e.g., `$x: expr`.
623-
MetaVariable(ast::Name, String),
627+
MetaVariable(Symbol, String),
624628
/// e.g., `$($foo: expr),*`
625629
Repeat(
626630
/// `()`, `[]` or `{}`.

src/modules.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
44

55
use rustc_ast::ast;
66
use rustc_ast::visit::Visitor;
7-
use rustc_span::symbol::{sym, Symbol};
7+
use rustc_span::symbol::{self, sym, Symbol};
88

99
use crate::attr::MetaVisitor;
1010
use crate::config::FileName;
@@ -239,7 +239,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
239239
/// Find a file path in the filesystem which corresponds to the given module.
240240
fn find_external_module(
241241
&self,
242-
mod_name: ast::Ident,
242+
mod_name: symbol::Ident,
243243
attrs: &[ast::Attribute],
244244
sub_mod: &Cow<'ast, ast::Mod>,
245245
) -> Result<Option<SubModKind<'c, 'ast>>, String> {
@@ -326,7 +326,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
326326
}
327327
}
328328

329-
fn push_inline_mod_directory(&mut self, id: ast::Ident, attrs: &[ast::Attribute]) {
329+
fn push_inline_mod_directory(&mut self, id: symbol::Ident, attrs: &[ast::Attribute]) {
330330
if let Some(path) = find_path_value(attrs) {
331331
self.directory.path.push(&*path.as_str());
332332
self.directory.ownership = DirectoryOwnership::Owned { relative: None };

0 commit comments

Comments
 (0)