about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-09-17 22:05:31 +0000
committerbors <bors@rust-lang.org>2017-09-17 22:05:31 +0000
commite8a76d8accf04047a938ba43b32d5ff9ab581715 (patch)
tree9c8a37e523ef8300f9600dd73a84018f742bca85 /src/libsyntax
parentcfcac37204c8dbdde192c1c9387cdbe663fe5ed5 (diff)
parent6d614ddc2ebc25d3987b1efc84c0c7fea00ce325 (diff)
downloadrust-e8a76d8accf04047a938ba43b32d5ff9ab581715.tar.gz
rust-e8a76d8accf04047a938ba43b32d5ff9ab581715.zip
Auto merge of #44529 - alexcrichton:trans-query, r=michaelwoerister
Refactor translation unit partitioning/collection as a query

This commit is targeted at #44486 with the ultimate goal of making the `collect_and_partition_translation_items` function a query. This mostly just involved query-ifying a few other systems along with plumbing the tcx instead of `SharedCrateContext` in a few locations.

Currently this only tackles the first bullet of #44486 and doesn't add a dedicated query for a particular codegen unit. I wasn't quite sure how to do that yet but figured this was good to put up.

Closes #44486
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/attr.rs24
-rw-r--r--src/libsyntax/diagnostic_list.rs23
2 files changed, 0 insertions, 47 deletions
diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs
index 03907eed900..36ab3737f38 100644
--- a/src/libsyntax/attr.rs
+++ b/src/libsyntax/attr.rs
@@ -506,30 +506,6 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<Symbol> {
     first_attr_value_str_by_name(attrs, "crate_name")
 }
 
-/// Find the value of #[export_name=*] attribute and check its validity.
-pub fn find_export_name_attr(diag: &Handler, attrs: &[Attribute]) -> Option<Symbol> {
-    attrs.iter().fold(None, |ia,attr| {
-        if attr.check_name("export_name") {
-            if let s@Some(_) = attr.value_str() {
-                s
-            } else {
-                struct_span_err!(diag, attr.span, E0558,
-                                 "export_name attribute has invalid format")
-                    .span_label(attr.span, "did you mean #[export_name=\"*\"]?")
-                    .emit();
-                None
-            }
-        } else {
-            ia
-        }
-    })
-}
-
-pub fn contains_extern_indicator(diag: &Handler, attrs: &[Attribute]) -> bool {
-    contains_name(attrs, "no_mangle") ||
-        find_export_name_attr(diag, attrs).is_some()
-}
-
 #[derive(Copy, Clone, PartialEq)]
 pub enum InlineAttr {
     None,
diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs
index 46dec73c962..b29883670bd 100644
--- a/src/libsyntax/diagnostic_list.rs
+++ b/src/libsyntax/diagnostic_list.rs
@@ -219,29 +219,6 @@ Erroneous code example:
 Delete the offending feature attribute.
 "##,
 
-E0558: r##"
-The `export_name` attribute was malformed.
-
-Erroneous code example:
-
-```compile_fail,E0558
-#[export_name] // error: export_name attribute has invalid format
-pub fn something() {}
-
-fn main() {}
-```
-
-The `export_name` attribute expects a string in order to determine the name of
-the exported symbol. Example:
-
-```
-#[export_name = "some_function"] // ok!
-pub fn something() {}
-
-fn main() {}
-```
-"##,
-
 E0565: r##"
 A literal was used in an attribute that doesn't support literals.