Commit Graph

168407 Commits

Author SHA1 Message Date
Yuki Okushi
519b6b4c77
Rollup merge of #97093 - pvdrz:migrate-maybe-recover-from-bad-type-plus, r=davidtwco
Migrate `maybe_recover_from_bad_type_plus` diagnostic

r? `@davidtwco`
2022-05-17 19:01:34 +09:00
Yuki Okushi
13ee094260
Rollup merge of #97080 - lcnr:relate-sus, r=oli-obk
remove the `RelateResultCompare` trait

it's unused
2022-05-17 19:01:33 +09:00
Yuki Okushi
70cd85f5e3
Rollup merge of #97079 - SparrowLii:successors, r=lcnr
Change `Successors` to `impl Iterator<Item = BasicBlock>`

This PR fixes the FIXME in `compiler\rustc_middle\src\mir\mod.rs`.
This can omit several `&`, `*` or `cloned` operations on Successros' generated elements
2022-05-17 19:01:32 +09:00
Yuki Okushi
aaa0c014e2
Rollup merge of #97075 - JohnTitor:issue-81804, r=compiler-errors
Add regression test for #81804

Closes #81804
r? ``@compiler-errors``
2022-05-17 19:01:31 +09:00
Yuki Okushi
17eebcd4c3
Rollup merge of #97009 - fortanix:raoul/unused_macro_sgx, r=thomcc
Allow `unused_macro_rules` in path tests

PR #96150 adds a new lint to warn about unused macro rules (arms/matchers). This causes errors in `library/std/src/path/tests.rs` on the `x86_64-fortanix-unknown-sgx` platform. This PR fixes compilation errors on that platform by allowing unused macro rules.
2022-05-17 19:01:30 +09:00
Yuki Okushi
15aa2d6189
Rollup merge of #96329 - aliemjay:fixed-by-90887, r=jackh726
Add a couple tests for #90887 fixes

closes #56556
closes #90875

These are confirmed fixes by #90887, so
r? ``@jackh726``
2022-05-17 19:01:29 +09:00
bors
735efc0c70 Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwco
Add a query for checking whether a function is an intrinsic.

work towards #93145

This will reduce churn when we add more ways to declare intrinsics

r? `@scottmcm`
2022-05-17 09:39:26 +00:00
mbartlett21
cdc12edb4c Add a test for fn pointer calls in consts 2022-05-17 07:24:47 +00:00
bors
7355d971a9 Auto merge of #96825 - kckeiks:remove-item-like-visitor-trait, r=cjgillot
Retire `ItemLikeVisitor` trait

Issue #95004
cc `@cjgillot`
2022-05-17 06:51:45 +00:00
bors
1e8cd63d60 Auto merge of #96907 - sunfishcode:sunfishcode/update-wasi, r=Mark-Simulacrum
Update the wasi toolchain.

Update the WASI build to LLVM 14.0 and the wasi-libc version from wasi-sdk-15.

This will require a ci-mirrors.rust-lang.org file load. Specifically, we
need [this LLVM release tarball] uploaded to be downloadable from
[this URL].

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-05-10-clang%2Bllvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
2022-05-17 04:37:47 +00:00
mbartlett21
56649bb844 Update function pointer call error message
It now uses the type of context. (issue 97082)
2022-05-17 04:13:20 +00:00
Noa
e68e9775e2
Add tracking issue for ExitCode::exit_process 2022-05-16 22:56:26 -05:00
Christian Poveda
7cafefec4a
keep bounds where they were 2022-05-16 22:23:32 -05:00
bors
c1d65eaa45 Auto merge of #96892 - oli-obk:🐌_obligation_cause_code_🐌, r=estebank
Clean up derived obligation creation

r? `@estebank`

