Skip to content

Commit 54ab3d9

Browse files
committed
---
yaml --- r: 172926 b: refs/heads/batch c: 27db3f0 h: refs/heads/master v: v3
1 parent 51d2d8a commit 54ab3d9

File tree

6 files changed

+14
-28
lines changed

6 files changed

+14
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 56f3554f52e50712fe0830720d8f7e4a4fdaa0cf
32+
refs/heads/batch: 27db3f058523ce66e284436e4a3a72edad4c4b81
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/src/librustc/lint/builtin.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,8 @@ impl LintPass for UnusedResults {
774774
warned |= check_must_use(cx, &it.attrs[], s.span);
775775
}
776776
} else {
777-
csearch::get_item_attrs(&cx.sess().cstore, did, |attrs| {
778-
warned |= check_must_use(cx, &attrs[], s.span);
779-
});
777+
let attrs = csearch::get_item_attrs(&cx.sess().cstore, did);
778+
warned |= check_must_use(cx, &attrs[], s.span);
780779
}
781780
}
782781
_ => {}

branches/batch/src/librustc/metadata/csearch.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,11 @@ pub fn get_methods_if_impl(cstore: &cstore::CStore,
203203
decoder::get_methods_if_impl(cstore.intr.clone(), &*cdata, def.node)
204204
}
205205

206-
pub fn get_item_attrs<F>(cstore: &cstore::CStore,
207-
def_id: ast::DefId,
208-
f: F) where
209-
F: FnOnce(Vec<ast::Attribute>),
210-
{
206+
pub fn get_item_attrs(cstore: &cstore::CStore,
207+
def_id: ast::DefId)
208+
-> Vec<ast::Attribute> {
211209
let cdata = cstore.get_crate_data(def_id.krate);
212-
f(decoder::get_item_attrs(&*cdata, def_id.node));
210+
decoder::get_item_attrs(&*cdata, def_id.node)
213211
}
214212

215213
pub fn get_struct_fields(cstore: &cstore::CStore,

branches/batch/src/librustc/middle/ty.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5556,8 +5556,7 @@ pub fn predicates<'tcx>(
55565556
}
55575557

55585558
/// Iterate over attributes of a definition.
5559-
// (This should really be an iterator, but that would require csearch and
5560-
// decoder to use iterators instead of higher-order functions.)
5559+
// (This should really be an iterator.)
55615560
pub fn each_attr<F>(tcx: &ctxt, did: DefId, mut f: F) -> bool where
55625561
F: FnMut(&ast::Attribute) -> bool,
55635562
{
@@ -5566,12 +5565,8 @@ pub fn each_attr<F>(tcx: &ctxt, did: DefId, mut f: F) -> bool where
55665565
item.attrs.iter().all(|attr| f(attr))
55675566
} else {
55685567
info!("getting foreign attrs");
5569-
let mut cont = true;
5570-
csearch::get_item_attrs(&tcx.sess.cstore, did, |attrs| {
5571-
if cont {
5572-
cont = attrs.iter().all(|attr| f(attr));
5573-
}
5574-
});
5568+
let attrs = csearch::get_item_attrs(&tcx.sess.cstore, did);
5569+
let cont = attrs.iter().all(|attr| f(attr));
55755570
info!("done");
55765571
cont
55775572
}

branches/batch/src/librustc_trans/trans/base.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ fn get_extern_rust_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_ty: Ty<'tcx>,
248248

249249
let f = decl_rust_fn(ccx, fn_ty, name);
250250

251-
csearch::get_item_attrs(&ccx.sess().cstore, did, |attrs| {
252-
set_llvm_fn_attrs(ccx, &attrs[], f)
253-
});
251+
let attrs = csearch::get_item_attrs(&ccx.sess().cstore, did);
252+
set_llvm_fn_attrs(ccx, &attrs[], f);
254253

255254
ccx.externs().borrow_mut().insert(name.to_string(), f);
256255
f

branches/batch/src/librustdoc/clean/inline.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,8 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
126126

127127
pub fn load_attrs(cx: &DocContext, tcx: &ty::ctxt,
128128
did: ast::DefId) -> Vec<clean::Attribute> {
129-
let mut attrs = Vec::new();
130-
csearch::get_item_attrs(&tcx.sess.cstore, did, |v| {
131-
attrs.extend(v.into_iter().map(|a| {
132-
a.clean(cx)
133-
}));
134-
});
135-
attrs
129+
let attrs = csearch::get_item_attrs(&tcx.sess.cstore, did);
130+
attrs.into_iter().map(|a| a.clean(cx)).collect()
136131
}
137132

138133
/// Record an external fully qualified name in the external_paths cache.

0 commit comments

Comments
 (0)