]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoRollup merge of #104316 - cjgillot:simplify-async-suggestion, r=estebank
Matthias Krüger [Tue, 15 Nov 2022 09:44:11 +0000 (10:44 +0100)]
Rollup merge of #104316 - cjgillot:simplify-async-suggestion, r=estebank

Simplify suggestions for errors in generators.

Split from https://github.com/rust-lang/rust/pull/101692/

19 months agoRollup merge of #104309 - chenyukang:yukang/fix-104088-identifier-error, r=davidtwco
Matthias Krüger [Tue, 15 Nov 2022 09:44:11 +0000 (10:44 +0100)]
Rollup merge of #104309 - chenyukang:yukang/fix-104088-identifier-error, r=davidtwco

Slightly improve error message for invalid identifier

fixes #104088

19 months agoRollup merge of #104296 - compiler-errors:opaque-ty-ffi-normalization-cycle, r=lcnr
Matthias Krüger [Tue, 15 Nov 2022 09:44:10 +0000 (10:44 +0100)]
Rollup merge of #104296 - compiler-errors:opaque-ty-ffi-normalization-cycle, r=lcnr

Walk types more carefully in `ProhibitOpaqueTypes` visitor

The visitor didn't account for the case where you could have `<TAIT as Trait>::Assoc` normalize to itself, in the case of a `type TAIT = impl Trait` with an unconstrained associated type. That causes the visitor to loop on the same type over and over.

Fixes #104291

19 months agoRollup merge of #104258 - compiler-errors:tait-closure-deduce, r=oli-obk
Matthias Krüger [Tue, 15 Nov 2022 09:44:10 +0000 (10:44 +0100)]
Rollup merge of #104258 - compiler-errors:tait-closure-deduce, r=oli-obk

Deduce closure signature from a type alias `impl Trait`'s supertraits

r? `@oli-obk`

Basically pass the TAIT's bounds through the same method that we're using to deduce a signature from infer var closure bounds.

Does this need a new FCP? I see it as a logical extension of #101834, but happy to rfcbot a new one if it does.

19 months agoRollup merge of #104241 - bjorn3:smaller_unwind_build_script, r=Mark-Simulacrum
Matthias Krüger [Tue, 15 Nov 2022 09:44:09 +0000 (10:44 +0100)]
Rollup merge of #104241 - bjorn3:smaller_unwind_build_script, r=Mark-Simulacrum

Move most of unwind's build script to lib.rs

Only the android libunwind detection remains in the build script

* Reduces dependence on build scripts for building the standard library
* Reduces dependence on exact target names in favor of using semantic cfg(target_*) usage.
* Keeps almost all code related to linking of the unwinder in one file

19 months agoRollup merge of #104148 - fmease:fix-104140, r=petrochenkov
Matthias Krüger [Tue, 15 Nov 2022 09:44:09 +0000 (10:44 +0100)]
Rollup merge of #104148 - fmease:fix-104140, r=petrochenkov

Visit attributes of trait impl items during AST validation

Fixes #104140.

This fix might not be backward compatible (in practice) since we now validate more attributes than before.
Should I write more tests?

`@rustbot` label A-attributes

19 months agoRollup merge of #103734 - Mark-Simulacrum:fix-version-stabilized, r=JohnTitor
Matthias Krüger [Tue, 15 Nov 2022 09:44:08 +0000 (10:44 +0100)]
Rollup merge of #103734 - Mark-Simulacrum:fix-version-stabilized, r=JohnTitor

Adjust stabilization version to 1.65.0 for wasi fds

See https://github.com/rust-lang/rust/pull/103308#issuecomment-1292277645 for this ask.

Backport of that PR to beta (1.65.0) will include a similar patch.

19 months agoRollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebank
Matthias Krüger [Tue, 15 Nov 2022 09:44:07 +0000 (10:44 +0100)]
Rollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebank

Show note where the macro failed to match

When feeding the wrong tokens, it used to fail with a very generic error that wasn't very helpful. This change tries to help by noting where specifically the matching went wrong.

```rust
macro_rules! uwu {
    (a a a b) => {};
}
uwu! { a a a c }
```

```diff
error: no rules expected the token `c`
 --> macros.rs:5:14
  |
1 | macro_rules! uwu {
  | ---------------- when calling this macro
...
4 | uwu! { a a a c }
  |              ^ no rules expected this token in macro call
  |
+note: while trying to match `b`
+ --> macros.rs:2:12
+  |
+2 |     (a a a b) => {};
+  |            ^
```

19 months agoAuto merge of #104428 - matthiaskrgr:rollup-jo3078i, r=matthiaskrgr
bors [Tue, 15 Nov 2022 06:43:28 +0000 (06:43 +0000)]
Auto merge of #104428 - matthiaskrgr:rollup-jo3078i, r=matthiaskrgr

Rollup of 13 pull requests

Successful merges:

 - #103842 (Adding Fuchsia compiler testing script, docs)
 - #104354 (Remove leading newlines from `NonZero*` doc examples)
 - #104372 (Update compiler-builtins)
 - #104380 (rustdoc: remove unused CSS `code { opacity: 1 }`)
 - #104381 (Remove dead NoneError diagnostic handling)
 - #104383 (Remove unused symbols and diagnostic items)
 - #104391 (Deriving cleanups)
 - #104403 (Specify language of code comment to generate document)
 - #104404 (Fix missing minification for static files)
 - #104413 ([llvm-wrapper] adapt for LLVM API change)
 - #104415 (rustdoc: fix corner case in search keyboard commands)
 - #104422 (Fix suggest associated call syntax)
 - #104426 (Add test for #102154)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoNormalize types before looking for opaques
Michael Goulet [Tue, 15 Nov 2022 03:44:45 +0000 (03:44 +0000)]
Normalize types before looking for opaques

