]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #60963 - blkerby:boxed_docs, r=alexcrichton
Mazdak Farrokhzad [Wed, 22 May 2019 01:47:32 +0000 (03:47 +0200)]
Rollup merge of #60963 - blkerby:boxed_docs, r=alexcrichton

Update boxed::Box docs on memory layout

The existing docs for the `Box` type state that "the way `Box` allocates and releases memory is unspecified", and that therefore the only valid pointer to pass to `Box::from_raw` is one obtained from `Box::into_raw`. This is inconsistent with the module-level docs which specify,

> It is valid to convert both ways between a Box and a raw pointer allocated with the Global allocator, given that the Layout used with the allocator is correct for the type. More precisely, a value: *mut T that has been allocated with the Global allocator with Layout::for_value(&*value) may be converted into a box using Box::<T>::from_raw(value). Conversely, the memory backing a value: *mut T obtained from Box::<T>::into_raw may be deallocated using the Global allocator with Layout::for_value(&*value).

This pull request updates the docs for `Box` to make them consistent with the module-level docs and adds some examples of how to use the global allocator in conjunction with `Box::from_raw` and `Box::into_raw`.

5 years agoRollup merge of #60581 - hellow554:fix_60580, r=alexcrichton
Mazdak Farrokhzad [Wed, 22 May 2019 01:47:31 +0000 (03:47 +0200)]
Rollup merge of #60581 - hellow554:fix_60580, r=alexcrichton

convert custom try macro to `?`

resolves #60580

r? @frewsxcv

5 years agoRollup merge of #59742 - Zoxc:edition-cleanup, r=petrochenkov
Mazdak Farrokhzad [Wed, 22 May 2019 01:47:29 +0000 (03:47 +0200)]
Rollup merge of #59742 - Zoxc:edition-cleanup, r=petrochenkov

Move `edition` outside the hygiene lock and avoid accessing it

r? @petrochenkov

5 years agoAuto merge of #61007 - michaelwoerister:limited-debuginfo, r=alexcrichton
bors [Tue, 21 May 2019 21:37:41 +0000 (21:37 +0000)]
Auto merge of #61007 - michaelwoerister:limited-debuginfo, r=alexcrichton

debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1

https://github.com/rust-lang/rust/commit/cff075009 made LLVM emit less debuginfo when compiling with "line-tables-only". The change was essentially correct but the reduced amount of debuginfo broke
a number of tools.

This commit reverts the change so we get back the old behavior, until we figure out how to do this properly and give external tools to adapt to the new format.

See https://github.com/rust-lang/rust/issues/60020 for more info.

r? @cuviper
cc @jrmuizel & @froydnj

5 years agoSpecify the edition for the rustdoc thread-pool
John Kåre Alsaker [Mon, 20 May 2019 01:39:48 +0000 (03:39 +0200)]
Specify the edition for the rustdoc thread-pool

5 years agoMove `edition` outside the hygiene lock and avoid accessing it
John Kåre Alsaker [Fri, 5 Apr 2019 22:15:49 +0000 (00:15 +0200)]
Move `edition` outside the hygiene lock and avoid accessing it

5 years agodebuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1.
Michael Woerister [Tue, 21 May 2019 11:41:44 +0000 (13:41 +0200)]
debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1.

https://github.com/rust-lang/rust/commit/cff075009 made LLVM emit
less debuginfo when compiling with "line-tables-only". The change
was essentially correct but the reduced amount of debuginfo broke
a number of tools.

This commit reverts the change so we get back the old behavior,
until we figure out how to do this properly and give external
tools to adapt to the new format.

See https://github.com/rust-lang/rust/issues/60020 for more info.

5 years agoAuto merge of #60903 - nnethercote:mv-gensyms-from-Symbol-to-Ident, r=petrochenkov
bors [Tue, 21 May 2019 06:37:03 +0000 (06:37 +0000)]
Auto merge of #60903 - nnethercote:mv-gensyms-from-Symbol-to-Ident, r=petrochenkov

Move gensym operations from `Symbol` to `Ident`

Gensyms are always at the `Ident` level, and long-term we probably want to record gensym-ness in hygiene data.

r? @petrochenkov

5 years agoAuto merge of #60950 - taiki-e:arbitrary_self_types-tests, r=Centril
bors [Tue, 21 May 2019 03:44:09 +0000 (03:44 +0000)]
Auto merge of #60950 - taiki-e:arbitrary_self_types-tests, r=Centril

Move arbitrary self types's tests into ui/self

https://github.com/rust-lang/rust/pull/60944#discussion_r285362006

r? @Centril

5 years agoCreate and reference Memory Layout section of boxed docs
Brent Kerby [Tue, 21 May 2019 03:03:40 +0000 (21:03 -0600)]
Create and reference Memory Layout section of boxed docs

5 years agoAuto merge of #60985 - cr1901:msp430-fix, r=alexcrichton
bors [Tue, 21 May 2019 00:50:12 +0000 (00:50 +0000)]
Auto merge of #60985 - cr1901:msp430-fix, r=alexcrichton

