Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #68044

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d288c28
Relax the Sized bounds on Pin::map_unchecked(_mut)
Thomasdezeeuw Jan 6, 2020
eb4fc2d
Export scalar statics in wasm
MaikKlein Jan 7, 2020
093fb85
Always export static variables as SymbolExportLevel::C in wasm
MaikKlein Jan 7, 2020
a526c8d
Add tests for static variables
MaikKlein Jan 7, 2020
eddb3f0
Fix indentation
MaikKlein Jan 7, 2020
b81ab44
Remove unnecessary global counting
MaikKlein Jan 8, 2020
f1fb384
Check for the entry kind
MaikKlein Jan 8, 2020
e3f3cb9
Recognise riscv64 in compiletest
infinity0 Jan 8, 2020
2c5766f
Unify output of "variant not found" errors
estebank Jan 8, 2020
7c52718
Remove obsolete llvm_tools flag
cuviper Jan 8, 2020
51b7044
Build compiletest with in-tree libtest
cuviper Jan 8, 2020
25b9621
compiletest: Do not deduplicate diagnostics in UI tests
petrochenkov Jan 8, 2020
8fd85db
Update tests
petrochenkov Jan 8, 2020
d426771
Address review comments
petrochenkov Jan 8, 2020
686d5f8
Comment on allowing only feature(test) in compiletest
cuviper Jan 8, 2020
37d17e6
Rollup merge of #67122 - petrochenkov:nodedup, r=estebank
Centril Jan 9, 2020
b0e7653
Rollup merge of #67935 - Thomasdezeeuw:issue_67669, r=withoutboats
Centril Jan 9, 2020
c8693fc
Rollup merge of #67975 - EmbarkStudios:export-statics-wasm, r=alexcri…
Centril Jan 9, 2020
5fdc57c
Rollup merge of #68006 - infinity0:master, r=nikomatsakis
Centril Jan 9, 2020
12df732
Rollup merge of #68014 - estebank:unify-e0599, r=cramertj
Centril Jan 9, 2020
dcffe11
Rollup merge of #68019 - cuviper:in-tree-compiletest, r=Mark-Simulacrum
Centril Jan 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 8 additions & 12 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ fn rustbook_features() -> Vec<String> {
macro_rules! bootstrap_tool {
($(
$name:ident, $path:expr, $tool_name:expr
$(,llvm_tools = $llvm:expr)*
$(,is_external_tool = $external:expr)*
$(,is_unstable_tool = $unstable:expr)*
$(,features = $features:expr)*
;
)+) => {
Expand All @@ -301,15 +301,6 @@ macro_rules! bootstrap_tool {
)+
}

impl Tool {
/// Whether this tool requires LLVM to run
pub fn uses_llvm_tools(&self) -> bool {
match self {
$(Tool::$name => false $(|| $llvm)*,)+
}
}
}

impl<'a> Builder<'a> {
pub fn tool_exe(&self, tool: Tool) -> PathBuf {
match tool {
Expand Down Expand Up @@ -350,7 +341,12 @@ macro_rules! bootstrap_tool {
compiler: self.compiler,
target: self.target,
tool: $tool_name,
mode: Mode::ToolBootstrap,
mode: if false $(|| $unstable)* {
// use in-tree libraries for unstable features
Mode::ToolStd
} else {
Mode::ToolBootstrap
},
path: $path,
is_optional_tool: false,
source_type: if false $(|| $external)* {
Expand All @@ -377,7 +373,7 @@ bootstrap_tool!(
Tidy, "src/tools/tidy", "tidy";
Linkchecker, "src/tools/linkchecker", "linkchecker";
CargoTest, "src/tools/cargotest", "cargotest";
Compiletest, "src/tools/compiletest", "compiletest", llvm_tools = true;
Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true;
BuildManifest, "src/tools/build-manifest", "build-manifest";
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client";
RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true;
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
#[stable(feature = "pin", since = "1.33.0")]
pub unsafe fn map_unchecked<U, F>(self, func: F) -> Pin<&'a U>
where
U: ?Sized,
F: FnOnce(&T) -> &U,
{
let pointer = &*self.pointer;
Expand Down Expand Up @@ -763,6 +764,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
#[stable(feature = "pin", since = "1.33.0")]
pub unsafe fn map_unchecked_mut<U, F>(self, func: F) -> Pin<&'a mut U>
where
U: ?Sized,
F: FnOnce(&mut T) -> &mut U,
{
let pointer = Pin::get_unchecked_mut(self);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
if is_extern && !std_internal {
let target = &tcx.sess.target.target.llvm_target;
// WebAssembly cannot export data symbols, so reduce their export level
if target.contains("wasm32") || target.contains("emscripten") {
if target.contains("emscripten") {
if let Some(Node::Item(&hir::Item { kind: hir::ItemKind::Static(..), .. })) =
tcx.hir().get_if_local(sym_def_id)
{
Expand Down
8 changes: 6 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2125,9 +2125,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let msg = format!("expected type, found variant `{}`", assoc_ident);
tcx.sess.span_err(span, &msg);
} else if qself_ty.is_enum() {
let mut err = tcx.sess.struct_span_err(
let mut err = struct_span_err!(
tcx.sess,
assoc_ident.span,
&format!("no variant `{}` in enum `{}`", assoc_ident, qself_ty),
E0599,
"no variant named `{}` found for enum `{}`",
assoc_ident,
qself_ty,
);

let adt_def = qself_ty.ty_adt_def().expect("enum is not an ADT");
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_typeck/check/method/suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
tcx.sess,
span,
E0599,
"no {} named `{}` found for type `{}` in the current scope",
"no {} named `{}` found for {} `{}` in the current scope",
item_kind,
item_name,
ty_str
actual.prefix_string(),
ty_str,
);
if let Some(span) =
tcx.sess.confused_type_with_std_module.borrow().get(&span)
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/consts/const-fn-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const fn f(x: usize) -> usize {
let mut sum = 0;
for i in 0..x {
//~^ ERROR E0015
//~| ERROR E0015
//~| ERROR E0658
//~| ERROR E0080
//~| ERROR E0744
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/issue-52443.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fn main() {
//~| WARN denote infinite loops with
[(); { for _ in 0usize.. {}; 0}];
//~^ ERROR calls in constants are limited to constant functions
//~| ERROR calls in constants are limited to constant functions
//~| ERROR `for` is not allowed in a `const`
//~| ERROR references in constants may only refer to immutable values
//~| ERROR evaluation of constant value failed
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-make/wasm-export-all-symbols/bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

#[no_mangle]
pub extern fn foo() {}

#[no_mangle]
pub static FOO: u64 = 42;
14 changes: 9 additions & 5 deletions src/test/run-make/wasm-export-all-symbols/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ console.log('exports', list);

const my_exports = {};
let nexports = 0;

for (const entry of list) {
if (entry.kind !== 'function')
continue;
my_exports[entry.name] = true;
nexports += 1;
if (entry.kind == 'function'){
nexports += 1;
}
my_exports[entry.name] = entry.kind;
}

if (my_exports.foo === undefined)
if (my_exports.foo != "function")
throw new Error("`foo` wasn't defined");

if (my_exports.FOO != "global")
throw new Error("`FOO` wasn't defined");

if (my_exports.main === undefined) {
if (nexports != 1)
throw new Error("should only have one function export");
Expand Down
2 changes: 2 additions & 0 deletions src/test/ui-fulldeps/lint-plugin-forbid-attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ fn lintme() { } //~ ERROR item is named 'lintme'

#[allow(test_lint)]
//~^ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
pub fn main() {
lintme();
}
20 changes: 19 additions & 1 deletion src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ LL | #![forbid(test_lint)]
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid

error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
...
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid

warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-plugin-forbid-attrs.rs:5:1
|
Expand All @@ -27,6 +36,15 @@ note: lint level defined here
LL | #![forbid(test_lint)]
| ^^^^^^^^^

error: aborting due to 2 previous errors
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
...
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0453`.
2 changes: 2 additions & 0 deletions src/test/ui-fulldeps/lint-plugin-forbid-cmdline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
fn lintme() { } //~ ERROR item is named 'lintme'

#[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
pub fn main() {
lintme();
}
18 changes: 17 additions & 1 deletion src/test/ui-fulldeps/lint-plugin-forbid-cmdline.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ LL | #[allow(test_lint)]
|
= note: `forbid` lint level was set on command line

error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line

warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-plugin-forbid-cmdline.rs:6:1
|
Expand All @@ -22,6 +30,14 @@ LL | fn lintme() { }
|
= note: requested on the command line with `-F test-lint`

error: aborting due to 2 previous errors
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0453`.
12 changes: 12 additions & 0 deletions src/test/ui-fulldeps/lint-tool-cmdline-allow.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ warning: lint name `test_lint` is deprecated and does not have an effect anymore
|
= note: requested on the command line with `-A test_lint`

warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`

warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-cmdline-allow.rs:7:1
|
Expand All @@ -10,6 +14,10 @@ LL | #![plugin(lint_tool_test)]
|
= note: `#[warn(deprecated)]` on by default

warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`

warning: item is named 'lintme'
--> $DIR/lint-tool-cmdline-allow.rs:9:1
|
Expand All @@ -18,3 +26,7 @@ LL | fn lintme() {}
|
= note: `#[warn(clippy::test_lint)]` on by default

warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`

7 changes: 6 additions & 1 deletion src/test/ui-fulldeps/lint-tool-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
#![allow(dead_code)]
#![cfg_attr(foo, warn(test_lint))]
//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~^^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
#![deny(clippy_group)]
//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future

fn lintme() { } //~ ERROR item is named 'lintme'

Expand All @@ -25,6 +28,8 @@ pub fn main() {

#[allow(test_group)]
//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
fn hello() {
fn lintmetoo() { }
Expand Down
44 changes: 37 additions & 7 deletions src/test/ui-fulldeps/lint-tool-test.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ LL | #![cfg_attr(foo, warn(test_lint))]
= note: `#[warn(renamed_and_removed_lints)]` on by default

warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`

warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:26:9
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`

warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint-tool-test.rs:28:8
--> $DIR/lint-tool-test.rs:33:8
|
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -32,6 +32,18 @@ warning: lint name `test_lint` is deprecated and may not have an effect in the f
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`

warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`

warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`

warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-test.rs:6:1
|
Expand All @@ -40,31 +52,49 @@ LL | #![plugin(lint_tool_test)]
|
= note: `#[warn(deprecated)]` on by default

warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:9:23
|
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`

warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`

error: item is named 'lintme'
--> $DIR/lint-tool-test.rs:15:1
--> $DIR/lint-tool-test.rs:18:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`

error: item is named 'lintmetoo'
--> $DIR/lint-tool-test.rs:23:5
--> $DIR/lint-tool-test.rs:26:5
|
LL | fn lintmetoo() { }
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]`

warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion src/test/ui/associated-const/associated-const-no-item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trait Foo {
}

const X: i32 = <i32>::ID;
//~^ ERROR no associated item named `ID` found for type `i32`
//~^ ERROR no associated item named `ID` found

fn main() {
assert_eq!(1, X);
Expand Down
Loading