19 months agoAuto merge of #104418 - matthiaskrgr:rollup-y4i6xjc, r=matthiaskrgr
bors [Tue, 15 Nov 2022 03:37:07 +0000 (03:37 +0000)]
Auto merge of #104418 - matthiaskrgr:rollup-y4i6xjc, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #101967 (Move `unix_socket_abstract` feature API to `SocketAddrExt`.)
 - #102470 (Stabilize const char convert)
 - #104223 (Recover from function pointer types with generic parameter list)
 - #104229 (Don't print full paths in overlap errors)
 - #104294 (Don't ICE with inline const errors during MIR build)
 - #104332 (Fixed some `_i32` notation in `maybe_uninit`’s doc)
 - #104349 (fix some typos in comments)
 - #104350 (Fix x finding Python on Windows)
 - #104356 (interpret: make check_mplace public)
 - #104364 (rustdoc: Resolve doc links in external traits having local impls)
 - #104378 (Bump chalk to v0.87)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agomove testcase for tidy
yukang [Tue, 15 Nov 2022 01:00:27 +0000 (09:00 +0800)]
move testcase for tidy

19 months agocomment feedback
yukang [Mon, 14 Nov 2022 14:13:49 +0000 (22:13 +0800)]
comment feedback

19 months agofix #104088, Slightly improve error message for invalid identifier
yukang [Fri, 11 Nov 2022 20:22:47 +0000 (04:22 +0800)]
fix #104088, Slightly improve error message for invalid identifier

19 months agoRollup merge of #104426 - aDotInTheVoid:test-102154, r=compiler-errors
Matthias Krüger [Tue, 15 Nov 2022 00:40:47 +0000 (01:40 +0100)]
Rollup merge of #104426 - aDotInTheVoid:test-102154, r=compiler-errors

Add test for #102154

Closes #102154

19 months agoRollup merge of #104422 - compiler-errors:fix-suggest_associated_call_syntax, r=BoxyUwU
Matthias Krüger [Tue, 15 Nov 2022 00:40:47 +0000 (01:40 +0100)]
Rollup merge of #104422 - compiler-errors:fix-suggest_associated_call_syntax, r=BoxyUwU

Fix suggest associated call syntax

Fixes #104412

19 months agoRollup merge of #104415 - notriddle:notriddle/search-keyboard-commands, r=GuillaumeGomez
Matthias Krüger [Tue, 15 Nov 2022 00:40:46 +0000 (01:40 +0100)]
Rollup merge of #104415 - notriddle:notriddle/search-keyboard-commands, r=GuillaumeGomez

rustdoc: fix corner case in search keyboard commands

This fixes a bug when that shows up in nightly and in stable where:

* Search something
* Press down: first result is highlighted
* Press down: second result is highlighted
* Press down: third result is highlighted
* Press right: first result of second tab is highlighted
* Press left: third result of first tab is highlighted
* Press up: second result is highlighted
* Press up: first result is highlighted
* Press up: Search box is highlighted
* Press down: **third result** is highlighted, where it ought to highlight the first result

19 months agoRollup merge of #104413 - krasimirgg:llvm-16-mref, r=nikic
Matthias Krüger [Tue, 15 Nov 2022 00:40:46 +0000 (01:40 +0100)]
Rollup merge of #104413 - krasimirgg:llvm-16-mref, r=nikic

[llvm-wrapper] adapt for LLVM API change

for https://github.com/llvm/llvm-project/commit/feda983ff89b7be27a9bfabbabce7d2b59869eba.

19 months agoRollup merge of #104404 - GuillaumeGomez:fix-missing-minification, r=notriddle
Matthias Krüger [Tue, 15 Nov 2022 00:40:45 +0000 (01:40 +0100)]
Rollup merge of #104404 - GuillaumeGomez:fix-missing-minification, r=notriddle

Fix missing minification for static files

It's a fix for https://github.com/rust-lang/rust/pull/101702.

The problem was that `Path::ends_with` doesn't do what we thought it does: it checks if the entire item is the last path part, no just if the "path string" ends with the given argument. So instead, I just used the `extension()` method to get the information we want.

cc `@jsha`
r? `@notriddle`

PS: Is it worth it to add a CI test to ensure that the minification was performed on JS and CSS files or not?

19 months agoRollup merge of #104403 - koka831:lint-doc, r=Dylan-DPC
Matthias Krüger [Tue, 15 Nov 2022 00:40:45 +0000 (01:40 +0100)]
Rollup merge of #104403 - koka831:lint-doc, r=Dylan-DPC

Specify language of code comment to generate document

Fix `let_underscore_drop` comment
https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#example-7

19 months agoRollup merge of #104391 - nnethercote:deriving-cleanups, r=jackh726
Matthias Krüger [Tue, 15 Nov 2022 00:40:44 +0000 (01:40 +0100)]
Rollup merge of #104391 - nnethercote:deriving-cleanups, r=jackh726

Deriving cleanups

Fixing some minor problems `@RalfJung` found in #99046.

r? `@RalfJung`

19 months agoRollup merge of #104383 - WaffleLapkin:rustc_undiagnostic_item, r=compiler-errors
Matthias Krüger [Tue, 15 Nov 2022 00:40:44 +0000 (01:40 +0100)]
Rollup merge of #104383 - WaffleLapkin:rustc_undiagnostic_item, r=compiler-errors

Remove unused symbols and diagnostic items

As the title suggests, this removes unused symbols from `sym::` and `#[rustc_diagnostic_item]` annotations that weren't mentioned anywhere.

Originally I tried to use grep, to find symbols and item names that are never mentioned via `sym::name`, however this produced a lot of false positives (?), for example clippy matching on `Symbol::as_str` or macros "implicitly" adding `sym::`. I ended up fixing all these false positives (?) by hand, but tbh I'm not sure if it was worth it...

19 months agoRollup merge of #104381 - mejrs:none_error, r=compiler-errors
Matthias Krüger [Tue, 15 Nov 2022 00:40:44 +0000 (01:40 +0100)]
Rollup merge of #104381 - mejrs:none_error, r=compiler-errors