Bump LLVM submodule to fix MSP430 AsmPrinter and assembler syntax mismatch.

Moving on to steps 9 and 10 of the llvm bugfix [guide](https://rust-lang.github.io/rustc-guide/codegen/updating-llvm.html#bugfix-updates), now that Rust's copy of LLVM was [updated](https://github.com/rust-lang/llvm-project/pull/13).

This PR closes issue #59077. Nightlies following this PR should have working msp430 codegen again :D.

Thanks for the prompt response even though it took me a while to get this "simple" PR done!

5 years agoAuto merge of #60986 - Centril:rollup-nhpgrfb, r=Centril
bors [Mon, 20 May 2019 21:38:19 +0000 (21:38 +0000)]
Auto merge of #60986 - Centril:rollup-nhpgrfb, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #60383 (Fix position source code files toggle)
 - #60453 (Fall back to `/dev/urandom` on `EPERM` for `getrandom`)
 - #60487 (Fix search sidebar width when no crate select is present)
 - #60511 (Fix intra-doc link resolution failure on re-exporting libstd)
 - #60823 (Fix incremental compilation of cdylib emitting spurious unused_attributes lint)
 - #60915 (stable hashing: Remove unused field and add documentation.)
 - #60942 (Misc changes to rustc_metadata)
 - #60952 (Document BinaryHeap time complexity)
 - #60959 (rustc: Improve type size assertions)
 - #60972 (remove confusing remarks about mixed volatile and non-volatile accesses)
 - #60983 (Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind)

Failed merges:

r? @ghost

5 years agoRollup merge of #60983 - petrhosek:libunwind-no-exceptions, r=alexcrichton
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:10 +0000 (23:03 +0200)]
Rollup merge of #60983 - petrhosek:libunwind-no-exceptions, r=alexcrichton

Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind

These are required otherwise libunwind will end up with undefined
references to __gxx_personality_v0 which is provided by C++ ABI
library and that's undesirable.

5 years agoRollup merge of #60972 - RalfJung:volatile, r=alexcrichton
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:08 +0000 (23:03 +0200)]
Rollup merge of #60972 - RalfJung:volatile, r=alexcrichton

remove confusing remarks about mixed volatile and non-volatile accesses

These comments were originally added by @ecstatic-morse in https://github.com/rust-lang/rust/commit/911d35f0bfd207112806eaec2763201dad06d1c7 and then later edited by me. The intention, I think, was to make sure people do both their reads and writes with these methods if the affected memory really is used for communication with external devices.

However, [people read this as saying that mixed volatile/non-volatile accesses are UB](https://github.com/rust-lang/rust/issues/58599#issuecomment-493791130), which -- to my knowledge -- they are not. So better remove this.

Cc @rkruppe @rust-lang/wg-unsafe-code-guidelines

5 years agoRollup merge of #60959 - petrochenkov:sassert, r=estebank
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:07 +0000 (23:03 +0200)]
Rollup merge of #60959 - petrochenkov:sassert, r=estebank

rustc: Improve type size assertions

Now they
- Tell what the new size is, when it changes
- Do not require passing an identifier

```
   ::: src\libsyntax\parse\token.rs:223:1
    |
223 |    static_assert_size!(Token, 123);
    |    -------------------------------- in this macro invocation
    |
    = note: expected type `[(); 123]`
               found type `[(); 16]`
```

5 years agoRollup merge of #60952 - dtolnay:heap, r=Amanieu
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:06 +0000 (23:03 +0200)]
Rollup merge of #60952 - dtolnay:heap, r=Amanieu

Document BinaryHeap time complexity

I went into some detail on the time complexity of `push` because it is relevant for using BinaryHeap efficiently -- specifically that you should avoid pushing many elements in ascending order when possible.

r? @Amanieu
Closes #47976. Closes #59698.

5 years agoRollup merge of #60942 - bjorn3:metadata_loader_refactor, r=michaelwoerister
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:03 +0000 (23:03 +0200)]
Rollup merge of #60942 - bjorn3:metadata_loader_refactor, r=michaelwoerister

Misc changes to rustc_metadata

5 years agoRollup merge of #60915 - michaelwoerister:hashstablestuff, r=estebank
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:02 +0000 (23:03 +0200)]
Rollup merge of #60915 - michaelwoerister:hashstablestuff, r=estebank

stable hashing: Remove unused field and add documentation.

This PR removes the `bytes_hashed` field from `StableHasher` which in the past has been used for collecting some statistics but has gone unused for quite a while (months at least) now.

The PR also tries to document some requirements for `HashStable` implementations that haven't been written down explicitly anywhere.

5 years agoRollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoerister
Mazdak Farrokhzad [Mon, 20 May 2019 21:03:00 +0000 (23:03 +0200)]
Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoerister

Fix incremental compilation of cdylib emitting spurious unused_attributes lint

fixes #60050

5 years agoRollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 20 May 2019 21:02:59 +0000 (23:02 +0200)]
Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC

Fix intra-doc link resolution failure on re-exporting libstd

Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366).
```rust
pub use std::*;
```

Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates.

Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.)

