diff --git a/Cargo.lock b/Cargo.lock index 2c161e4d27a9d..5826a1dbbd949 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,16 +27,16 @@ dependencies = [ [[package]] name = "ammonia" -version = "2.1.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384d704f242a0a9faf793fff775a0be6ab9aa27edabffa097331d73779142520" +checksum = "9e266e1f4be5ffa05309f650e2586fe1d3ae6034eb24025a7ae1dfecc330823a" dependencies = [ "html5ever", "lazy_static 1.3.0", "maplit", "matches", "tendril", - "url 1.7.2", + "url 2.1.0", ] [[package]] @@ -1363,16 +1363,16 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce65ac8028cf5a287a7dbf6c4e0a6cf2dcf022ed5b167a81bae66ebf599a8b7" +checksum = "025483b0a1e4577bb28578318c886ee5f817dda6eb62473269349044406644cb" dependencies = [ "log", "mac", "markup5ever", - "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "proc-macro2 1.0.3", + "quote 1.0.2", + "syn 1.0.5", ] [[package]] @@ -1902,9 +1902,9 @@ checksum = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" [[package]] name = "markup5ever" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1af46a727284117e09780d05038b1ce6fc9c76cc6df183c3dae5a8955a25e21" +checksum = "65381d9d47506b8592b97c4efd936afcf673b09b059f2bef39c7211ee78b9d03" dependencies = [ "log", "phf", @@ -1925,9 +1925,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "mdbook" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949bb2acb2cff9fa5c375cf9c43e70b3dba0a974d9fe01c31285d7a84d2a0fa2" +checksum = "9a070268274c566082efb6b2ace7743e43ba91a70d5c6982981e96d3c05ac81c" dependencies = [ "ammonia", "chrono", @@ -3103,6 +3103,7 @@ dependencies = [ "failure", "mdbook", "mdbook-linkcheck", + "rustc-workspace-hack", ] [[package]] diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 76509134f7ccd..bb6041d7f3196 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -133,6 +133,10 @@ def v(*args): "mips-unknown-linux-musl install directory") v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root", "mipsel-unknown-linux-musl install directory") +v("musl-root-mips64", "target.mips64-unknown-linux-muslabi64.musl-root", + "mips64-unknown-linux-muslabi64 install directory") +v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root", + "mips64el-unknown-linux-muslabi64 install directory") v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs", "rootfs in qemu testing, you probably don't want to use this") v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs", diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 97cdd25680162..e76604e45bdeb 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -534,6 +534,10 @@ impl Step for TestHelpers { builder.info("Building test helpers"); t!(fs::create_dir_all(&dst)); let mut cfg = cc::Build::new(); + // FIXME: Workaround for https://github.com/emscripten-core/emscripten/issues/9013 + if target.contains("emscripten") { + cfg.pic(false); + } // We may have found various cross-compilers a little differently due to our // extra configuration, so inform gcc of these compilers. Note, though, that diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index f1baeafe26afb..815498047fd5d 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -244,6 +244,7 @@ pub fn prepare_tool_cargo( path.ends_with("rls") || path.ends_with("clippy") || path.ends_with("miri") || + path.ends_with("rustbook") || path.ends_with("rustfmt") { cargo.env("LIBZ_SYS_STATIC", "1"); diff --git a/src/ci/azure-pipelines/pr.yml b/src/ci/azure-pipelines/pr.yml index 62e23efe1ef16..566e654fdb3f0 100644 --- a/src/ci/azure-pipelines/pr.yml +++ b/src/ci/azure-pipelines/pr.yml @@ -22,14 +22,6 @@ jobs: IMAGE: x86_64-gnu-llvm-6.0 mingw-check: IMAGE: mingw-check - -- job: LinuxTools - timeoutInMinutes: 600 - pool: - vmImage: ubuntu-16.04 - steps: - - template: steps/run.yml - parameters: - only_on_updated_submodules: 'yes' - variables: - IMAGE: x86_64-gnu-tools + x86_64-gnu-tools: + IMAGE: x86_64-gnu-tools + CI_ONLY_WHEN_SUBMODULES_CHANGED: 1 diff --git a/src/ci/azure-pipelines/steps/run.yml b/src/ci/azure-pipelines/steps/run.yml index 01858cca50b1c..b8e32cf2cdfe3 100644 --- a/src/ci/azure-pipelines/steps/run.yml +++ b/src/ci/azure-pipelines/steps/run.yml @@ -6,11 +6,6 @@ # # Check travis config for `gdb --batch` command to print all crash logs -parameters: - # When this parameter is set to anything other than an empty string the tests - # will only be executed when the commit updates submodules - only_on_updated_submodules: '' - steps: # Disable automatic line ending conversion, which is enabled by default on @@ -26,21 +21,8 @@ steps: - checkout: self fetchDepth: 2 -# Set the SKIP_JOB environment variable if this job is supposed to only run -# when submodules are updated and they were not. The following time consuming -# tasks will be skipped when the environment variable is present. -- ${{ if parameters.only_on_updated_submodules }}: - - bash: | - set -e - # Submodules pseudo-files inside git have the 160000 permissions, so when - # those files are present in the diff a submodule was updated. - if git diff HEAD^ | grep "^index .* 160000" >/dev/null 2>&1; then - echo "Executing the job since submodules are updated" - else - echo "Not executing this job since no submodules were updated" - echo "##vso[task.setvariable variable=SKIP_JOB;]1" - fi - displayName: Decide whether to run this job +- bash: src/ci/scripts/should-skip-this.sh + displayName: Decide whether to run this job # Spawn a background process to collect CPU usage statistics which we'll upload # at the end of the build. See the comments in the script here for more diff --git a/src/ci/docker/dist-various-1/Dockerfile b/src/ci/docker/dist-various-1/Dockerfile index fab3824a20ae3..816bdb34a7bfe 100644 --- a/src/ci/docker/dist-various-1/Dockerfile +++ b/src/ci/docker/dist-various-1/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ g++-arm-linux-gnueabi \ g++-arm-linux-gnueabihf \ g++-aarch64-linux-gnu \ + g++-mips64-linux-gnuabi64 \ + g++-mips64el-linux-gnuabi64 \ gcc-sparc64-linux-gnu \ libc6-dev-sparc64-cross \ bzip2 \ @@ -77,6 +79,14 @@ RUN env \ CC=mipsel-openwrt-linux-gcc \ CXX=mipsel-openwrt-linux-g++ \ bash musl.sh mipsel && \ + env \ + CC=mips64-linux-gnuabi64-gcc \ + CXX=mips64-linux-gnuabi64-g++ \ + bash musl.sh mips64 && \ + env \ + CC=mips64el-linux-gnuabi64-gcc \ + CXX=mips64el-linux-gnuabi64-g++ \ + bash musl.sh mips64el && \ rm -rf /build/* # FIXME(mozilla/sccache#235) this shouldn't be necessary but is currently @@ -97,6 +107,8 @@ ENV TARGETS=$TARGETS,wasm32-unknown-emscripten ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd ENV TARGETS=$TARGETS,mips-unknown-linux-musl ENV TARGETS=$TARGETS,mipsel-unknown-linux-musl +ENV TARGETS=$TARGETS,mips64-unknown-linux-muslabi64 +ENV TARGETS=$TARGETS,mips64el-unknown-linux-muslabi64 ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi @@ -125,6 +137,8 @@ ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \ CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \ + CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc \ + CC_mips64_unknown_linux_muslabi64=mips64-linux-gnuabi64-gcc \ CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \ CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \ CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \ @@ -139,6 +153,8 @@ ENV RUST_CONFIGURE_ARGS \ --musl-root-aarch64=/musl-aarch64 \ --musl-root-mips=/musl-mips \ --musl-root-mipsel=/musl-mipsel \ + --musl-root-mips64=/musl-mips64 \ + --musl-root-mips64el=/musl-mips64el \ --disable-docs ENV SCRIPT \ diff --git a/src/ci/scripts/should-skip-this.sh b/src/ci/scripts/should-skip-this.sh new file mode 100755 index 0000000000000..f945db0ada27d --- /dev/null +++ b/src/ci/scripts/should-skip-this.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Set the SKIP_JOB environment variable if this job is supposed to only run +# when submodules are updated and they were not. The following time consuming +# tasks will be skipped when the environment variable is present. + +set -euo pipefail +IFS=$'\n\t' + +source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" + +if [[ -z "${CI_ONLY_WHEN_SUBMODULES_CHANGED+x}" ]]; then + echo "Executing the job since there is no skip rule in effect" +elif git diff HEAD^ | grep --quiet "^index .* 160000"; then + # Submodules pseudo-files inside git have the 160000 permissions, so when + # those files are present in the diff a submodule was updated. + echo "Executing the job since submodules are updated" +else + echo "Not executing this job since no submodules were updated" + ciCommandSetEnv SKIP_JOB 1 +fi diff --git a/src/libcore/ffi.rs b/src/libcore/ffi.rs index 0ea4187ccd482..569c667ac0a54 100644 --- a/src/libcore/ffi.rs +++ b/src/libcore/ffi.rs @@ -18,8 +18,13 @@ use crate::ops::{Deref, DerefMut}; /// stabilized, it is recommended to use a newtype wrapper around an empty /// byte array. See the [Nomicon] for details. /// +/// One could use `std::os::raw::c_void` if they want to support old Rust +/// compiler down to 1.1.0. After Rust 1.30.0, it was re-exported by +/// this definition. For more information, please read [RFC 2521]. +/// /// [pointer]: ../../std/primitive.pointer.html /// [Nomicon]: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs +/// [RFC 2521]: https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md // N.B., for LLVM to recognize the void pointer type and by extension // functions like malloc(), we need to have it represented as i8* in // LLVM bitcode. The enum used here ensures this and prevents misuse @@ -29,7 +34,7 @@ use crate::ops::{Deref, DerefMut}; // would be uninhabited and at least dereferencing such pointers would // be UB. #[repr(u8)] -#[stable(feature = "raw_os", since = "1.1.0")] +#[stable(feature = "core_c_void", since = "1.30.0")] pub enum c_void { #[unstable(feature = "c_void_variant", reason = "temporary implementation detail", issue = "0")] diff --git a/src/libproc_macro/bridge/client.rs b/src/libproc_macro/bridge/client.rs index 5c543165bc2b1..9643dba997aa4 100644 --- a/src/libproc_macro/bridge/client.rs +++ b/src/libproc_macro/bridge/client.rs @@ -15,8 +15,9 @@ macro_rules! define_handles { } impl HandleCounters { - // FIXME(#53451) public to work around `Cannot create local mono-item` ICE. - pub extern "C" fn get() -> &'static Self { + // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of + // a wrapper `fn` pointer, once `const fn` can reference `static`s. + extern "C" fn get() -> &'static Self { static COUNTERS: HandleCounters = HandleCounters { $($oty: AtomicUsize::new(1),)* $($ity: AtomicUsize::new(1),)* @@ -333,16 +334,19 @@ impl Bridge<'_> { #[repr(C)] #[derive(Copy, Clone)] pub struct Client { + // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of + // a wrapper `fn` pointer, once `const fn` can reference `static`s. pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters, pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer, pub(super) f: F, } -// FIXME(#53451) public to work around `Cannot create local mono-item` ICE, -// affecting not only the function itself, but also the `BridgeState` `thread_local!`. -pub extern "C" fn __run_expand1( +/// Client-side helper for handling client panics, entering the bridge, +/// deserializing input and serializing output. +// FIXME(eddyb) maybe replace `Bridge::enter` with this? +fn run_client DecodeMut<'a, 's, ()>, R: Encode<()>>( mut bridge: Bridge<'_>, - f: fn(crate::TokenStream) -> crate::TokenStream, + f: impl FnOnce(A) -> R, ) -> Buffer { // The initial `cached_buffer` contains the input. let mut b = bridge.cached_buffer.take(); @@ -350,12 +354,12 @@ pub extern "C" fn __run_expand1( panic::catch_unwind(panic::AssertUnwindSafe(|| { bridge.enter(|| { let reader = &mut &b[..]; - let input = TokenStream::decode(reader, &mut ()); + let input = A::decode(reader, &mut ()); // Put the `cached_buffer` back in the `Bridge`, for requests. Bridge::with(|bridge| bridge.cached_buffer = b.take()); - let output = f(crate::TokenStream(input)).0; + let output = f(input); // Take the `cached_buffer` back out, for the output value. b = Bridge::with(|bridge| bridge.cached_buffer.take()); @@ -383,65 +387,35 @@ pub extern "C" fn __run_expand1( impl Client crate::TokenStream> { pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self { + extern "C" fn run( + bridge: Bridge<'_>, + f: impl FnOnce(crate::TokenStream) -> crate::TokenStream, + ) -> Buffer { + run_client(bridge, |input| f(crate::TokenStream(input)).0) + } Client { get_handle_counters: HandleCounters::get, - run: __run_expand1, + run, f, } } } -// FIXME(#53451) public to work around `Cannot create local mono-item` ICE, -// affecting not only the function itself, but also the `BridgeState` `thread_local!`. -pub extern "C" fn __run_expand2( - mut bridge: Bridge<'_>, - f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream, -) -> Buffer { - // The initial `cached_buffer` contains the input. - let mut b = bridge.cached_buffer.take(); - - panic::catch_unwind(panic::AssertUnwindSafe(|| { - bridge.enter(|| { - let reader = &mut &b[..]; - let input = TokenStream::decode(reader, &mut ()); - let input2 = TokenStream::decode(reader, &mut ()); - - // Put the `cached_buffer` back in the `Bridge`, for requests. - Bridge::with(|bridge| bridge.cached_buffer = b.take()); - - let output = f(crate::TokenStream(input), crate::TokenStream(input2)).0; - - // Take the `cached_buffer` back out, for the output value. - b = Bridge::with(|bridge| bridge.cached_buffer.take()); - - // HACK(eddyb) Separate encoding a success value (`Ok(output)`) - // from encoding a panic (`Err(e: PanicMessage)`) to avoid - // having handles outside the `bridge.enter(|| ...)` scope, and - // to catch panics that could happen while encoding the success. - // - // Note that panics should be impossible beyond this point, but - // this is defensively trying to avoid any accidental panicking - // reaching the `extern "C"` (which should `abort` but may not - // at the moment, so this is also potentially preventing UB). - b.clear(); - Ok::<_, ()>(output).encode(&mut b, &mut ()); - }) - })) - .map_err(PanicMessage::from) - .unwrap_or_else(|e| { - b.clear(); - Err::<(), _>(e).encode(&mut b, &mut ()); - }); - b -} - impl Client crate::TokenStream> { pub const fn expand2( f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream ) -> Self { + extern "C" fn run( + bridge: Bridge<'_>, + f: impl FnOnce(crate::TokenStream, crate::TokenStream) -> crate::TokenStream, + ) -> Buffer { + run_client(bridge, |(input, input2)| { + f(crate::TokenStream(input), crate::TokenStream(input2)).0 + }) + } Client { get_handle_counters: HandleCounters::get, - run: __run_expand2, + run, f, } } diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index 2dce9b04c9e9e..85e0b6d465ab0 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -3,7 +3,7 @@ use crate::llvm; use syntax_pos::symbol::Symbol; use rustc::session::Session; use rustc::session::config::PrintRequest; -use rustc_target::spec::MergeFunctions; +use rustc_target::spec::{MergeFunctions, PanicStrategy}; use libc::c_int; use std::ffi::CString; use syntax::feature_gate::UnstableFeatures; @@ -73,6 +73,11 @@ unsafe fn configure_llvm(sess: &Session) { } } + if sess.target.target.target_os == "emscripten" && + sess.panic_strategy() == PanicStrategy::Unwind { + add("-enable-emscripten-cxx-exceptions"); + } + // HACK(eddyb) LLVM inserts `llvm.assume` calls to preserve align attributes // during inlining. Unfortunately these may block other optimizations. add("-preserve-alignment-assumptions-during-inlining=false"); diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs index 9443f22572378..85a90459f5ee4 100644 --- a/src/librustc_codegen_ssa/back/symbol_export.rs +++ b/src/librustc_codegen_ssa/back/symbol_export.rs @@ -364,8 +364,9 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL); if is_extern && !std_internal { - // Emscripten cannot export statics, so reduce their export level here - if tcx.sess.target.target.options.is_like_emscripten { + 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 let Some(Node::Item(&hir::Item { kind: hir::ItemKind::Static(..), .. diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index c18bdfad22cf0..648c5104b1af7 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -256,9 +256,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { if self.r.is_accessible_from(vis, parent_scope.module) { vis } else { - let msg = - "visibilities can only be restricted to ancestor modules"; - self.r.session.span_err(path.span, msg); + struct_span_err!(self.r.session, path.span, E0742, + "visibilities can only be restricted to ancestor modules") + .emit(); ty::Visibility::Public } } diff --git a/src/librustc_resolve/error_codes.rs b/src/librustc_resolve/error_codes.rs index 9515c87ce4bb5..9937f27931fb7 100644 --- a/src/librustc_resolve/error_codes.rs +++ b/src/librustc_resolve/error_codes.rs @@ -1910,6 +1910,7 @@ E0671: r##" Const parameters cannot depend on type parameters. The following is therefore invalid: + ```compile_fail,E0741 #![feature(const_generics)] @@ -1933,6 +1934,44 @@ struct Foo> { ``` "##, +E0742: r##" +Visibility is restricted to a module which isn't an ancestor of the current +item. + +Erroneous code example: + +```compile_fail,E0742,edition2018 +pub mod Sea {} + +pub (in crate::Sea) struct Shark; // error! + +fn main() {} +``` + +To fix this error, we need to move the `Shark` struct inside the `Sea` module: + +```edition2018 +pub mod Sea { + pub (in crate::Sea) struct Shark; // ok! +} + +fn main() {} +``` + +Of course, you can do it as long as the module you're referring to is an +ancestor: + +```edition2018 +pub mod Earth { + pub mod Sea { + pub (in crate::Earth) struct Shark; // ok! + } +} + +fn main() {} +``` +"##, + ; // E0153, unused error code // E0157, unused error code diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index c95009858e4c0..03ff8ba7dc158 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -977,8 +977,9 @@ impl<'a, 'b> ImportResolver<'a, 'b> { if !is_prelude && max_vis.get() != ty::Visibility::Invisible && // Allow empty globs. !max_vis.get().is_at_least(directive.vis.get(), &*self) { - let msg = "A non-empty glob must import something with the glob's visibility"; - self.r.session.span_err(directive.span, msg); + let msg = + "glob import doesn't reexport anything because no candidate is public enough"; + self.r.session.buffer_lint(UNUSED_IMPORTS, directive.id, directive.span, msg); } return None; } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index e282936b5d9e7..a372106d3795b 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -300,7 +300,16 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> { } if let ast::FunctionRetTy::Ty(ref ret_ty) = sig.decl.output { - v.visit_ty(ret_ty); + // In async functions, return types are desugared and redefined + // as an `impl Trait` existential type. Because of this, to match + // the definition paths when resolving nested types we need to + // start walking from the newly-created definition. + match sig.header.asyncness.node { + ast::IsAsync::Async { return_impl_trait_id, .. } => { + v.nest_tables(return_impl_trait_id, |v| v.visit_ty(ret_ty)) + } + _ => v.visit_ty(ret_ty) + } } // walk the fn body @@ -369,6 +378,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> { &mut self, item: &'l ast::Item, decl: &'l ast::FnDecl, + header: &'l ast::FnHeader, ty_params: &'l ast::Generics, body: &'l ast::Block, ) { @@ -391,7 +401,16 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> { // FIXME: Opaque type desugaring prevents us from easily // processing trait bounds. See `visit_ty` for more details. } else { - v.visit_ty(&ret_ty); + // In async functions, return types are desugared and redefined + // as an `impl Trait` existential type. Because of this, to match + // the definition paths when resolving nested types we need to + // start walking from the newly-created definition. + match header.asyncness.node { + ast::IsAsync::Async { return_impl_trait_id, .. } => { + v.nest_tables(return_impl_trait_id, |v| v.visit_ty(ret_ty)) + } + _ => v.visit_ty(ret_ty) + } } } @@ -1315,8 +1334,8 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> { ); } } - Fn(ref decl, .., ref ty_params, ref body) => { - self.process_fn(item, &decl, ty_params, &body) + Fn(ref decl, ref header, ref ty_params, ref body) => { + self.process_fn(item, &decl, &header, ty_params, &body) } Static(ref typ, _, ref expr) => self.process_static_or_const_item(item, typ, expr), Const(ref typ, ref expr) => self.process_static_or_const_item(item, &typ, &expr), diff --git a/src/librustc_target/spec/wasm32_unknown_emscripten.rs b/src/librustc_target/spec/wasm32_unknown_emscripten.rs index 6a2c8c495372f..906c704c804f3 100644 --- a/src/librustc_target/spec/wasm32_unknown_emscripten.rs +++ b/src/librustc_target/spec/wasm32_unknown_emscripten.rs @@ -9,12 +9,8 @@ pub fn target() -> Result { "-s".to_string(), "ASSERTIONS=1".to_string(), "-s".to_string(), - "DISABLE_EXCEPTION_CATCHING=1".to_string(), - "-s".to_string(), "ABORTING_MALLOC=0".to_string(), - // FIXME(tlively): Enable this linker option once libc type errors - // are resolved. See https://github.com/rust-lang/libc/pull/1478. - // "-Wl,--fatal-warnings".to_string(), + "-Wl,--fatal-warnings".to_string(), ]); let opts = TargetOptions { @@ -24,10 +20,7 @@ pub fn target() -> Result { linker: None, linker_is_gnu: true, is_like_emscripten: true, - // FIXME(tlively): Emscripten supports unwinding, but we would have to pass - // -enable-emscripten-cxx-exceptions to LLVM at codegen time and merge - // https://reviews.llvm.org/rG5c3cdef84b82464756bb571c13c31cf7773860c3to use it. - panic_strategy: PanicStrategy::Abort, + panic_strategy: PanicStrategy::Unwind, post_link_args, target_family: Some("unix".to_string()), .. wasm32_base::options() diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index a0e07d58c9da9..a5264a2dfc9d1 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -379,9 +379,13 @@ function getSearchElement() { set_fragment(cur_id); } - } else if (hasClass(document.getElementById("help"), "hidden") === false) { - addClass(document.getElementById("help"), "hidden"); - removeClass(document.body, "blur"); + } else if (hasClass(getHelpElement(), "hidden") === false) { + var help = getHelpElement(); + var is_inside_help_popup = ev.target !== help && help.contains(ev.target); + if (is_inside_help_popup === false) { + addClass(help, "hidden"); + removeClass(document.body, "blur"); + } } else { // Making a collapsed element visible on onhashchange seems // too late diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs index 69fcfa8b39ca5..28d9906eb93b5 100644 --- a/src/libstd/ffi/mod.rs +++ b/src/libstd/ffi/mod.rs @@ -163,7 +163,7 @@ pub use self::c_str::{FromBytesWithNulError}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::os_str::{OsString, OsStr}; -#[stable(feature = "raw_os", since = "1.1.0")] +#[stable(feature = "core_c_void", since = "1.30.0")] pub use core::ffi::c_void; #[unstable(feature = "c_variadic", diff --git a/src/libtest/helpers/concurrency.rs b/src/libtest/helpers/concurrency.rs index 61651a927c5f7..6b0c8a8af32b4 100644 --- a/src/libtest/helpers/concurrency.rs +++ b/src/libtest/helpers/concurrency.rs @@ -54,6 +54,12 @@ pub fn get_concurrency() -> usize { 1 } + #[cfg(target_os = "hermit")] + fn num_cpus() -> usize { + // FIXME: Implement num_cpus on HermitCore + 1 + } + #[cfg(any( all(target_arch = "wasm32", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx") diff --git a/src/libtest/helpers/isatty.rs b/src/libtest/helpers/isatty.rs index 6e4954778e605..4955e1fc88862 100644 --- a/src/libtest/helpers/isatty.rs +++ b/src/libtest/helpers/isatty.rs @@ -2,7 +2,7 @@ //! if stdout is a tty. #[cfg(any( - target_os = "cloudabi", + target_os = "cloudabi", target_os = "hermit", all(target_arch = "wasm32", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx") ))] diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 8c1e9f1722a26..341a2e18db5fc 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -441,9 +441,9 @@ pub fn run_test( ) { let TestDescAndFn { desc, testfn } = test; - // FIXME: Re-enable emscripten once it can catch panics again + // Emscripten can catch panics but other wasm targets cannot let ignore_because_no_process_support = desc.should_panic != ShouldPanic::No - && (cfg!(target_arch = "wasm32") || cfg!(target_os = "emscripten")); + && cfg!(target_arch = "wasm32") && !cfg!(target_os = "emscripten"); if force_ignore || desc.ignore || ignore_because_no_process_support { let message = CompletedTest::new(desc, TrIgnored, None, Vec::new()); diff --git a/src/test/codegen/c-variadic.rs b/src/test/codegen/c-variadic.rs index 7fa61d15f77c4..971f4e3e12ea8 100644 --- a/src/test/codegen/c-variadic.rs +++ b/src/test/codegen/c-variadic.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C no-prepopulate-passes // ignore-tidy-linelength diff --git a/src/test/codegen/drop.rs b/src/test/codegen/drop.rs index 49e40d5f243f1..959929fbafbf1 100644 --- a/src/test/codegen/drop.rs +++ b/src/test/codegen/drop.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C no-prepopulate-passes #![crate_type = "lib"] diff --git a/src/test/codegen/personality_lifetimes.rs b/src/test/codegen/personality_lifetimes.rs index c82ae476b1b2c..9f07488a9a8a6 100644 --- a/src/test/codegen/personality_lifetimes.rs +++ b/src/test/codegen/personality_lifetimes.rs @@ -1,5 +1,5 @@ // ignore-msvc -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -O -C no-prepopulate-passes diff --git a/src/test/codegen/unwind-extern-exports.rs b/src/test/codegen/unwind-extern-exports.rs index d924a3b75dde3..e5a2936b92497 100644 --- a/src/test/codegen/unwind-extern-exports.rs +++ b/src/test/codegen/unwind-extern-exports.rs @@ -1,5 +1,5 @@ // compile-flags: -C opt-level=0 -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![crate_type = "lib"] #![feature(unwind_attributes)] diff --git a/src/test/codegen/unwind-extern-imports.rs b/src/test/codegen/unwind-extern-imports.rs index d88a498775642..8403e1e9da9fa 100644 --- a/src/test/codegen/unwind-extern-imports.rs +++ b/src/test/codegen/unwind-extern-imports.rs @@ -1,5 +1,5 @@ // compile-flags: -C no-prepopulate-passes -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![crate_type = "lib"] #![feature(unwind_attributes)] diff --git a/src/test/incremental/change_crate_dep_kind.rs b/src/test/incremental/change_crate_dep_kind.rs index 2bcb06d6eb8b7..8c35f6ca0000d 100644 --- a/src/test/incremental/change_crate_dep_kind.rs +++ b/src/test/incremental/change_crate_dep_kind.rs @@ -1,7 +1,7 @@ // Test that we detect changes to the `dep_kind` query. If the change is not // detected then -Zincremental-verify-ich will trigger an assertion. -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // revisions:cfail1 cfail2 // compile-flags: -Z query-dep-graph -Cpanic=unwind // build-pass (FIXME(62277): could be check-pass?) diff --git a/src/test/mir-opt/box_expr.rs b/src/test/mir-opt/box_expr.rs index 4b66c07b0934b..8dc6b73edf6d4 100644 --- a/src/test/mir-opt/box_expr.rs +++ b/src/test/mir-opt/box_expr.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(box_syntax)] diff --git a/src/test/mir-opt/generator-storage-dead-unwind.rs b/src/test/mir-opt/generator-storage-dead-unwind.rs index b595c100039d6..109304d6d22cc 100644 --- a/src/test/mir-opt/generator-storage-dead-unwind.rs +++ b/src/test/mir-opt/generator-storage-dead-unwind.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // Test that we generate StorageDead on unwind paths for generators. // diff --git a/src/test/mir-opt/issue-41110.rs b/src/test/mir-opt/issue-41110.rs index 8824496fdb07c..e73390f52b5d5 100644 --- a/src/test/mir-opt/issue-41110.rs +++ b/src/test/mir-opt/issue-41110.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // check that we don't emit multiple drop flags when they are not needed. diff --git a/src/test/mir-opt/issue-62289.rs b/src/test/mir-opt/issue-62289.rs index 93250fd48d82d..a3b517e9bca87 100644 --- a/src/test/mir-opt/issue-62289.rs +++ b/src/test/mir-opt/issue-62289.rs @@ -1,7 +1,7 @@ // check that we don't forget to drop the Box if we early return before // initializing it // ignore-tidy-linelength -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(box_syntax)] diff --git a/src/test/mir-opt/no-spurious-drop-after-call.rs b/src/test/mir-opt/no-spurious-drop-after-call.rs index 370cd593b02bb..782bc31186ca5 100644 --- a/src/test/mir-opt/no-spurious-drop-after-call.rs +++ b/src/test/mir-opt/no-spurious-drop-after-call.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // Test that after the call to `std::mem::drop` we do not generate a // MIR drop of the argument. (We used to have a `DROP(_2)` in the code diff --git a/src/test/mir-opt/packed-struct-drop-aligned.rs b/src/test/mir-opt/packed-struct-drop-aligned.rs index eaa1fbd69ecc6..da73cc96348f0 100644 --- a/src/test/mir-opt/packed-struct-drop-aligned.rs +++ b/src/test/mir-opt/packed-struct-drop-aligned.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default fn main() { let mut x = Packed(Aligned(Droppy(0))); diff --git a/src/test/mir-opt/remove_fake_borrows.rs b/src/test/mir-opt/remove_fake_borrows.rs index 71beaa736639d..965897ad541e7 100644 --- a/src/test/mir-opt/remove_fake_borrows.rs +++ b/src/test/mir-opt/remove_fake_borrows.rs @@ -1,6 +1,6 @@ // Test that the fake borrows for matches are removed after borrow checking. -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default fn match_guard(x: Option<&&i32>, c: bool) -> i32 { match x { diff --git a/src/test/mir-opt/retag.rs b/src/test/mir-opt/retag.rs index a0bdfb3ab8ba9..db36a1fab5f21 100644 --- a/src/test/mir-opt/retag.rs +++ b/src/test/mir-opt/retag.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // ignore-tidy-linelength // compile-flags: -Z mir-emit-retag -Z mir-opt-level=0 -Z span_free_formats diff --git a/src/test/ui/abi/statics/static-mut-foreign.rs b/src/test/ui/abi/statics/static-mut-foreign.rs index b30e8f00e4035..5d6fa416b9895 100644 --- a/src/test/ui/abi/statics/static-mut-foreign.rs +++ b/src/test/ui/abi/statics/static-mut-foreign.rs @@ -5,10 +5,6 @@ // ignore-wasm32-bare no libc to test ffi with -// FIXME: This will work on emscripten once libc is updated to include -// rust-lang/libc/#1478 -// ignore-emscripten libc type mismatch - #![feature(rustc_private)] extern crate libc; diff --git a/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs b/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs index 4e0a238c5d48d..ea4a9e5afa501 100644 --- a/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs +++ b/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs @@ -2,7 +2,7 @@ // Check that partially moved from function parameters are dropped after the // named bindings that move from them. -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default use std::{panic, cell::RefCell}; diff --git a/src/test/ui/builtin-clone-unwind.rs b/src/test/ui/builtin-clone-unwind.rs index 1fd91440a7884..339bcfa1060a4 100644 --- a/src/test/ui/builtin-clone-unwind.rs +++ b/src/test/ui/builtin-clone-unwind.rs @@ -2,7 +2,7 @@ #![allow(unused_variables)] #![allow(unused_imports)] -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // Test that builtin implementations of `Clone` cleanup everything // in case of unwinding. diff --git a/src/test/ui/catch-unwind-bang.rs b/src/test/ui/catch-unwind-bang.rs index c2c21bca7ef71..f181991713b2c 100644 --- a/src/test/ui/catch-unwind-bang.rs +++ b/src/test/ui/catch-unwind-bang.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default fn worker() -> ! { panic!() diff --git a/src/test/ui/drop/dynamic-drop-async.rs b/src/test/ui/drop/dynamic-drop-async.rs index bec86d6465ae9..91063edf0f6c4 100644 --- a/src/test/ui/drop/dynamic-drop-async.rs +++ b/src/test/ui/drop/dynamic-drop-async.rs @@ -5,7 +5,7 @@ // run-pass // edition:2018 -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(slice_patterns)] #![allow(unused)] diff --git a/src/test/ui/drop/dynamic-drop.rs b/src/test/ui/drop/dynamic-drop.rs index 5a7568fe2cd50..29dcbfe9609a0 100644 --- a/src/test/ui/drop/dynamic-drop.rs +++ b/src/test/ui/drop/dynamic-drop.rs @@ -2,7 +2,7 @@ #![allow(unused_assignments)] #![allow(unused_variables)] -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait, untagged_unions)] #![feature(slice_patterns)] diff --git a/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs b/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs index 759fb170f90dd..20c443b63d175 100644 --- a/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs +++ b/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs @@ -1,4 +1,4 @@ -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals #![crate_type = "lib"] diff --git a/src/test/ui/generator/panic-drops.rs b/src/test/ui/generator/panic-drops.rs index b1a5cc67e86b3..f88687858fd11 100644 --- a/src/test/ui/generator/panic-drops.rs +++ b/src/test/ui/generator/panic-drops.rs @@ -1,6 +1,6 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/panic-safe.rs b/src/test/ui/generator/panic-safe.rs index 06c026180190a..5f6778674dce1 100644 --- a/src/test/ui/generator/panic-safe.rs +++ b/src/test/ui/generator/panic-safe.rs @@ -1,6 +1,6 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait)] diff --git a/src/test/ui/generator/resume-after-return.rs b/src/test/ui/generator/resume-after-return.rs index ab18be58155df..71a68ff684af3 100644 --- a/src/test/ui/generator/resume-after-return.rs +++ b/src/test/ui/generator/resume-after-return.rs @@ -1,6 +1,6 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(generators, generator_trait)] diff --git a/src/test/ui/imports/reexports.rs b/src/test/ui/imports/reexports.rs index b0a591b08ac89..d76cc41be4e55 100644 --- a/src/test/ui/imports/reexports.rs +++ b/src/test/ui/imports/reexports.rs @@ -1,16 +1,21 @@ +#![warn(unused_imports)] + mod a { fn foo() {} mod foo {} mod a { pub use super::foo; //~ ERROR cannot be re-exported - pub use super::*; //~ ERROR must import something with the glob's visibility + pub use super::*; + //~^ WARNING glob import doesn't reexport anything because no candidate is public enough } } mod b { pub fn foo() {} - mod foo { pub struct S; } + mod foo { + pub struct S; + } pub mod a { pub use super::foo; // This is OK since the value `foo` is visible enough. diff --git a/src/test/ui/imports/reexports.stderr b/src/test/ui/imports/reexports.stderr index af2c97e77b9d7..4388e2c276b8e 100644 --- a/src/test/ui/imports/reexports.stderr +++ b/src/test/ui/imports/reexports.stderr @@ -1,34 +1,40 @@ error[E0364]: `foo` is private, and cannot be re-exported - --> $DIR/reexports.rs:6:17 + --> $DIR/reexports.rs:8:17 | LL | pub use super::foo; | ^^^^^^^^^^ | note: consider marking `foo` as `pub` in the imported module - --> $DIR/reexports.rs:6:17 + --> $DIR/reexports.rs:8:17 | LL | pub use super::foo; | ^^^^^^^^^^ -error: A non-empty glob must import something with the glob's visibility - --> $DIR/reexports.rs:7:17 - | -LL | pub use super::*; - | ^^^^^^^^ - error[E0603]: module `foo` is private - --> $DIR/reexports.rs:28:15 + --> $DIR/reexports.rs:33:15 | LL | use b::a::foo::S; | ^^^ error[E0603]: module `foo` is private - --> $DIR/reexports.rs:29:15 + --> $DIR/reexports.rs:34:15 | LL | use b::b::foo::S as T; | ^^^ -error: aborting due to 4 previous errors +warning: glob import doesn't reexport anything because no candidate is public enough + --> $DIR/reexports.rs:9:17 + | +LL | pub use super::*; + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/reexports.rs:1:9 + | +LL | #![warn(unused_imports)] + | ^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors Some errors have detailed explanations: E0364, E0603. For more information about an error, try `rustc --explain E0364`. diff --git a/src/test/ui/issues/issue-14875.rs b/src/test/ui/issues/issue-14875.rs index 29e974ad83d1e..0d95d168b3db3 100644 --- a/src/test/ui/issues/issue-14875.rs +++ b/src/test/ui/issues/issue-14875.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // Check that values are not leaked when a dtor panics (#14875) diff --git a/src/test/ui/issues/issue-29948.rs b/src/test/ui/issues/issue-29948.rs index 5237a2f67bdd7..8ede8143ea657 100644 --- a/src/test/ui/issues/issue-29948.rs +++ b/src/test/ui/issues/issue-29948.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default use std::panic; diff --git a/src/test/ui/issues/issue-43853.rs b/src/test/ui/issues/issue-43853.rs index 2a932db05af26..47c3ab59aa2eb 100644 --- a/src/test/ui/issues/issue-43853.rs +++ b/src/test/ui/issues/issue-43853.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default use std::panic; diff --git a/src/test/ui/issues/issue-46519.rs b/src/test/ui/issues/issue-46519.rs index 40c3117f01ce9..cca0995d4ca10 100644 --- a/src/test/ui/issues/issue-46519.rs +++ b/src/test/ui/issues/issue-46519.rs @@ -1,7 +1,7 @@ // run-pass // compile-flags:--test -O -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #[test] #[should_panic(expected = "creating inhabited type")] diff --git a/src/test/ui/iterators/iter-count-overflow-debug.rs b/src/test/ui/iterators/iter-count-overflow-debug.rs index fdd285dcad2a1..d661203575083 100644 --- a/src/test/ui/iterators/iter-count-overflow-debug.rs +++ b/src/test/ui/iterators/iter-count-overflow-debug.rs @@ -1,6 +1,6 @@ // run-pass // only-32bit too impatient for 2⁶⁴ items -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C debug_assertions=yes -C opt-level=3 use std::panic; diff --git a/src/test/ui/iterators/iter-position-overflow-debug.rs b/src/test/ui/iterators/iter-position-overflow-debug.rs index b578999af8e94..f1eded31702c4 100644 --- a/src/test/ui/iterators/iter-position-overflow-debug.rs +++ b/src/test/ui/iterators/iter-position-overflow-debug.rs @@ -1,6 +1,6 @@ // run-pass // only-32bit too impatient for 2⁶⁴ items -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C debug_assertions=yes -C opt-level=3 use std::panic; diff --git a/src/test/ui/iterators/iter-step-overflow-debug.rs b/src/test/ui/iterators/iter-step-overflow-debug.rs index 3872a03b68259..5d67c7cbb4256 100644 --- a/src/test/ui/iterators/iter-step-overflow-debug.rs +++ b/src/test/ui/iterators/iter-step-overflow-debug.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C debug_assertions=yes use std::panic; diff --git a/src/test/ui/iterators/iter-sum-overflow-debug.rs b/src/test/ui/iterators/iter-sum-overflow-debug.rs index 4a9e8cdb72e70..ee4ab4d24c6ab 100644 --- a/src/test/ui/iterators/iter-sum-overflow-debug.rs +++ b/src/test/ui/iterators/iter-sum-overflow-debug.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C debug_assertions=yes use std::panic; diff --git a/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs b/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs index 6bd1425e32465..429f8e0bc9648 100644 --- a/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs +++ b/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C overflow-checks use std::panic; diff --git a/src/test/ui/macros/macro-comma-behavior-rpass.rs b/src/test/ui/macros/macro-comma-behavior-rpass.rs index 1c791bb1ca3d6..32cf59294e760 100644 --- a/src/test/ui/macros/macro-comma-behavior-rpass.rs +++ b/src/test/ui/macros/macro-comma-behavior-rpass.rs @@ -13,7 +13,7 @@ // compile-flags: --test -C debug_assertions=yes // revisions: std core -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![cfg_attr(core, no_std)] diff --git a/src/test/ui/mir/mir_calls_to_shims.rs b/src/test/ui/mir/mir_calls_to_shims.rs index de8d958af45e3..6f13d5612ce51 100644 --- a/src/test/ui/mir/mir_calls_to_shims.rs +++ b/src/test/ui/mir/mir_calls_to_shims.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(fn_traits)] #![feature(never_type)] diff --git a/src/test/ui/mir/mir_drop_order.rs b/src/test/ui/mir/mir_drop_order.rs index 2bc5cf1c97637..2949437b1e4b6 100644 --- a/src/test/ui/mir/mir_drop_order.rs +++ b/src/test/ui/mir/mir_drop_order.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default use std::cell::RefCell; use std::panic; diff --git a/src/test/ui/never_type/panic-uninitialized-zeroed.rs b/src/test/ui/never_type/panic-uninitialized-zeroed.rs index 72b844d8b4886..e0c30160b9e94 100644 --- a/src/test/ui/never_type/panic-uninitialized-zeroed.rs +++ b/src/test/ui/never_type/panic-uninitialized-zeroed.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // This test checks that instantiating an uninhabited type via `mem::{uninitialized,zeroed}` results // in a runtime panic. diff --git a/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs b/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs index c1959866e5c25..e9927304f23f8 100644 --- a/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs +++ b/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs @@ -1,6 +1,6 @@ // run-pass // compile-flags: -C debug_assertions=yes -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // ignore-emscripten dies with an LLVM error use std::panic; diff --git a/src/test/ui/panic-runtime/transitive-link-a-bunch.rs b/src/test/ui/panic-runtime/transitive-link-a-bunch.rs index 6dcb852a3669f..5d72771c2dcff 100644 --- a/src/test/ui/panic-runtime/transitive-link-a-bunch.rs +++ b/src/test/ui/panic-runtime/transitive-link-a-bunch.rs @@ -4,7 +4,7 @@ // aux-build:wants-panic-runtime-abort.rs // aux-build:panic-runtime-lang-items.rs // error-pattern: is not compiled with this crate's panic strategy `unwind` -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![no_std] #![no_main] diff --git a/src/test/ui/panic-runtime/want-unwind-got-abort.rs b/src/test/ui/panic-runtime/want-unwind-got-abort.rs index e7811d40b5b9a..4c25c09d6438f 100644 --- a/src/test/ui/panic-runtime/want-unwind-got-abort.rs +++ b/src/test/ui/panic-runtime/want-unwind-got-abort.rs @@ -1,7 +1,7 @@ // error-pattern:is incompatible with this crate's strategy of `unwind` // aux-build:panic-runtime-abort.rs // aux-build:panic-runtime-lang-items.rs -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![no_std] #![no_main] diff --git a/src/test/ui/panic-runtime/want-unwind-got-abort2.rs b/src/test/ui/panic-runtime/want-unwind-got-abort2.rs index 44671796c01a3..478af451e7f65 100644 --- a/src/test/ui/panic-runtime/want-unwind-got-abort2.rs +++ b/src/test/ui/panic-runtime/want-unwind-got-abort2.rs @@ -2,7 +2,7 @@ // aux-build:panic-runtime-abort.rs // aux-build:wants-panic-runtime-abort.rs // aux-build:panic-runtime-lang-items.rs -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![no_std] #![no_main] diff --git a/src/test/ui/privacy/restricted/relative-2018.stderr b/src/test/ui/privacy/restricted/relative-2018.stderr index 61effc463e98f..54fee085ee943 100644 --- a/src/test/ui/privacy/restricted/relative-2018.stderr +++ b/src/test/ui/privacy/restricted/relative-2018.stderr @@ -1,4 +1,4 @@ -error: visibilities can only be restricted to ancestor modules +error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/relative-2018.rs:7:12 | LL | pub(in ::core) struct S4; @@ -14,3 +14,4 @@ LL | pub(in a::b) struct S5; error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0742`. diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index a23973d0853f1..e6a61fbefb0d8 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -4,7 +4,7 @@ error[E0433]: failed to resolve: maybe a missing crate `bad`? LL | pub(in bad::path) mod m1 {} | ^^^ maybe a missing crate `bad`? -error: visibilities can only be restricted to ancestor modules +error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/test.rs:51:12 | LL | pub(in foo) mod m2 {} @@ -78,5 +78,5 @@ LL | u.h(); error: aborting due to 12 previous errors -Some errors have detailed explanations: E0364, E0433, E0603, E0616, E0624. +Some errors have detailed explanations: E0364, E0433, E0603, E0616, E0624, E0742. For more information about an error, try `rustc --explain E0364`. diff --git a/src/test/ui/proc-macro/expand-with-a-macro.rs b/src/test/ui/proc-macro/expand-with-a-macro.rs index 690a76ef3e0af..418178d0f0ead 100644 --- a/src/test/ui/proc-macro/expand-with-a-macro.rs +++ b/src/test/ui/proc-macro/expand-with-a-macro.rs @@ -1,7 +1,7 @@ // run-pass // aux-build:expand-with-a-macro.rs -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![deny(warnings)] diff --git a/src/test/ui/proc-macro/issue-50493.stderr b/src/test/ui/proc-macro/issue-50493.stderr index 28c61a2f52fed..6b8724457a6a3 100644 --- a/src/test/ui/proc-macro/issue-50493.stderr +++ b/src/test/ui/proc-macro/issue-50493.stderr @@ -1,4 +1,4 @@ -error: visibilities can only be restricted to ancestor modules +error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/issue-50493.rs:8:12 | LL | pub(in restricted) field: usize, @@ -12,4 +12,5 @@ LL | #[derive(Derive)] error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0616`. +Some errors have detailed explanations: E0616, E0742. +For more information about an error, try `rustc --explain E0616`. diff --git a/src/test/ui/pub/pub-restricted.stderr b/src/test/ui/pub/pub-restricted.stderr index 596264ba16b42..56ff104b4fed9 100644 --- a/src/test/ui/pub/pub-restricted.stderr +++ b/src/test/ui/pub/pub-restricted.stderr @@ -53,7 +53,7 @@ LL | pub (xyz) fn xyz() {} `pub(super)`: visible only in the current module's parent `pub(in path::to::module)`: visible only on the specified path -error: visibilities can only be restricted to ancestor modules +error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/pub-restricted.rs:25:17 | LL | pub (in x) non_parent_invalid: usize, @@ -61,4 +61,5 @@ LL | pub (in x) non_parent_invalid: usize, error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0704`. +Some errors have detailed explanations: E0704, E0742. +For more information about an error, try `rustc --explain E0704`. diff --git a/src/test/ui/reachable-unnameable-items.rs b/src/test/ui/reachable-unnameable-items.rs index 26c51efea1e1c..f1e53a0d8b426 100644 --- a/src/test/ui/reachable-unnameable-items.rs +++ b/src/test/ui/reachable-unnameable-items.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // aux-build:reachable-unnameable-items.rs extern crate reachable_unnameable_items; diff --git a/src/test/ui/resolve/resolve-bad-visibility.stderr b/src/test/ui/resolve/resolve-bad-visibility.stderr index d2fb7c7a9e69d..43af38cf491e3 100644 --- a/src/test/ui/resolve/resolve-bad-visibility.stderr +++ b/src/test/ui/resolve/resolve-bad-visibility.stderr @@ -10,7 +10,7 @@ error[E0577]: expected module, found trait `Tr` LL | pub(in Tr) struct Z; | ^^ not a module -error: visibilities can only be restricted to ancestor modules +error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/resolve-bad-visibility.rs:6:8 | LL | pub(in std::vec) struct F; @@ -30,4 +30,5 @@ LL | pub(in too_soon) struct H; error: aborting due to 5 previous errors -For more information about this error, try `rustc --explain E0433`. +Some errors have detailed explanations: E0433, E0742. +For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs index c8e8b9dcfc6a7..0bd7bf3d51a78 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs @@ -1,7 +1,7 @@ // compile-flags: --test // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![feature(test)] diff --git a/src/test/ui/rfcs/rfc1857-drop-order.rs b/src/test/ui/rfcs/rfc1857-drop-order.rs index b10b6ec11b53a..7923aa7c0e22f 100644 --- a/src/test/ui/rfcs/rfc1857-drop-order.rs +++ b/src/test/ui/rfcs/rfc1857-drop-order.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default #![allow(dead_code, unreachable_code)] diff --git a/src/test/ui/save-analysis/issue-65590.rs b/src/test/ui/save-analysis/issue-65590.rs new file mode 100644 index 0000000000000..27874f8655e56 --- /dev/null +++ b/src/test/ui/save-analysis/issue-65590.rs @@ -0,0 +1,21 @@ +// check-pass +// compile-flags: -Zsave-analysis +// edition:2018 + +// Async desugaring for return types in (associated) functions introduces a +// separate definition internally, which we need to take into account +// (or else we ICE). +trait Trait { type Assoc; } +struct Struct; + +async fn foobar() -> T::Assoc { + unimplemented!() +} + +impl Struct { + async fn foo(&self) -> T::Assoc { + unimplemented!() + } +} + +fn main() {} diff --git a/src/test/ui/test-attrs/test-allow-fail-attr.rs b/src/test/ui/test-attrs/test-allow-fail-attr.rs index 55b743ab7c7ea..1a478460efc6c 100644 --- a/src/test/ui/test-attrs/test-allow-fail-attr.rs +++ b/src/test/ui/test-attrs/test-allow-fail-attr.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: --test #![feature(allow_fail)] diff --git a/src/test/ui/test-attrs/test-should-fail-good-message.rs b/src/test/ui/test-attrs/test-should-fail-good-message.rs index 2284953fbbe94..9fa759f9eb483 100644 --- a/src/test/ui/test-attrs/test-should-fail-good-message.rs +++ b/src/test/ui/test-attrs/test-should-fail-good-message.rs @@ -1,5 +1,5 @@ // run-pass -// ignore-emscripten compiled with panic=abort by default +// ignore-wasm32-bare compiled with panic=abort by default // compile-flags: --test #[test] #[should_panic(expected = "foo")] diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 2a189a92f4b12..fca57eec79fc6 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -91,7 +91,9 @@ static TARGETS: &[&str] = &[ "mips-unknown-linux-gnu", "mips-unknown-linux-musl", "mips64-unknown-linux-gnuabi64", + "mips64-unknown-linux-muslabi64", "mips64el-unknown-linux-gnuabi64", + "mips64el-unknown-linux-muslabi64", "mipsisa32r6-unknown-linux-gnu", "mipsisa32r6el-unknown-linux-gnu", "mipsisa64r6-unknown-linux-gnuabi64", diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 0309488506584..d750595e272cf 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -141,10 +141,6 @@ impl EarlyProps { if config.target == "wasm32-unknown-unknown" && config.parse_check_run_results(ln) { props.ignore = Ignore::Ignore; } - // FIXME: Re-enable run-fail once panics are handled correctly - if config.target.contains("emscripten") && config.mode == common::RunFail { - props.ignore = Ignore::Ignore; - } } if (config.mode == common::DebugInfoGdb || config.mode == common::DebugInfoGdbLldb) && diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index a7188f0d11eac..89bbde4d5a9e3 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -13,6 +13,11 @@ clap = "2.25.0" failure = "0.1" mdbook-linkcheck = { version = "0.3.0", optional = true } +# A noop dependency that changes in the Rust repository, it's a bit of a hack. +# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` +# for more information. +rustc-workspace-hack = "1.0.0" + [dependencies.mdbook] version = "0.3.0" default-features = false