Commit graph

128174 commits

Author SHA1 Message Date
blitzerr
985dff9e7e fixing the test failure 2020-09-22 20:16:13 -07:00
Joshua Nelson
15f08d6ddf
Revert "Function to convert OpenOptions to c_int" 2020-09-22 23:07:30 -04:00
Robin Schoonover
6c056d3465 Satisfy rc_buffer lint in Constant::Binary byte string by copying data
We can avoid the data copy again by fixing rustc_ast::ast::LitKind
later.
2020-09-22 20:35:54 -06:00
bors
e62323df22 Auto merge of #77063 - cuviper:llvm-11.0.0-rc3, r=nikic
Rebase LLVM onto 11.0.0-rc3

r? `@nikic`
2020-09-23 02:15:38 +00:00
Eric Huss
9f27f3796d Include libunwind in the rust-src component. 2020-09-22 17:20:15 -07:00
Ashley Mannix
9b2c8d866e revert const_type_id stabilization
This reverts commit e3856616ee.
2020-09-23 09:40:51 +10:00
LingMan
d76b80768c
Merge two almost identical match arms 2020-09-23 01:09:24 +02:00
bors
6d3acf5129 Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandry
cache types during normalization

partially fixes #75992

reduces the following test from 14 to 3 seconds locally.

cc `@Mark-Simulacrum` would it make sense to add that test to `perf`?
```rust
#![recursion_limit="2048"]
#![type_length_limit="112457564"]

pub async fn h0(v: &String, x: &u64) { println!("{} {}", v, x) }
pub async fn h1(v: &String, x: &u64) { h0(v, x).await }
pub async fn h2(v: &String, x: &u64) { h1(v, x).await }
pub async fn h3(v: &String, x: &u64) { h2(v, x).await }
pub async fn h4(v: &String, x: &u64) { h3(v, x).await }
pub async fn h5(v: &String, x: &u64) { h4(v, x).await }
pub async fn h6(v: &String, x: &u64) { h5(v, x).await }
pub async fn h7(v: &String, x: &u64) { h6(v, x).await }
pub async fn h8(v: &String, x: &u64) { h7(v, x).await }
pub async fn h9(v: &String, x: &u64) { h8(v, x).await }

pub async fn h10(v: &String, x: &u64) { h9(v, x).await }
pub async fn h11(v: &String, x: &u64) { h10(v, x).await }
pub async fn h12(v: &String, x: &u64) { h11(v, x).await }
pub async fn h13(v: &String, x: &u64) { h12(v, x).await }
pub async fn h14(v: &String, x: &u64) { h13(v, x).await }
pub async fn h15(v: &String, x: &u64) { h14(v, x).await }
pub async fn h16(v: &String, x: &u64) { h15(v, x).await }
pub async fn h17(v: &String, x: &u64) { h16(v, x).await }
pub async fn h18(v: &String, x: &u64) { h17(v, x).await }
pub async fn h19(v: &String, x: &u64) { h18(v, x).await }

macro_rules! async_recursive {
    (29, $inner:expr) => { async { async_recursive!(28, $inner) }.await };
    (28, $inner:expr) => { async { async_recursive!(27, $inner) }.await };
    (27, $inner:expr) => { async { async_recursive!(26, $inner) }.await };
    (26, $inner:expr) => { async { async_recursive!(25, $inner) }.await };
    (25, $inner:expr) => { async { async_recursive!(24, $inner) }.await };
    (24, $inner:expr) => { async { async_recursive!(23, $inner) }.await };
    (23, $inner:expr) => { async { async_recursive!(22, $inner) }.await };
    (22, $inner:expr) => { async { async_recursive!(21, $inner) }.await };
    (21, $inner:expr) => { async { async_recursive!(20, $inner) }.await };
    (20, $inner:expr) => { async { async_recursive!(19, $inner) }.await };

    (19, $inner:expr) => { async { async_recursive!(18, $inner) }.await };
    (18, $inner:expr) => { async { async_recursive!(17, $inner) }.await };
    (17, $inner:expr) => { async { async_recursive!(16, $inner) }.await };
    (16, $inner:expr) => { async { async_recursive!(15, $inner) }.await };
    (15, $inner:expr) => { async { async_recursive!(14, $inner) }.await };
    (14, $inner:expr) => { async { async_recursive!(13, $inner) }.await };
    (13, $inner:expr) => { async { async_recursive!(12, $inner) }.await };
    (12, $inner:expr) => { async { async_recursive!(11, $inner) }.await };
    (11, $inner:expr) => { async { async_recursive!(10, $inner) }.await };
    (10, $inner:expr) => { async { async_recursive!(9, $inner) }.await };

    (9, $inner:expr) => { async { async_recursive!(8, $inner) }.await };
    (8, $inner:expr) => { async { async_recursive!(7, $inner) }.await };
    (7, $inner:expr) => { async { async_recursive!(6, $inner) }.await };
    (6, $inner:expr) => { async { async_recursive!(5, $inner) }.await };
    (5, $inner:expr) => { async { async_recursive!(4, $inner) }.await };
    (4, $inner:expr) => { async { async_recursive!(3, $inner) }.await };
    (3, $inner:expr) => { async { async_recursive!(2, $inner) }.await };
    (2, $inner:expr) => { async { async_recursive!(1, $inner) }.await };
    (1, $inner:expr) => { async { async_recursive!(0, $inner) }.await };
    (0, $inner:expr) => { async { h19(&String::from("owo"), &0).await; $inner }.await };
}

async fn f() {
    async_recursive!(14, println!("hello"));
}

fn main() {
    let _ = f();
}
```
r? `@eddyb` requires a perf run.
2020-09-22 22:52:07 +00:00
Alexis Bourget
ec4e9cd12a Use Self in alloc 2020-09-23 00:31:37 +02:00
LingMan
c07890543d
Don't use an if guard to check equality with a constant
Match on it directly instead
2020-09-23 00:29:56 +02:00
Alexis Bourget
87a5dec4db Use Self more in core in doc when possible 2020-09-23 00:16:16 +02:00
Alexis Bourget
b6e72837fd Use Self more in core/src/cmp.rs 2020-09-22 23:36:08 +02:00
Simon Vandel Sillesen
ff241633f4 rebless after rebase 2020-09-22 23:09:07 +02:00
Simon Vandel Sillesen
b6f51d6d6a cleanup cfg after optimization 2020-09-22 23:09:07 +02:00
Simon Vandel Sillesen
f472303a93 The optimization should also apply for DropAndReplace 2020-09-22 23:09:07 +02:00
Simon Vandel Sillesen
d3338dcf4d Get LocalDefId from source instead of passing in 2020-09-22 23:09:07 +02:00
Simon Vandel Sillesen
b4bdaa14f2 Suggestion from review
Co-authored-by: Andreas Jonson <andjo403@users.noreply.github.com>
2020-09-22 23:09:07 +02:00
Simon Vandel Sillesen
290dca1781 MIR pass to remove unneeded drops on types not needing drop
This is heavily dependent on MIR inlining running to actually see the drop statement
2020-09-22 23:09:07 +02:00
bors
0da5800745 Auto merge of #76810 - Mark-Simulacrum:fix-lld-macos, r=alexcrichton
Don't dynamically link LLVM tools unless rustc is too