r? @QuietMisdreavus

5 years agoRollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colors, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 20 May 2019 21:02:57 +0000 (23:02 +0200)]
Rollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colors, r=Dylan-DPC

Fix search sidebar width when no crate select is present

Fixes #60480.

I also fixed the box-shadow that seemed to have been kind of removed?

r? @QuietMisdreavus

5 years agoRollup merge of #60453 - tbu-:pr_getrandom_enoperm, r=sfackler
Mazdak Farrokhzad [Mon, 20 May 2019 21:02:55 +0000 (23:02 +0200)]
Rollup merge of #60453 - tbu-:pr_getrandom_enoperm, r=sfackler

Fall back to `/dev/urandom` on `EPERM` for `getrandom`

This can happen because of seccomp or some VMs.

Fixes #52609.

5 years agoRollup merge of #60383 - GuillaumeGomez:fix-position-source-code-files-toggle, r...
Mazdak Farrokhzad [Mon, 20 May 2019 21:02:52 +0000 (23:02 +0200)]
Rollup merge of #60383 - GuillaumeGomez:fix-position-source-code-files-toggle, r=Manishearth

Fix position source code files toggle

Fixes #60381.

The second commit is a big cleanup of the media queries.

r? @rust-lang/rustdoc

cc @Manishearth

screenshot of the fix:

<img width="501" alt="Screenshot 2019-04-29 at 23 42 56" src="https://user-images.githubusercontent.com/3050060/56929111-112b2b00-6ad9-11e9-9a23-e0a8e3641395.png">

5 years agoFix MSP430 AsmPrinter and assembler syntax mismatch.
William D. Jones [Mon, 20 May 2019 19:27:11 +0000 (15:27 -0400)]
Fix MSP430 AsmPrinter and assembler syntax mismatch.

5 years agoSet -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind
Petr Hosek [Mon, 20 May 2019 19:27:15 +0000 (12:27 -0700)]
Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind

These are required otherwise libunwind will end up with undefined
references to __gxx_personality_v0 which is provided by C++ ABI
library and that's undesirable.

5 years agoAuto merge of #60445 - RalfJung:maybe-uninit, r=Centril
bors [Mon, 20 May 2019 15:05:04 +0000 (15:05 +0000)]
Auto merge of #60445 - RalfJung:maybe-uninit, r=Centril

stabilize core parts of MaybeUninit

and deprecate mem::uninitialized in the future (1.40.0). This is part of implementing https://github.com/rust-lang/rfcs/pull/1892.

Also expand the documentation a bit.

This type is currently primarily useful when dealing with partially initialized arrays. In libstd, it is used e.g. in `BTreeMap` (with some unstable APIs that however can all be replaced, less ergonomically, by stable ones). What we stabilize should also be enough for `SmallVec` (Cc @bluss).

Making this useful for structs requires https://github.com/rust-lang/rfcs/pull/2582 or a commitment that references to uninitialized data are not insta-UB.

5 years agoRemove trailing whitespaces to satisfy tidy
Brent Kerby [Sun, 19 May 2019 23:47:18 +0000 (17:47 -0600)]
Remove trailing whitespaces to satisfy tidy

5 years agoUpdate boxed::Box docs on memory layout
Brent Kerby [Sun, 19 May 2019 15:21:03 +0000 (09:21 -0600)]
Update boxed::Box docs on memory layout

5 years agoupdate miri
Ralf Jung [Mon, 20 May 2019 08:54:36 +0000 (10:54 +0200)]
update miri

5 years agoDocument layout guarantee of MaybeUninit
Peter Todd [Mon, 6 May 2019 21:39:39 +0000 (17:39 -0400)]
Document layout guarantee of MaybeUninit

5 years agoelliminate mem::uninitialize from docs in libcore
Ralf Jung [Wed, 8 May 2019 12:24:14 +0000 (14:24 +0200)]
elliminate mem::uninitialize from docs in libcore

5 years agoadd out-pointer example
Ralf Jung [Sat, 4 May 2019 09:14:58 +0000 (11:14 +0200)]
add out-pointer example

5 years agoapply feedback
Ralf Jung [Thu, 2 May 2019 14:50:56 +0000 (16:50 +0200)]
apply feedback

5 years agostabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future
Ralf Jung [Wed, 1 May 2019 17:39:52 +0000 (19:39 +0200)]
stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future

Also expand the documentation a bit

5 years agoDocument requirements for HashStable implementations better.
Michael Woerister [Fri, 17 May 2019 13:28:45 +0000 (15:28 +0200)]
Document requirements for HashStable implementations better.

5 years agoAuto merge of #60921 - cuviper:remove-mpsc_select, r=SimonSapin
bors [Mon, 20 May 2019 08:30:17 +0000 (08:30 +0000)]
Auto merge of #60921 - cuviper:remove-mpsc_select, r=SimonSapin

Remove the unstable and deprecated mpsc_select

This removes macro `select!` and `std::sync::mpsc::{Handle, Select}`,
which were all unstable and have been deprecated since 1.32.

