Commit Graph

120262 Commits

Author SHA1 Message Date
bors
6f5c7827b7 Auto merge of #71557 - matthewjasper:mir-asymmetric-or-pattern, r=oli-obk
Fix ICE for broken or-pattern in async fn

closes #71297
2020-05-10 01:12:21 +00:00
bors
0a3619c9e5 Auto merge of #69530 - Aaron1011:perf/skip-coerce-var, r=nikomatsakis
[perf] Skip attempting to run coerce_unsized on an inference variable

See the included comment for a detailed explanation of why this is
sound.
2020-05-09 21:01:19 +00:00
Marko Mijalkovic
8961b08376 Formatting 2020-05-09 16:39:45 -04:00
Marko Mijalkovic
20a6691323 Update stdarch 2020-05-09 16:03:40 -04:00
Marko Mijalkovic
b6e4581937 Add mipsel-sony-psp target 2020-05-09 15:41:49 -04:00
Bastian Kauschke
bb6a6e0832 move ty::List into a new submodule 2020-05-09 21:06:48 +02:00
bors
43a1777b89 Auto merge of #5564 - MrAwesome:master, r=flip1995
Allow `use super::*;` glob imports

changelog: Allow super::* glob imports

fixes #5554
fixes #5569

A first pass at #5554 - this allows all `use super::*` to pass, which may or may not be desirable. The original issue was around allowing test modules to import their entire parent modules - I'm happy to modify this to do that instead, may just need some guidance on how to implement that (I played around a bit with #[cfg(test)] but from what I can gather, clippy itself isn't in test mode when running, even if the code in question is being checked for the test target).
2020-05-09 18:43:28 +00:00
Glenn Hope
b69200b846 Move is_test_module check to top of function 2020-05-09 11:10:16 -07:00
Glenn Hope
0ba61c612e Check is_macro inside check_exceptions, update references to fix test 2020-05-09 11:10:16 -07:00
Glenn Hope
a339766136 Fix test from auto-formatter fix 2020-05-09 11:10:16 -07:00
Glenn Hope
4db6abcd50 Remove check for Fn, reflect this in test cases, make test cases more robust/explicit 2020-05-09 11:09:38 -07:00
Glenn Hope
152cdcb45b Remove unnecessary field, check for Mod/Fn ItemKind 2020-05-09 11:09:38 -07:00
Glenn Hope
a42a2bdac2 Also have flag disable macro check 2020-05-09 11:09:38 -07:00
Glenn Hope
ad92486d52 Add check for "test" in parent name. Include flag for disabling wildcard import exceptions 2020-05-09 11:09:38 -07:00
Glenn Hope
56f4e1c3a8 Check if the parent module name contains "test" 2020-05-09 11:09:38 -07:00
Glenn Hope
bdc75dbb7b Run cargo dev fmt 2020-05-09 11:09:38 -07:00
Glenn Hope
0c14ea8ed7 Allow 'use super::*;' imports 2020-05-09 11:09:38 -07:00
bors
bad3bf622b Auto merge of #72041 - RalfJung:rollup-xivrvy2, r=RalfJung
Rollup of 5 pull requests

Successful merges:

 - #69406 (upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir)
 - #71185 (Move tests from `test/run-fail` to UI)
 - #71234 (rustllvm: Use .init_array rather than .ctors)
 - #71508 (Simplify the `tcx.alloc_map` API)
 - #71555 (Remove ast::{Ident, Name} reexports.)

Failed merges:

r? @ghost
2020-05-09 17:31:08 +00:00
Bastian Kauschke
0db2aec14a display ConstKind::Param 2020-05-09 17:10:40 +02:00
Jonas Schievink
e22cc993fb Visit move out of _0 when visiting return 2020-05-09 16:08:04 +02:00
bors
43d9cdc7b3 Auto merge of #5580 - matthiaskrgr:regex_dep, r=flip1995
deps: remove unused regex dependency from root crate

changelog: none
2020-05-09 12:41:19 +00:00
Ralf Jung
6a8cf4a17c adjust tests 2020-05-09 14:40:17 +02:00
Ralf Jung
1fce20340a expand "incomplete feature" message to include unsoundness and link to tracking issue 2020-05-09 14:06:10 +02:00
Guillaume Gomez
e0c0c3b96f Add missing backtick in E0569 explanation 2020-05-09 13:51:46 +02:00
Guillaume Gomez
b865db0462 Sort "implementations on foreign types" section in the sidebar 2020-05-09 13:50:24 +02:00
Julian Wollersberger
e734e31340 Small doc improvements.
The phrasing is from the commit description of 395ee0b79f by @Matklad.
2020-05-09 13:46:03 +02:00
Ralf Jung
51158cc71f Rollup merge of #71555 - cjgillot:nameless, r=matthewjasper
Remove ast::{Ident, Name} reexports.

