Commit Graph

168245 Commits

Author SHA1 Message Date
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
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
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
Vadim Petrochenkov
159b56f288 rustdoc: Resolve some more doc links early 2022-05-16 19:26:01 +03: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
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
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
Ralf Jung
cdc19b072a update miri 2022-05-15 13:37:04 +02:00
bors
10b3a0d209 Auto merge of #96885 - petrochenkov:linkstrict2, r=cjgillot,luqmana
rustc: Stricter checking for #[link] attributes

A subset of https://github.com/rust-lang/rust/pull/94962 that doesn't touch library renaming/reordering/deduplication.

`#[link]` attributes are checked for all kinds of unexpected arguments inside them.
I also tried to make wording for these errors more consistent, that's why some existing errors are changed, including errors for command line `-l` options.
Spans are also made more precise where possible.
2022-05-15 11:19:27 +00:00
bjorn3
ecd8fa1a75 Merge commit '63734fcdd718cca089f84c42f3a42c0096cfd431' into sync_cg_clif-2022-05-15 2022-05-15 12:32:19 +02:00
bjorn3
63734fcdd7 Rustup to rustc 1.62.0-nightly (70b3681bf 2022-05-14) 2022-05-15 12:26:21 +02:00
bjorn3
e5ff9f1b6d Sync from rust e1ec3260d7 2022-05-15 12:25:32 +02:00
bors
e1ec3260d7 Auto merge of #97055 - matthiaskrgr:rollup-1nqwfzx, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #96958 (Improve settings menu display and remove theme menu)
 - #97032 (Allow the unused_macro_rules lint for now)
 - #97041 (Fix `download-ci-llvm` NixOS patching for `.so`s.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-15 07:32:58 +00:00
Matthias Krüger
a37ba96868
Rollup merge of #97041 - eddyb:nixos-llvm-ci-patchelf, r=Mark-Simulacrum
Fix `download-ci-llvm` NixOS patching for `.so`s.

See https://github.com/rust-lang/rust/pull/95170#discussion_r872960686 - in short, `Path::ends_with` doesn't do the same thing as `str::ends_with`, and can only be used to check for whole file names, not extensions.

With this PR, I get the full suite of:
```
extracting /home/eddy/Projects/rust-A/build/cache/llvm-ebb80ec4e90f8622440f3e33562db0d6e6c66555-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm
info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-config
/nix/store/r4bzq2xilvv8fmqjg626hzwi22ah3hf4-rust-stage0-dependencies
info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck
info: you seem to be using Nix. Attempting to patch /home/eddy/Projects/rust-A/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so
```
(that `libLLVM-14-rust-1.62.0-nightly.so` at the end having been missing before)

r? `@Mark-Simulacrum` cc `@jyn514`
2022-05-15 08:10:44 +02:00
Matthias Krüger
673d45124b
Rollup merge of #97032 - est31:unused_macro_rules, r=petrochenkov
Allow the unused_macro_rules lint for now

It was newly added by #96150 with warn by default, which is great as it gave exposure to the community, and their feedback gave me ideas for improvements.

Allowing the lint is good for two reasons:

* It makes the transition easier as e.g. allow directives won't fire the unknown lint warning once it is turned to warn by default in the future. The [commit that allowed the lint in fuchsia](https://fuchsia.googlesource.com/fuchsia/+/9d8f96517c3963de2f0e25598fd36061914524cd%5E%21/) had to allow unknown lints for example.
This is especially important compared to other lints in the unused group,
because the _ prefix trick doesn't exist for macro rules, allowing is the
only option (either of unused_macro_rules, or of the entire unused group,
but that is not as informative to readers). Allowing the lint also makes it
possible to work on possible heuristics for disabling the macro in specific
cases.
* It gives time for implementing heuristics for when to suppress the lint, e.g.
when `compile_error!` is invoked by that arm (so it's only there to yield an error).

See: https://github.com/rust-lang/rust/pull/96150#issuecomment-1126599107

I would also like this to be backported to the 1.62 beta branch (cc #97016).
2022-05-15 08:10:42 +02:00
Matthias Krüger
7bf43c3931
Rollup merge of #96958 - GuillaumeGomez:settings-menu-display, r=jsha
Improve settings menu display and remove theme menu

We talked about improving the settings menu and we mentioned that firefox pocket was a nice inspiration so I implemented it. The result looks like this:

![Screenshot from 2022-05-11 23-59-53](https://user-images.githubusercontent.com/3050060/167954743-438c0a06-4628-478c-bf0c-d20313c1fdfc.png)

You can test it [here](https://rustdoc.crud.net/imperio/settings-menu-display/doc/foo/index.html).

Only question I have is: should I re-assign the shortcut `T` to this setting menu now that the theme menu is gone? For now I simply removed it.

Important to be noted: the full settings page (at `settings.html`) is still rendered the same as currently.

r? ``@jsha``
2022-05-15 08:10:42 +02:00
bors
0be8768323 Auto merge of #96602 - TApplencourt:patch-1, r=Mark-Simulacrum
boostrap.py use curl by default

Fixes #61611
2022-05-15 04:52:16 +00:00
CAD97
09dc24bc04 Remove potentially misleading realloc parenthetical 2022-05-14 22:30:14 -05:00
bors
7fb2d0ecef Auto merge of #97016 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump to 1.63

r? `@Mark-Simulacrum`

Posting this now, but will only approve later today / early tomorrow to give a little more time for not-yet-approved PRs to land on master (e.g., https://github.com/rust-lang/rust/pull/96970).
2022-05-15 02:11:35 +00:00
bors
2a8a0fc423 Auto merge of #96883 - jackh726:early-binder-2, r=oli-obk
Add EarlyBinder

Chalk has no concept of `Param` (e0ade19d13/chalk-ir/src/lib.rs (L579)) or `ReEarlyBound` (e0ade19d13/chalk-ir/src/lib.rs (L1308)). Everything  is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk.

Either way, tracking when we have or haven't already substituted out these in rustc can be helpful.

As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted.

r? `@nikomatsakis`
2022-05-14 23:53:11 +00:00
Vadim Petrochenkov
4fa24bcb54 rustc: Stricter checking for #[link] attributes 2022-05-15 02:45:47 +03:00
bors
70b3681bf6 Auto merge of #97044 - Urgau:check-cfg-fix-rustc-perf, r=Mark-Simulacrum
Fix rustc-perf benchmarks

See https://github.com/rust-lang/rust/pull/96984#issuecomment-1126678773 and https://github.com/rust-lang/rust/pull/96984#issuecomment-1126719585

cc `@ehuss` `@lqd`
2022-05-14 20:43:45 +00:00
Miguel Guarniz
48fd66613b allocate string only when error will be emitted
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-14 12:23:23 -04:00
bors
b36be12d97 Auto merge of #97039 - cjgillot:no-rpit-hrtb, r=jackh726
Forbid nested opaque types to reference HRTB from opaque types.

Avoids https://github.com/rust-lang/rust/issues/96194
Alternative to https://github.com/rust-lang/rust/pull/96970

r? `@oli-obk`
2022-05-14 15:47:22 +00:00
Guillaume Gomez
dee294759b Update documentation about themes 2022-05-14 17:21:52 +02:00
Guillaume Gomez
44e5b3bf3e Update GUI tests 2022-05-14 17:21:52 +02:00
Guillaume Gomez
e8762757c3 Remove theme picker button 2022-05-14 17:21:52 +02:00
Guillaume Gomez
5e01ba36c9 Improve settings menu display 2022-05-14 17:21:52 +02:00
Miguel Guarniz
f77658b470 use opt_item_name to pattern match items with names
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-14 11:02:14 -04:00
Miguel Guarniz
959636d531 avoid fetching HIR when handling Impl assoc items
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-14 11:01:33 -04:00
Urgau
9a4285c2c6 Fix rustc-perf benchmarks 2022-05-14 16:18:17 +02:00
Jack Huey
06a1e8854c Add rustc_on_unimplemented to Subst 2022-05-14 10:16:59 -04:00
Jack Huey
91afd02632 Add bound_explicit_item_bounds and bound_item_bounds 2022-05-14 10:16:49 -04:00
bors
2d69117088 Auto merge of #96345 - petrochenkov:linclean, r=notriddle
rustdoc: Cleanup doc link resolution

See individual commits for specific changes
2022-05-14 13:24:34 +00:00
Camille GILLOT
872f09c975 Add a test with both passing and erroneous cases. 2022-05-14 14:11:18 +02:00