bors [Thu, 7 Feb 2019 14:47:57 +0000 (14:47 +0000)]
Auto merge of #58266 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests
Successful merges:
- #57504 (Re-enable history api on file:// protocol)
- #57848 (Generate a documentation page for core::mem::transmute.)
- #57884 (Update minifier version)
- #57954 (rustdoc: remove blank unstable spans)
- #58028 (Fix image link in the settings menu)
- #58033 (rustdoc: wrap stability tags in colored spans)
- #58086 ([rustdoc] Improve file list display)
- #58143 (Sort elements in the sidebar)
- #58146 (Prevent automatic collapse of methods impl blocks)
- #58150 (Don't apply impl block collapse rules to trait impls)
- #58185 (Remove images' url to make it work even without internet connection)
Guillaume Gomez [Thu, 7 Feb 2019 13:28:29 +0000 (14:28 +0100)]
Rollup merge of #57848 - jrvanwhy:transmute-export-doc, r=QuietMisdreavus
Generate a documentation page for core::mem::transmute.
In `#[no_std]` environments, `std::mem::transmute` is unavailable. Searching for "core transmute" online only pulls up `core::intrinsics::transmute`, which is behind the (unstable) `core_intrinsics` feature flag. Users wishing to use transmute in `#[no_std]` environments typically should use `core::mem::transmute` instead, as it is stable. This documentation makes `core::mem::transmute` discoverable.
Guillaume Gomez [Thu, 7 Feb 2019 13:28:27 +0000 (14:28 +0100)]
Rollup merge of #57504 - GuillaumeGomez:re-enable-history, r=QuietMisdreavus
Re-enable history api on file:// protocol
Fixes #57135.
I tested locally on chrome (since it was the browser having issues with history management on `file://` protocol) and it worked fine so I guess we can re-enable it.
kennytm [Thu, 7 Feb 2019 05:58:02 +0000 (13:58 +0800)]
Rollup merge of #58242 - notriddle:patch-3, r=zackmdavis
Document the one TyKind that isn't documented
This is especially confusing since the name `Foreign` and the name `extern type` are so different. I deduced that they're the same by consulting git-blame.
kennytm [Thu, 7 Feb 2019 05:57:44 +0000 (13:57 +0800)]
Rollup merge of #58192 - dlrobertson:fix_57876, r=oli-obk
Do not ICE in codegen when using a extern_type static
The layout of a extern_type static is unsized, but may pass the
Well-Formed check in typeck (See #55257). As a result, we
cannot assume that a static is sized when generating the `Place`
for an r-value.
bors [Thu, 7 Feb 2019 04:26:08 +0000 (04:26 +0000)]
Auto merge of #57998 - niklasf:align-enum, r=nagisa
Allow #[repr(align(x))] on enums (#57996)
Tracking issue: #57996
Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999.
It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs).
Michael Howell [Wed, 6 Feb 2019 19:27:01 +0000 (12:27 -0700)]
Document the one TyKind that isn't documented
This is especially confusing since the name `Foreign`
and the name `extern type` are so different. I deduced
that they're the same by consulting git-blame.
bors [Wed, 6 Feb 2019 06:01:37 +0000 (06:01 +0000)]
Auto merge of #58061 - nnethercote:overhaul-syntax-Folder, r=petrochenkov
Overhaul `syntax::fold::Folder`.
This PR changes `syntax::fold::Folder` from a functional style
(where most methods take a `T` and produce a new `T`) to a more
imperative style (where most methods take and modify a `&mut T`), and
renames it `syntax::mut_visit::MutVisitor`.
The compiler allows you to write a `use` statement for a built-in non-macro attribute, since `use proc_macro` can apply to both the `proc_macro` crate and the `#[proc_macro]` attribute. However, if you write a use statement for something that *doesn't* have this crossover, rustdoc will try to use it the same way as anything else... which resulted in an ICE because it tried to pull a DefId for something that didn't have one. This PR makes rustdoc skip those lookups when it encounters them, allowing it to properly process and render these imports.
bors [Tue, 5 Feb 2019 22:08:47 +0000 (22:08 +0000)]
Auto merge of #58131 - ehuss:update-cargo, r=alexcrichton
Update cargo
7 commits in 245818076052dd7178f5bb7585f5aec5b6c1e03e..4e74e2fc0908524d17735c768067117d3e84ee9c
2019-01-27 15:17:26 +0000 to 2019-02-02 17:48:44 +0000
- Fix overlapping progress with stdout. (rust-lang/cargo#6618)
- Improve progress bar flickering. (rust-lang/cargo#6615)
- Add detail to multiple rename deps (rust-lang/cargo#6603)
- Fix race condition in local registry crate unpacking (rust-lang/cargo#6591)
- Revert "Make incremental compilation the default for all profiles." (rust-lang/cargo#6610)
- Fixup the docs on crate-type (rust-lang/cargo#6606)
- Document that owner --add now just invites (rust-lang/cargo#6604)
This commit changes `syntax::fold::Folder` from a functional style
(where most methods take a `T` and produce a new `T`) to a more
imperative style (where most methods take and modify a `&mut T`), and
renames it `syntax::mut_visit::MutVisitor`.
The first benefit is speed. The functional style does not require any
reallocations, due to the use of `P::map` and
`MoveMap::move_{,flat_}map`. However, every field in the AST must be
overwritten; even those fields that are unchanged are overwritten with
the same value. This causes a lot of unnecessary memory writes. The
imperative style reduces instruction counts by 1--3% across a wide range
of workloads, particularly incremental workloads.
The second benefit is conciseness; the imperative style is usually more
concise. E.g. compare the old functional style:
```
fn fold_abc(&mut self, abc: ABC) {
ABC {
a: fold_a(abc.a),
b: fold_b(abc.b),
c: abc.c,
}
}
```
with the imperative style:
```
fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) {
visit_a(a);
visit_b(b);
}
```
(The reductions get larger in more complex examples.)
Overall, the patch removes over 200 lines of code -- even though the new
code has more comments -- and a lot of the remaining lines have fewer
characters.
Some notes:
- The old style used methods called `fold_*`. The new style mostly uses
methods called `visit_*`, but there are a few methods that map a `T`
to something other than a `T`, which are called `flat_map_*` (`T` maps
to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s).
- `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed
`map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to
reflect their slightly changed signatures.
- Although this commit renames the `fold` module as `mut_visit`, it
keeps it in the `fold.rs` file, so as not to confuse git. The next
commit will rename the file.
Dan Robertson [Tue, 5 Feb 2019 15:52:54 +0000 (15:52 +0000)]
Do not ICE in codegen given a extern_type static
The layout of a extern_type static is unsized, but may pass the
Well-Formed check in typeck. As a result, we cannot assume that
a static is sized when generating the `Place` for an r-value.
bors [Tue, 5 Feb 2019 19:12:11 +0000 (19:12 +0000)]
Auto merge of #57851 - Aaron1011:fix/clean-lifetime, r=GuillaumeGomez
Don't try to clean predicates involving ReErased
There's nothing to render when we have a bound involving ReErased (either
a type or region outliving it), so we don't attempt to generate a clean
WherePredicate
Fixes #57806
I haven't been able to come up with a minimized reproduction for the issue, but I've confirmed that this allows the docs to build for `parqet-rs`
kennytm [Tue, 5 Feb 2019 15:29:19 +0000 (00:29 +0900)]
Rollup merge of #58172 - garyemerson:patch-1, r=steveklabnik
update split docs
Some confusion about split popped up at https://news.ycombinator.com/item?id=19080931 since the docs sorta sound like `&str`, `char` and closures are the only types that can be patterns.
kennytm [Tue, 5 Feb 2019 15:29:13 +0000 (00:29 +0900)]
Rollup merge of #58142 - jethrogb:jb/sgx-rwlock, r=joshtriplett
Remove stray FIXME
These were copied from the WebAssembly implementation, and later commented. There is nothing to be fixed, RWLock is Send/Sync because all member fields are Send/Sync.
kennytm [Tue, 5 Feb 2019 15:29:02 +0000 (00:29 +0900)]
Rollup merge of #58116 - topecongiro:wrong-span-assignment, r=petrochenkov
Include the span of attributes of the lhs to the span of the assignment expression
This PR adds the span of attributes of the lhs to the span of the assignment expression. Currently with the following code, `#[attr]` is not included to the span of the assignment (`foo = true`).
```rust
#[attr]
foo = true;
```
The rational behind this change is that as libsyntax user I expect the span of the parent node includes every span of child nodes.
cc https://github.com/rust-lang/rustfmt/issues/3313, https://github.com/rust-lang/rust/issues/15701.
kennytm [Tue, 5 Feb 2019 15:28:46 +0000 (00:28 +0900)]
Rollup merge of #58001 - pnkfelix:issue-57735-proc-macro-with-large-tokenstream-slow, r=eddyb
proc_macro: make `TokenStream::from_streams` pre-allocate its vector.
This requires a pre-pass over the input streams. But that is cheap compared to the quadratic blowup associated with reallocating the accumulating vector on-the-fly.