The reexport of `Symbol` into `Name` confused me.
2020-05-09 13:36:39 +02:00
Ralf Jung
366c1786e6
Rollup merge of #71555 - cjgillot:nameless, r=matthewjasper
Remove ast::{Ident, Name} reexports.

The reexport of `Symbol` into `Name` confused me.
2020-05-09 13:36:39 +02:00
Ralf Jung
8c0310d18c
Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJung
Simplify the `tcx.alloc_map` API

This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private.

r? @RalfJung
2020-05-09 13:36:37 +02:00
Ralf Jung
ce05553c62
Rollup merge of #71234 - maurer:init-array, r=cuviper
rustllvm: Use .init_array rather than .ctors

LLVM TargetMachines default to using the (now-legacy) .ctors
representation of init functions. Mixing .ctors and .init_array
representations can cause issues when linking with lld.

This happens in practice for:

* Our profiling runtime which is currently implicitly built with
  .init_array since it is built by clang, which sets this field.
* External C/C++ code that may be linked into the same process.

Fixes: #71233
2020-05-09 13:36:32 +02:00
Ralf Jung
1704dca270
Rollup merge of #71185 - JohnTitor:run-fail, r=petrochenkov
Move tests from `test/run-fail` to UI

Fixes #65440
cc #65865 #65506
r? @nikomatsakis
2020-05-09 13:36:30 +02:00
Ralf Jung
2420b42ac6
Rollup merge of #69406 - jackh726:chalk-upgrade, r=nikomatsakis
upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir

Reintegrate chalk into rustc.

r? @nikomatsakis
cc. @rust-lang/wg-traits
2020-05-09 13:36:29 +02:00
Matthew Jasper
b998497bd4 Address review comments 2020-05-09 10:51:39 +01:00
Matthew Jasper
a030c92341 Bless mir-opt tests 2020-05-09 10:51:39 +01:00
Matthew Jasper
1a19c1da73 Add some more comments 2020-05-09 10:51:38 +01:00
bors
7c59a81a5f Auto merge of #72030 - matthiaskrgr:submodule_upd, r=Mark-Simulacrum
submodules: update cargo from f534844c2 to cb06cb269

Changes:
````
more clippy fixes
Document that bench is unstable in the man page.
Update assertions in LTO calculations
Updated comments in resolve.rs to reflect actual data strcture used.
Try to remove secrets from http.debug.
Revert always computing filename Metadata.
clean -p: call `get_many` once.
Implement new `clean -p` using globs.
Rework how Cargo computes the rustc file outputs.
Add CrateType to replace LibKind.
````

I'd like to get the fix for https://github.com/rust-lang/cargo/issues/8223 into nightly asap.

r? @ehuss
2020-05-09 09:50:58 +00:00
Matthew Jasper
54aa418a60 Reduce the number of drop-flag assignments in unwind paths 2020-05-09 10:50:55 +01:00
Matthew Jasper
611988551f Defer creating drop trees in MIR lowering until leaving that scope 2020-05-09 10:50:55 +01:00
bors
34d6b446e5 Auto merge of #71994 - jyn514:path-independent, r=Mark-Simulacrum
x.py: allow configuring the build directory

This allows configuring the directory for build artifacts, instead of having it always be `./build`. This means you can set it to a constant location, letting you reuse the same cache while working in several different directories.

The configuration lives in `config.toml` under `build.build-dir`. By default, it keeps the existing default of `./build`, but it can be configured to any relative or absolute path. Additionally, it allows making outputs relative to the root of the git repository using `$ROOT`.

r? @Mark-Simulacrum
2020-05-09 06:26:57 +00:00
bors
945d110e05 Auto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #70834 (Add core::future::{pending,ready})
 - #71839 (Make BTreeMap::new and BTreeSet::new const)
 - #71890 (Simplify the error Registry methods a little)
 - #71942 (Shrink `LocalDecl`)
 - #71947 (Dead-code pass highlights too much of impl functions)
 - #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation)
 - #72018 (Fix canonicalization links)
 - #72031 (Better documentation for io::Read::read() return value)

Failed merges:

r? @ghost
2020-05-09 03:07:54 +00:00
Dylan DPC
4b337d2bf6
Rollup merge of #72031 - Elinvynia:master, r=Mark-Simulacrum
Better documentation for io::Read::read() return value