Remove dead NoneError diagnostic handling

`NoneError` was removed some time ago, so this was dead code.

19 months agoRollup merge of #104380 - rust-lang:notriddle/code-opacity, r=GuillaumeGomez
Matthias Krüger [Tue, 15 Nov 2022 00:40:43 +0000 (01:40 +0100)]
Rollup merge of #104380 - rust-lang:notriddle/code-opacity, r=GuillaumeGomez

rustdoc: remove unused CSS `code { opacity: 1 }`

According to https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/CSS.20cleanup this style was added for declarations that no longer use opacity.

19 months agoRollup merge of #104372 - Ayush1325:compiler-builtins, r=JohnTitor
Matthias Krüger [Tue, 15 Nov 2022 00:40:43 +0000 (01:40 +0100)]
Rollup merge of #104372 - Ayush1325:compiler-builtins, r=JohnTitor

Update compiler-builtins

This was originally a part of https://github.com/rust-lang/rust/pull/100316. However, extracting it to a seperate PR should help with any extra testing that might be needed.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoRollup merge of #104354 - lukas-code:blank-lines-2, r=JohnTitor
Matthias Krüger [Tue, 15 Nov 2022 00:40:42 +0000 (01:40 +0100)]
Rollup merge of #104354 - lukas-code:blank-lines-2, r=JohnTitor

Remove leading newlines from `NonZero*` doc examples

Like https://github.com/rust-lang/rust/pull/103045, but for `NonZero*`.

`@rustbot` label A-docs

19 months agoRollup merge of #103842 - andrewpollack:add-fuchsia-test-script, r=tmandry
Matthias Krüger [Tue, 15 Nov 2022 00:40:42 +0000 (01:40 +0100)]
Rollup merge of #103842 - andrewpollack:add-fuchsia-test-script, r=tmandry

Adding Fuchsia compiler testing script, docs

Adding Fuchsia compiler testing script and related docs updates

r? `@tmandry`

cc. `@djkoloski`

19 months agoAuto merge of #104091 - BelovDV:issue-103044, r=petrochenkov
bors [Tue, 15 Nov 2022 00:38:08 +0000 (00:38 +0000)]
Auto merge of #104091 - BelovDV:issue-103044, r=petrochenkov

Wrap bundled static libraries into object files

Fixes #103044 (not sure, couldn't test locally)

Bundled static libraries should be wrapped into object files as it's done for metadata file.

r? `@petrochenkov`

19 months agoAdd test for #102154
Nixon Enraght-Moony [Mon, 14 Nov 2022 22:42:57 +0000 (22:42 +0000)]
Add test for #102154

19 months agorustdoc: fix corner case in search keyboard commands
Michael Howell [Mon, 14 Nov 2022 17:41:07 +0000 (10:41 -0700)]
rustdoc: fix corner case in search keyboard commands

19 months agoAdd regression test
Michael Goulet [Mon, 14 Nov 2022 19:29:17 +0000 (19:29 +0000)]
Add regression test

19 months agoDo autoderef to match impl against rcvr
Michael Goulet [Mon, 14 Nov 2022 19:18:38 +0000 (19:18 +0000)]
Do autoderef to match impl against rcvr

19 months agoMove logic into method
Michael Goulet [Mon, 14 Nov 2022 18:40:20 +0000 (18:40 +0000)]
Move logic into method

19 months agoDrive-by: actual -> rcvr_ty
Michael Goulet [Mon, 14 Nov 2022 17:25:37 +0000 (17:25 +0000)]
Drive-by: actual -> rcvr_ty
19 months agoShow a note where a macro failed to match
Nilstrieb [Sat, 12 Nov 2022 22:18:32 +0000 (23:18 +0100)]
Show a note where a macro failed to match

This shows a small note on what the macro matcher was currently
processing to aid with "no rules expected the token X" errors.

19 months agoRollup merge of #104378 - compiler-errors:chalk-up, r=jackh726
Matthias Krüger [Mon, 14 Nov 2022 18:26:19 +0000 (19:26 +0100)]
Rollup merge of #104378 - compiler-errors:chalk-up, r=jackh726

Bump chalk to v0.87

1. Removes `ReEmpty` from chalk
2. Adds support for the `std::marker::Tuple` trait

19 months agoRollup merge of #104364 - petrochenkov:docice2, r=GuillaumeGomez
Matthias Krüger [Mon, 14 Nov 2022 18:26:19 +0000 (19:26 +0100)]
Rollup merge of #104364 - petrochenkov:docice2, r=GuillaumeGomez

rustdoc: Resolve doc links in external traits having local impls

For external impls it was done in https://github.com/rust-lang/rust/pull/103192 right away, but the local impl case was forgotten.

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

19 months agoRollup merge of #104356 - RalfJung:interpret-check-mplace, r=oli-obk
Matthias Krüger [Mon, 14 Nov 2022 18:26:18 +0000 (19:26 +0100)]
Rollup merge of #104356 - RalfJung:interpret-check-mplace, r=oli-obk

interpret: make check_mplace public

This helps avoid code duplication in https://github.com/rust-lang/miri/pull/2661.

19 months agoRollup merge of #104350 - SparkyPotato:fix-x-wrapper, r=jyn514
Matthias Krüger [Mon, 14 Nov 2022 18:26:18 +0000 (19:26 +0100)]
Rollup merge of #104350 - SparkyPotato:fix-x-wrapper, r=jyn514

Fix x finding Python on Windows

`x` searches through the path for `{dir}/python{2|3}?`, but this fails on Windows because the appropriate path is `{dir}/python.exe`.

This PR adds the expected `.exe` extension on Windows while searching.

19 months agoRollup merge of #104349 - rustaceanclub:master, r=oli-obk
Matthias Krüger [Mon, 14 Nov 2022 18:26:18 +0000 (19:26 +0100)]
Rollup merge of #104349 - rustaceanclub:master, r=oli-obk

