diff options
| author | arcnmx <arcnmx@users.noreply.github.com> | 2016-01-15 14:43:14 -0500 |
|---|---|---|
| committer | arcnmx <arcnmx@users.noreply.github.com> | 2016-02-11 12:45:52 -0500 |
| commit | 0ff055ad6640e26a4ddf783682545320de0d1c03 (patch) | |
| tree | d918826422bbf9d81d971c87d65af560a8955cb9 /src/libsyntax | |
| parent | a141c52816b606f01a3eb432ea1c5e1131513d1c (diff) | |
| download | rust-0ff055ad6640e26a4ddf783682545320de0d1c03.tar.gz rust-0ff055ad6640e26a4ddf783682545320de0d1c03.zip | |
Pass through diagnostic handler instead
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index fca659e63b5..9953947eb52 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -298,16 +298,16 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<InternedString> { } /// Find the value of #[export_name=*] attribute and check its validity. -pub fn find_export_name_attr(diag: Option<&Handler>, attrs: &[Attribute]) -> Option<InternedString> { +pub fn find_export_name_attr(diag: &Handler, attrs: &[Attribute]) -> Option<InternedString> { attrs.iter().fold(None, |ia,attr| { if attr.check_name("export_name") { if let s@Some(_) = attr.value_str() { s } else { - diag.map(|d| d.struct_span_err(attr.span, + diag.struct_span_err(attr.span, "export_name attribute has invalid format") .help("use #[export_name=\"*\"]") - .emit()); + .emit(); None } } else { @@ -316,9 +316,9 @@ pub fn find_export_name_attr(diag: Option<&Handler>, attrs: &[Attribute]) -> Opt }) } -pub fn contains_extern_indicator(attrs: &[Attribute]) -> bool { +pub fn contains_extern_indicator(diag: &Handler, attrs: &[Attribute]) -> bool { contains_name(attrs, "no_mangle") || - find_export_name_attr(None, attrs).is_some() + find_export_name_attr(diag, attrs).is_some() } #[derive(Copy, Clone, PartialEq)] |
