diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 24befbd44a106..4a2981b8cdfe5 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -497,8 +497,8 @@ impl<'a> CrateReader<'a> { let register = should_link && self.existing_match(info.name.as_slice(), None).is_none(); let metadata = if register { // Register crate now to avoid double-reading metadata - let (_, cmd, _) = self.register_crate(&None, info.ident[], - info.name[], span, library); + let (_, cmd, _) = self.register_crate(&None, &info.ident[], + &info.name[], span, library); PMDSource::Registered(cmd) } else { // Not registering the crate; just hold on to the metadata diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index c506d32fc94f2..d9bb1d769bfbe 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -311,18 +311,20 @@ macro_rules! options { if !setter(&mut op, value) { match (value, opt_type_desc) { (Some(..), None) => { - early_error(format!("{} option `{}` takes no \ + early_error(&format!("{} option `{}` takes no \ value", $outputname, key)[]) } (None, Some(type_desc)) => { - early_error(format!("{0} option `{1}` requires \ + early_error(&format!("{0} option `{1}` requires \ {2} ({3} {1}=)", - $outputname, key, type_desc, $prefix)[]) + $outputname, key, + type_desc, $prefix)[]) } (Some(value), Some(type_desc)) => { - early_error(format!("incorrect value `{}` for {} \ + early_error(&format!("incorrect value `{}` for {} \ option `{}` - {} was expected", - value, $outputname, key, type_desc)[]) + value, $outputname, + key, type_desc)[]) } (None, None) => unreachable!() } @@ -331,7 +333,7 @@ macro_rules! options { break; } if !found { - early_error(format!("unknown codegen option: `{}`", + early_error(&format!("unknown codegen option: `{}`", key)[]); } } diff --git a/src/test/run-pass-fulldeps/lint-plugin-cmdline.rs b/src/test/run-pass-fulldeps/lint-plugin-cmdline-allow.rs similarity index 100% rename from src/test/run-pass-fulldeps/lint-plugin-cmdline.rs rename to src/test/run-pass-fulldeps/lint-plugin-cmdline-allow.rs diff --git a/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs b/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs new file mode 100644 index 0000000000000..1af26094f2315 --- /dev/null +++ b/src/test/run-pass-fulldeps/lint-plugin-cmdline-load.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:lint_plugin_test.rs +// ignore-stage1 +// ignore-pretty: Random space appears with the pretty test +// compile-flags: -Z extra-plugins=lint_plugin_test + +fn lintme() { } //~ WARNING item is named 'lintme' + +#[allow(test_lint)] +pub fn main() { + fn lintme() { } +}