fix some typos in comments

19 months agoRollup merge of #104332 - Elarcis:maybe_uninit_doc_fix, r=m-ou-se
Matthias Krüger [Mon, 14 Nov 2022 18:26:17 +0000 (19:26 +0100)]
Rollup merge of #104332 - Elarcis:maybe_uninit_doc_fix, r=m-ou-se

Fixed some `_i32` notation in `maybe_uninit`’s doc

This PR just changed two lines in the documentation for `MaybeUninit`:

```rs
let val = 0x12345678i32;
```
was changed to:
```rs
let val = 0x12345678_i32;
```
in two doctests, making the values a tad easier to read.

It does not seem like there are other literals needing this change in the file.

19 months agoRollup merge of #104294 - compiler-errors:inline-ct-err-in-mir-build, r=davidtwco
Matthias Krüger [Mon, 14 Nov 2022 18:26:17 +0000 (19:26 +0100)]
Rollup merge of #104294 - compiler-errors:inline-ct-err-in-mir-build, r=davidtwco

Don't ICE with inline const errors during MIR build

Fixes #104277

19 months agoRollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwco
Matthias Krüger [Mon, 14 Nov 2022 18:26:16 +0000 (19:26 +0100)]
Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwco

Don't print full paths in overlap errors

We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message.

r? diagnostics

19 months agoRollup merge of #104223 - fmease:recover-fn-ptr-with-generics, r=estebank
Matthias Krüger [Mon, 14 Nov 2022 18:26:16 +0000 (19:26 +0100)]
Rollup merge of #104223 - fmease:recover-fn-ptr-with-generics, r=estebank

Recover from function pointer types with generic parameter list

Give a more helpful error when encountering function pointer types with a generic parameter list like `fn<'a>(&'a str) -> bool` or `fn<T>(T) -> T` and suggest moving lifetime parameters to a `for<>` parameter list.

I've added a bunch of extra code to properly handle (unlikely?) corner cases like `for<'a> fn<'b>()` (where there already exists a `for<>` parameter list) correctly suggesting `for<'a, 'b> fn()` (merging the lists). If you deem this useless, I can simplify the code by suggesting nothing at all in this case.

I am quite open to suggestions regarding the wording of the diagnostic messages.

Fixes #103487.
``@rustbot`` label A-diagnostics
r? diagnostics

19 months agoRollup merge of #102470 - est31:stabilize_const_char_convert, r=joshtriplett
Matthias Krüger [Mon, 14 Nov 2022 18:26:15 +0000 (19:26 +0100)]
Rollup merge of #102470 - est31:stabilize_const_char_convert, r=joshtriplett

Stabilize const char convert

Split out `const_char_from_u32_unchecked` from `const_char_convert` and stabilize the rest, i.e. stabilize the following functions:

```Rust
impl char {
    pub const fn from_u32(self, i: u32) -> Option<char>;
    pub const fn from_digit(self, num: u32, radix: u32) -> Option<char>;
    pub const fn to_digit(self, radix: u32) -> Option<u32>;
}

// Available through core::char and std::char
mod char {
    pub const fn from_u32(i: u32) -> Option<char>;
    pub const fn from_digit(num: u32, radix: u32) -> Option<char>;
}
```

And put the following under the `from_u32_unchecked` const stability gate as it needs `Option::unwrap` which isn't const-stable (yet):

```Rust
impl char {
    pub const unsafe fn from_u32_unchecked(i: u32) -> char;
}

// Available through core::char and std::char
mod char {
    pub const unsafe fn from_u32_unchecked(i: u32) -> char;
}
```

cc the tracking issue #89259 (which I'd like to keep open for `const_char_from_u32_unchecked`).

19 months agoRollup merge of #101967 - jmillikin:linux-abstract-socket-addr, r=joshtriplett
Matthias Krüger [Mon, 14 Nov 2022 18:26:14 +0000 (19:26 +0100)]
Rollup merge of #101967 - jmillikin:linux-abstract-socket-addr, r=joshtriplett

Move `unix_socket_abstract` feature API to `SocketAddrExt`.

The pre-stabilized API for abstract socket addresses exposes methods on `SocketAddr` that are only enabled for `cfg(any(target_os = "android", target_os = "linux"))`. Per discussion in <https://github.com/rust-lang/rust/issues/85410>, moving these methods to an OS-specific extension trait is required before stabilization can be considered.

