Commit Graph

90470 Commits

Author SHA1 Message Date
Jethro Beekman
e41e694d9e Clarify guarantees for Box allocation 2019-02-13 12:51:59 +05:30
Matthias Einwag
871338c3ae Merging master 2019-02-12 22:46:14 -08:00
Scott McMurray
317f15304e Revert "Remove mentions of unstable sort_by_cached key from stable documentation"
This reverts commit 9c7b69e179.
2019-02-12 22:26:44 -08:00
Scott McMurray
3777b86f9b Stabilize slice_sort_by_cached_key 2019-02-12 22:26:44 -08:00
bors
827a141466 Auto merge of #58415 - Centril:rollup, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #57693 (Doc rewording)
 - #57815 (Speed up the fast path for assert_eq! and assert_ne!)
 - #58034 (Stabilize the time_checked_add feature)
 - #58057 (Stabilize linker-plugin based LTO (aka cross-language LTO))
 - #58137 (Cleanup: rename node_id_to_type(_opt))
 - #58166 (allow shorthand syntax for deprecation reason)
 - #58200 (fix str mutating through a ptr derived from &self)
 - #58273 (Rename rustc_errors dependency in rust 2018 crates)
 - #58289 (impl iter() for dyn Error)
 - #58387 (Disallow `auto` trait alias syntax)
 - #58404 (use Ubuntu keyserver for CloudABI ports)
 - #58405 (Remove some dead code from libcore)

Failed merges:

r? @ghost
2019-02-13 05:14:12 +00:00
Mazdak Farrokhzad
6562c28607
Rollup merge of #58405 - gnzlbg:remove_unused_macros, r=alexcrichton
Remove some dead code from libcore

These macros are not required to glue the `core_arch` crate anymore.
2019-02-13 04:37:09 +01:00
Mazdak Farrokhzad
f3c4652d0c
Rollup merge of #58404 - euclio:cloudabi-keyserver, r=alexcrichton
use Ubuntu keyserver for CloudABI ports

The Ubuntu keyserver is more reliable than the MIT PGP server, which is
prone to going down. This commit also explicitly uses port 80 on the
keyserver for reasons outlined in #57844.
2019-02-13 04:37:08 +01:00
Mazdak Farrokhzad
a5e869eb62
Rollup merge of #58387 - alexreg:fix-trait-alias-2, r=centril
Disallow `auto` trait alias syntax

See https://github.com/rust-lang/rust/issues/41517#issuecomment-462567679.

r? @Centril

CC @topecongiro @nikomatsakis
2019-02-13 04:37:07 +01:00
Mazdak Farrokhzad
5aa260a4b5
Rollup merge of #58289 - haraldh:master, r=sfackler
impl iter() for dyn Error

Examples:

```rust
let next_error_type_a = err
    .iter()
    .filter_map(Error::downcast_ref::<ErrorTypeA>)
    .next();
```

```rust
let source_root_error = err.iter().last();
```

Credit for the ErrorIter goes to reddit user /u/tdiekmann (Tim Diekmann)
https://www.reddit.com/r/rust/comments/aj3lpg/is_an_iterator_impl_over_errorsource_possible/
2019-02-13 04:37:05 +01:00
Mazdak Farrokhzad
0bc8f6f3f4
Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasper
Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc #58099

r? @Centril
2019-02-13 04:37:04 +01:00
Mazdak Farrokhzad
ecb6503169
Rollup merge of #58200 - RalfJung:str-as-mut-ptr, r=SimonSapin
fix str mutating through a ptr derived from &self

Found by Miri: In `get_unchecked_mut` (also used by the checked variants internally) uses `str::as_ptr` to create a mutable reference, but `as_ptr` takes `&self`.  This means the mutable references we return here got created from a shared reference, which violates the shared-references-are-read-only discipline!

For this by using a newly introduced `as_mut_ptr` instead.
2019-02-13 04:37:03 +01:00
Mazdak Farrokhzad
856e41142c
Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkov
allow shorthand syntax for deprecation reason

