diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-17 14:17:47 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-17 17:04:58 +0300 |
| commit | db74efce69711fcee03d3338afcbca67c27ceee8 (patch) | |
| tree | ab54b453943a292c250b890140d431e99091be5e /src/librustc_plugin | |
| parent | 7cf074a1e655ac07d04d045667278fa1a9970b93 (diff) | |
Make meta-item API compatible with `LocalInternedString::get` soundness fix
Diffstat (limited to 'src/librustc_plugin')
| -rw-r--r-- | src/librustc_plugin/load.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_plugin/load.rs b/src/librustc_plugin/load.rs index bd11e0ce802..8b86bddb29f 100644 --- a/src/librustc_plugin/load.rs +++ b/src/librustc_plugin/load.rs @@ -56,12 +56,12 @@ pub fn load_plugins(sess: &Session, for plugin in plugins { // plugins must have a name and can't be key = value - match plugin.ident_str() { - Some(name) if !plugin.is_value_str() => { - let args = plugin.meta_item_list().map(ToOwned::to_owned); - loader.load_plugin(plugin.span(), name, args.unwrap_or_default()); - }, - _ => call_malformed_plugin_attribute(sess, attr.span), + let name = plugin.name_or_empty(); + if !name.is_empty() && !plugin.is_value_str() { + let args = plugin.meta_item_list().map(ToOwned::to_owned); + loader.load_plugin(plugin.span(), &name, args.unwrap_or_default()); + } else { + call_malformed_plugin_attribute(sess, attr.span); } } } |