This PR makes four changes:
1. The internal module `std::os::net` contains logic for the unstable feature `tcp_quickack` (https://github.com/rust-lang/rust/issues/96256). I moved that code into `linux_ext/tcp.rs` and tried to adjust the module tree so it could accommodate a second unstable feature there.
2. Moves the public API out of `impl SocketAddr`, into `impl SocketAddrExt for SocketAddr` (the headline change).
3. The existing function names and docs for `unix_socket_abstract` refer to addresses as being created from abstract namespaces, but a more accurate description is that they create sockets in *the* abstract namespace. I adjusted the function signatures correspondingly and tried to update the docs to be clearer.
4. I also tweaked `from_abstract_name` so it takes an `AsRef<[u8]>` instead of `&[u8]`, allowing `b""` literals to be passed directly.

Issues:
1. The public module `std::os::linux::net` is marked as part of `tcp_quickack`. I couldn't figure out how to mark a module as being part of two unstable features, so I just left the existing attributes in place. My hope is that this will be fixed as a side-effect of stabilizing either feature.

19 months ago[llvm-wrapper] adapt for LLVM API change
Krasimir Georgiev [Mon, 14 Nov 2022 14:59:32 +0000 (14:59 +0000)]
[llvm-wrapper] adapt for LLVM API change

19 months agoMove most of unwind's build script to lib.rs
bjorn3 [Thu, 10 Nov 2022 12:17:31 +0000 (12:17 +0000)]
Move most of unwind's build script to lib.rs

Only the android libunwind detection remains in the build script

* Reduces dependence on build scripts for building the standard library
* Reduces dependence on exact target names in favor of using semantic
  cfg(target_*) usage.
* Keeps almost all code related to linking of the unwinder in one file

19 months agoFix missing minification for static files
Guillaume Gomez [Mon, 14 Nov 2022 14:14:54 +0000 (15:14 +0100)]
Fix missing minification for static files

19 months agoSpecify language of code comment to generate document
koka [Mon, 14 Nov 2022 13:55:50 +0000 (22:55 +0900)]
Specify language of code comment to generate document

19 months agoWrap bundlen static libraries into object files
Daniil Belov [Sun, 16 Oct 2022 14:05:53 +0000 (17:05 +0300)]
Wrap bundlen static libraries into object files

19 months agoAuto merge of #104387 - Manishearth:rollup-9e551p5, r=Manishearth
bors [Mon, 14 Nov 2022 06:30:18 +0000 (06:30 +0000)]
Auto merge of #104387 - Manishearth:rollup-9e551p5, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #103709 (ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0)
 - #103744 (Upgrade cc for working is_flag_supported on cross-compiles)
 - #104105 (llvm: dwo only emitted when object code emitted)
 - #104158 (Return .efi extension for EFI executable)
 - #104181 (Add a few known-bug tests)
 - #104266 (Regression test for coercion of mut-ref to dyn-star)
 - #104300 (Document `Path::parent` behavior around relative paths)
 - #104304 (Enable profiler in dist-s390x-linux)
 - #104362 (Add `delay_span_bug` to `AttrWrapper::take_for_recovery`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRemove TraitDef::generics.
Nicholas Nethercote [Mon, 14 Nov 2022 04:43:10 +0000 (15:43 +1100)]
Remove TraitDef::generics.

Because it's always empty.

19 months agoAuto merge of #104188 - jyn514:download-config-only, r=Mark-Simulacrum
bors [Mon, 14 Nov 2022 03:15:03 +0000 (03:15 +0000)]
Auto merge of #104188 - jyn514:download-config-only, r=Mark-Simulacrum

Make all download functions need only Config, not Builder

This also adds a new `mod download` instead of scattering the download code across `config.rs` and `native.rs`.

This is the simplest and also most bit-rotty part of https://github.com/rust-lang/rust/pull/102282. Opening it earlier so it's not mixed in with behavior changes and to avoid rebase hell.

cc https://github.com/rust-lang/rust/issues/94829 (which nows has the hackmd linked).

r? `@Mark-Simulacrum`

19 months agoRemove `addr_of` argument from `create_struct_pattern_fields`.
Nicholas Nethercote [Mon, 14 Nov 2022 02:59:54 +0000 (13:59 +1100)]
Remove `addr_of` argument from `create_struct_pattern_fields`.

Because it's always false.

19 months agoMake all download functions need only Config, not Builder
Joshua Nelson [Sun, 30 Oct 2022 22:29:51 +0000 (17:29 -0500)]
Make all download functions need only Config, not Builder

This also adds a new `mod download` instead of scattering the download code
across `config.rs` and `native.rs`.

19 months agoRollup merge of #104362 - WaffleLapkin:span_bug_won't_come_on_time_today, r=Aaron1011
Manish Goregaokar [Mon, 14 Nov 2022 02:49:27 +0000 (21:49 -0500)]
Rollup merge of #104362 - WaffleLapkin:span_bug_won't_come_on_time_today, r=Aaron1011

Add `delay_span_bug` to `AttrWrapper::take_for_recovery`

`take_for_recovery` should only be used for recovery (when we should already have an error), so using `delay_span_bug` seems appropriate.

cc `@Aaron1011` (you've added the `FIXME` that this pr fixes)

19 months agoRollup merge of #104304 - uweigand:s390x-profiler, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:27 +0000 (21:49 -0500)]
Rollup merge of #104304 - uweigand:s390x-profiler, r=Mark-Simulacrum

Enable profiler in dist-s390x-linux

Build the profiler runtime to allow using -C profile-generate and -C instrument-coverage on s390x-linux.

I've verified in a local build that the runtime builds and the profiler is working fine on the platform.

19 months agoRollup merge of #104300 - tbu-:pr_path_parent_caveats, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:27 +0000 (21:49 -0500)]
Rollup merge of #104300 - tbu-:pr_path_parent_caveats, r=Mark-Simulacrum

Document `Path::parent` behavior around relative paths

A relative path with just one component will return `Some("")` as its parent, which wasn't clear to me from the documentation.

The parent of `""` is `None`, which was missing from the documentation as well.

19 months agoRollup merge of #104266 - compiler-errors:issue-102430, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:26 +0000 (21:49 -0500)]
Rollup merge of #104266 - compiler-errors:issue-102430, r=Mark-Simulacrum

Regression test for coercion of mut-ref to dyn-star

Closes #102430

19 months agoRollup merge of #104181 - jackh726:known-bug-tests, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:26 +0000 (21:49 -0500)]
Rollup merge of #104181 - jackh726:known-bug-tests, r=Mark-Simulacrum

Add a few known-bug tests

The labels of these tests should be changed from `S-bug-has-mcve` to `S-bug-has-test` once this is merged.

cc:
#101518
#99492
#90950
#89196
#104034
#101350
#103705
#103899

I couldn't reproduce the failures in #101962 and #100772 (so either these have started passing, or I didn't repro properly), so leaving those out for now.

#102065 was a bit more complicated, since it uses `rustc_private` and I didn't want to mess with that.

19 months agoRollup merge of #104158 - Ayush1325:executable, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:25 +0000 (21:49 -0500)]
Rollup merge of #104158 - Ayush1325:executable, r=Mark-Simulacrum

Return .efi extension for EFI executable

Originally part of https://github.com/rust-lang/rust/pull/100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoRollup merge of #104105 - davidtwco:split-dwarf-lto, r=michaelwoerister
Manish Goregaokar [Mon, 14 Nov 2022 02:49:25 +0000 (21:49 -0500)]
Rollup merge of #104105 - davidtwco:split-dwarf-lto, r=michaelwoerister

llvm: dwo only emitted when object code emitted

Fixes #103932.

`CompiledModule` should not think a DWARF object was emitted when a bitcode-only compilation has happened, this can confuse archive file creation (which expects to create an archive containing non-existent dwo files).

r? ``````@michaelwoerister``````

19 months agoRollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:24 +0000 (21:49 -0500)]
Rollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-Simulacrum

