Skip to content

Commit 121abd0

Browse files
committed
make it compile again
1 parent 24a6284 commit 121abd0

File tree

20 files changed

+92
-94
lines changed

20 files changed

+92
-94
lines changed

src/librustc/hir/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
308308

309309
fn check_used(&self, item: &hir::Item, target: Target) {
310310
for attr in &item.attrs {
311-
if attr.name().map(|name| name == "used").unwrap_or(false) && target != Target::Static {
311+
if attr.name() == "used" && target != Target::Static {
312312
self.tcx.sess
313313
.span_err(attr.span, "attribute must be applied to a `static` variable");
314314
}

src/librustc/ich/impls_syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for ast::Path {
216216
hasher: &mut StableHasher<W>) {
217217
self.segments.len().hash_stable(hcx, hasher);
218218
for segment in &self.segments {
219-
segment.identifier.name.hash_stable(hcx, hasher);
219+
segment.ident.name.hash_stable(hcx, hasher);
220220
}
221221
}
222222
}

src/librustc/lint/levels.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a> LintLevelsBuilder<'a> {
221221
continue
222222
}
223223
};
224-
let name = word.ident.name;
224+
let name = word.name();
225225
match store.check_lint_name(&name.as_str()) {
226226
CheckLintNameResult::Ok(ids) => {
227227
let src = LintSource::Node(name, li.span);
@@ -260,7 +260,7 @@ impl<'a> LintLevelsBuilder<'a> {
260260
Some(li.span.into()),
261261
&msg);
262262
if name.as_str().chars().any(|c| c.is_uppercase()) {
263-
let name_lower = name.as_str().to_lowercase();
263+
let name_lower = name.as_str().to_lowercase().to_string();
264264
if let CheckLintNameResult::NoLint =
265265
store.check_lint_name(&name_lower) {
266266
db.emit();

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> ast::CrateConfig {
16831683
early_error(ErrorOutputType::default(), &msg)
16841684
}
16851685

1686-
(meta_item.ident.name, meta_item.value_str())
1686+
(meta_item.name(), meta_item.value_str())
16871687
})
16881688
.collect::<ast::CrateConfig>()
16891689
}

src/librustc/traits/on_unimplemented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a, 'gcx, 'tcx> OnUnimplementedDirective {
190190
for command in self.subcommands.iter().chain(Some(self)).rev() {
191191
if let Some(ref condition) = command.condition {
192192
if !attr::eval_condition(condition, &tcx.sess.parse_sess, &mut |c| {
193-
options.contains(&(c.ident.name.as_str().to_string(),
193+
options.contains(&(c.name().as_str().to_string(),
194194
match c.value_str().map(|s| s.as_str().to_string()) {
195195
Some(s) => Some(s),
196196
None => None

src/librustc_driver/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ impl RustcDefaultCalls {
10601060
let mut cfgs = Vec::new();
10611061
for &(name, ref value) in sess.parse_sess.config.iter() {
10621062
let gated_cfg = GatedCfg::gate(&ast::MetaItem {
1063-
name: ast::Path::from_ident(DUMMY_SP, name.to_ident()),
1063+
ident: ast::Path::from_ident(name.to_ident()),
10641064
node: ast::MetaItemKind::Word,
10651065
span: DUMMY_SP,
10661066
});

src/librustc_incremental/assert_dep_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'a, 'tcx> IfThisChanged<'a, 'tcx> {
110110
for list_item in attr.meta_item_list().unwrap_or_default() {
111111
match list_item.word() {
112112
Some(word) if value.is_none() =>
113-
value = Some(word.ident.name),
113+
value = Some(word.name()),
114114
_ =>
115115
// FIXME better-encapsulate meta_item (don't directly access `node`)
116116
span_bug!(list_item.span(), "unexpected meta-item {:?}", list_item.node),

src/librustc_resolve/build_reduced_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ impl<'a> Resolver<'a> {
702702
match attr.meta_item_list() {
703703
Some(names) => for attr in names {
704704
if let Some(word) = attr.word() {
705-
imports.imports.push((word.ident.name, attr.span()));
705+
imports.imports.push((word.name(), attr.span()));
706706
} else {
707707
span_err!(self.session, attr.span(), E0466, "bad macro import");
708708
}

src/librustdoc/clean/cfg.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ mod test {
438438

439439
fn dummy_meta_item_word(name: &str) -> MetaItem {
440440
MetaItem {
441-
name: Path::from_ident(DUMMY_SP, Ident::from_str(name)),
441+
ident: Path::from_ident(Ident::from_str(name)),
442442
node: MetaItemKind::Word,
443443
span: DUMMY_SP,
444444
}
@@ -447,7 +447,7 @@ mod test {
447447
macro_rules! dummy_meta_item_list {
448448
($name:ident, [$($list:ident),* $(,)*]) => {
449449
MetaItem {
450-
name: Path::from_ident(DUMMY_SP, Ident::from_str(stringify!($name))),
450+
ident: Path::from_ident(Ident::from_str(stringify!($name))),
451451
node: MetaItemKind::List(vec![
452452
$(
453453
dummy_spanned(NestedMetaItemKind::MetaItem(
@@ -461,7 +461,7 @@ mod test {
461461

462462
($name:ident, [$($list:expr),* $(,)*]) => {
463463
MetaItem {
464-
name: Path::from_ident(DUMMY_SP, Ident::from_str(stringify!($name))),
464+
ident: Path::from_ident(Ident::from_str(stringify!($name))),
465465
node: MetaItemKind::List(vec![
466466
$(
467467
dummy_spanned(NestedMetaItemKind::MetaItem($list)),
@@ -601,7 +601,7 @@ mod test {
601601
assert_eq!(Cfg::parse(&mi), Ok(word_cfg("all")));
602602

603603
let mi = MetaItem {
604-
name: Path::from_ident(DUMMY_SP, Ident::from_str("all")),
604+
ident: Path::from_ident(Ident::from_str("all")),
605605
node: MetaItemKind::NameValue(dummy_spanned(LitKind::Str(
606606
Symbol::intern("done"),
607607
StrStyle::Cooked,
@@ -636,7 +636,7 @@ mod test {
636636
fn test_parse_err() {
637637
with_globals(|| {
638638
let mi = MetaItem {
639-
name: Path::from_ident(DUMMY_SP, Ident::from_str("foo")),
639+
ident: Path::from_ident(Ident::from_str("foo")),
640640
node: MetaItemKind::NameValue(dummy_spanned(LitKind::Bool(false))),
641641
span: DUMMY_SP,
642642
};

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3284,7 +3284,7 @@ fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
32843284
}
32853285

32863286
fn render_attribute(attr: &ast::MetaItem) -> Option<String> {
3287-
let name = attr.ident.name;
3287+
let name = attr.name();
32883288

32893289
if attr.is_word() {
32903290
Some(format!("{}", name))

0 commit comments

Comments
 (0)