Skip to content

Commit aa69777

Browse files
committed
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
2 parents caa1f8d + db49686 commit aa69777

File tree

80 files changed

+304
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+304
-202
lines changed

Cargo.lock

+13-12
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ dependencies = [
2727

2828
[[package]]
2929
name = "ammonia"
30-
version = "2.1.2"
30+
version = "3.0.0"
3131
source = "registry+https://github.com/rust-lang/crates.io-index"
32-
checksum = "384d704f242a0a9faf793fff775a0be6ab9aa27edabffa097331d73779142520"
32+
checksum = "9e266e1f4be5ffa05309f650e2586fe1d3ae6034eb24025a7ae1dfecc330823a"
3333
dependencies = [
3434
"html5ever",
3535
"lazy_static 1.3.0",
3636
"maplit",
3737
"matches",
3838
"tendril",
39-
"url 1.7.2",
39+
"url 2.1.0",
4040
]
4141

4242
[[package]]
@@ -1363,16 +1363,16 @@ dependencies = [
13631363

13641364
[[package]]
13651365
name = "html5ever"
1366-
version = "0.23.0"
1366+
version = "0.24.1"
13671367
source = "registry+https://github.com/rust-lang/crates.io-index"
1368-
checksum = "5ce65ac8028cf5a287a7dbf6c4e0a6cf2dcf022ed5b167a81bae66ebf599a8b7"
1368+
checksum = "025483b0a1e4577bb28578318c886ee5f817dda6eb62473269349044406644cb"
13691369
dependencies = [
13701370
"log",
13711371
"mac",
13721372
"markup5ever",
1373-
"proc-macro2 0.4.30",
1374-
"quote 0.6.12",
1375-
"syn 0.15.35",
1373+
"proc-macro2 1.0.3",
1374+
"quote 1.0.2",
1375+
"syn 1.0.5",
13761376
]
13771377

13781378
[[package]]
@@ -1902,9 +1902,9 @@ checksum = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43"
19021902

19031903
[[package]]
19041904
name = "markup5ever"
1905-
version = "0.8.1"
1905+
version = "0.9.0"
19061906
source = "registry+https://github.com/rust-lang/crates.io-index"
1907-
checksum = "f1af46a727284117e09780d05038b1ce6fc9c76cc6df183c3dae5a8955a25e21"
1907+
checksum = "65381d9d47506b8592b97c4efd936afcf673b09b059f2bef39c7211ee78b9d03"
19081908
dependencies = [
19091909
"log",
19101910
"phf",
@@ -1925,9 +1925,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
19251925

19261926
[[package]]
19271927
name = "mdbook"
1928-
version = "0.3.1"
1928+
version = "0.3.3"
19291929
source = "registry+https://github.com/rust-lang/crates.io-index"
1930-
checksum = "949bb2acb2cff9fa5c375cf9c43e70b3dba0a974d9fe01c31285d7a84d2a0fa2"
1930+
checksum = "9a070268274c566082efb6b2ace7743e43ba91a70d5c6982981e96d3c05ac81c"
19311931
dependencies = [
19321932
"ammonia",
19331933
"chrono",
@@ -3103,6 +3103,7 @@ dependencies = [
31033103
"failure",
31043104
"mdbook",
31053105
"mdbook-linkcheck",
3106+
"rustc-workspace-hack",
31063107
]
31073108

31083109
[[package]]

src/bootstrap/configure.py

+4
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def v(*args):
133133
"mips-unknown-linux-musl install directory")
134134
v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root",
135135
"mipsel-unknown-linux-musl install directory")
136+
v("musl-root-mips64", "target.mips64-unknown-linux-muslabi64.musl-root",
137+
"mips64-unknown-linux-muslabi64 install directory")
138+
v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root",
139+
"mips64el-unknown-linux-muslabi64 install directory")
136140
v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
137141
"rootfs in qemu testing, you probably don't want to use this")
138142
v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs",

src/bootstrap/native.rs