Upgrade cc for working is_flag_supported on cross-compiles

https://github.com/rust-lang/rust/pull/85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to https://github.com/rust-lang/cc-rs/issues/675, this didn't work properly on cross-compiles. https://github.com/rust-lang/cc-rs/commit/3eeb50b391a7543a6fed96276ee9388b5430a50d fixes this, and was released in cc 1.0.74, hence the upgrade

19 months agoRollup merge of #103709 - cuviper:netbsd-9, r=pietroalbini
Manish Goregaokar [Mon, 14 Nov 2022 02:49:24 +0000 (21:49 -0500)]
Rollup merge of #103709 - cuviper:netbsd-9, r=pietroalbini

ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0

This is another step in toolchain upgrades for LLVM 16, which will need at least GCC 7.1.

Our previous NetBSD 8.0 cross-toolchain used its system GCC 5.5. While there are newer versions available in pkgsrc, I could not get those working for cross-compilation. Upgrading to NetBSD 9.0 gets us GCC 7.4, which is sufficient for now.

This will affect the compatibility of the build we ship for `x86_64-unknown-netbsd`, but others may still build their own from source if that is needed. It is expected that NetBSD 8 will reach EOL soon anyway, approximately one month after 10 is released, but there is no firm date for that.

19 months agoClarify `expand_struct_method_body`.
Nicholas Nethercote [Mon, 14 Nov 2022 02:49:08 +0000 (13:49 +1100)]
Clarify `expand_struct_method_body`.

Spotted by @RalfJung. This causes no behavioural changes.

19 months agoAuto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
bors [Mon, 14 Nov 2022 00:07:19 +0000 (00:07 +0000)]
Auto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini

Bump bootstrap compiler to 1.66

This PR:

- Bumps version placeholders to release
- Bumps to latest beta
- cfg-steps code

r? `@pietroalbini`

19 months agoAdd a few known-bug tests
Jack Huey [Wed, 9 Nov 2022 03:15:02 +0000 (22:15 -0500)]
Add a few known-bug tests

19 months agoFix clippy and rustdoc
Maybe Waffle [Sun, 13 Nov 2022 22:58:20 +0000 (22:58 +0000)]
Fix clippy and rustdoc

please, please, don't match on `Symbol::as_str`s, every time you do,
somewhere in the world another waffle becomes sad...

19 months agorustdoc: remove unused CSS `code { opacity: 1 }`
Michael Howell [Sun, 13 Nov 2022 21:56:22 +0000 (14:56 -0700)]
rustdoc: remove unused CSS `code { opacity: 1 }`

According to https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/CSS.20cleanup
this style was added for declarations that no longer use opacity.

19 months agoRemove dead NoneError error handling
mejrs [Sun, 13 Nov 2022 21:48:27 +0000 (22:48 +0100)]
Remove dead NoneError error handling

19 months agoAuto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc
bors [Sun, 13 Nov 2022 21:12:48 +0000 (21:12 +0000)]
Auto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc

Change the way libunwind is linked for *-windows-gnullvm targets

I have no idea why previous way works for `x86_64-fortanix-unknown-sgx` (assuming it actually works...) but not for `gnullvm`. It fails when linking libtest during Rust build (unless somebody adds `RUSTFLAGS='-Clinkarg=-lunwind'`).
Also fixes exception handling on AArch64.

19 months agoRemove unused symbols
Maybe Waffle [Sun, 13 Nov 2022 20:05:32 +0000 (20:05 +0000)]
Remove unused symbols

19 months agoMake rustc build with new chalk
Michael Goulet [Sun, 13 Nov 2022 19:53:35 +0000 (19:53 +0000)]
Make rustc build with new chalk

19 months agoBump chalk to v0.87
Michael Goulet [Sun, 13 Nov 2022 19:29:38 +0000 (19:29 +0000)]
Bump chalk to v0.87

19 months agoRemove unused diagnostic items
Maybe Waffle [Sun, 13 Nov 2022 18:49:21 +0000 (18:49 +0000)]
Remove unused diagnostic items

19 months agoAuto merge of #104370 - matthiaskrgr:rollup-c3b38sm, r=matthiaskrgr
bors [Sun, 13 Nov 2022 18:13:08 +0000 (18:13 +0000)]
Auto merge of #104370 - matthiaskrgr:rollup-c3b38sm, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #103996 (Add small clarification around using pointers derived from references)
 - #104315 (Improve spans with `use crate::{self}`)
 - #104320 (Use `derive_const` and rm manual StructuralEq impl)
 - #104357 (add is_sized method on Abi and Layout, and use it)
 - #104365 (Add x tool to triagebot)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoUpdate compiler-builtins
Ayush Singh [Sun, 13 Nov 2022 16:50:54 +0000 (22:20 +0530)]
Update compiler-builtins

This was originally a part of https://github.com/rust-lang/rust/pull/100316.
However, extracting it to a seperate PR should help with any extra
testing that might be needed.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoRollup merge of #104365 - albertlarsan68:add-x-tool-to-triagebot, r=Mark-Simulacrum
Matthias Krüger [Sun, 13 Nov 2022 16:37:38 +0000 (17:37 +0100)]
Rollup merge of #104365 - albertlarsan68:add-x-tool-to-triagebot, r=Mark-Simulacrum

Add x tool to triagebot

