Drop span argument from mk_list_item
This commit is contained in:
parent
4be0675589
commit
ab3fb1e775
@ -5176,11 +5176,10 @@ impl<'a> LoweringContext<'a> {
|
||||
let attr = {
|
||||
// `allow(unreachable_code)`
|
||||
let allow = {
|
||||
let allow_ident = Ident::with_empty_ctxt(sym::allow).with_span_pos(e.span);
|
||||
let uc_ident = Ident::with_empty_ctxt(sym::unreachable_code)
|
||||
.with_span_pos(e.span);
|
||||
let allow_ident = Ident::new(sym::allow, e.span);
|
||||
let uc_ident = Ident::new(sym::unreachable_code, e.span);
|
||||
let uc_nested = attr::mk_nested_word_item(uc_ident);
|
||||
attr::mk_list_item(e.span, allow_ident, vec![uc_nested])
|
||||
attr::mk_list_item(allow_ident, vec![uc_nested])
|
||||
};
|
||||
attr::mk_attr_outer(allow)
|
||||
};
|
||||
|
@ -355,8 +355,8 @@ pub fn mk_name_value_item(span: Span, ident: Ident, lit_kind: LitKind, lit_span:
|
||||
MetaItem { path: Path::from_ident(ident), span, node: MetaItemKind::NameValue(lit) }
|
||||
}
|
||||
|
||||
pub fn mk_list_item(span: Span, ident: Ident, items: Vec<NestedMetaItem>) -> MetaItem {
|
||||
MetaItem { path: Path::from_ident(ident), span, node: MetaItemKind::List(items) }
|
||||
pub fn mk_list_item(ident: Ident, items: Vec<NestedMetaItem>) -> MetaItem {
|
||||
MetaItem { path: Path::from_ident(ident), span: ident.span, node: MetaItemKind::List(items) }
|
||||
}
|
||||
|
||||
pub fn mk_word_item(ident: Ident) -> MetaItem {
|
||||
|
@ -879,7 +879,7 @@ impl<'a> ExtCtxt<'a> {
|
||||
|
||||
pub fn meta_list(&self, sp: Span, name: ast::Name, mis: Vec<ast::NestedMetaItem>)
|
||||
-> ast::MetaItem {
|
||||
attr::mk_list_item(sp, Ident::new(name, sp), mis)
|
||||
attr::mk_list_item(Ident::new(name, sp), mis)
|
||||
}
|
||||
|
||||
pub fn meta_name_value(&self, span: Span, name: ast::Name, lit_kind: ast::LitKind)
|
||||
|
@ -1272,7 +1272,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
|
||||
];
|
||||
|
||||
let include_ident = Ident::with_empty_ctxt(sym::include);
|
||||
let item = attr::mk_list_item(DUMMY_SP, include_ident, include_info);
|
||||
let item = attr::mk_list_item(include_ident, include_info);
|
||||
items.push(ast::NestedMetaItem::MetaItem(item));
|
||||
}
|
||||
Err(e) => {
|
||||
@ -1333,7 +1333,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
|
||||
}
|
||||
}
|
||||
|
||||
let meta = attr::mk_list_item(DUMMY_SP, Ident::with_empty_ctxt(sym::doc), items);
|
||||
let meta = attr::mk_list_item(Ident::with_empty_ctxt(sym::doc), items);
|
||||
*at = attr::Attribute {
|
||||
span: at.span,
|
||||
id: at.id,
|
||||
|
@ -15,7 +15,7 @@ use crate::tokenstream::{self, TokenStream, TokenTree};
|
||||
|
||||
use rustc_target::spec::abi::{self, Abi};
|
||||
use syntax_pos::{self, BytePos};
|
||||
use syntax_pos::{DUMMY_SP, FileName, Span};
|
||||
use syntax_pos::{FileName, Span};
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
@ -124,8 +124,7 @@ pub fn print_crate<'a>(cm: &'a SourceMap,
|
||||
|
||||
// #![feature(prelude_import)]
|
||||
let pi_nested = attr::mk_nested_word_item(ast::Ident::with_empty_ctxt(sym::prelude_import));
|
||||
let list = attr::mk_list_item(
|
||||
DUMMY_SP, ast::Ident::with_empty_ctxt(sym::feature), vec![pi_nested]);
|
||||
let list = attr::mk_list_item(ast::Ident::with_empty_ctxt(sym::feature), vec![pi_nested]);
|
||||
let fake_attr = attr::mk_attr_inner(list);
|
||||
s.print_attribute(&fake_attr);
|
||||
|
||||
|
@ -157,8 +157,7 @@ impl MutVisitor for EntryPointCleaner {
|
||||
item.map(|ast::Item {id, ident, attrs, node, vis, span, tokens}| {
|
||||
let allow_ident = Ident::with_empty_ctxt(sym::allow);
|
||||
let dc_nested = attr::mk_nested_word_item(Ident::from_str("dead_code"));
|
||||
let allow_dead_code_item = attr::mk_list_item(DUMMY_SP, allow_ident,
|
||||
vec![dc_nested]);
|
||||
let allow_dead_code_item = attr::mk_list_item(allow_ident, vec![dc_nested]);
|
||||
let allow_dead_code = attr::mk_attr_outer(allow_dead_code_item);
|
||||
|
||||
ast::Item {
|
||||
|
Loading…
x
Reference in New Issue
Block a user