This PR initially tried to support link-shared on all of our target platforms (other than Windows), but ran into a number of difficulties:
 * LLVM doesn't really support a shared link on macOS (llvm-config runs into problems with the version suffix)
 * LLVM doesn't seem to support a shared link when cross-compiling (the libLLVM.so ends up empty and symbols are not found)

So, this PR has now been revised such that we don't attempt to dynamically link LLVM tools (even if that would, otherwise, be supported) on targets where LLVM is statically linked to rustc. Currently that's basically everything except for x86_64-unknown-linux-gnu (where we dynamically link to avoid rerunning ThinLTO in each stage).

Follow-up to #76708.
Fixes #76698.
2020-09-22 20:35:45 +00:00
Bastian Kauschke
438d229b25 dead_code: look at trait impls even if they don't contain items 2020-09-22 22:13:58 +02:00
Bastian Kauschke
179f63dafc add array from_ref 2020-09-22 21:35:43 +02:00
Jonas Schievink
928a29fd41 Bless mir-opt tests 2020-09-22 20:59:05 +02:00
Jonas Schievink
4b6a4821b7 Fix dest prop miscompilation around references 2020-09-22 20:19:00 +02:00
Dylan MacKenzie
186d148b4c Use correct feature gate for unsizing casts 2020-09-22 10:22:50 -07:00
Dylan MacKenzie
6044836284 Add #![feature(const_fn_transmute)] to rustc_ast 2020-09-22 10:22:21 -07:00
Josh Stone
883a7a5c05 Rebase LLVM onto 11.0.0-rc3 2020-09-22 10:16:03 -07:00
Dylan MacKenzie
08e3822d9a Replace missing comment 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
d60e204e0a Use the same name everywhere for is_const_stable_const_fn 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
9be3d106c3 Bless compile-fail 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
ef6d4277ed Bless tests 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
3569bb6323 Update const-checker to replicate qualify_min_const_fn 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
5ee5429e00 Add structured errors for qualify_min_const_fn checks 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
bfc10a89c3 Allow errors to abort const checking when emitted
This is a hack for parity with `qualify_min_const_fn`, which only
emitted a single error.
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
7fb9587a3c Return true if check_const emits an error 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
a173c5c1b3 Add const-stability helpers 2020-09-22 10:05:58 -07:00
Dylan MacKenzie
110e59e70e Update library functions with stability attributes
This may not be strictly minimal, but all unstable functions also need a
`rustc_const_unstable` attribute.
2020-09-22 10:05:58 -07:00
Dylan MacKenzie
3dd28c78c3 Useful derives on ops::Status 2020-09-22 10:05:58 -07:00
Imbolc
4622ceb5e0
Update library/std/src/net/addr.rs
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-09-22 19:09:35 +03:00
Imbolc
5ab714fdfe
Update library/std/src/net/addr.rs
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-09-22 19:09:27 +03:00
bors
29b12f22fc Auto merge of #6069 - alex-700:redundant-pattern-matching-in-macro, r=Manishearth
Forbid redundant_pattern_matching triggering in macros