Assign the A-bootstrap label when a pr modifies the x tool.

Happened in #104350.

19 months agoRollup merge of #104357 - RalfJung:is-sized, r=cjgillot
Matthias Krüger [Sun, 13 Nov 2022 16:37:38 +0000 (17:37 +0100)]
Rollup merge of #104357 - RalfJung:is-sized, r=cjgillot

add is_sized method on Abi and Layout, and use it

This avoids the double negation of `!is_unsized()` that we have quite a lot.

19 months agoRollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obk
Matthias Krüger [Sun, 13 Nov 2022 16:37:37 +0000 (17:37 +0100)]
Rollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obk

Use `derive_const` and rm manual StructuralEq impl

This does not change any semantics of the impl except for the const stability. It should be fine because trait methods and const bounds can never be used in stable without enabling `const_trait_impl`.

cc `@oli-obk`

19 months agoRollup merge of #104315 - SparkyPotato:fix-104276, r=cjgillot
Matthias Krüger [Sun, 13 Nov 2022 16:37:37 +0000 (17:37 +0100)]
Rollup merge of #104315 - SparkyPotato:fix-104276, r=cjgillot

Improve spans with `use crate::{self}`

Fixes #104276.

The error becomes:
```
error: crate root imports need to be explicitly named: `use crate as name;`
 --> src/lib.rs.rs:1:13
  |
1 | use crate::{self};
  |             ^^^^

warning: unused import: `self`
 --> src/lib.rs:1:13
  |
1 | use crate::{self};
  |             ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
```

19 months agoRollup merge of #103996 - SUPERCILEX:docs, r=RalfJung
Matthias Krüger [Sun, 13 Nov 2022 16:37:36 +0000 (17:37 +0100)]
Rollup merge of #103996 - SUPERCILEX:docs, r=RalfJung

Add small clarification around using pointers derived from references

r? `@RalfJung`

One question about your example from https://github.com/rust-lang/libs-team/issues/122: at what point does UB arise? If writing 0 does not cause UB and the reference `x` is never read or written to (explicitly or implicitly by being wrapped in another data structure) after the call to `foo`, does UB only arise when dropping the value? I don't really get that since I thought references were always supposed to point to valid data?

```rust
fn foo(x: &mut NonZeroI32)  {
  let ptr = x as *mut NonZeroI32;
  unsafe { ptr.cast::<i32>().write(0); } // no UB here
  // What now? x is considered garbage when?
}
```

19 months agoMake it also assign correct people
Albert Larsan [Sun, 13 Nov 2022 15:09:15 +0000 (16:09 +0100)]
Make it also assign correct people

19 months agoAuto merge of #104292 - GuillaumeGomez:fix-missing-reexports-doc-comments, r=notriddle
bors [Sun, 13 Nov 2022 15:02:10 +0000 (15:02 +0000)]
Auto merge of #104292 - GuillaumeGomez:fix-missing-reexports-doc-comments, r=notriddle

Fix missing reexports' doc comments

Fixes #81893.

The issue was that an import directly "links" to the target without the intermediate imports. Unfortunately, to fix this bug we need to go through them one by one. To do so, I take the import path direct parent (so `b` in `a::b::c`) and then look for `c` into it.

r? `@notriddle`

19 months agoAdd x tool to triagebot
Albert Larsan [Sun, 13 Nov 2022 14:31:49 +0000 (15:31 +0100)]
Add x tool to triagebot

Assign the A-bootstrap label when a pr modifies the x tool.

19 months agorustdoc: Resolve doc links in external traits having local impls
Vadim Petrochenkov [Sun, 13 Nov 2022 13:31:00 +0000 (16:31 +0300)]
rustdoc: Resolve doc links in external traits having local impls

19 months agoAdd `delay_span_bug` to `AttrWrapper::take_for_recovery`
Maybe Waffle [Sun, 13 Nov 2022 13:08:58 +0000 (13:08 +0000)]
Add `delay_span_bug` to `AttrWrapper::take_for_recovery`

19 months agoAuto merge of #93563 - ibraheemdev:crossbeam-channel, r=Amanieu
bors [Sun, 13 Nov 2022 12:08:42 +0000 (12:08 +0000)]
Auto merge of #93563 - ibraheemdev:crossbeam-channel, r=Amanieu

Merge crossbeam-channel into `std::sync::mpsc`