working on fixing the perf regression from https://github.com/rust-lang/rust/pull/91030#issuecomment-1083360210
2022-05-17 01:46:25 +00:00
SparrowLii
38bf1158bd Change Successors to impl Iterator<Item = BasicBlock> 2022-05-17 08:41:01 +08:00
Connor Horman
50ce367880 add clobbers 2022-05-16 20:40:19 -04:00
Josh Stone
1c3921fa43 Read the Ref/RefMut pointer in natvis 2022-05-16 17:39:34 -07:00
Josh Stone
1f33c921d1 Add a comment for covariant Ref 2022-05-16 17:24:53 -07:00
Josh Stone
1e53fab55a Remove outdated references to nll-rfc#40 2022-05-16 17:22:51 -07:00
Connor Horman
658be0d1cf Add tmm_reg clobbers 2022-05-16 20:15:06 -04:00
Tomasz Miąsko
17f2893455 Types with reachable constructors are reachable 2022-05-17 00:00:00 +00:00
bors
c1cfdd1fb2 Auto merge of #96713 - petrochenkov:doclink8, r=notriddle
rustdoc: Resolve some more doc links early 2

The subset of https://github.com/rust-lang/rust/pull/94857 that shouldn't be too expensive.
2022-05-16 23:01:28 +00:00
Christian Poveda
7e8517df61
migrate maybe_recover_from_bad_type_plus diagnostic 2022-05-16 17:16:27 -05:00
Ken Matsui
03007dee79
Omit unnecessary help to add #[cfg(test)] when already annotated 2022-05-17 06:50:07 +09:00
Tyler Mandry
4d523a8149 Apply review feedback 2022-05-16 13:46:08 -07:00
Chris Martin
aba3454aa1 Improve error message for fallback RNG failure 2022-05-16 13:49:12 -04:00
Vadim Petrochenkov
159b56f288 rustdoc: Resolve some more doc links early 2022-05-16 19:26:01 +03:00
b-naber
96b36d6eb2 use GlobalId in eval_to_valtree query and introduce query for valtree_to_const_val 2022-05-16 15:58:15 +02:00
bors
c52b9c10bf Auto merge of #96676 - petrochenkov:docrules, r=GuillaumeGomez
rustdoc: Remove doc link resolution fallback to all `macro_rules` in the crate

This is a deny-by-default lint detecting such fallback for crater run, as discussed in https://github.com/rust-lang/rust/pull/96521.
2022-05-16 13:53:40 +00:00
lcnr
0ea7301fa3 remove the RelateResultCompare trait 2022-05-16 15:41:05 +02:00
Oli Scherer
0cefa5fa18 Force inline InternedObligationCauseCode creation 2022-05-16 13:34:03 +00:00
Dan Gohman
4cc0cc7eb3 Update how CC etc. are set in the wasi-libc Makefile.
wasi-libc's Makefile changed how it detects the compiler to use; update
Rust's script to set `CC` directly to the compiler it installs.
2022-05-16 05:07:28 -07:00
Yuki Okushi
a3bc2e5293
Add regression test for #81804 2022-05-16 19:34:30 +09:00
Oli Scherer
0a6b69106e Add a query for checking whether a function is an intrinsic. 2022-05-16 07:07:44 +00:00
Raoul Strackx
3e252a7ffc Allow unused_macro_rules in path tests 2022-05-16 08:55:05 +02:00
bors
56d540e057 Auto merge of #97053 - CAD97:realloc-clarification, r=dtolnay
Remove potentially misleading realloc parenthetical

This parenthetical is problematic, because it suggests that the following is sound:

```rust
let layout = Layout:🆕:<[u8; 32]>();
let p1 = alloc(layout);
let p2 = realloc(p1, layout, 32);
if p1 == p2 {
    p1.write([0; 32]);
    dealloc(p1, layout);
} else {
    dealloc(p2, layout);
}
```

At the very least, this isn't the case for [ANSI `realloc`](https://en.cppreference.com/w/c/memory/realloc)

> The original pointer `ptr` is invalidated and any access to it is undefined behavior (even if reallocation was in-place).

