Skip to content

Commit a36b7bb

Browse files
committed
---
yaml --- r: 274809 b: refs/heads/stable c: 0ff055a h: refs/heads/master i: 274807: 04d1ccf
1 parent 0ce91be commit a36b7bb

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: a141c52816b606f01a3eb432ea1c5e1131513d1c
32+
refs/heads/stable: 0ff055ad6640e26a4ddf783682545320de0d1c03
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc/middle/reachable.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
237237
} else {
238238
false
239239
};
240-
if reachable || attr::contains_extern_indicator(&item.attrs) {
240+
let is_extern = attr::contains_extern_indicator(&self.tcx.sess.diagnostic(),
241+
&item.attrs);
242+
if reachable || is_extern {
241243
self.reachable_symbols.insert(search_item);
242244
}
243245
}

branches/stable/src/librustc_metadata/decoder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,8 @@ pub fn is_extern_item(cdata: Cmd, id: DefIndex, tcx: &ty::ctxt) -> bool {
15861586
};
15871587

15881588
if applicable {
1589-
attr::contains_extern_indicator(&get_attributes(item_doc))
1589+
attr::contains_extern_indicator(tcx.sess.diagnostic(),
1590+
&get_attributes(item_doc))
15901591
} else {
15911592
false
15921593
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,7 @@ fn exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
27272727
None => {}
27282728
}
27292729

2730-
match attr::find_export_name_attr(Some(ccx.sess().diagnostic()), attrs) {
2730+
match attr::find_export_name_attr(ccx.sess().diagnostic(), attrs) {
27312731
// Use provided name
27322732
Some(name) => name.to_string(),
27332733
_ => {

branches/stable/src/libsyntax/attr.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,16 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<InternedString> {
298298
}
299299

300300
/// Find the value of #[export_name=*] attribute and check its validity.
301-
pub fn find_export_name_attr(diag: Option<&Handler>, attrs: &[Attribute]) -> Option<InternedString> {
301+
pub fn find_export_name_attr(diag: &Handler, attrs: &[Attribute]) -> Option<InternedString> {
302302
attrs.iter().fold(None, |ia,attr| {
303303
if attr.check_name("export_name") {
304304
if let s@Some(_) = attr.value_str() {
305305
s
306306
} else {
307-
diag.map(|d| d.struct_span_err(attr.span,
307+
diag.struct_span_err(attr.span,
308308
"export_name attribute has invalid format")
309309
.help("use #[export_name=\"*\"]")
310-
.emit());
310+
.emit();
311311
None
312312
}
313313
} else {
@@ -316,9 +316,9 @@ pub fn find_export_name_attr(diag: Option<&Handler>, attrs: &[Attribute]) -> Opt
316316
})
317317
}
318318

319-
pub fn contains_extern_indicator(attrs: &[Attribute]) -> bool {
319+
pub fn contains_extern_indicator(diag: &Handler, attrs: &[Attribute]) -> bool {
320320
contains_name(attrs, "no_mangle") ||
321-
find_export_name_attr(None, attrs).is_some()
321+
find_export_name_attr(diag, attrs).is_some()
322322
}
323323

324324
#[derive(Copy, Clone, PartialEq)]

0 commit comments

Comments
 (0)