Commit graph

153128 commits

Author SHA1 Message Date
Guillaume Gomez
fc3a90dc74
Rollup merge of #87966 - pietroalbini:fix-pidfd-test, r=m-ou-se
Fix `command-create-pidfd` test inside unprivileged Docker containers

In `src/test/ui/command/command-create-pidfd.rs` (added #81825), the detection code to skip the test on unsupported platforms doesn't account for unprivileged Docker containers (CI uses privileged containers), which leads to a test failure as you can't call the `clone3` syscall in that environment. This PR enhances the detection code to also consider unprivileged containers.
2021-08-13 15:29:11 +02:00
Guillaume Gomez
717f9e3769
Rollup merge of #87795 - estebank:erase-lifetimes-in-suggestion, r=oli-obk
Avoid ICE caused by suggestion

When suggesting dereferencing something that can be iterable in a `for`
loop, erase lifetimes and use a fresh `ty::ParamEnv` to avoid 'region
constraints already solved' panic.

Fix #87657, fix #87709, fix #87651.
2021-08-13 15:29:10 +02:00
Frank Steffahn
3f0d04e97b Improve wording, correct -> tight. 2021-08-13 15:27:30 +02:00
Guillaume Gomez
11716db285 Update browser-ui-test package version 2021-08-13 14:52:28 +02:00
Guillaume Gomez
a3d3df4ba6 Add rustdoc GUI test for headers 2021-08-13 14:23:13 +02:00
Deadbeef
74627c17c5
Fix Cargo.lock and ui test 2021-08-13 11:30:33 +00:00
Mara Bos
8fedb31649 Use is_diagnostic_item instead of get_diagnostic_item. 2021-08-13 12:21:31 +02:00
Mara Bos
5ad41069e6 Update non-fmt-panic tests. 2021-08-13 12:20:14 +02:00
Frank Steffahn
4304686049 Consistent use of impl Trait arguments in the test's helper function. 2021-08-13 12:02:35 +02:00
Mara Bos
b4f448a7ea non_fmt_panic: machine app. suggestion for assert with string msg. 2021-08-13 11:50:32 +02:00
Deadbeef
2931a9df2f
make check less conservative and add explanation 2021-08-13 09:28:52 +00:00
Deadbeef
54d4fc245a
Bless test 2021-08-13 09:28:52 +00:00
Deadbeef
1fa712d0ba
Make assoc types work with ?const opt=out 2021-08-13 09:28:52 +00:00
Deadbeef
8c2a1e8e43
allow incomplete features for now 2021-08-13 09:28:52 +00:00
Deadbeef
7ea0280aa9
Moved ui test 2021-08-13 09:28:51 +00:00
Deadbeef
869daad8fc
Fix tests 2021-08-13 09:28:51 +00:00
Deadbeef
6b6ad781f8
Fix call-generic-method-nonconst test 2021-08-13 09:28:51 +00:00
Deadbeef
7106f8d8ee
Don't transform predicates in Inherited 2021-08-13 09:28:51 +00:00
Deadbeef
c6d0a20f7b
handle the case when container is not impl 2021-08-13 09:28:50 +00:00
Deadbeef
bcf0e2f528
Fix assoc-type test 2021-08-13 09:28:50 +00:00
Deadbeef
01bb3710b5
Pass constness to SelectionContext 2021-08-13 09:28:50 +00:00
Deadbeef
a00f2bcf5c
Try to fix problem 2021-08-13 09:28:50 +00:00
Deadbeef
779eef2dae
Relate impl 2021-08-13 09:28:50 +00:00
Deadbeef
3bab45d2ac
Make selection and evaluation caches use constness 2021-08-13 09:28:49 +00:00
Deadbeef
36ace4c0ad
fmt 2021-08-13 09:28:49 +00:00
Deadbeef
7e6db83b14
Inherited use constness and assoc change predicate 2021-08-13 09:28:40 +00:00
Deadbeef
d356cd10f7
fmt 2021-08-13 09:26:34 +00:00
Deadbeef
4c8b6a20a9
Filter non-const impls when we expect a const one 2021-08-13 09:26:33 +00:00
Deadbeef
32390a0df6
move Constness into TraitPredicate 2021-08-13 09:26:33 +00:00
bors
2fc3c69e54 Auto merge of #87956 - m-ou-se:closure-migration-macro-body, r=Aaron1011
Fix closure migration suggestion when the body is a macro.

Fixes https://github.com/rust-lang/rust/issues/87955

Before:
```
warning: changes to closure capture in Rust 2021 will affect drop order
 --> src/main.rs:5:13
  |
5 |     let _ = || panic!(a.0);
  |             ^^^^^^^^^^---^
  |                       |
  |                       in Rust 2018, closure captures all of `a`, but in Rust 2021, it only captures `a.0`
6 | }
  | - in Rust 2018, `a` would be dropped here, but in Rust 2021, only `a.0` would be dropped here alongside the closure
  |

help: add a dummy let to cause `a` to be fully captured
  |
20~     ($msg:expr $(,)?) => ({ let _ = &a;
21+         $crate::rt::begin_panic($msg)
22~     }),
  |
```

After:
```
warning: changes to closure capture in Rust 2021 will affect drop order
 --> src/main.rs:5:13
  |
5 |     let _ = || panic!(a.0);
  |             ^^^^^^^^^^---^
  |                       |
  |                       in Rust 2018, closure captures all of `a`, but in Rust 2021, it only captures `a.0`
6 | }
  | - in Rust 2018, `a` would be dropped here, but in Rust 2021, only `a.0` would be dropped here alongside the closure
  |
help: add a dummy let to cause `a` to be fully captured
  |
5 |     let _ = || { let _ = &a; panic!(a.0) };
  |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2021-08-13 08:31:26 +00:00
bors
04c9901a08 Auto merge of #87954 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2021-08-13 05:30:37 +00:00
skim
474ba60f04 Updates favicon order of precedence as it matters to Chrome 2021-08-12 21:08:14 -07:00
bors
13d6c5c90c Auto merge of #87927 - spastorino:use-def-id-typeckresults, r=oli-obk
Make concrete_opaque_types be FxHashSet<DefId>

r? `@oli-obk`

`@bors` rollup=always
2021-08-13 02:49:45 +00:00
bors
61885df263 Auto merge of #87980 - Manishearth:rollup-vkuix3y, r=Manishearth
Rollup of 4 pull requests

Successful merges:

 - #87916 (Implement `black_box` using intrinsic)
 - #87922 (Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets)
 - #87953 (Improve formatting of closure capture migration suggestion for multi-line closures.)
 - #87965 (Silence non_fmt_panic from external macros.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-08-12 23:48:16 +00:00
Frank Steffahn
0bb11f43f6 Rewrite test from previous commit but without using macros. 2021-08-12 23:11:19 +02:00
bors
0fa3190394 Auto merge of #87916 - nbdd0121:black_box, r=nagisa
Implement `black_box` using intrinsic

Introduce `black_box` intrinsic, as suggested in https://github.com/rust-lang/rust/pull/87590#discussion_r680468700.

This is still codegenned as empty inline assembly for LLVM. For MIR interpretation and cranelift it's treated as identity.

cc `@Amanieu` as this is related to inline assembly
cc `@bjorn3` for rustc_codegen_cranelift changes
cc `@RalfJung` as this affects MIRI

r? `@nagisa` I suppose
2021-08-12 21:04:07 +00:00
Mara Bos
26c590d1b3 Improve fallback span for closure migration lint. 2021-08-12 20:35:54 +02:00
Mara Bos
cd7f960314 Improve comment in closure migration code. 2021-08-12 20:35:39 +02:00
Manish Goregaokar
2d27976b8b
Rollup merge of #87965 - m-ou-se:non-fmt-panic-external, r=estebank
Silence non_fmt_panic from external macros.

This stops the non_fmt_panic lint from triggering if a macro from another crate is entirely responsible. In those cases there's nothing that the current crate can/should do.

See also https://github.com/rust-lang/rust/issues/87621#issuecomment-890311054
2021-08-12 10:04:16 -07:00
Manish Goregaokar
0c4e37ad5c
Rollup merge of #87953 - m-ou-se:closure-migration-multiline-formatting, r=petrochenkov
Improve formatting of closure capture migration suggestion for multi-line closures.

Fixes https://github.com/rust-lang/rust/issues/87952

Before:
```
help: add a dummy let to cause `a` to be fully captured
  |
5 ~     let _ = || { let _ = &a;
6 +         dbg!(a.0);
7 ~     };
  |
```

After:
```
help: add a dummy let to cause `a` to be fully captured
  |
5 ~     let _ = || {
6 +         let _ = &a;
7 +         dbg!(a.0);
8 ~     };
  |
```
2021-08-12 10:04:15 -07:00
Manish Goregaokar
692833a28f
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets

Fixes https://github.com/rust-lang/rust/issues/87917

<s>Haven't tested this yet, still playing around.</s>

This seems to fix the issue.
2021-08-12 10:04:14 -07:00
Manish Goregaokar
df23264f80
Rollup merge of #87916 - nbdd0121:black_box, r=nagisa
Implement `black_box` using intrinsic

Introduce `black_box` intrinsic, as suggested in https://github.com/rust-lang/rust/pull/87590#discussion_r680468700.

This is still codegenned as empty inline assembly for LLVM. For MIR interpretation and cranelift it's treated as identity.

cc `@Amanieu` as this is related to inline assembly
cc `@bjorn3` for rustc_codegen_cranelift changes
cc `@RalfJung` as this affects MIRI

r? `@nagisa` I suppose
2021-08-12 10:04:07 -07:00
Manish Goregaokar
4c0e424461 Apply c_enum_min_bits = 8 to (arm|thumb)-none- platforms 2021-08-12 09:44:16 -07:00
Manish Goregaokar
fd116c806a Add c_enum_min_bits to target spec 2021-08-12 09:44:16 -07:00
hyd-dev
9315a0cd4c
Add tests for #[no_mangle] in impl blocks that looks like generic impl blocks but are actually not 2021-08-13 00:15:58 +08:00
Mara Bos
8dc8649bd7 Add test or unused import removal suggestion with attributes. 2021-08-12 17:35:57 +02:00
Mara Bos
f1860d1901 Include attributes in removal span for unused imports. 2021-08-12 17:35:52 +02:00
Frank Steffahn
31e49f0272 Test and fix size_hint for slice's [r]split* iterators
Adds extensive test for all the [r]split* iterators.
Fixes size_hint upper bound for split_inclusive* iterators which was one higher than necessary for non-empty slices.
Fixes size_hint lower bound for [r]splitn* iterators when n==0, which was one too high.
2021-08-12 17:26:03 +02:00
Gary Guo
1fb1643129 Implement black_box using intrinsic
The new implementation allows some `memcpy`s to be optimized away,
so the uninit value in ui/sanitize/memory.rs is constructed directly
onto the return place. Therefore the sanitizer now says that the
value is allocated by `main` rather than `random`.
2021-08-12 16:16:57 +01:00
hyd-dev
db138485b1
Adjust check_no_mangle and check_export_name to warn/error on #[no_mangle]/#[export_name] on trait methods 2021-08-12 22:02:22 +08:00