diff options
| author | Michael Woerister <michaelwoerister@posteo.net> | 2016-02-26 16:25:25 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-03-25 14:07:18 -0400 |
| commit | 2eebb7b60588902c51d6d8dd9e695c6babaa8aa2 (patch) | |
| tree | 560ad9f8aaef9fed7162961441e0ff7cdfe50197 /src/librustc_plugin | |
| parent | fafdfa8bdc2cf762d84ca2e18215d3e11caf3af5 (diff) | |
| download | rust-2eebb7b60588902c51d6d8dd9e695c6babaa8aa2.tar.gz rust-2eebb7b60588902c51d6d8dd9e695c6babaa8aa2.zip | |
Make the compiler emit an error if the crate graph contains two crates with the same crate-name and crate-salt but different SVHs.
Diffstat (limited to 'src/librustc_plugin')
| -rw-r--r-- | src/librustc_plugin/load.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/librustc_plugin/load.rs b/src/librustc_plugin/load.rs index a950198a4e4..ac40215bbb1 100644 --- a/src/librustc_plugin/load.rs +++ b/src/librustc_plugin/load.rs @@ -44,9 +44,12 @@ fn call_malformed_plugin_attribute(a: &Session, b: Span) { } /// Read plugin metadata and dynamically load registrar functions. -pub fn load_plugins(sess: &Session, cstore: &CStore, krate: &ast::Crate, +pub fn load_plugins(sess: &Session, + cstore: &CStore, + krate: &ast::Crate, + crate_name: &str, addl_plugins: Option<Vec<String>>) -> Vec<PluginRegistrar> { - let mut loader = PluginLoader::new(sess, cstore); + let mut loader = PluginLoader::new(sess, cstore, crate_name); for attr in &krate.attrs { if !attr.check_name("plugin") { @@ -82,10 +85,10 @@ pub fn load_plugins(sess: &Session, cstore: &CStore, krate: &ast::Crate, } impl<'a> PluginLoader<'a> { - fn new(sess: &'a Session, cstore: &'a CStore) -> PluginLoader<'a> { + fn new(sess: &'a Session, cstore: &'a CStore, crate_name: &str) -> PluginLoader<'a> { PluginLoader { sess: sess, - reader: CrateReader::new(sess, cstore), + reader: CrateReader::new(sess, cstore, crate_name), plugins: vec![], } } |
