Commit Graph

86774 Commits

Author SHA1 Message Date
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
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
Eduard-Mihai Burtescu
f083c32da7 tests: support cross-compilation in run-make/rustc-macro-dep-files. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
15c77caf59 bootstrap: ensure that libproc_macro is available on the host for tests even when cross-compiling. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
3369929ddb tests: use force-host and no-prefer-dynamic in all proc_macro tests. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
fcca22cb40 tests: move all proc_macro tests from -fulldeps. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
d3ab4a74ef tests: remove ignore-stage1 where possible in proc_macro tests. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
188d2dafcd Statically link proc_macro into proc macros. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
67afeef9e4 proc_macro: move to a dependency of libtest. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
8cf463bcff proc_macro: move the rustc server to syntax_ext. 2018-11-30 06:15:19 +02:00
Eduard-Mihai Burtescu
38fee305da proc_macro: remove the __internal module. 2018-11-30 06:15:19 +02:00
Eduard-Mihai Burtescu
e305994beb proc_macro: introduce a "bridge" between clients (proc macros) and servers (compiler front-ends). 2018-11-30 06:15:19 +02:00
Alexander Regueiro
5f19cdc4f8 Changed test for issue 56202 to compile-pass. 2018-11-30 03:12:10 +00:00
Esteban Küber
027bf8b4de Use opt_def_id instead of having special branch 2018-11-30 03:12:10 +00:00
Esteban Küber
c144dc07e3 Fix ICE with feature self_struct_ctor 2018-11-30 03:12:10 +00:00
Dan Robertson
a0fec9488e
Fix panic with outlives in existential type
Don't panic in determining the privacy of a type if a lifetime outlives
generic exists in an existential type.
2018-11-30 02:04:10 +00:00
Nikita Popov
cbf748993f Enable -mergefunc-use-aliases
If the Rust LLVM fork is used, enable the -mergefunc-use-aliases
flag, which will create aliases for merged functions, rather than
inserting a call from one to the other.

A number of codegen tests needed to be adjusted, because functions
that previously fell below the thunk limit are now being merged.
Merging is prevented either using -C no-prepopulate-passes, or by
making the functions non-identical.

I expect that this is going to break something, somewhere, because
it isn't able to deal with aliases properly, but we won't find out
until we try :)

This fixes #52651.
2018-11-30 00:52:16 +01:00
Vitaly _Vi Shukela
f18a8c6163
Fix exceeding line width limit 2018-11-30 02:37:04 +03:00
Vitaly _Vi Shukela
d3f9788e59
panic_immediate_abort: Fix issues from review 2018-11-30 02:17:05 +03:00
Alex Crichton
225140ed21 Optimize local linkchecker program
I noticed on a [recent build][1] that the linkchecker stage of CI took a
whopping 15 minutes of CI time for something that should be near
instantaneous. Some local profiling showed some very hot functions and
clones which were pretty easy to remove, and now instead of running in
minutes locally it runs in seconds.

[1]: https://ci.appveyor.com/project/rust-lang/rust/build/job/kptifw1kb1nm4xuu
2018-11-29 15:02:06 -08:00
Vitaly _Vi Shukela
fdef3848a0
Add libstd and libcore Cargo features "panic_immediate_abort"
It stop asserts and panics from libstd to automatically
include string output and formatting code.

Use case: developing static executables smaller than 50 kilobytes,
where usual formatting code is excessive while keeping debuggability
in debug mode.

May resolve #54981.
2018-11-30 00:56:41 +03:00
John Kåre Alsaker
4cce4ffdef Add inline attributes and add unit to CommonTypes 2018-11-29 22:11:02 +01:00
varkor
1cdf5df451 Fix error message after rebase 2018-11-29 21:00:11 +00:00
varkor
46ef9f820c Fix broken tests 2018-11-29 20:58:38 +00:00
varkor
32a8dec889 Clarify undecided semantics 2018-11-29 20:58:38 +00:00
varkor
d2b340758b Add a test for uninhabitedness changes 2018-11-29 20:58:37 +00:00
varkor
682f0f8d80 Consider references and unions potentially inhabited during privacy-respecting inhabitedness checks 2018-11-29 20:58:37 +00:00
scalexm
1fce415649 Correctly generalize inference variables in nll_relate 2018-11-29 21:57:40 +01:00
scalexm
c805e817a9 Fix doc comments 2018-11-29 21:57:40 +01:00
scalexm
b2b82f790b Implement AggregateOps
`make_solution` does not return any guidance for now
2018-11-29 21:57:40 +01:00
scalexm
0169dc3f36 Implement ResolventOps 2018-11-29 21:57:40 +01:00
scalexm
3b2cfc510b Handle inference variables in nll_relate and use it for chalk 2018-11-29 21:57:34 +01:00
David Wood
0124341935
Only consider stem when extension is exe.
This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.
2018-11-29 20:47:59 +01:00
bors
3e90a12a8a Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddyb
libcore: Add VaList and variadic arg handling intrinsics

## Summary

 - Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`.
 - Add `core::va_list::VaList` to `libcore`.

Part 1 of (at least) 3 for #44930

Comments and critiques are very much welcomed 😄
2018-11-29 19:28:21 +00:00
bjorn3
d108a913c7 Move get_static from CodegenCx to Builder 2018-11-29 18:19:44 +01:00
bjorn3
ceb29e2ac4 Use implicit deref instead of BuilderMethods::cx() 2018-11-29 18:19:44 +01:00
bjorn3
e45733048e Require Deref to CodegenCx for HasCodegen 2018-11-29 18:19:44 +01:00
bjorn3
f47505e867 Rename static_bitcast to const_bitcast 2018-11-29 18:19:43 +01:00
bjorn3
e8da3c6c32 Remove static_addr_of_mut from cg_ssa 2018-11-29 18:19:43 +01:00