@@ -11,7 +11,7 @@ use std::mem;
11
11
use std:: path:: PathBuf ;
12
12
use syntax:: ast;
13
13
use syntax:: span_err;
14
- use syntax:: symbol:: sym;
14
+ use syntax:: symbol:: { Symbol , keywords , sym} ;
15
15
use syntax_pos:: { Span , DUMMY_SP } ;
16
16
17
17
/// Pointer to a registrar function.
@@ -58,9 +58,9 @@ pub fn load_plugins(sess: &Session,
58
58
for plugin in plugins {
59
59
// plugins must have a name and can't be key = value
60
60
let name = plugin. name_or_empty ( ) ;
61
- if ! name. is_empty ( ) && !plugin. is_value_str ( ) {
61
+ if name != keywords :: Invalid . name ( ) && !plugin. is_value_str ( ) {
62
62
let args = plugin. meta_item_list ( ) . map ( ToOwned :: to_owned) ;
63
- loader. load_plugin ( plugin. span ( ) , & name, args. unwrap_or_default ( ) ) ;
63
+ loader. load_plugin ( plugin. span ( ) , name, args. unwrap_or_default ( ) ) ;
64
64
} else {
65
65
call_malformed_plugin_attribute ( sess, attr. span ) ;
66
66
}
@@ -70,7 +70,7 @@ pub fn load_plugins(sess: &Session,
70
70
71
71
if let Some ( plugins) = addl_plugins {
72
72
for plugin in plugins {
73
- loader. load_plugin ( DUMMY_SP , & plugin, vec ! [ ] ) ;
73
+ loader. load_plugin ( DUMMY_SP , Symbol :: intern ( & plugin) , vec ! [ ] ) ;
74
74
}
75
75
}
76
76
@@ -86,7 +86,7 @@ impl<'a> PluginLoader<'a> {
86
86
}
87
87
}
88
88
89
- fn load_plugin ( & mut self , span : Span , name : & str , args : Vec < ast:: NestedMetaItem > ) {
89
+ fn load_plugin ( & mut self , span : Span , name : Symbol , args : Vec < ast:: NestedMetaItem > ) {
90
90
let registrar = self . reader . find_plugin_registrar ( span, name) ;
91
91
92
92
if let Some ( ( lib, disambiguator) ) = registrar {
0 commit comments