Closes #27800
r? @SimonSapin

5 years agoremove confusing remarks about mixed volatile and non-volatile accesses
Ralf Jung [Mon, 20 May 2019 07:50:37 +0000 (09:50 +0200)]
remove confusing remarks about mixed volatile and non-volatile accesses

5 years agoRemove `Symbol::gensym()`.
Nicholas Nethercote [Fri, 17 May 2019 00:44:51 +0000 (10:44 +1000)]
Remove `Symbol::gensym()`.

5 years agoEliminate `Symbol::gensymed`.
Nicholas Nethercote [Fri, 17 May 2019 00:27:17 +0000 (10:27 +1000)]
Eliminate `Symbol::gensymed`.

5 years agoMove `is_gensymed` from `Symbol` to `Ident`.
Nicholas Nethercote [Thu, 16 May 2019 23:35:26 +0000 (09:35 +1000)]
Move `is_gensymed` from `Symbol` to `Ident`.

Note that the `is_gensymed` call on `primitive_types` is unnecessary
because that table only contains the name of primitive types (e.g.
`i32`) and never contains gensyms.

5 years agoAuto merge of #60815 - nnethercote:use-Symbol-more-2, r=petrochenkov
bors [Mon, 20 May 2019 03:36:43 +0000 (03:36 +0000)]
Auto merge of #60815 - nnethercote:use-Symbol-more-2, r=petrochenkov

Use `Symbol` even more

These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls).

r? @petrochenkov

5 years agoAuto merge of #60969 - Centril:rollup-3j71mqj, r=Centril
bors [Mon, 20 May 2019 00:37:48 +0000 (00:37 +0000)]
Auto merge of #60969 - Centril:rollup-3j71mqj, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #60590 (Test interaction of unions with non-zero/niche-filling optimization)
 - #60745 (Perform constant propagation into terminators)
 - #60895 (Enable thumbv7a-pc-windows-msvc target build end to end in rust/master)
 - #60908 (Fix lints handling in rustdoc)
 - #60960 (Stop using gensyms in HIR lowering)
 - #60962 (Fix data types indication)

Failed merges:

r? @ghost

5 years agoIntroduce `LocalInternedString::intern`.
Nicholas Nethercote [Tue, 14 May 2019 05:13:42 +0000 (15:13 +1000)]
Introduce `LocalInternedString::intern`.

`LocalInternedString::intern(x)` is preferable to
`Symbol::intern(x).as_str()`, because the former involves one call to
`with_interner` while the latter involves two.

5 years agoIntroduce `InternedString::intern`.
Nicholas Nethercote [Tue, 14 May 2019 04:55:15 +0000 (14:55 +1000)]
Introduce `InternedString::intern`.

`InternedString::intern(x)` is preferable to
`Symbol::intern(x).as_interned_str()`, because the former involves one
call to `with_interner` while the latter involves two.

The case within InternedString::decode() is particularly hot, and this
change reduces the number of `with_interner` calls by up to 13%.

5 years agoAvoid `as_str()` in `ParamTy::is_self`.
Nicholas Nethercote [Tue, 14 May 2019 03:47:01 +0000 (13:47 +1000)]
Avoid `as_str()` in `ParamTy::is_self`.

It's a hot function, and a direct `Symbol` comparison is faster.

The patch also converts some `&InternedString`s to `InternedString`.

5 years agoRollup merge of #60962 - VeryTastyTomato:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 19 May 2019 23:01:44 +0000 (01:01 +0200)]
Rollup merge of #60962 - VeryTastyTomato:patch-1, r=jonas-schievink

Fix data types indication

Fix the data types indication in basic examples of the Trait std::fmt::LowerExp and std::fmt::UpperExp.
Since there aren’t any type annotation on the let statement using the number 42.0, they are of type f64 according to The Book:
https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types

5 years agoRollup merge of #60960 - matthewjasper:remove-lowering-gensym, r=petrochenkov
Mazdak Farrokhzad [Sun, 19 May 2019 23:01:42 +0000 (01:01 +0200)]
Rollup merge of #60960 - matthewjasper:remove-lowering-gensym, r=petrochenkov

Stop using gensyms in HIR lowering

These names aren't ever handled by resolve, so there's no reason to
make them gensyms.

Diagnostics wanting to behave differently for these variables should
inspect either the `MatchSource`/`LocalSource` or the `Span`. All
current diagnostics appear to do this.

r? @petrochenkov

5 years agoRollup merge of #60908 - GuillaumeGomez:errors, r=oli-obk
Mazdak Farrokhzad [Sun, 19 May 2019 23:01:41 +0000 (01:01 +0200)]
Rollup merge of #60908 - GuillaumeGomez:errors, r=oli-obk

Fix lints handling in rustdoc

Part of #60664: now lints are handled just like any other lints you would setup in rustc. Still remains to handle `missing code examples` and `missing_docs` as part of the same group.

r? @oli-obk