This PR imports the [`crossbeam-channel`](https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel#crossbeam-channel) crate into the standard library as a private module, `sync::mpmc`. `sync::mpsc` is now implemented as a thin wrapper around `sync::mpmc`. The primary purpose of this PR is to resolve https://github.com/rust-lang/rust/issues/39364. The public API intentionally remains the same.

The reason https://github.com/rust-lang/rust/issues/39364 has not been fixed in over 5 years is that the current channel is *incredibly* complex. It was written many years ago and has sat mostly untouched since. `crossbeam-channel` has become the most popular alternative on crates.io, amassing over 30 million downloads. While crossbeam's channel is also complex, like all fast concurrent data structures, it avoids some of the major issues with the current implementation around dynamic flavor upgrades. The new implementation decides on the datastructure to be used when the channel is created, and the channel retains that structure until it is dropped.

Replacing `sync::mpsc` with a simpler, less performant implementation has been discussed as an alternative. However, Rust touts itself as enabling *fearless concurrency*, and having the standard library feature a subpar implementation of a core concurrency primitive doesn't feel right. The argument is that slower is better than broken, but this PR shows that we can do better.

As mentioned before, the primary purpose of this PR is to fix https://github.com/rust-lang/rust/issues/39364, and so the public API intentionally remains the same. *After* that problem is fixed, the fact that `sync::mpmc` now exists makes it easier to fix the primary limitation of `mpsc`, the fact that it only supports a single consumer. spmc and mpmc are two other common concurrency patterns, and this change enables a path to deprecating `mpsc` and exposing a general `sync::channel` module that supports multiple consumers. It also implements other useful methods such as `send_timeout`. That said, exposing MPMC and other new functionality is mostly out of scope for this PR, and it would be helpful if discussion stays on topic :)

For what it's worth, the new implementation has also been shown to be more performant in [some basic benchmarks](https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel/benchmarks#results).

cc `@taiki-e`

r? rust-lang/libs

19 months agointerpret: make check_mplace public
Ralf Jung [Sun, 13 Nov 2022 11:22:06 +0000 (12:22 +0100)]
interpret: make check_mplace public

19 months agoadd is_sized method on Abi and Layout, and use it
Ralf Jung [Sun, 13 Nov 2022 11:14:59 +0000 (12:14 +0100)]
add is_sized method on Abi and Layout, and use it

19 months agoremove leading newlines from `NonZero*` doc examples
Lukas Markeffsky [Sun, 13 Nov 2022 10:32:57 +0000 (11:32 +0100)]
remove leading newlines from `NonZero*` doc examples

19 months agouse `EXE_EXTENSION` while searching for python
SparkyPotato [Sun, 13 Nov 2022 10:21:16 +0000 (15:51 +0530)]
use `EXE_EXTENSION` while searching for python

19 months agoAuto merge of #104351 - JohnTitor:rollup-ikh2dzr, r=JohnTitor
bors [Sun, 13 Nov 2022 09:13:41 +0000 (09:13 +0000)]
Auto merge of #104351 - JohnTitor:rollup-ikh2dzr, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #103650 (rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`)
 - #104177 (rustdoc: use consistent "popover" styling for notable traits)
 - #104318 (Move tests)
 - #104323 (rustdoc: remove no-op CSS `.scrape-help { background: transparent }`)
 - #104345 (Fix up a Fluent message)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agomove span to `self` instead of `crate`
SparkyPotato [Sun, 13 Nov 2022 08:16:11 +0000 (13:46 +0530)]
move span to `self` instead of `crate`

19 months agoRollup merge of #104345 - fmease:fix-up-a-fluent-message, r=compiler-errors
Yuki Okushi [Sun, 13 Nov 2022 07:41:46 +0000 (16:41 +0900)]
Rollup merge of #104345 - fmease:fix-up-a-fluent-message, r=compiler-errors

Fix up a Fluent message

Fix up a Fluent message which contained arrows `->` after [selectors](https://projectfluent.org/fluent/guide/selectors.html). The original author probably thought that they were required as part of the selector syntax but in reality they were interpreted as literal text and actually showed up in the emitted diagnostic.

This wasn't caught during the diagnostic migration since the branch constructing the diagnostic in question (`rustc_infer::errors::LifetimeMismatchLabels::Normal`) was not exercised by the UI test suite. I've added two more test cases to do so (one testing `LifetimeMismatchLabels::Normal` where `hir_equal == true` and one where `hir_equal == false`).

Diff visualizing the `->` bug (`master` vs `fix-up-a-fluent-message`):

```diff
 error[E0623]: lifetime mismatch
   --> src/test/ui/implied-bounds/hrlt-implied-trait-bounds-guard.rs:39:30
    |
 39 | fn badboi3<'in_, 'out, T>(a: Foo<'in_, 'out, (&'in_ T, &'out T)>, sadness: &'in_ T) {
    |                              ^^^^^^^^^^^^^^^^^-------^^-------^^
    |                              |                |
    |                              |                these two types are declared with different lifetimes...
-   |                              ...but data->  from `a` flows->  into `a` here
+   |                              ...but data from `a` flows into `a` here
```

19 months agoRollup merge of #104323 - notriddle:notriddle/scrape-help-background, r=GuillaumeGomez
Yuki Okushi [Sun, 13 Nov 2022 07:41:45 +0000 (16:41 +0900)]
Rollup merge of #104323 - notriddle:notriddle/scrape-help-background, r=GuillaumeGomez

rustdoc: remove no-op CSS `.scrape-help { background: transparent }`

It's a link. This is the default CSS for it.

19 months agoRollup merge of #104318 - c410-f3r:moar-errors, r=petrochenkov
Yuki Okushi [Sun, 13 Nov 2022 07:41:45 +0000 (16:41 +0900)]
Rollup merge of #104318 - c410-f3r:moar-errors, r=petrochenkov

Move tests

r? `@petrochenkov`

https://github.com/rust-lang/rust/pull/46521 -> enum-discriminant

19 months agoRollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, r=GuillaumeGomez
Yuki Okushi [Sun, 13 Nov 2022 07:41:44 +0000 (16:41 +0900)]
Rollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, r=GuillaumeGomez

rustdoc: use consistent "popover" styling for notable traits

Follow-up to #104129
Fixes https://github.com/rust-lang/rust/issues/104313.

Preview: https://notriddle.com/notriddle-rustdoc-demos/js-notable-trait-v2/std/iter/trait.Iterator.html#method.step_by

## Before

![image](https://user-images.githubusercontent.com/1593513/200710372-d2d992ce-0bdc-4437-9a2e-379a29df09cf.png)

![image](https://user-images.githubusercontent.com/1593513/200711266-e372b176-daa9-45f3-a022-738ef0a77d3c.png)

## After

![image](https://user-images.githubusercontent.com/1593513/200710601-09b3b717-116f-43c6-b14f-34a8b02b33c0.png)

![image](https://user-images.githubusercontent.com/1593513/200711288-3978cdc1-a6c2-47f6-9216-e22e3c1f5bdf.png)

19 months agoRollup merge of #103650 - notriddle:notriddle/line-anchors, r=GuillaumeGomez
Yuki Okushi [Sun, 13 Nov 2022 07:41:44 +0000 (16:41 +0900)]
Rollup merge of #103650 - notriddle:notriddle/line-anchors, r=GuillaumeGomez

rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`

Example: https://notriddle.com/notriddle-rustdoc-demos/line-anchors/test_dingus/fn.test.html

This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.