bors [Sat, 1 Dec 2018 03:04:12 +0000 (03:04 +0000)]
Auto merge of #56391 - alexcrichton:less-compare-mode, r=Mark-Simulacrum
ci: Only run compare-mode tests on one builder
The run-pass test suite currently takes 30 minutes on Windows, and
that appears to be roughly split between two 15 minute runs of the test
suite: one without NLL and one with NLL. In discussion on Discord the
platform coverage of the NLL compare mode may not necessarily be worth
it, so this commit removes the NLL compare mode from tests by default,
and then reenables it on only one builder.
Alex Crichton [Fri, 30 Nov 2018 22:31:04 +0000 (14:31 -0800)]
ci: Only run compare-mode tests on one builder
The run-pass test suite currently takes 30 minutes on Windows, and
that appears to be roughly split between two 15 minute runs of the test
suite: one without NLL and one with NLL. In discussion on Discord the
platform coverage of the NLL compare mode may not necessarily be worth
it, so this commit removes the NLL compare mode from tests by default,
and then reenables it on only one builder.
bors [Fri, 30 Nov 2018 19:24:17 +0000 (19:24 +0000)]
Auto merge of #56381 - kennytm:rollup, r=kennytm
Rollup of 19 pull requests
Successful merges:
- #55011 (Add libstd Cargo feature "panic_immediate_abort")
- #55821 (Use sort_by_cached_key when the key function is not trivial/free)
- #56014 (add test for issue #21335)
- #56131 (Assorted tweaks)
- #56214 (Implement chalk unification routines)
- #56216 (Add TryFrom<&[T]> for [T; $N] where T: Copy)
- #56268 (Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.)
- #56324 (Use raw_entry for more efficient interning)
- #56336 (Clean up and streamline the pretty-printer)
- #56337 (Fix const_fn ICE with non-const function pointer)
- #56339 (Remove not used option)
- #56341 (Rename conversion util; remove duplicate util in librustc_codegen_llvm.)
- #56349 (rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker)
- #56355 (Add inline attributes and add unit to CommonTypes)
- #56360 (Optimize local linkchecker program)
- #56364 (Fix panic with outlives in existential type)
- #56365 (Stabilize self_struct_ctor feature.)
- #56367 (Moved some feature gate tests to correct location)
- #56373 (Update books)
kennytm [Fri, 30 Nov 2018 18:31:12 +0000 (02:31 +0800)]
Rollup merge of #56214 - scalexm:unification, r=nikomatsakis
Implement chalk unification routines
`ResolventOps` and `AggregateOps` are mostly straightforwardly translated from chalk. I had caught a few bugs already in my `chalk` branch and backported fixes to this branch, but there may be other ones left. EDIT: I hope there are none left now :)
kennytm [Fri, 30 Nov 2018 17:06:06 +0000 (01:06 +0800)]
Rollup merge of #56360 - alexcrichton:linkchecker-omg, r=pietroalbini
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.
kennytm [Fri, 30 Nov 2018 17:05:54 +0000 (01:05 +0800)]
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`.
bors [Fri, 30 Nov 2018 06:44:14 +0000 (06:44 +0000)]
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
Alex Crichton [Thu, 29 Nov 2018 23:02:06 +0000 (15:02 -0800)]
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.
bors [Thu, 29 Nov 2018 12:23:05 +0000 (12:23 +0000)]
Auto merge of #56340 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 22 pull requests
Successful merges:
- #55391 (bootstrap: clean up a few clippy findings)
- #56021 (avoid features_untracked)
- #56023 (atomic::Ordering: Get rid of misleading parts of intro)
- #56080 (Reduce the amount of bold text at doc.rlo)
- #56114 (Enclose type in backticks for "non-exhaustive patterns" error)
- #56124 (Fix small doc mistake on std::io::read::read_to_end)
- #56127 (Update an outdated comment in mir building)
- #56148 (Add rustc-guide as a submodule)
- #56149 (Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer)
- #56220 (Suggest appropriate place for lifetime when declared after type arguments)
- #56223 (Make JSON output from -Zprofile-json valid)
- #56236 (Remove unsafe `unsafe` inner function.)
- #56255 (Update outdated code comments in StringReader)
- #56257 (rustc-guide has moved to rust-lang/)
- #56273 (Add missing doc link)
- #56289 (Fix small typo in comment of thread::stack_size)
- #56294 (Fix a typo in the documentation of std::ffi)
- #56312 (Deduplicate literal -> constant lowering)
- #56319 (fix futures creating aliasing mutable and shared ref)
- #56321 (rustdoc: add bottom margin spacing to nested lists)
- #56322 (resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`)
- #56330 (Clean up span in non-trailing `..` suggestion)
Guillaume Gomez [Thu, 29 Nov 2018 12:10:50 +0000 (13:10 +0100)]
Rollup merge of #56319 - RalfJung:async-mutable-ref, r=cramertj
fix futures creating aliasing mutable and shared ref
Fixes the problem described in https://github.com/solson/miri/issues/532#issuecomment-442552764: `set_task_waker` takes a shared reference and puts a copy into the TLS (in a `NonNull`), but `get_task_waker` gets it back out as a mutable reference. That violates "mutable references must not alias anything"!
Guillaume Gomez [Thu, 29 Nov 2018 12:10:41 +0000 (13:10 +0100)]
Rollup merge of #56236 - frewsxcv:frewsxcv-unsafe-unsafe, r=cramertj
Remove unsafe `unsafe` inner function.
Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.
To address this issue, I removed that inner function.
Guillaume Gomez [Thu, 29 Nov 2018 12:10:38 +0000 (13:10 +0100)]
Rollup merge of #56149 - ariasuni:improve-amctime-doc, r=TimNN
Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer
I was confused by this API so I clarified what they are doing.
I was wondering if I should try to unify more documentation and examples between `unix` and `linux` (e.g. “of the file” is used in `unix` to refer to the file these metadata is for, “of this file” in `linux`, “of the underlying file” in `std::fs::File`).
Guillaume Gomez [Thu, 29 Nov 2018 12:10:34 +0000 (13:10 +0100)]
Rollup merge of #56124 - antoine-de:fix_read_to_end_doc_mistake, r=TimNN
Fix small doc mistake on std::io::read::read_to_end
The std::io::read main documentation can lead to error because the buffer is prefilled with 10 zeros that will pad the response.
Using an empty vector is better.
The `read_to_end` documentation is already correct though.
This is my first rust PR, don't hesitate to tell me if I did something wrong.
Guillaume Gomez [Thu, 29 Nov 2018 12:10:31 +0000 (13:10 +0100)]
Rollup merge of #56080 - mark-i-m:patch-2, r=steveklabnik
Reduce the amount of bold text at doc.rlo
Currently, all of the text is either huge or small. IMHO this is hard to read, so I propose that we make the second-level headings smaller, without making them any less prominent.
Guillaume Gomez [Thu, 29 Nov 2018 12:10:30 +0000 (13:10 +0100)]
Rollup merge of #56023 - vorner:doc/atomic-ordering-strip, r=@stjepang
atomic::Ordering: Get rid of misleading parts of intro
Remove the parts of atomic::Ordering's intro that wrongly claimed that
SeqCst prevents all reorderings around it.
Closes #55196
This is a (minimal) alternative to #55233.
I also wonder if it would be worth adding at least some warnings that atomics are often a footgun/hard to use correctly, similarly like `mem::transmute` or other functions have.
Guillaume Gomez [Thu, 29 Nov 2018 12:10:27 +0000 (13:10 +0100)]
Rollup merge of #55391 - matthiaskrgr:bootstrap_cleanup, r=TimNN
bootstrap: clean up a few clippy findings
remove useless format!()s
remove redundant field names in a few struct initializations
pass slice instead of a vector to a function
use is_empty() instead of comparisons to .len()
`pretty_print` takes a `Token` and `match`es on it. But the particular
`Token` kind is known at each call site, so this commit splits it into
five functions: `pretty_print_eof`, `pretty_print_begin`, etc.
This commit also does likewise with `print`, though there is one
callsite for `print` where the `Token` kind isn't known, so a generic
`print` has to stay (but it now just calls out to the various `print_*`
functions).
`Printer::word` takes a `&str` and converts it into a `String`, which
causes an allocation. But that allocation is rarely necessary, because
`&str` is almost always a `&'static str` or a `String` that won't be
used again.
This commit changes `Token::String` so it holds a `Cow<'static, str>`
instead of a `String`, which avoids a lot of allocations.
bors [Thu, 29 Nov 2018 00:06:20 +0000 (00:06 +0000)]
Auto merge of #56300 - nikic:issue-56267, r=eddyb
Fix alignment of stores to scalar pair
The alignment for the second element of a scalar pair is not the same as for the first element, make sure it is calculated correctly. This fixes #56267.