Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #64944

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2cb460e
Use `saturating_sub` where applicable
AnthonyMikh Sep 25, 2019
e9a93be
Use `max` instead of `if`s
AnthonyMikh Sep 25, 2019
4fc5650
Simplify Unicode-aware trimming
AnthonyMikh Sep 25, 2019
d6327e8
Use map + sum instead of fold for computing Unicode width
AnthonyMikh Sep 25, 2019
aef169b
Use Option::map_or where applicable
AnthonyMikh Sep 25, 2019
9b447e2
Unify order of variables in chained comparison
AnthonyMikh Sep 25, 2019
f93827f
Simplify `Emitter::fix_multispan_in_std_macros`
AnthonyMikh Sep 25, 2019
ea32862
Use `sort_by_key` rather than `sort_by`
AnthonyMikh Sep 25, 2019
7a0725f
Simplify `style_or_override`
AnthonyMikh Sep 25, 2019
75a7c27
Revert "Simplify Unicode-aware trimming"
AnthonyMikh Sep 26, 2019
3eba6c1
syntax: recover trailing `|` in or-patterns.
Centril Sep 29, 2019
d938a80
Fixed grammar for some `time` fn calls and a diagnostic.
alexreg Sep 30, 2019
fdd1a62
Added backticks for one diagnostic message.
alexreg Sep 30, 2019
8a4af2f
Fixed weird non-sequential indices for serialisation of `SourceFile` …
alexreg Sep 30, 2019
13b61b5
Fixed grammar in one diagnostic and blessed tests.
alexreg Sep 29, 2019
49c6c86
Fixed stylistic convention for one diagnostic and blessed tests.
alexreg Sep 30, 2019
33ed03f
Cleaned up a few doc comments in libfmt_macros.
alexreg Sep 30, 2019
349259d
Stabilize macros in `extern` blocks
petrochenkov Aug 26, 2019
5ae38bb
Stabilize proc macros in type positions
petrochenkov Aug 27, 2019
b04d5f7
Upgrade Emscripten targets to use upstream LLVM backend
tlively Aug 17, 2019
535d474
syntax: Split `ast::Attribute` into container and inner parts
petrochenkov Aug 17, 2019
576c215
Add test for #50571
JohnTitor Sep 30, 2019
bc25746
Add test for #58022
JohnTitor Sep 30, 2019
9c73131
Add test for #58344
JohnTitor Sep 30, 2019
957986d
syntax: Support modern attribute syntax in the `meta` matcher
petrochenkov Aug 17, 2019
870b47f
typeck: silence unreachable code from await
davidtwco Sep 30, 2019
7dc953b
Simplify code for special case of annotation
AnthonyMikh Sep 30, 2019
6b6a79b
Simplify `EmitterWriter::get_multispan_max_line_num`
AnthonyMikh Sep 30, 2019
7b4c5c6
Simplify `EmitterWriter::get_max_line_num`
AnthonyMikh Sep 30, 2019
21724ed
Update doc comment for `style_or_override`
AnthonyMikh Sep 30, 2019
7a807c5
Simplify `EmitterWriter::emit_suggestion_default`
AnthonyMikh Sep 30, 2019
9d73176
Remove redundant `.iter_mut()`
AnthonyMikh Sep 30, 2019
55b5428
Simplify a conditional in `collect_annotations`
AnthonyMikh Sep 30, 2019
6ea4a52
Address review comments
petrochenkov Sep 30, 2019
bb44288
Use pattern matching instead of indexing tuples
AnthonyMikh Sep 30, 2019
e5db5b3
(fmt) remove trailing whitespaces
AnthonyMikh Sep 30, 2019
61bc38e
Fix errors
AnthonyMikh Sep 30, 2019
515262c
Ascript type explicitly
AnthonyMikh Sep 30, 2019
fdce416
Hint type for `.sum()`
AnthonyMikh Oct 1, 2019
50c2a58
Fix borrowck errors
AnthonyMikh Oct 1, 2019
13e9b3d
Deduplicate closure type errors
estebank Oct 1, 2019
2aafa46
Rollup merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexc…
Centril Oct 1, 2019
3ca5804
Rollup merge of #63674 - petrochenkov:meta2, r=Centril
Centril Oct 1, 2019
8bae91d
Rollup merge of #63931 - petrochenkov:stabmac, r=Centril
Centril Oct 1, 2019
8206e61
Rollup merge of #64887 - Centril:recover-trailing-vert, r=estebank
Centril Oct 1, 2019
857b2b9
Rollup merge of #64907 - alexreg:tidy-up, r=Mark-Simulacrum
Centril Oct 1, 2019
0aaab33
Rollup merge of #64928 - JohnTitor:add-some-tests, r=Centril
Centril Oct 1, 2019
cac592f
Rollup merge of #64930 - davidtwco:issue-61798-diverging-await, r=pet…
Centril Oct 1, 2019
3ff0f33
Rollup merge of #64935 - AnthonyMikh:librustc_errors/emmiter__code-cl…
Centril Oct 1, 2019
7ca64cc
Rollup merge of #64937 - estebank:dedup-closure-err, r=Centril
Centril Oct 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@
# but you can also optionally enable the "emscripten" backend for asm.js or
# make this an empty array (but that probably won't get too far in the
# bootstrap)
# FIXME: remove the obsolete emscripten backend option.
#codegen-backends = ["llvm"]