5 years agoRollup merge of #60895 - chandde:master, r=alexcrichton
Mazdak Farrokhzad [Sun, 19 May 2019 23:01:39 +0000 (01:01 +0200)]
Rollup merge of #60895 - chandde:master, r=alexcrichton

Enable thumbv7a-pc-windows-msvc target build end to end in rust/master

With this PR, plus another commit https://github.com/rust-lang-nursery/compiler-builtins/commit/cf98161da7ed5217b6031796f0f60b4dd07148a4, I'm able to build the target thumbv7a-pc-windows-msvc successfully, and I'm able to use the stage2 artifacts to build arm32 projects. The commit in compiler_builtins is in release 0.1.14, the current cargo.lock in rust master still uses 0.1.12, so I bumped the compiler_builtins version in cargo.lock to 0.1.15

The command I used to build rust
```
c:\python27\python.exe x.py build --host x86_64-pc-windows-msvc --build x86_64-pc-windows-msvc --target thumbv7a-pc-windows-msvc --verbose
```

**Changes**
1. update cargolock to use compiler_builtins 0.1.15
2. handle libunwind in libtest for thumv7a the same as what we have for aarch64
3. in llvm codegen add a field in CodegenContext to carry the arch, so later in create_msvc_imps function, the arch can be used to check against "x86", instead of 32 pointer width. Apparently Thumv7a is handled differently than x86.

**Background**
I'm from Microsoft working on enabling Azure IoTEdge on ARM32 Windows IoTCore, Azure IoTEdge has a component called IoTEdged written in rust as a NT service running on Windows, so we need to enable rust on thumbv7a in order to have full IoTEdge. My colleague had made some heavy lifting and we've been using our private toolchain to build IoTEdged in our devops pipeline, because at that time we cannot build thumbv7a target end to end successfully. This change is a followup to enable the end to end build for thumbv7a-pc-windows-msvc target.

**Next step**
I'll submit more changes to have this target built nightly in rust/master, to achieve the same availability for aarch64-pc-windows-msvc, indexed here https://rust-lang.github.io/rustup-components-history/aarch64-pc-windows-msvc.html and can be manually installed. **Please do share what takes to make this happen, is there a formal process I need to follow\?**

5 years agoRollup merge of #60745 - wesleywiser:const_prop_into_terminators, r=oli-obk
Mazdak Farrokhzad [Sun, 19 May 2019 23:01:38 +0000 (01:01 +0200)]
Rollup merge of #60745 - wesleywiser:const_prop_into_terminators, r=oli-obk

Perform constant propagation into terminators

Perform constant propagation into MIR `Assert` and `SwitchInt` `Terminator`s which in some cases allows them to be removed by the branch simplification pass.

r? @oli-obk

5 years agoRollup merge of #60590 - petertodd:2018-test-union-nonzero, r=nikomatsakis,Centril
Mazdak Farrokhzad [Sun, 19 May 2019 23:01:37 +0000 (01:01 +0200)]
Rollup merge of #60590 - petertodd:2018-test-union-nonzero, r=nikomatsakis,Centril

Test interaction of unions with non-zero/niche-filling optimization

Notably this nails down part of the behavior that MaybeUninit assumes, e.g. that a Option<MaybeUninit<&u8>> does not take advantage of non-zero optimization, and thus is a safe construct.

It also verifies the status quo: that even unions that could theoretically take advantage of niches don't. (relevant: https://github.com/rust-lang/rust/issues/36394)

5 years agoAuto merge of #60272 - Jakst:patch-1, r=Manishearth
bors [Sun, 19 May 2019 21:36:15 +0000 (21:36 +0000)]
Auto merge of #60272 - Jakst:patch-1, r=Manishearth

Explicitly set height on rust logo <img> element in docs

The layout of the left side menu in docs reflows when navigating between pages because of missing height on the <img> element of rust logo.

Setting height='100' tells the browser to reserve that vertical space, leading to a less janky experience.

5 years ago[const-prop] Don't const-prop into terminators unless mir-opt-level >= 2
Wesley Wiser [Sat, 11 May 2019 16:33:10 +0000 (12:33 -0400)]
[const-prop] Don't const-prop into terminators unless mir-opt-level >= 2

5 years ago[const-prop] Remove catch all match and add FIXME
Wesley Wiser [Sat, 11 May 2019 16:28:53 +0000 (12:28 -0400)]
[const-prop] Remove catch all match and add FIXME

5 years ago[const-prop] Support propagating into SwitchInt's `discr` Operand
Wesley Wiser [Sat, 11 May 2019 15:24:14 +0000 (11:24 -0400)]
[const-prop] Support propagating into SwitchInt's `discr` Operand

5 years ago[const-prop] Support propagating into Assert's `cond` Operand
Wesley Wiser [Sat, 11 May 2019 14:55:34 +0000 (10:55 -0400)]
[const-prop] Support propagating into Assert's `cond` Operand

5 years agoAuto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27
bors [Sun, 19 May 2019 16:48:12 +0000 (16:48 +0000)]
Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27

rustdoc: set the default edition when pre-parsing a doctest