Fixes #48271.

Created based on discussion in #56896.
2019-02-13 04:37:02 +01:00
Mazdak Farrokhzad
81434cbf84
Rollup merge of #58137 - ljedrz:cleanup_node_id_to_type, r=estebank
Cleanup: rename node_id_to_type(_opt)

Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here.

In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).
2019-02-13 04:37:00 +01:00
Mazdak Farrokhzad
1c1d2e44c5
Rollup merge of #58057 - michaelwoerister:stabilize-xlto, r=alexcrichton
Stabilize linker-plugin based LTO (aka cross-language LTO)

This PR stabilizes [linker plugin based LTO](https://github.com/rust-lang/rust/issues/49879), also known as "cross-language LTO" because it allows for doing inlining and other optimizations across language boundaries in mixed Rust/C/C++ projects.

As described in the tracking issue, it works by making `rustc` emit LLVM bitcode instead of machine code, the same as `clang` does. A linker with the proper plugin (like LLD) can then run (Thin)LTO across all modules.

The feature has been implemented over a number of pull requests and there are various [codegen](https://github.com/rust-lang/rust/blob/master/src/test/codegen/no-dllimport-w-cross-lang-lto.rs) and [run](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-clang)-[make](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs) [tests](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/cross-lang-lto) that make sure that it keeps working.

It also works for building big projects like [Firefox](https://treeherder.mozilla.org/#/jobs?repo=try&revision=2ce2d5ddcea6fbff790503eac406954e469b2f5d).

The PR makes the feature available under the `-C linker-plugin-lto` flag. As discussed in the tracking issue it is not cross-language specific and also not LLD specific. `-C linker-plugin-lto` is descriptive of what it does. If someone has a better name, let me know `:)`
2019-02-13 04:36:59 +01:00
Mazdak Farrokhzad
0ab1057a56
Rollup merge of #58034 - faern:stabilize-time-checked-add, r=alexcrichton
Stabilize the time_checked_add feature

Closes #55940

Stabilizes `checked_add` and `checked_sub` on `Instant` and `SystemTime`.
2019-02-13 04:36:58 +01:00
Mazdak Farrokhzad
0ed894afae
Rollup merge of #57815 - dotdash:asserts, r=sfackler
Speed up the fast path for assert_eq! and assert_ne!

Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.

By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.

We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.
2019-02-13 04:36:56 +01:00
Mazdak Farrokhzad
734cc3e79e
Rollup merge of #57693 - king6cong:word, r=Centril
Doc rewording

None
2019-02-13 04:36:55 +01:00
Clint Frederickson
4e5eda3697 compute is_partial_move outside of the move_site loop for clarity 2019-02-12 19:35:32 -07:00
bors
0f949c2fcc Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichton
Stabilize str::escape_* methods with new return types…

… that implement `Display` and `Iterator<Item=char>`, as proposed in FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 23:30:16 +00:00
Josh Stone
adb54c2fa7 [CI] Update dist-x86_64-linux to GCC 5.5
This also updates dist-i686-linux, since it borrows the same scripts.

While we're at it, update llvm+clang+lld to llvm-project 8.0.0-rc2.
2019-02-12 15:28:27 -08:00
Vitaly _Vi Shukela
7b2a08cf49
Add Instant::checked_duration_since, address #58402. 2019-02-13 00:49:48 +03:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Andy Russell
e827c9ab3c
respect alternate flag when formatting impl trait 2019-02-12 13:45:36 -05:00
David Wood
ee82d09b6c
Check user type annotations for range patterns.
This commit builds on the fix from #58161 (which fixed miscompilation
caused by the introduction of `AscribeUserType` patterns for associated
constants) to start checking these patterns are well-formed for ranges
(previous fix just ignored them so that miscompilation wouldn't occur).
2019-02-12 19:37:54 +01:00
Josh Stone
e0544ca1cf [CI] Update crosstool-ng builders to GCC 5.2 2019-02-12 09:56:09 -08:00
Michael Woerister
3a9d171b0a Fix some rebasing fallout regarding xLTO. 2019-02-12 17:17:05 +01:00
Vadim Kaushan
1f1a82434b Add riscv64gc-unknown-none-elf target 2019-02-12 19:15:00 +03:00
Vadim Kaushan
06f21a5314 Add riscv64imac-unknown-none-elf target 2019-02-12 19:05:41 +03:00
Vadim Kaushan
0f4668a5b0 Update LLVM: apply patches for RISC-V 64-bit support 2019-02-12 18:58:06 +03:00
Taiki Endo
c08b5ca4ad Fix rebase fail 2019-02-13 00:31:53 +09:00
Taiki Endo
c360ba285c Cleanup imports 2019-02-13 00:31:51 +09:00
Taiki Endo
3216c7656a Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
gnzlbg
3a8448c3ff Fix rustc_driver swallowing errors when compilation is stopped 2019-02-12 16:16:12 +01:00
gnzlbg
1431c216fe Remove some dead code from libcore
These macros are not required to glue the `core_arch` crate anymore.
2019-02-12 16:11:59 +01:00
Michael Woerister
3733b3267d Add documentation about -Clinker-plugin-lto to rustc book. 2019-02-12 15:42:04 +01:00
Andy Russell
8b21a55b96
use Ubuntu keyserver for CloudABI ports
The Ubuntu keyserver is more reliable than the MIT PGP server, which is
prone to going down. This commit also explicitly uses port 80 on the
keyserver for reasons outlined in #57844.
2019-02-12 09:39:38 -05:00
Alexander Regueiro
370f1f26ce Added tests. 2019-02-12 14:33:58 +00:00
Michael Woerister
04f425d2c3 Stabilize linker-plugin based LTO. 2019-02-12 15:10:29 +01:00
Oliver Scherer
6ed4401609 Permit issue posting to have network failures 2019-02-12 14:48:53 +01:00
Alex Crichton
e983b4f64e rustc: Implement incremental "fat" LTO
Currently the compiler will produce an error if both incremental
compilation and full fat LTO is requested. With recent changes and the
advent of incremental ThinLTO, however, all the hard work is already
done for us and it's actually not too bad to remove this error!

This commit updates the codegen backend to allow incremental full fat
LTO. The semantics are that the input modules to LTO are all produce
incrementally, but the final LTO step is always done unconditionally
regardless of whether the inputs changed or not. The only real
incremental win we could have here is if zero of the input modules
changed, but that's so rare it's unlikely to be worthwhile to implement
such a code path.

cc #57968
cc rust-lang/cargo#6643
2019-02-12 04:58:31 -08:00
bors
c84e797642 Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov
Require a list of features in `#[allow_internal_unstable]`

The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-12 12:10:10 +00:00
Mazdak Farrokhzad
ee3371ec91
Update RELEASES.md
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
2019-02-12 10:41:39 +01:00
Mazdak Farrokhzad
4c0a3d5894
Update RELEASES.md
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
2019-02-12 10:40:22 +01:00
Mazdak Farrokhzad
8a026f1cdd
Update RELEASES.md
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
2019-02-12 10:40:14 +01:00
Mazdak Farrokhzad
73921f67e9
Update RELEASES.md
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
2019-02-12 10:40:07 +01:00
Simon Sapin
eb158f9350 Add doctests for str::escape_* 2019-02-12 09:55:30 +01:00
Simon Sapin
114593d638 Make the prema-unstable char::escape_debug_ext method crate-private 2019-02-12 09:55:30 +01:00
Simon Sapin
92cce78d06 Move str::escape_* to libcore 2019-02-12 09:55:30 +01:00
Simon Sapin
55216f82a6 Stabilize str::escape_* methods
FCP: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 09:55:29 +01:00
Simon Sapin
7a077804a3 New return types for str::escape_* that impl Display and Iterator<char>
As FCP’ed in the tracking issue: https://github.com/rust-lang/rust/issues/27791#issuecomment-376864727
2019-02-12 09:55:20 +01:00