and [Windows `HeapReAlloc`](https://docs.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heaprealloc) is unclear at best (`HEAP_REALLOC_IN_PLACE_ONLY`'s description may imply that the old pointer may be used if `HEAP_REALLOC_IN_PLACE_ONLY` is provided).

The conservative position is to just remove the parenthetical.

cc `@rust-lang/wg-unsafe-code-guidelines` `@rust-lang/wg-allocators`
2022-05-16 02:33:34 +00:00
bors
cdd74fc7b1 Auto merge of #97065 - gabriel-doriath-dohler:master, r=joshtriplett
Rename `eq_ignore_case` to `starts_with_ignore_case`

The method doesn't test for equality. It tests if the object starts with
a given byte array, so its name is confusing.
2022-05-16 00:12:06 +00:00
gabriel-doriath-dohler
26265319c7 Rename eq_ignore_case to starts_with_ignore_case
The method doesn't test for equality. It tests if the object starts with
a given byte array, so its name is confusing.
2022-05-15 23:59:59 +00:00
bors
42e1761c70 Auto merge of #97057 - bjorn3:sync_cg_clif-2022-05-15, r=bjorn3
Sync rustc_codegen_cranelift

Since the last sync there have mostly been fixes of various sorts. I also changed cg_clif from using a custom driver to `-Zcodegen-backend` when built as separate project. When built as part of rust it was already using `-Zcodegen-backend`.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2022-05-15 21:17:46 +00:00
bors
29e972dc60 Auto merge of #97063 - Dylan-DPC:rollup-u5el7hb, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #96947 (Add rustc_nonnull_optimization_guaranteed to Owned/Borrowed Fd/Socket)
 - #97021 (Added note in documentation)
 - #97042 (Add new eslint rule about brace style)
 - #97060 (Fix use of SetHandleInformation on UWP)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-15 18:52:28 +00:00
Vadim Petrochenkov
b4019ded77 rustdoc: Remove doc link resolution fallback to all macro_rules in the crate 2022-05-15 21:08:32 +03:00
Dylan DPC
d56c59efdc
Rollup merge of #97060 - bdbai:fix/uwphandle, r=ChrisDenton
Fix use of SetHandleInformation on UWP

The use of `SetHandleInformation` (introduced in #96441 to make `HANDLE` inheritable) breaks UWP builds because it is not available for UWP targets.

Proposed workaround: duplicate the `HANDLE` with `inherit = true` and immediately close the old one. Traditional Windows Desktop programs are not affected.

cc `@ChrisDenton`
2022-05-15 18:41:27 +02:00
Dylan DPC
ede4f0ef68
Rollup merge of #97042 - GuillaumeGomez:eslint-brace-style, r=notriddle
Add new eslint rule about brace style

It also prevents one liners.

r? `@notriddle`
2022-05-15 18:41:26 +02:00
Dylan DPC
e8e7555c34
Rollup merge of #97021 - Volker-Weissmann:patch-1, r=Dylan-DPC
Added note in documentation

I added this note, because if you forget the `--target` flags, you get a really ugly error message.
https://github.com/rust-lang/cargo/issues/10666
2022-05-15 18:41:26 +02:00
Dylan DPC
f8832c23da
Rollup merge of #96947 - sunfishcode:sunfishcode/rustc-nonnull-optimization-guaranteed, r=joshtriplett
Add rustc_nonnull_optimization_guaranteed to Owned/Borrowed Fd/Socket

PR #94586 added support for using
`rustc_nonnull_optimization_guaranteed` on values where the "null" value
is the all-ones bitpattern.

Now that #94586 has made it to the stage0 compiler, add
`rustc_nonnull_optimization_guaranteed` to `OwnedFd`, `BorrowedFd`,
`OwnedSocket`, and `BorrowedSocket`, since these types all exclude
all-ones bitpatterns.

This allows `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`,
and `Option<BorrowedSocket>` to be used in FFI declarations, as described
in the [I/O safety RFC].

[I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-05-15 18:41:25 +02:00
bors
0f202d22c5 Auto merge of #96895 - SparrowLii:interval, r=Mark-Simulacrum
optimize `insert_range` method of `IntervalSet`

This PR fixes the FIXME in the `insert_range` method that avoids recurse calculations when overlaping
2022-05-15 16:27:43 +00:00
bors
a170f2b3d2 Auto merge of #97056 - RalfJung:miri, r=RalfJung
update miri

Fixes https://github.com/rust-lang/rust/issues/96975
r? `@ghost`
2022-05-15 13:46:54 +00:00
bdbai
4f637ee30b fix use of SetHandleInformation on UWP 2022-05-15 21:15:45 +08:00
Guillaume Gomez
5d84c0c569 Add new eslint rule about brace style 2022-05-15 13:59:51 +02:00
bjorn3
a06deb5191 Compute pre_compiled_cgus more eagerly
This reduces the complexity of this code a lot
2022-05-15 11:49:25 +00:00