Fixes https://github.com/rust-lang/rust/issues/59313 (possibly more? i think we've had issues with parsing edition-specific syntax in doctests at some point)

When handling a doctest, rustdoc needs to parse it beforehand, so that it can see whether it declares a `fn main` or `extern crate my_crate` explicitly. However, while doing this, rustdoc doesn't set the "default edition" used by the parser like the regular compilation runs do. This caused a problem when parsing a doctest with an `async move` block in it, since it was expecting the `move` keyword to start a closure, not a block.

This PR changes the `rustdoc::test::make_test` function to set the parser's default edition while looking for a main function and `extern crate` statement. However, to do this, `make_test` needs to know what edition to set. Since this is also used during the HTML rendering process (to make playground URLs), now the HTML renderer needs to know about the default edition. Upshot: rendering standalone markdown files can now accept a "default edition" for their doctests with the `--edition` flag! (I'm pretty sure i waffled around how to set that a long time ago when we first added the `--edition` flag... `>_>`)

I'm posting this before i stop for the night so that i can write this description while it's still in my head, but before this merges i want to make sure that (1) the `rustdoc-ui/failed-doctest-output` test still works (i expect it doesn't), and (2) i add a test with the sample from the linked issue.

5 years agoFix data types indication
VeryTastyTomato [Sun, 19 May 2019 13:51:46 +0000 (13:51 +0000)]
Fix data types indication

Fix the data types indication in basic examples of the Trait std::fmt::LowerExp and std::fmt::UpperExp.
Since there aren’t any type annotation on the let statement using the number 42.0, they are of type f64 according to The Book:
https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types

5 years agoMove run-pass/self/* to ui/self
Taiki Endo [Sun, 19 May 2019 13:17:12 +0000 (22:17 +0900)]
Move run-pass/self/* to ui/self

5 years agoStop using gensyms in HIR lowering
Matthew Jasper [Sun, 19 May 2019 12:00:28 +0000 (13:00 +0100)]
Stop using gensyms in HIR lowering

These names aren't ever handled by resolve, so there's no reason to
make them gensyms.

5 years agoAuto merge of #60946 - Xanewok:update-rls, r=oli-obk
bors [Sun, 19 May 2019 11:51:34 +0000 (11:51 +0000)]
Auto merge of #60946 - Xanewok:update-rls, r=oli-obk

Update RLS

Includes a fix (https://github.com/rust-lang/rls/pull/1462) for breakage due to Cargo update PR (https://github.com/rust-lang/rust/pull/60874)

r? @Manishearth @oli-obk @ehuss

5 years agoImprove type size assertions
Vadim Petrochenkov [Sun, 19 May 2019 10:59:44 +0000 (13:59 +0300)]
Improve type size assertions

Now they
- Tell what the new size is, when it changes
- Do not require passing an identifier

5 years agoAuto merge of #60937 - RalfJung:miri, r=oli-obk
bors [Sun, 19 May 2019 08:56:24 +0000 (08:56 +0000)]
Auto merge of #60937 - RalfJung:miri, r=oli-obk

update Miri

r? @oli-obk

5 years agoAuto merge of #60760 - GuillaumeGomez:generic-display, r=varkor,badboy
bors [Sun, 19 May 2019 06:06:12 +0000 (06:06 +0000)]
Auto merge of #60760 - GuillaumeGomez:generic-display, r=varkor,badboy

Fix display of const generics in rustdoc

<img width="745" alt="Screenshot 2019-05-18 at 15 45 22" src="https://user-images.githubusercontent.com/3050060/57970638-04854e80-7984-11e9-9f04-da6b51ec8bc7.png">

Part of #60737.

cc @varkor

r? @badboy

5 years agoMove arbitrary_self_types's tests into ui/self
Taiki Endo [Sun, 19 May 2019 03:31:08 +0000 (12:31 +0900)]
Move arbitrary_self_types's tests into ui/self

5 years agoDocument BinaryHeap time complexity
David Tolnay [Sun, 19 May 2019 03:25:15 +0000 (20:25 -0700)]
Document BinaryHeap time complexity

I went into some detail on the time complexity of `push` because it is
relevant for using BinaryHeap efficiently -- specifically that you
should avoid pushing many elements in ascending order when possible.

5 years agoMake clear that status quo ≠ guarantee
Peter Todd [Sun, 19 May 2019 02:27:33 +0000 (22:27 -0400)]
Make clear that status quo ≠ guarantee

5 years agoAuto merge of #60949 - Centril:rollup-f918e1v, r=Centril
bors [Sun, 19 May 2019 01:56:14 +0000 (01:56 +0000)]
Auto merge of #60949 - Centril:rollup-f918e1v, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #60370 (Mark core::alloc::Layout::from_size_align_unchecked const)
 - #60678 (Stabilize vecdeque_rotate)
 - #60924 (Explain that ? converts the error type using From)
 - #60931 (Use iter() for iterating arrays by slice)
 - #60934 (Declare DefIndex with the newtype_index macro)
 - #60943 (fix copy-paste typo in docs for ptr::read_volatile)
 - #60945 (Simplify BufRead::fill_buf doc example using NLL)
 - #60947 (Fix typos in docs of GlobalAlloc)

Failed merges:

r? @ghost

5 years agoRollup merge of #60947 - blkerby:global_alloc_typo, r=jonas-schievink
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:46 +0000 (02:31 +0200)]
Rollup merge of #60947 - blkerby:global_alloc_typo, r=jonas-schievink

Fix typos in docs of GlobalAlloc

5 years agoRollup merge of #60945 - blkerby:fill_buf_nll_doc_example, r=shepmaster
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:44 +0000 (02:31 +0200)]
Rollup merge of #60945 - blkerby:fill_buf_nll_doc_example, r=shepmaster

Simplify BufRead::fill_buf doc example using NLL

With non-lexical lifetimes, in this example it is no longer necessary to use a block to end the borrow early.

5 years agoRollup merge of #60943 - blkerby:master, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:43 +0000 (02:31 +0200)]
Rollup merge of #60943 - blkerby:master, r=Mark-Simulacrum

fix copy-paste typo in docs for ptr::read_volatile

5 years agoRollup merge of #60934 - fabric-and-ink:defindex_with_newtype_macro, r=petrochenkov
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:42 +0000 (02:31 +0200)]
Rollup merge of #60934 - fabric-and-ink:defindex_with_newtype_macro, r=petrochenkov

Declare DefIndex with the newtype_index macro

See #60666

5 years agoRollup merge of #60931 - cuviper:array-iter, r=KodrAus
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:40 +0000 (02:31 +0200)]
Rollup merge of #60931 - cuviper:array-iter, r=KodrAus

Use iter() for iterating arrays by slice

These `into_iter()` calls will change from iterating references to
values if we ever get `IntoIterator` for arrays, which may break the
code using that iterator. Calling `iter()` is future proof.

5 years agoRollup merge of #60924 - estebank:try-msg, r=petrochenkov
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:39 +0000 (02:31 +0200)]
Rollup merge of #60924 - estebank:try-msg, r=petrochenkov

Explain that ? converts the error type using From

Fix #60917.

5 years agoRollup merge of #60678 - DutchGhost:master, r=scottmcm
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:35 +0000 (02:31 +0200)]
Rollup merge of #60678 - DutchGhost:master, r=scottmcm

Stabilize vecdeque_rotate

This PR stabilizes the vecdeque_rotate feature.
r? @scottmcm

Closes https://github.com/rust-lang/rust/issues/56686

5 years agoRollup merge of #60370 - Richard-W:const-layout-construction, r=sfackler
Mazdak Farrokhzad [Sun, 19 May 2019 00:31:32 +0000 (02:31 +0200)]
Rollup merge of #60370 - Richard-W:const-layout-construction, r=sfackler

Mark core::alloc::Layout::from_size_align_unchecked const

Makes it possible (pending stabilization of #57563 (`const_fn`)) to rewrite code like

```rust
const BUFFER_SIZE: usize = 0x2000;
const BUFFER_ALIGN: usize = 0x1000;

fn foo() {
  let layout = std::alloc::Layout::from_size_align(BUFFER_SIZE, BUFFER_ALIGN)
    .unwrap();
  let buffer = std::alloc::alloc(layout);
}
```
to
```rust
const BUFFER_LAYOUT: std::alloc::Layout = unsafe {
  std::alloc::Layout::from_size_align_unchecked(0x2000, 0x1000)
};

fn foo() {
  let buffer = std::alloc::alloc(BUFFER_LAYOUT);
}
```

which (although `unsafe` is used) looks somewhat cleaner and is easier to read.

5 years agoFix typos in docs of GlobalAlloc
Brent Kerby [Sat, 18 May 2019 22:22:59 +0000 (16:22 -0600)]
Fix typos in docs of GlobalAlloc

5 years agoReverse RLS toolstate check override
Igor Matuszewski [Sat, 18 May 2019 21:59:57 +0000 (23:59 +0200)]
Reverse RLS toolstate check override

As per https://github.com/rust-lang/rust/pull/60946#issuecomment-493707005

5 years agoUpdate RLS
Igor Matuszewski [Sat, 18 May 2019 20:54:33 +0000 (22:54 +0200)]
Update RLS

5 years agoAuto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth
bors [Sat, 18 May 2019 20:49:22 +0000 (20:49 +0000)]
Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth

Fix attrs pos

Fixes #60042.

Screenshot:

<img width="438" alt="Screenshot 2019-05-12 at 15 02 25" src="https://user-images.githubusercontent.com/3050060/57582606-1455ec00-74c7-11e9-9d4e-5ec4da4de7dd.png">

r? @rust-lang/rustdoc

5 years agoSimplify BufRead doc example using NLL
Brent Kerby [Sat, 18 May 2019 18:38:06 +0000 (12:38 -0600)]
Simplify BufRead doc example using NLL

5 years agoAuto merge of #60940 - Manishearth:clippyup, r=Manishearth
bors [Sat, 18 May 2019 17:57:55 +0000 (17:57 +0000)]
Auto merge of #60940 - Manishearth:clippyup, r=Manishearth

Update clippy

Contains https://github.com/rust-lang/rust-clippy/pull/4110

Should fix RLS

r? @ghost

5 years agofix copy-paste typo in docs for ptr::read_volatile
Brent Kerby [Sat, 18 May 2019 16:03:12 +0000 (10:03 -0600)]
fix copy-paste typo in docs for ptr::read_volatile

5 years agoMisc changes to rustc_metadata
bjorn3 [Sat, 18 May 2019 15:51:12 +0000 (17:51 +0200)]
Misc changes to rustc_metadata

5 years agoUpdate clippy
Manish Goregaokar [Sat, 18 May 2019 15:32:50 +0000 (08:32 -0700)]
Update clippy

5 years agoAuto merge of #60252 - davidtwco:issue-57672, r=Mark-Simulacrum
bors [Sat, 18 May 2019 15:07:38 +0000 (15:07 +0000)]
Auto merge of #60252 - davidtwco:issue-57672, r=Mark-Simulacrum

Don't suggest changing extern crate w/ alias to use.

Fixes #57672.

5 years agoFix display of const generics in rustdoc
Guillaume Gomez [Sun, 12 May 2019 14:53:39 +0000 (16:53 +0200)]
Fix display of const generics in rustdoc

5 years agoupdate miri
Ralf Jung [Sat, 18 May 2019 12:40:34 +0000 (14:40 +0200)]
update miri

5 years agoexpand comment in StorageLive
Ralf Jung [Sat, 18 May 2019 12:40:17 +0000 (14:40 +0200)]
expand comment in StorageLive

5 years agoDeclare DefIndex with the newtype_index macro
Fabian Drinck [Sat, 18 May 2019 11:19:33 +0000 (13:19 +0200)]
Declare DefIndex with the newtype_index macro

5 years agoFix tests not running locally
Guillaume Gomez [Sat, 18 May 2019 10:42:13 +0000 (12:42 +0200)]
Fix tests not running locally

5 years agoUpdate rustdoc-ui tests
Guillaume Gomez [Fri, 17 May 2019 11:39:20 +0000 (13:39 +0200)]
Update rustdoc-ui tests

5 years agoFix lints handling in rustdoc
Guillaume Gomez [Thu, 16 May 2019 16:31:53 +0000 (18:31 +0200)]
Fix lints handling in rustdoc

5 years agoAuto merge of #60386 - Goirad:sgx-ignore-tests, r=nikomatsakis
bors [Sat, 18 May 2019 09:04:14 +0000 (09:04 +0000)]
Auto merge of #60386 - Goirad:sgx-ignore-tests, r=nikomatsakis

Added ignore-sgx for appropriate tests in src/test

These are all the tests that make sense to ignore when targeting fortanix-unknonw-sgx, at least in test/runpass. Other suites not yet covered.

5 years agofix line length
chandde [Sat, 18 May 2019 07:49:54 +0000 (00:49 -0700)]
fix line length

5 years agooptimize the arm64 OR arm32 check
chandde [Sat, 18 May 2019 03:45:25 +0000 (20:45 -0700)]
optimize the arm64 OR arm32 check

5 years agoUse iter() for iterating arrays by slice
Josh Stone [Sat, 18 May 2019 02:56:35 +0000 (19:56 -0700)]
Use iter() for iterating arrays by slice

These `into_iter()` calls will change from iterating references to
values if we ever get `IntoIterator` for arrays, which may break the
code using that iterator. Calling `iter()` is future proof.

5 years agoAuto merge of #60910 - nnethercote:avoid-some-unnecessary-interning, r=petrochenkov
bors [Sat, 18 May 2019 02:10:21 +0000 (02:10 +0000)]
Auto merge of #60910 - nnethercote:avoid-some-unnecessary-interning, r=petrochenkov

Avoid some unnecessary interning

r? @petrochenkov

5 years agoAuto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, r=nikomatsakis
bors [Fri, 17 May 2019 23:06:51 +0000 (23:06 +0000)]
Auto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, r=nikomatsakis

lint: convert incoherent_fundamental_impls into hard error

*Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version:
- gtk-rs: upgrade to at least 0.4
- rusqlite: upgrade to at least 0.14
- nalgebra: upgrade to at least 0.15, or the last patch version of 0.14
- spade: upgrade or refresh the Cargo.lock file to use version 1.7
- imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra)

implement #46205

r? @nikomatsakis

5 years agoAuto merge of #60920 - Manishearth:rollup-p4xp4gk, r=Manishearth
bors [Fri, 17 May 2019 20:02:13 +0000 (20:02 +0000)]
Auto merge of #60920 - Manishearth:rollup-p4xp4gk, r=Manishearth

Rollup of 4 pull requests

Successful merges:

 - #60791 (Update books)
 - #60891 (Allow claiming issues with triagebot)
 - #60901 (Handle more string addition cases with appropriate suggestions)
 - #60902 (Prevent Error::type_id overrides)

Failed merges:

r? @ghost