+4
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,10 @@ impl Step for TestHelpers {
534534
builder.info("Building test helpers");
535535
t!(fs::create_dir_all(&dst));
536536
let mut cfg = cc::Build::new();
537+
// FIXME: Workaround for https://github.com/emscripten-core/emscripten/issues/9013
538+
if target.contains("emscripten") {
539+
cfg.pic(false);
540+
}
537541

538542
// We may have found various cross-compilers a little differently due to our
539543
// extra configuration, so inform gcc of these compilers. Note, though, that

src/bootstrap/tool.rs

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ pub fn prepare_tool_cargo(
244244
path.ends_with("rls") ||
245245
path.ends_with("clippy") ||
246246
path.ends_with("miri") ||
247+
path.ends_with("rustbook") ||
247248
path.ends_with("rustfmt")
248249
{
249250
cargo.env("LIBZ_SYS_STATIC", "1");

src/ci/azure-pipelines/pr.yml

+3-11
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ jobs:
2222
IMAGE: x86_64-gnu-llvm-6.0
2323
mingw-check:
2424
IMAGE: mingw-check
25-
26-
- job: LinuxTools
27-
timeoutInMinutes: 600
28-
pool:
29-
vmImage: ubuntu-16.04
30-
steps:
31-
- template: steps/run.yml
32-
parameters:
33-
only_on_updated_submodules: 'yes'
34-
variables:
35-
IMAGE: x86_64-gnu-tools
25+
x86_64-gnu-tools:
26+
IMAGE: x86_64-gnu-tools
27+
CI_ONLY_WHEN_SUBMODULES_CHANGED: 1

src/ci/azure-pipelines/steps/run.yml

+2-20
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
#
77
# Check travis config for `gdb --batch` command to print all crash logs
88

9-
parameters:
10-
# When this parameter is set to anything other than an empty string the tests
11-
# will only be executed when the commit updates submodules
12-
only_on_updated_submodules: ''
13-
149
steps:
1510

1611
# Disable automatic line ending conversion, which is enabled by default on
@@ -26,21 +21,8 @@ steps:
2621
- checkout: self
2722
fetchDepth: 2
2823

29-
# Set the SKIP_JOB environment variable if this job is supposed to only run
30-
# when submodules are updated and they were not. The following time consuming
31-
# tasks will be skipped when the environment variable is present.
32-
- ${{ if parameters.only_on_updated_submodules }}:
33-
- bash: |
34-
set -e
35-
# Submodules pseudo-files inside git have the 160000 permissions, so when
36-
# those files are present in the diff a submodule was updated.
37-
if git diff HEAD^ | grep "^index .* 160000" >/dev/null 2>&1; then
38-
echo "Executing the job since submodules are updated"
39-
else
40-
echo "Not executing this job since no submodules were updated"
41-
echo "##vso[task.setvariable variable=SKIP_JOB;]1"
42-
fi
43-
displayName: Decide whether to run this job
24+
- bash: src/ci/scripts/should-skip-this.sh
25+
displayName: Decide whether to run this job
4426

4527
# Spawn a background process to collect CPU usage statistics which we'll upload
4628
# at the end of the build. See the comments in the script here for more

src/ci/docker/dist-various-1/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515
g++-arm-linux-gnueabi \
1616
g++-arm-linux-gnueabihf \
1717
g++-aarch64-linux-gnu \
18+
g++-mips64-linux-gnuabi64 \
19+
g++-mips64el-linux-gnuabi64 \
1820
gcc-sparc64-linux-gnu \
1921
libc6-dev-sparc64-cross \
2022
bzip2 \
@@ -77,6 +79,14 @@ RUN env \
7779
CC=mipsel-openwrt-linux-gcc \
7880
CXX=mipsel-openwrt-linux-g++ \
7981
bash musl.sh mipsel && \
82+
env \
83+
CC=mips64-linux-gnuabi64-gcc \
84+
CXX=mips64-linux-gnuabi64-g++ \
85+
bash musl.sh mips64 && \
86+
env \
87+
CC=mips64el-linux-gnuabi64-gcc \
88+
CXX=mips64el-linux-gnuabi64-g++ \
89+
bash musl.sh mips64el && \
8090
rm -rf /build/*
8191

8292
# FIXME(mozilla/sccache#235) this shouldn't be necessary but is currently
@@ -97,6 +107,8 @@ ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
97107
ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd
98108
ENV TARGETS=$TARGETS,mips-unknown-linux-musl
99109
ENV TARGETS=$TARGETS,mipsel-unknown-linux-musl
110+
ENV TARGETS=$TARGETS,mips64-unknown-linux-muslabi64
111+
ENV TARGETS=$TARGETS,mips64el-unknown-linux-muslabi64
100112
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabi
101113
ENV TARGETS=$TARGETS,arm-unknown-linux-musleabihf
102114
ENV TARGETS=$TARGETS,armv5te-unknown-linux-gnueabi
@@ -125,6 +137,8 @@ ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
125137

126138
ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
127139
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
140+
CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc \
141+
CC_mips64_unknown_linux_muslabi64=mips64-linux-gnuabi64-gcc \
128142
CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
129143
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \
130144
CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
@@ -139,6 +153,8 @@ ENV RUST_CONFIGURE_ARGS \
139153
--musl-root-aarch64=/musl-aarch64 \
140154
--musl-root-mips=/musl-mips \
141155
--musl-root-mipsel=/musl-mipsel \
156+
--musl-root-mips64=/musl-mips64 \
157+
--musl-root-mips64el=/musl-mips64el \
142158
--disable-docs
143159

144160
ENV SCRIPT \

src/ci/scripts/should-skip-this.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
# Set the SKIP_JOB environment variable if this job is supposed to only run
3+
# when submodules are updated and they were not. The following time consuming
4+
# tasks will be skipped when the environment variable is present.
5+
6+
set -euo pipefail
7+
IFS=$'\n\t'
8+
9+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
10+
11+
if [[ -z "${CI_ONLY_WHEN_SUBMODULES_CHANGED+x}" ]]; then
12+
echo "Executing the job since there is no skip rule in effect"
13+
elif git diff HEAD^ | grep --quiet "^index .* 160000"; then
14+
# Submodules pseudo-files inside git have the 160000 permissions, so when
15+
# those files are present in the diff a submodule was updated.
16+
echo "Executing the job since submodules are updated"
17+
else
18+
echo "Not executing this job since no submodules were updated"
19+
ciCommandSetEnv SKIP_JOB 1
20+
fi

src/libcore/ffi.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ use crate::ops::{Deref, DerefMut};
1818
/// stabilized, it is recommended to use a newtype wrapper around an empty
1919
/// byte array. See the [Nomicon] for details.
2020
///
21+
/// One could use `std::os::raw::c_void` if they want to support old Rust
22+
/// compiler down to 1.1.0. After Rust 1.30.0, it was re-exported by
23+
/// this definition. For more information, please read [RFC 2521].
24+
///
2125
/// [pointer]: ../../std/primitive.pointer.html
2226
/// [Nomicon]: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs
27+
/// [RFC 2521]: https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md
2328
// N.B., for LLVM to recognize the void pointer type and by extension
2429
// functions like malloc(), we need to have it represented as i8* in
2530
// LLVM bitcode. The enum used here ensures this and prevents misuse
@@ -29,7 +34,7 @@ use crate::ops::{Deref, DerefMut};
2934
// would be uninhabited and at least dereferencing such pointers would
3035
// be UB.
3136
#[repr(u8)]
32-
#[stable(feature = "raw_os", since = "1.1.0")]
37+
#[stable(feature = "core_c_void", since = "1.30.0")]
3338
pub enum c_void {
3439
#[unstable(feature = "c_void_variant", reason = "temporary implementation detail",
3540
issue = "0")]

src/libproc_macro/bridge/client.rs

+28-54
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ macro_rules! define_handles {
1515
}
1616

1717
impl HandleCounters {
18-
// FIXME(#53451) public to work around `Cannot create local mono-item` ICE.
19-
pub extern "C" fn get() -> &'static Self {
18+
// FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
19+
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
20+
extern "C" fn get() -> &'static Self {
2021
static COUNTERS: HandleCounters = HandleCounters {
2122
$($oty: AtomicUsize::new(1),)*
2223
$($ity: AtomicUsize::new(1),)*
@@ -333,29 +334,32 @@ impl Bridge<'_> {
333334
#[repr(C)]
334335
#[derive(Copy, Clone)]
335336
pub struct Client<F> {
337+
// FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
338+
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
336339
pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
337340
pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,
338341
pub(super) f: F,
339342
}
340343

341-
// FIXME(#53451) public to work around `Cannot create local mono-item` ICE,
342-
// affecting not only the function itself, but also the `BridgeState` `thread_local!`.
343-
pub extern "C" fn __run_expand1(
344+
/// Client-side helper for handling client panics, entering the bridge,
345+
/// deserializing input and serializing output.
346+
// FIXME(eddyb) maybe replace `Bridge::enter` with this?
347+
fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
344348
mut bridge: Bridge<'_>,
345-
f: fn(crate::TokenStream) -> crate::TokenStream,
349+
f: impl FnOnce(A) -> R,
346350
) -> Buffer<u8> {
347351
// The initial `cached_buffer` contains the input.
348352
let mut b = bridge.cached_buffer.take();
349353

350354
panic::catch_unwind(panic::AssertUnwindSafe(|| {
351355
bridge.enter(|| {
352356
let reader = &mut &b[..];
353-
let input = TokenStream::decode(reader, &mut ());
357+
let input = A::decode(reader, &mut ());
354358

355359
// Put the `cached_buffer` back in the `Bridge`, for requests.
356360
Bridge::with(|bridge| bridge.cached_buffer = b.take());
357361

358-
let output = f(crate::TokenStream(input)).0;
362+
let output = f(input);
359363

360364
// Take the `cached_buffer` back out, for the output value.
361365
b = Bridge::with(|bridge| bridge.cached_buffer.take());
@@ -383,65 +387,35 @@ pub extern "C" fn __run_expand1(
383387

384388
impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
385389
pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
390+
extern "C" fn run(
391+
bridge: Bridge<'_>,
392+
f: impl FnOnce(crate::TokenStream) -> crate::TokenStream,
393+
) -> Buffer<u8> {
394+
run_client(bridge, |input| f(crate::TokenStream(input)).0)
395+
}
386396
Client {
387397
get_handle_counters: HandleCounters::get,
388-
run: __run_expand1,
398+
run,
389399
f,
390400
}
391401
}
392402
}
393403

394-
// FIXME(#53451) public to work around `Cannot create local mono-item` ICE,
395-
// affecting not only the function itself, but also the `BridgeState` `thread_local!`.
396-
pub extern "C" fn __run_expand2(
397-
mut bridge: Bridge<'_>,
398-
f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
399-
) -> Buffer<u8> {
400-
// The initial `cached_buffer` contains the input.
401-
let mut b = bridge.cached_buffer.take();
402-
403-
panic::catch_unwind(panic::AssertUnwindSafe(|| {
404-
bridge.enter(|| {
405-
let reader = &mut &b[..];
406-
let input = TokenStream::decode(reader, &mut ());
407-
let input2 = TokenStream::decode(reader, &mut ());
408-
409-
// Put the `cached_buffer` back in the `Bridge`, for requests.
410-
Bridge::with(|bridge| bridge.cached_buffer = b.take());
411-
412-
let output = f(crate::TokenStream(input), crate::TokenStream(input2)).0;
413-
414-
// Take the `cached_buffer` back out, for the output value.
415-
b = Bridge::with(|bridge| bridge.cached_buffer.take());
416-
417-
// HACK(eddyb) Separate encoding a success value (`Ok(output)`)
418-
// from encoding a panic (`Err(e: PanicMessage)`) to avoid
419-
// having handles outside the `bridge.enter(|| ...)` scope, and
420-
// to catch panics that could happen while encoding the success.
421-
//
422-
// Note that panics should be impossible beyond this point, but
423-
// this is defensively trying to avoid any accidental panicking
424-
// reaching the `extern "C"` (which should `abort` but may not
425-
// at the moment, so this is also potentially preventing UB).
426-
b.clear();
427-
Ok::<_, ()>(output).encode(&mut b, &mut ());
428-
})
429-
}))
430-
.map_err(PanicMessage::from)
431-
.unwrap_or_else(|e| {
432-
b.clear();
433-
Err::<(), _>(e).encode(&mut b, &mut ());
434-
});
435-
b
436-
}
437-
438404
impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
439405
pub const fn expand2(
440406
f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream
441407
) -> Self {
408+
extern "C" fn run(
409+
bridge: Bridge<'_>,
410+
f: impl FnOnce(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
411+
) -> Buffer<u8> {
412+
run_client(bridge, |(input, input2)| {
413+
f(crate::TokenStream(input), crate::TokenStream(input2)).0
414+
})
415+
}
442416
Client {
443417
get_handle_counters: HandleCounters::get,
444-
run: __run_expand2,
418+
run,
445419
f,
446420
}
447421
}

0 commit comments

Comments
 (0)