fixes #6065

changelog: forbid redundant_pattern_matching triggering in macros
2020-09-22 16:01:39 +00:00
blitzerr
14736ca20b fixing the custom.rs 2020-09-22 08:51:20 -07:00
est31
05c3a2b07d Add #[track_caller] to more panicking Cell functions
Continuation of #74526

Adds the #[track_caller] attribute to almost all panicking Cell
functions. The ones that borrow two Cells in their function
body are spared, because the panic location helps pinpoint
which of the two borrows failed. You'd need to have
full debuginfo and backtraces enabled together with column
info in order to be able to discern the cases.
Column info is only available on non-Windows platforms.
2020-09-22 15:34:22 +02:00
blitzerr
3ffd403c6b removing &mut self for other methods of AllocRef 2020-09-22 06:22:02 -07:00
bors
e0bc267512 Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplett
Function to convert OpenOptions to c_int

Fixes: #74943
The creation_mode and access_mode function were already available in the OpenOptions struct, but currently private. I've added a new free functions to unix/fs.rs which takes the OpenOptions, and returns the c_int to be used as parameter for the `open` call.
2020-09-22 13:02:02 +00:00
Guillaume Gomez
143557ec56 Add missing examples on Vec iter types 2020-09-22 13:47:06 +02:00
bors
cbc5e4d4d5 Auto merge of #76626 - jyn514:x.py-changelog, r=Mark-Simulacrum
Add a changelog for x.py and nag contributors until they read it

Add a changelog for x.py

- Add a changelog and instructions for updating it
- Use `changelog-seen` in `config.toml` and `VERSION` in bootstrap to determine whether the changelog has been read.  There's no way to tie reading the changelog to updating the version, so unfortunately they still have to update `config.toml` manually. Actually reading the changelog is optional, anyone can set `changelog-seen = N` without reading (although it's not recommended).
- Nag people if they haven't read the x.py changelog
  + Print message twice to make sure it's seen
- Give different error messages depending on whether the version needs to be updated or added

Closes https://github.com/rust-lang/rust/issues/76617
r? `@Mark-Simulacrum`
2020-09-22 10:36:41 +00:00
Federico Ponzi
2f5192280f
enable unstable open_options_ext_as_flags feature in doc comments 2020-09-22 09:54:36 +01:00
follower
0082d201f1
Typo fix: "satsify" -> "satisfy" 2020-09-22 20:54:07 +12:00
bors
c113030f6b Auto merge of #76906 - Nicholas-Baron:shorten_typeck_check, r=oli-obk
Split rustc_typeck::check into separate files

Contributing to #60302.
2020-09-22 08:11:07 +00:00
Ralf Jung
731113b8ee Miri: more informative deallocation error messages 2020-09-22 09:05:12 +02:00