Aims to provide the clarity requested in #70360
2020-05-09 03:10:16 +02:00
Dylan DPC
46d97c21cf
Rollup merge of #72018 - mark-i-m:canon-chalk, r=mark-i-m
Fix canonicalization links
2020-05-09 03:10:14 +02:00
Dylan DPC
b86b626b02
Rollup merge of #71981 - DarkEld3r:patch-1, r=ollie27
Fix `strip-priv-imports` pass name in the rustdoc documentation
2020-05-09 03:10:12 +02:00
Dylan DPC
966589edfc
Rollup merge of #71947 - mibac138:dead-code, r=cramertj
Dead-code pass highlights too much of impl functions

Fixes #66627.
Previous diagnostic:
```
error: method is never used: `unused_impl_fn_3`
  --> src/main.rs:28:5
   |
28 | /     fn unused_impl_fn_3(
29 | |         var: i32,
30 | |     ) {
31 | |         println!("bar {}", var);
32 | |     }
   | |_____^
```
New diagnostic:
```
error: associated function is never used: `unused_impl_fn_3`
  --> $DIR/lint-dead-code-6.rs:13:8
   |
LL |     fn unused_impl_fn_3(
   |        ^^^^^^^^^^^^^^^^
```

This makes associated functions in line with free-standing functions.
2020-05-09 03:10:11 +02:00
Dylan DPC
2b3a114633
Rollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasper
Shrink `LocalDecl`

`LocalDecl` contributes 4-8% of peak heap memory usage on a range of benchmarks. This PR reduces its size from 128 bytes to 56 bytes on 64-bit, and does some clean-ups as well.

r? @matthewjasper
2020-05-09 03:10:09 +02:00
Dylan DPC
d16d02b011
Rollup merge of #71890 - cuviper:simple-error-Registry, r=cramertj
Simplify the error Registry methods a little
2020-05-09 03:10:07 +02:00
Dylan DPC
f16c27f1c4
Rollup merge of #71839 - LG3696:master, r=cramertj
Make BTreeMap::new and BTreeSet::new const
2020-05-09 03:10:05 +02:00
Dylan DPC
62374ee4ad
Rollup merge of #70834 - yoshuawuyts:future-pending-ready, r=sfackler
Add core::future::{pending,ready}

Adds two future constructors to `core`: `future::ready` and `future::pending`. These functions enable constructing futures of any type that either immediately resolve, or never resolve which is an incredible useful tool when writing documentation.

These functions have prior art in both the `futures` and `async-std` crates. This implementation has been adapted from the `futures` crate.

## Examples

In https://github.com/rust-lang/rust/pull/70817 we propose adding the `ready!` macro. In the example we use an `async fn` which does not return a future that implements `Unpin`, which leads to the use of `unsafe`. Instead had we had `future::ready` available, we could've written the same example without using `unsafe`:

```rust
use core::task::{Context, Poll};
use core::future::{self, Future};
use core::pin::Pin;

pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
    let mut fut = future::ready(42_u8);
    let num = ready!(Pin::new(fut).poll(cx));
    // ... use num

    Poll::Ready(())
}
```

## Why future::ready?

Arguably `future::ready` and `async {}` can be considered equivalent. The main differences are that `future::ready` returns a future that implements `Unpin`, and the returned future is a concrete type. This is useful for traits that require a future as an associated type that can sometimes be a no-op ([example](https://docs.rs/http-service/0.4.0/http_service/trait.HttpService.html#associatedtype.ConnectionFuture)).

The final, minor argument is that `future::ready` and `future::pending` form a counterpart to the enum members of `Poll`: `Ready` and `Pending`. These functions form a conceptual bridge between `Poll` and `Future`, and can be used as a useful teaching device.

## References
- [`futures::future::ready`](https://docs.rs/futures/0.3.4/futures/future/fn.ready.html)
- [`futures::future::pending`](https://docs.rs/futures/0.3.4/futures/future/fn.pending.html)
- [`async_std::future::pending`](https://docs.rs/async-std/1.5.0/async_std/future/fn.pending.html)
- [`async_std::future::ready`](https://docs.rs/async-std/1.5.0/async_std/future/fn.ready.html)
2020-05-09 03:10:01 +02:00
Joshua Nelson
df36ec0b7e x.py: allow configuring the build directory
This allows configuring the directory for build artifacts, instead of having it always be ./build. This means you can set it to a constant location, letting you reuse the same cache while working in several different directories.

The configuration lives in config.toml under build.build-dir. By default, it keeps the existing default of ./build, but it can be configured to any relative or absolute path. Additionally, it allows making outputs relative to the root of the git repository using $ROOT.
2020-05-08 20:33:50 -04:00
bors
0f9088f961 Auto merge of #71418 - hbina:rename_miri_undef, r=RalfJung
Renamed "undef" -> "uninit"

1. InvalidUndefBytes -> InvalidUninitBytes
2. ScalarMaybeUndef -> ScalarMaybeUninit
3. UndefMask -> InitMask

Related issue #71193
2020-05-08 23:45:57 +00:00