The new formatting string syntax (`x?` and `X?`) is insta-stable in this PR because I don’t know how to change a built-in proc macro’s behavior based of a feature gate. I can look into adding that, but I also strongly suspect that keeping this feature unstable for a time period would not be useful as possibly no-one would use it during that time.
This PR does not add the new (public) `fmt::Formatter` proposed in the API because:
* There was some skepticism on response to this part of the RFC
* It is not possible to implement as-is without larger changes to `fmt`, because `Formatter` at the moment has no easy way to tell apart for example `Octal` from `Binary`: it only has a function pointer for the relevant `fmt()` method.
If some integer-like type outside of `std` want to implement this behavior, another RFC will likely need to propose a different public API for `Formatter`.
bors [Mon, 19 Mar 2018 00:02:32 +0000 (00:02 +0000)]
Auto merge of #49095 - alexcrichton:debug-asmjs, r=kennytm
Try to reduce amount of time on the asmjs builder
This PR has two commits for two separate strategies:
* First it disables optimizations for all tests, hopefully saving time by not optimizing the test code. This caused a number of run-pass tests to fail which are switched to being ignored here.
* Next it disables a number of test suites which aren't asm.js specific and already run elsewhere
bors [Sat, 17 Mar 2018 23:22:57 +0000 (23:22 +0000)]
Auto merge of #48842 - petrochenkov:under, r=nikomatsakis
syntax: Make `_` a reserved identifier
Why:
- Lexically `_` is an identifier.
- Internally it makes implementation of `use Trait as _;` (https://github.com/rust-lang/rust/issues/48216) and some other things cleaner.
- We prevent the externally observable effect of `_` being accepted by macros expecting `ident` by treating `_` specially in the `ident` matcher:
```rust
macro_rules! m {
($i: ident) => { let $i = 10; }
}
kennytm [Sat, 17 Mar 2018 09:20:47 +0000 (17:20 +0800)]
Rollup merge of #49077 - sinkuu:macro_use_typo, r=estebank
Checks for unknown attributes before aborting due to unresolved macros
Fixes #49074
The ``attribute `...` is currently unknown to the compiler`` error was not shown if there are any unresolved macros, which might be caused by mistyped `macro_use`.
These produce better code that what we are currently producing in `stdsimd`, but the code is still not optimal due to this LLVM bug: https://bugs.llvm.org/show_bug.cgi?id=36702
kennytm [Sat, 17 Mar 2018 09:20:41 +0000 (17:20 +0800)]
Rollup merge of #48943 - comex:verbose, r=kennytm
Support extra-verbose builds
- The bootstrap crate currently passes -v to Cargo if itself invoked with -vv. But Cargo supports -vv (to show build script output), so make bootstrap pass that if itself invoked with -vvv. (More specifically, pass N '-v's to Cargo if invoked with N+1 of them.)
- bootstrap.py currently tries to pass on up to two '-v's to cargo when building bootstrap, but incorrectly ('-v' is marked as 'store_true', so argparse stores either False or True, ignoring multiple '-v's). Fix this, allow passing any number of '-v's, and make it consistent with bootstrap's invocation of Cargo (i.e. subtract one from the number of '-v's).
- Also improve bootstrap.py's config.toml 'parsing' to support arbitrary verbosity levels, + allow command line to override it.
bors [Sat, 17 Mar 2018 03:15:21 +0000 (03:15 +0000)]
Auto merge of #49090 - QuietMisdreavus:test-rustdoc-again, r=Mark-Simulacrum
re-enable testing librustdoc
This was originally put in in https://github.com/rust-lang/rust/pull/44274, but https://github.com/rust-lang/rust/pull/48105 accidentally hid it. This change puts librustdoc unit/doc tests back in the main test listing.
bors [Sat, 17 Mar 2018 00:48:10 +0000 (00:48 +0000)]
Auto merge of #49088 - michaelwoerister:fix-49070, r=nikomatsakis
incr.comp.: Make sanity check in try_mark_green() aware of error conditions.
Before this PR, `DepGraph::try_mark_green()` assumed that forcing a query would always set the color of the corresponding dep-node. However, it did not take into account that queries could also fail (e.g. with a cycle error). This PR makes the method handle that condition gracefully.
The first one switches cargo from docopt to clap (
we also update to the latest calp in this repository),
the second one should help us to unify feature flags
for Cargo itself and RLS, and build Cargo libray only
once.
Alex Crichton [Fri, 16 Mar 2018 19:53:51 +0000 (12:53 -0700)]
ci: Run fewer tests on asmjs
Many tests run on the asmjs builder like compile-fail, ui, parse-fail, etc,
aren't actually specific to asm.js. Instead of running redundant test suites
this commit changes things up to only run tests that actually emit JS we then
pass to node.
Alex Crichton [Fri, 16 Mar 2018 18:42:42 +0000 (11:42 -0700)]
ci: Disable optimized tests for asm.js
Since all tests are compiled with LTO effectively in Emscripten this commit
disables optimizations to hopefully squeeze some more time out of the CI
builders.
bors [Fri, 16 Mar 2018 13:48:20 +0000 (13:48 +0000)]
Auto merge of #48896 - alexcrichton:bitcode-in-object, r=michaelwoerister
rustc: Enable embedding LLVM bitcode for iOS
This commit updates rustc to embed bitcode in each object file generated by
default when compiling for iOS. This was determined in #35968 as a step
towards better compatibility with the iOS toolchain, so let's give it a spin and
see how it turns out!
Note that this also updates the `cc` dependency which should propagate this
change of embedding bitcode for C dependencies as well.
bors [Fri, 16 Mar 2018 02:46:23 +0000 (02:46 +0000)]
Auto merge of #48524 - abonander:check-macro-stability, r=petrochenkov
check stability of macro invocations
I haven't implemented tests yet but this should be a pretty solid prototype. I think as-implemented it will also stability-check macro invocations in the same crate, dunno if we want that or not.
I don't know if we want this to go through `rustc::middle::stability` or not, considering the information there wouldn't be available at the time of macro expansion (even for external crates, right?).
r? @nrc
closes #34079
cc @petrochenkov @durka @jseyfried #38356
comex [Sun, 11 Mar 2018 23:44:05 +0000 (16:44 -0700)]
Support extra-verbose builds:
- The bootstrap crate currently passes -v to Cargo if itself invoked
with -vv. But Cargo supports -vv (to show build script output), so make
bootstrap pass that if itself invoked with -vvv. (More specifically,
pass N '-v's to Cargo if invoked with N+1 of them.)
- bootstrap.py currently tries to pass on up to two '-v's to cargo when
building bootstrap, but incorrectly ('-v' is marked as 'store_true', so
argparse stores either False or True, ignoring multiple '-v's). Fix
this, allow passing any number of '-v's, and make it consistent with
bootstrap's invocation of Cargo (i.e. subtract one from the number of
'-v's).
- Also improve bootstrap.py's config.toml 'parsing' to support arbitrary
verbosity levels, + allow command line to override it.
kennytm [Thu, 15 Mar 2018 21:38:29 +0000 (05:38 +0800)]
Rollup merge of #49049 - Centril:fix/flatten-fusediterator, r=bluss
Unstabilize FusedIterator for Flatten since Flatten is unstable
PR #47463 made `impl<I, U> FusedIterator for Flatten<I>` stable but shouldn't have since `Flatten` is still unstable. This PR makes the impl unstable again.
kennytm [Thu, 15 Mar 2018 21:36:46 +0000 (05:36 +0800)]
Rollup merge of #49050 - snf:fix_oom_asmjs, r=alexcrichton
setting ABORTING_MALLOC=0 for asmjs backend
This changes the behaviour of the allocator for asmjs backend.
It will return NULL on OOM instead of aborting and let Rust choose the behaviour.
Fixes #48968 and enables try_reserve (fallible allocation) in asmjs.
kennytm [Thu, 15 Mar 2018 17:49:50 +0000 (01:49 +0800)]
Rollup merge of #49024 - draganmladjenovic:mips64_cabi_sret, r=sanxiyn
rustc_trans: fix small aggregate returns for big-endian mips64 FFI
Current model of threating small aggregate returns as smallest encompassing integer works only for little-endian mips64.
The patch forces small aggregate return values to be viewed as one or two i64 chunks leaving to the casting implementation
to handle endianes differences.
kennytm [Thu, 15 Mar 2018 17:49:44 +0000 (01:49 +0800)]
Rollup merge of #48959 - alexcrichton:signext, r=eddyb
rustc: Start a custom cabi module for wasm32
It actually was already using the `cabi_asmjs` module but that was by accident,
so route the new `wasm32-unknown-unknown` target to a new `cabi_wasm32` module.
The first entries in this module are to use `signext` and `zeroext` for types
that are under 32 bytes in size
kennytm [Thu, 15 Mar 2018 17:49:41 +0000 (01:49 +0800)]
Rollup merge of #48892 - alexcrichton:thinlto-again, r=Mark-Simulacrum
rustbuild: Remove ThinLTO-related configuration
This commit removes some ThinLTO/codegen unit cruft primarily only needed during
the initial phase where we were adding ThinLTO support to rustc itself. The
current bootstrap compiler knows about ThinLTO and has it enabled by default for
multi-CGU builds which are also enabled by default. One CGU builds (aka
disabling ThinLTO) can be achieved by configuring the number of codegen units to
1 for a particular builds.
This also changes the defaults for our dist builders to go back to multiple
CGUs. Unfortunately we're seriously bleeding for cycle time on the bots right
now so we need to recover any time we can.
kennytm [Thu, 15 Mar 2018 17:49:38 +0000 (01:49 +0800)]
Rollup merge of #48706 - ehuss:main-not-found-in-crate, r=estebank
Add crate name to "main function not found" error message.
Fixes #44798 and rust-lang/cargo#4948.
I was wondering if it might be cleaner to update the ui tests to add a simple `fn main() {}` for the unrelated tests. Let me know if you would prefer that.
bors [Thu, 15 Mar 2018 16:00:40 +0000 (16:00 +0000)]
Auto merge of #47813 - kennytm:stable-incl-range, r=nrc
Stabilize inclusive range (`..=`)
Stabilize the followings:
* `inclusive_range` — The `std::ops::RangeInclusive` and `std::ops::RangeInclusiveTo` types, except its fields (tracked by #49022 separately).
* `inclusive_range_syntax` — The `a..=b` and `..=b` expression syntax
* `dotdoteq_in_patterns` — Using `a..=b` in a pattern
kennytm [Fri, 2 Mar 2018 22:05:54 +0000 (06:05 +0800)]
Disallow &a..=b and box a..=b in pattern.
They are disallowed because they have different precedence than
expressions. I assume parenthesis in pattern will be soon stabilized and
thus write that as suggestion directly.
bors [Thu, 15 Mar 2018 08:18:58 +0000 (08:18 +0000)]
Auto merge of #48648 - snf:fallible_allocation, r=Kimundi
Fallible allocation
Implementing RFC#2116 [Fallible Allocation](https://github.com/rust-lang/rust/issues/48043) .
Work in progress. Initially adding @Gankro's try_reserve for Vec.
This stabilizes `!`, removing the feature gate as well as the old defaulting-to-`()` behavior. The pattern exhaustiveness checks which were covered by `feature(never_type)` have been moved behind a new `feature(exhaustive_patterns)` gate.