# This is the name of the directory in which codegen backends will get installed
Expand Down
6 changes: 2 additions & 4 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,9 @@ impl Step for Compiletest {

// Also provide `rust_test_helpers` for the host.
builder.ensure(native::TestHelpers { target: compiler.host });
// As well as the target
builder.ensure(native::TestHelpers { target });

// wasm32 can't build the test helpers
if !target.contains("wasm32") {
builder.ensure(native::TestHelpers { target });
}
builder.ensure(RemoteCopyLibs { compiler, target });

let mut cmd = builder.tool_cmd(Tool::Compiletest);
Expand Down
30 changes: 10 additions & 20 deletions src/ci/docker/asmjs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
sudo \
gdb \
xz-utils
xz-utils \
bzip2

COPY scripts/emscripten.sh /scripts/
RUN bash /scripts/emscripten.sh
Expand All @@ -20,28 +21,17 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV PATH=$PATH:/emsdk-portable
ENV PATH=$PATH:/emsdk-portable/clang/e1.38.15_64bit/
ENV PATH=$PATH:/emsdk-portable/emscripten/1.38.15/
ENV PATH=$PATH:/emsdk-portable/node/8.9.1_64bit/bin/
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.38.15/
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.38.15_64bit/binaryen/
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
ENV EM_CONFIG=/emsdk-portable/.emscripten

ENV TARGETS=asmjs-unknown-emscripten

ENV RUST_CONFIGURE_ARGS --enable-emscripten --disable-optimize-tests
# TODO: Run run-fail, libcore, libstd, etc. once exceptions are enabled
ENV SCRIPT python2.7 ../x.py test --target $TARGETS src/test/ui

ENV SCRIPT python2.7 ../x.py test --target $TARGETS \
src/test/ui \
src/test/run-fail \
src/libstd \
src/liballoc \
src/libcore

# Debug assertions in rustc are largely covered by other builders, and LLVM
# assertions cause this builder to slow down by quite a large amount and don't
# buy us a huge amount over other builders (not sure if we've ever seen an
# asmjs-specific backend assertion trip), so disable assertions for these
# tests.
ENV NO_LLVM_ASSERTIONS=1
# This is almost identical to the wasm32-unknown-emscripten target, so
# running with assertions again is not useful
ENV NO_DEBUG_ASSERTIONS=1
ENV NO_LLVM_ASSERTIONS=1
35 changes: 0 additions & 35 deletions src/ci/docker/disabled/wasm32-exp/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions src/ci/docker/disabled/wasm32-exp/node.sh

This file was deleted.

16 changes: 8 additions & 8 deletions src/ci/docker/disabled/wasm32/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
sudo \
gdb \
xz-utils
xz-utils \
bzip2

# emscripten
COPY scripts/emscripten.sh /scripts/
RUN bash /scripts/emscripten.sh

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV PATH=$PATH:/emsdk-portable
ENV PATH=$PATH:/emsdk-portable/clang/e1.38.15_64bit/
ENV PATH=$PATH:/emsdk-portable/emscripten/1.38.15/
ENV PATH=$PATH:/emsdk-portable/node/8.9.1_64bit/bin/
ENV EMSCRIPTEN=/emsdk-portable/emscripten/1.38.15/
ENV BINARYEN_ROOT=/emsdk-portable/clang/e1.38.15_64bit/binaryen/
ENV PATH=$PATH:/emsdk-portable/upstream/emscripten/
ENV PATH=$PATH:/emsdk-portable/node/12.9.1_64bit/bin/
ENV BINARYEN_ROOT=/emsdk-portable/upstream/
ENV EM_CONFIG=/emsdk-portable/.emscripten

ENV TARGETS=wasm32-unknown-emscripten
ENV SCRIPT python2.7 ../x.py test --target $TARGETS

# TODO: Run run-fail, libcore, libstd, etc. once exceptions are enabled
ENV SCRIPT python2.7 ../x.py test --target $TARGETS src/test/ui
37 changes: 0 additions & 37 deletions src/ci/docker/scripts/emscripten-wasm.sh

This file was deleted.

11 changes: 3 additions & 8 deletions src/ci/docker/scripts/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@ exit 1
set -x
}

cd /
curl -fL https://mozilla-games.s3.amazonaws.com/emscripten/releases/emsdk-portable.tar.gz | \
tar -xz

git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
cd /emsdk-portable
./emsdk update
hide_output ./emsdk install sdk-1.38.15-64bit
./emsdk activate sdk-1.38.15-64bit
hide_output ./emsdk install 1.38.46-upstream
./emsdk activate 1.38.46-upstream

# Compile and cache libc
source ./emsdk_env.sh
echo "main(){}" > a.c
HOME=/emsdk-portable/ emcc a.c
HOME=/emsdk-portable/ emcc -s BINARYEN=1 a.c
rm -f a.*

# Make emsdk usable by any user
Expand Down
56 changes: 18 additions & 38 deletions src/libcore/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ impl fmt::Debug for c_void {
/// Basic implementation of a `va_list`.
// The name is WIP, using `VaListImpl` for now.
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
not(target_arch = "x86_64"), not(target_arch = "asmjs")),
not(target_arch = "x86_64")),
all(target_arch = "aarch64", target_os = "ios"),
target_arch = "wasm32",
target_arch = "asmjs",
windows))]
#[repr(transparent)]
#[unstable(feature = "c_variadic",
Expand All @@ -67,8 +69,10 @@ pub struct VaListImpl<'f> {
}

#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
not(target_arch = "x86_64"), not(target_arch = "asmjs")),
not(target_arch = "x86_64")),
all(target_arch = "aarch64", target_os = "ios"),
target_arch = "wasm32",
target_arch = "asmjs",
windows))]
#[unstable(feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
Expand Down Expand Up @@ -137,38 +141,6 @@ pub struct VaListImpl<'f> {
_marker: PhantomData<&'f mut &'f c_void>,
}

/// asm.js ABI implementation of a `va_list`.
// asm.js uses the PNaCl ABI, which specifies that a `va_list` is
// an array of 4 32-bit integers, according to the old PNaCl docs at
// https://web.archive.org/web/20130518054430/https://www.chromium.org/nativeclient/pnacl/bitcode-abi#TOC-Derived-Types
// and clang does the same in `CreatePNaClABIBuiltinVaListDecl` from `lib/AST/ASTContext.cpp`
#[cfg(all(target_arch = "asmjs", not(windows)))]
#[repr(C)]
#[unstable(feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930")]
#[lang = "va_list"]
pub struct VaListImpl<'f> {
inner: [crate::mem::MaybeUninit<i32>; 4],
_marker: PhantomData<&'f mut &'f c_void>,
}

#[cfg(all(target_arch = "asmjs", not(windows)))]
#[unstable(feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930")]
impl<'f> fmt::Debug for VaListImpl<'f> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
unsafe {
write!(f, "va_list* [{:#x}, {:#x}, {:#x}, {:#x}]",
self.inner[0].read(), self.inner[1].read(),
self.inner[2].read(), self.inner[3].read())
}
}
}

