Auto merge of #65943 - tmandry:rollup-g20uvkh, r=tmandry
Rollup of 12 pull requests Successful merges: - #65405 (Create new error E0742 and add long error explanation) - #65539 (resolve: Turn the "non-empty glob must import something" error into a lint) - #65724 (ci: refactor pr tools job skipping) - #65741 (Prevent help popup to disappear when clicking on it) - #65832 (Re-enable Emscripten's exception handling support) - #65843 (Enable dist for MIPS64 musl targets) - #65898 (add basic HermitCore support within libtest) - #65900 (proc_macro: clean up bridge::client::__run_expand{1,2} a bit.) - #65906 (Update mdbook to 0.3.3) - #65920 (Use rustc-workspace-hack for rustbook) - #65930 (doc: use new feature gate for c_void type) - #65936 (save-analysis: Account for async desugaring in async fn return types) Failed merges: - #65434 (Add long error explanation for E0577) r? @ghost
This commit is contained in:
commit
aa69777ea2
80 changed files with 304 additions and 202 deletions
25
Cargo.lock
25
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]]
|
||||
|
|
|
@ -133,6 +133,10 @@ v("musl-root-mips", "target.mips-unknown-linux-musl.musl-root",
|
|||
"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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
20
src/ci/scripts/should-skip-this.sh
Executable file
20
src/ci/scripts/should-skip-this.sh
Executable file
|
@ -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
|
|
@ -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")]
|
||||
|
|
|
@ -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<F> {
|
||||
// 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<u8>,
|
||||
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<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
|
||||
mut bridge: Bridge<'_>,
|
||||
f: fn(crate::TokenStream) -> crate::TokenStream,
|
||||
f: impl FnOnce(A) -> R,
|
||||
) -> Buffer<u8> {
|
||||
// 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<fn(crate::TokenStream) -> 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<u8> {
|
||||
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<u8> {
|
||||
// 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<fn(crate::TokenStream, crate::TokenStream) -> 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<u8> {
|
||||
run_client(bridge, |(input, input2)| {
|
||||
f(crate::TokenStream(input), crate::TokenStream(input2)).0
|
||||
})
|
||||
}
|
||||
Client {
|
||||
get_handle_counters: HandleCounters::get,
|
||||
run: __run_expand2,
|
||||
run,
|
||||
f,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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(..),
|
||||
..
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<X = Box<Self>> {
|
|||
```
|
||||
"##,
|
||||
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -9,12 +9,8 @@ pub fn target() -> Result<Target, String> {
|
|||
"-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<Target, String> {
|
|||
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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
))]
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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?)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// ignore-emscripten compiled with panic=abort by default
|
||||
// ignore-wasm32-bare compiled with panic=abort by default
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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!()
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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")]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
||||
|
|
21
src/test/ui/save-analysis/issue-65590.rs
Normal file
21
src/test/ui/save-analysis/issue-65590.rs
Normal file
|
@ -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: Trait>() -> T::Assoc {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
impl Struct {
|
||||
async fn foo<T: Trait>(&self) -> T::Assoc {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -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)]
|
||||
|
||||
|
|
|
@ -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")]
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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) &&
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue