87819 Commits

Author SHA1 Message Date
kennytm
45aaaa70bb
Rollup merge of #56355 - Zoxc:inline-things, r=michaelwoerister
Add inline attributes and add unit to CommonTypes
2018-12-01 02:03:51 +08:00
kennytm
cb9add6303
Rollup merge of #56349 - davidtwco:issue-55396-inference-extension, r=nagisa
rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker

Part of #55396.

This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.

r? @nagisa
cc @alexcrichton @japaric
2018-12-01 02:03:49 +08:00
kennytm
540f4cfa71
Rollup merge of #56341 - frewsxcv:frewsxcv-util-cstr, r=Mark-Simulacrum
Rename conversion util; remove duplicate util in librustc_codegen_llvm.
2018-12-01 02:03:47 +08:00
kennytm
78c598a7a2
Rollup merge of #56339 - yui-knk:remove_mir_stats_flag, r=alexcrichton
Remove not used option

`mir_stats` has not been used since 2b32cb90c72d90c722d56324ca0ea9f748ebf4e1.
2018-12-01 02:03:45 +08:00
kennytm
bdb901c865
Rollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakis
Clean up and streamline the pretty-printer

Some minor improvements.
2018-12-01 02:03:43 +08:00
kennytm
ce00a8dd4d
Rollup merge of #56268 - nnethercote:fold_opt_expr-recycle, r=petrochenkov
Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.

This requires adding a new method, `P::filter_map`.

This commit reduces instruction counts for various benchmarks by up to
0.7%.
2018-12-01 02:03:41 +08:00
kennytm
f7c407eb8b
Rollup merge of #56216 - SimonSapin:array-tryfrom-slice, r=withoutboats
Add TryFrom<&[T]> for [T; $N] where T: Copy

`TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists, but not needing to dereference makes type inference easier for example when using `u32::from_be_bytes`.

Also add doc examples doing just that.
2018-12-01 01:53:15 +08:00
kennytm
c3950c84c0
Rollup merge of #56131 - ljedrz:assorted, r=RalfJung
Assorted tweaks

- preallocate `VecDeque` in `Decodable::decode` (as it is done with other collections which can do it)
- add a FIXME to `String::from_utf16`

r? @RalfJung
2018-12-01 01:05:51 +08:00
kennytm
e40f37e39d
Rollup merge of #56014 - euclio:issue-21335, r=nagisa
add test for issue #21335

Running this test with LLVM assertions enabled doesn't seem to trigger an assertion on my Mac.

Fixes #21335.
2018-12-01 01:05:50 +08:00
kennytm
b8198da4d2
Rollup merge of #55821 - ljedrz:cached_key_sorts, r=michaelwoerister
Use sort_by_cached_key when the key function is not trivial/free

I'm not 100% sure about `def_path_hash` (everything it does is inlined) but it seems like a good idea at least for the rest, as they are cloning.
2018-12-01 01:05:48 +08:00
Alexander Regueiro
a8248976fd Moved feature-gate tests to correct dir. 2018-11-30 15:48:16 +00:00
Alexander Regueiro
24717fdaa1 Updated ui tests. 2018-11-30 15:42:57 +00:00
Alexander Regueiro
d49a8d558f Removed feature gate. 2018-11-30 15:42:43 +00:00
ljedrz
ca0806c703 arena: speed up TypedArena::clear 2018-11-30 16:36:20 +01:00
Steve Klabnik
934871aa79 Add the edition guide to doc.rust-lang.org 2018-11-30 09:36:49 -05:00
Steve Klabnik
4c34404940 update nomicon 2018-11-30 09:29:36 -05:00
Daan de Graaf
1560a75f6a Refer to the second borrow as the "second borrow". 2018-11-30 14:55:51 +01:00
varkor
4fc5758a67 Update existing tests with more precise error messages 2018-11-30 13:53:15 +00:00
varkor
e018268ffa Add precise_pointer_size_matching feature 2018-11-30 10:41:09 +00:00
varkor
f1f6d87eab Stabilise exhaustive_integer_patterns 2018-11-30 10:40:59 +00:00
Oliver Scherer
e6e08c666c Fix rebase fallout 2018-11-30 09:44:51 +01:00
Oliver Scherer
9d2f97be78 Test float assign ops 2018-11-30 09:44:16 +01:00
Oliver Scherer
42e5317f1d Add trailing newline 2018-11-30 09:44:16 +01:00
Oliver Scherer
172b428881 Re-add accidentally deleted test 2018-11-30 09:44:16 +01:00
Oliver Scherer
25d1c073d1 Remove unused feature gate from libcore 2018-11-30 09:44:16 +01:00
Oliver Scherer
ac47bd725f Fix a compile-fail test 2018-11-30 09:44:15 +01:00
Oliver Scherer
16d2a92b3d Improve the diagnostic message 2018-11-30 09:44:15 +01:00
Oliver Scherer
8937faa837 Reenable const_let feature gate 2018-11-30 09:44:15 +01:00
Oliver Scherer
866664c8bb Add a test for single variant matches 2018-11-30 09:44:06 +01:00
Oliver Scherer
d8ece188b8 Improve the error around short circuiting and let bindings 2018-11-30 09:44:06 +01:00
Oliver Scherer
75ce28a974 Show auto-applicable correction warning for short circuiting in constants 2018-11-30 09:44:06 +01:00
Oliver Scherer
507ea97a3e Properly name the flag for && -> & conversion 2018-11-30 09:44:06 +01:00
Oliver Scherer
d62bcad38d Allow let bindings everywhere 2018-11-30 09:44:06 +01:00
Oliver Scherer
7ec3c10d7e Add tests for mutable borrows 2018-11-30 09:43:41 +01:00
Oliver Scherer
59c6c4942a Also test the const_let feature gate in statics 2018-11-30 09:43:41 +01:00
Oliver Scherer
ef38afc83d Add a test for various const let features 2018-11-30 09:43:41 +01:00
Oliver Scherer
52b67b1766 Remove a bunch of now-unnecessary const_let feature gates 2018-11-30 09:43:41 +01:00
Oliver Scherer
df2123cff2 Update compile-fail test 2018-11-30 09:43:41 +01:00
Oliver Scherer
dba5ba02f7 Update a test's diagnostics 2018-11-30 09:43:41 +01:00
Oliver Scherer
4d2bed9460 Stabilize const_let inside const functions 2018-11-30 09:43:41 +01:00
Philipp Hansch
247ab49668
Pacify tidy 2018-11-30 08:45:15 +01:00
Philipp Hansch
9b847f0f96
Fix const_fn ICE with non-const function pointer 2018-11-30 08:43:50 +01:00
John Kåre Alsaker
946ea1453d Inline things 2018-11-30 08:14:22 +01:00
bors
d48ab693d1 Auto merge of #49219 - eddyb:proc-macro-decouple, r=alexcrichton
Decouple proc_macro from the rest of the compiler.

This PR removes all dependencies of `proc_macro` on compiler crates and allows multiple copies of `proc_macro`, built even by different compilers (but from the same source), to interoperate.

Practically, it allows:
* running proc macro tests at stage1 (I moved most from `-fulldeps` to the regular suites)
* using proc macros in the compiler itself (may require some rustbuild trickery)

On the server (i.e. compiler front-end) side:
* `server::*` traits are implemented to provide the concrete types and methods
  * the concrete types are completely separated from the `proc_macro` public API
  * the only use of the type implementing `Server` is to be passed to `Client::run`

On the client (i.e. proc macro) side (potentially using a different `proc_macro` instance!):
* `client::Client` wraps around client-side (expansion) function pointers
  * it encapsulates the `proc_macro` instance used by the client
  * its `run` method can be called by a server, to execute the client-side function
    * the client instance is bridged to the provided server, while it runs
    * ~~currently a thread is spawned, could use process isolation in the future~~
(not the case anymore, see #56058)
* proc macro crates get a generated `static` holding a `&[ProcMacro]`
  * this describes all derives/attr/bang proc macros, replacing the "registrar" function
  * each variant of `ProcMacro` contains an appropriately typed `Client<fn(...) -> ...>`

`proc_macro` public APIs call into the server via an internal "bridge":
* only a currently running proc macro `Client` can interact with those APIs
  * server code might not be able to (if it uses a different `proc_macro` instance)
    * however, it can always create and `run` its own `Client`, but that may be inefficient
* the `bridge` uses serialization, C ABI and integer handles to avoid Rust ABI instability
* each invocation of a proc macro results in disjoint integers in its `proc_macro` handles
  * this prevents using values of those types across invocations (if they even can be kept)

r? @alexcrichton cc @jseyfried @nikomatsakis @Zoxc @thepowersgang
2018-11-30 06:44:14 +00:00
Eduard-Mihai Burtescu
3a04d448f9 bootstrap: provide host rust_test_helpers to compiletest, not just target. 2018-11-30 06:21:18 +02:00
Eduard-Mihai Burtescu
840c3010f5 tests: ignore wasm32 for run-pass/proc-macro/expand-with-a-macro. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
dcf736d7ad tests: use alloc instead of libc in unnecessary-extern-crate, to make it work on wasm. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
f385589dde compiletest: don't pass -Clinker when // force-host was requested. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
b4e504f5b8 tests: use a #![no_std] target crate in run-make/rustc-macro-dep-files. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
eb2c71cdf2 bootstrap: don't use libraries from MUSL_ROOT on non-musl targets. 2018-11-30 06:15:20 +02:00