/// A wrapper for a `va_list`
#[repr(transparent)]
#[derive(Debug)]
Expand All @@ -178,23 +150,29 @@ impl<'f> fmt::Debug for VaListImpl<'f> {
issue = "44930")]
pub struct VaList<'a, 'f: 'a> {
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
not(target_arch = "x86_64"), not(target_arch = "asmjs")),
not(target_arch = "x86_64")),
all(target_arch = "aarch64", target_os = "ios"),
target_arch = "wasm32",
target_arch = "asmjs",
windows))]
inner: VaListImpl<'f>,

#[cfg(all(any(target_arch = "aarch64", target_arch = "powerpc",
target_arch = "x86_64", target_arch = "asmjs"),
target_arch = "x86_64"),
any(not(target_arch = "aarch64"), not(target_os = "ios")),
not(target_arch = "wasm32"),
not(target_arch = "asmjs"),
not(windows)))]
inner: &'a mut VaListImpl<'f>,

_marker: PhantomData<&'a mut VaListImpl<'f>>,
}

#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
not(target_arch = "x86_64"), not(target_arch = "asmjs")),
not(target_arch = "x86_64")),
all(target_arch = "aarch64", target_os = "ios"),
target_arch = "wasm32",
target_arch = "asmjs",
windows))]
#[unstable(feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
Expand All @@ -212,8 +190,10 @@ impl<'f> VaListImpl<'f> {
}

#[cfg(all(any(target_arch = "aarch64", target_arch = "powerpc",
target_arch = "x86_64", target_arch = "asmjs"),
target_arch = "x86_64"),
any(not(target_arch = "aarch64"), not(target_os = "ios")),
not(target_arch = "wasm32"),
not(target_arch = "asmjs"),
not(windows)))]
#[unstable(feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
Expand Down
16 changes: 0 additions & 16 deletions src/libcore/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,24 +114,8 @@ pub fn black_box<T>(dummy: T) -> T {
// this. LLVM's intepretation of inline assembly is that it's, well, a black
// box. This isn't the greatest implementation since it probably deoptimizes
// more than we want, but it's so far good enough.
#[cfg(not(any(
target_arch = "asmjs",
all(
target_arch = "wasm32",
target_os = "emscripten"
)
)))]
unsafe {
asm!("" : : "r"(&dummy));
return dummy;
}

// Not all platforms support inline assembly so try to do something without
// inline assembly which in theory still hinders at least some optimizations
// on those targets. This is the "best effort" scenario.
unsafe {
let ret = crate::ptr::read_volatile(&dummy);
crate::mem::forget(dummy);
ret
}
}
6 changes: 3 additions & 3 deletions src/libfmt_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl<'a> Parser<'a> {
&self.input[start..self.input.len()]
}

/// Parses an Argument structure, or what's contained within braces inside the format string
/// Parses an `Argument` structure, or what's contained within braces inside the format string.
fn argument(&mut self) -> Argument<'a> {
let pos = self.position();
let format = self.format();
Expand Down Expand Up @@ -464,7 +464,7 @@ impl<'a> Parser<'a> {
}

/// Parses a format specifier at the current position, returning all of the
/// relevant information in the FormatSpec struct.
/// relevant information in the `FormatSpec` struct.
fn format(&mut self) -> FormatSpec<'a> {
let mut spec = FormatSpec {
fill: None,
Expand Down Expand Up @@ -571,7 +571,7 @@ impl<'a> Parser<'a> {
spec
}

/// Parses a Count parameter at the current position. This does not check
/// Parses a `Count` parameter at the current position. This does not check
/// for 'CountIsNextParam' because that is only used in precision, not
/// width.
fn count(&mut self, start: usize) -> (Count, Option<InnerSpan>) {
Expand Down
6 changes: 4 additions & 2 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,12 @@ impl<'a> LoweringContext<'a> {
// lower attributes (we use the AST version) there is nowhere to keep
// the `HirId`s. We don't actually need HIR version of attributes anyway.
Attribute {
item: AttrItem {
path: attr.path.clone(),
tokens: self.lower_token_stream(attr.tokens.clone()),
},
id: attr.id,
style: attr.style,
path: attr.path.clone(),
tokens: self.lower_token_stream(attr.tokens.clone()),
is_sugared_doc: attr.is_sugared_doc,
span: attr.span,
}
Expand Down
Loading