]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoRemove the fishy need for a PartialEq impl
Oli Scherer [Wed, 9 Nov 2022 16:39:21 +0000 (16:39 +0000)]
Remove the fishy need for a PartialEq impl

20 months agoRemove some redundant span arguments
Oli Scherer [Wed, 9 Nov 2022 16:07:59 +0000 (16:07 +0000)]
Remove some redundant span arguments

20 months agoRemove an unnecessary `resolve_vars_if_possible`
Oli Scherer [Wed, 9 Nov 2022 14:43:51 +0000 (14:43 +0000)]
Remove an unnecessary `resolve_vars_if_possible`

20 months agoFlip a boolean that was used wrongly (has no effect though)
Oli Scherer [Wed, 9 Nov 2022 14:37:33 +0000 (14:37 +0000)]
Flip a boolean that was used wrongly (has no effect though)

20 months agoRollup merge of #104339 - compiler-errors:rustc_deny_explicit_impl, r=cjgillot
Matthias Krüger [Tue, 15 Nov 2022 09:44:12 +0000 (10:44 +0100)]
Rollup merge of #104339 - compiler-errors:rustc_deny_explicit_impl, r=cjgillot

Add `rustc_deny_explicit_impl`

Also adjust `E0322` error message to be more general, since it's used for `DiscriminantKind` and `Pointee` as well.

Also add `rustc_deny_explicit_impl` on the `Tuple` and `Destruct` marker traits.

20 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/

20 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

20 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

20 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.

20 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

20 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

20 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.

20 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) => {};
+  |            ^
```

20 months agoAuto merge of #101168 - jachris:dataflow-const-prop, r=oli-obk
bors [Tue, 15 Nov 2022 09:38:05 +0000 (09:38 +0000)]
Auto merge of #101168 - jachris:dataflow-const-prop, r=oli-obk

Add new MIR constant propagation based on dataflow analysis

The current constant propagation in `rustc_mir_transform/src/const_prop.rs` fails to handle many cases that would be expected from a constant propagation optimization. For example:
```rust
let x = if true { 0 } else { 0 };
```
This pull request adds a new constant propagation MIR optimization pass based on the existing dataflow analysis framework. Since most of the analysis is not unique to constant propagation, a generic framework has been extracted. It works on top of the existing framework and could be reused for other optimzations.

Closes #80038. Closes #81605.

## Todo
### Essential
- [x] [Writes to inactive enum variants](https://github.com/rust-lang/rust/pull/101168#pullrequestreview-1089493974). Resolved by rejecting the registration of places with downcast projections for now. Could be improved by flooding other variants if mutable access to a variant is observed.
- [X] Handle [`StatementKind::CopyNonOverlapping`](https://github.com/rust-lang/rust/pull/101168#discussion_r957774914). Resolved by flooding the destination.
- [x] Handle `UnsafeCell` / `!Freeze` correctly.
- [X] Overflow propagation of `CheckedBinaryOp`: Decided to not propagate if overflow flag is `true` (`false` will still be propagated)
- [x] More documentation in general.
- [x] Arguments for correctness, documentation of necessary assumptions.
- [x] Better performance, or alternatively, require `-Zmir-opt-level=3` for now.

### Extra
- [x]  Add explicit unreachability, i.e. upgrading the lattice from $\mathbb{P} \to \mathbb{V}$ to $\set{\bot} \cup (\mathbb{P} \to \mathbb{V})$.
- [x] Use storage statements to improve precision.
- [ ] Consider opening issue for duplicate diagnostics: https://github.com/rust-lang/rust/pull/101168#issuecomment-1276609950
- [ ] Flood moved-from places with $\bot$ (requires some changes for places with tracked projections).
- [ ] Add downcast projections back in.
- [ ] [Algebraic simplifications](https://github.com/rust-lang/rust/pull/101168#discussion_r957967878) (possibly with a shared API; done by old const prop).
- [ ] Propagation through slices / arrays.
- [ ] Find other optimizations that are done by old `const_prop.rs`, but not by this one.

20 months agoreturn when expr has errors
Takayuki Maeda [Tue, 15 Nov 2022 07:44:23 +0000 (16:44 +0900)]
return when expr has errors

add ui tests

20 months agoAuto merge of #2665 - RalfJung:rustup, r=RalfJung
bors [Tue, 15 Nov 2022 08:15:47 +0000 (08:15 +0000)]
Auto merge of #2665 - RalfJung:rustup, r=RalfJung

Rustup

20 months agoMerge from rustc
Ralf Jung [Tue, 15 Nov 2022 08:14:47 +0000 (09:14 +0100)]
Merge from rustc

20 months agosimplify `emit_unused_delims_expr`
Takayuki Maeda [Tue, 15 Nov 2022 07:43:50 +0000 (16:43 +0900)]
simplify `emit_unused_delims_expr`

20 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

20 months agoshift no characters when using raw string literals
Takayuki Maeda [Wed, 9 Nov 2022 13:40:51 +0000 (22:40 +0900)]
shift no characters when using raw string literals

remove `find_skips`

remove unnecessary variables

20 months agoIssue error when `-C link-self-contained` option is used on unsupported platforms
StackDoubleFlow [Tue, 8 Nov 2022 04:42:07 +0000 (22:42 -0600)]
Issue error when `-C link-self-contained` option is used on unsupported platforms

Document supported targets for `-C link-self-contained`

Move `LinkSelfContainedDefault::True` from wasm_base to wasm32_wasi

20 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

20 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

20 months agoUse `needs-unwind` instead of ignoring WASM/emscripten
Bryan Garza [Tue, 15 Nov 2022 01:07:18 +0000 (01:07 +0000)]
Use `needs-unwind` instead of ignoring WASM/emscripten

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

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

20 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

20 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

20 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

20 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

20 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.

20 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?

20 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

20 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`

20 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...

20 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.

20 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.

20 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>
20 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

20 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`

20 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`

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

20 months agorustdoc: remove no-op CSS `.main-header { justify-content }`
Michael Howell [Mon, 14 Nov 2022 22:27:04 +0000 (15:27 -0700)]
rustdoc: remove no-op CSS `.main-header { justify-content }`

This rule was added in 152e8889052adaaa6c12652486292be34059713c to push the
out-of-band content to the right while allowing it to line wrap when it got
too big. The idea was that the justification rule would fill the space
between the `<h1>` element and the `<div class="out-of-band">` element.

A later commit, 3cb03cb34247383ffb67a017ae70134741e8c4da, flattened the
in-band element into the `<h1>`, copying the `flex-grow` rule. This means
the `<h1>` element now grows to fill the space, so there's no need to
justify-content any more.

This commit also adds a test case for this.

20 months agox86_64 SSE2 fast-path for str.contains(&str) and short needles
The 8472 [Sun, 30 Oct 2022 20:47:04 +0000 (21:47 +0100)]
x86_64 SSE2 fast-path for str.contains(&str) and short needles

Based on Wojciech Muła's "SIMD-friendly algorithms for substring searching"[0]

The two-way algorithm is Big-O efficient but it needs to preprocess the needle
to find a "criticla factorization" of it. This additional work is significant
for short needles. Additionally it mostly advances needle.len() bytes at a time.

The SIMD-based approach used here on the other hand can advance based on its
vector width, which can exceed the needle length. Except for pathological cases,
but due to being limited to small needles the worst case blowup is also small.

benchmarks taken on a Zen2:

```
16CGU, OLD:
test str::bench_contains_short_short                     ... bench:          27 ns/iter (+/- 1)
test str::bench_contains_short_long                      ... bench:         667 ns/iter (+/- 29)
test str::bench_contains_bad_naive                       ... bench:         131 ns/iter (+/- 2)
test str::bench_contains_bad_simd                        ... bench:         130 ns/iter (+/- 2)
test str::bench_contains_equal                           ... bench:         148 ns/iter (+/- 4)

16CGU, NEW:
test str::bench_contains_short_short                     ... bench:           8 ns/iter (+/- 0)
test str::bench_contains_short_long                      ... bench:         135 ns/iter (+/- 4)
test str::bench_contains_bad_naive                       ... bench:         130 ns/iter (+/- 2)
test str::bench_contains_bad_simd                        ... bench:         292 ns/iter (+/- 1)
test str::bench_contains_equal                           ... bench:           3 ns/iter (+/- 0)

1CGU, OLD:
test str::bench_contains_short_short                     ... bench:          30 ns/iter (+/- 0)
test str::bench_contains_short_long                      ... bench:         713 ns/iter (+/- 17)
test str::bench_contains_bad_naive                       ... bench:         131 ns/iter (+/- 3)
test str::bench_contains_bad_simd                        ... bench:         130 ns/iter (+/- 3)
test str::bench_contains_equal                           ... bench:         148 ns/iter (+/- 6)

1CGU, NEW:
test str::bench_contains_short_short                     ... bench:          10 ns/iter (+/- 0)
test str::bench_contains_short_long                      ... bench:         111 ns/iter (+/- 0)
test str::bench_contains_bad_naive                       ... bench:         135 ns/iter (+/- 3)
test str::bench_contains_bad_simd                        ... bench:         274 ns/iter (+/- 2)
test str::bench_contains_equal                           ... bench:           4 ns/iter (+/- 0)
```

[0] http://0x80.pl/articles/simd-strfind.html#sse-avx2

20 months agoupdate str.contains benchmarks
The 8472 [Sun, 30 Oct 2022 20:50:49 +0000 (21:50 +0100)]
update str.contains benchmarks

20 months agoblack_box test strings in str.contains(str) benchmarks
The 8472 [Sun, 30 Oct 2022 20:26:05 +0000 (21:26 +0100)]
black_box test strings in str.contains(str) benchmarks

20 months agorespect visibility & stability of inherent associated types
León Orell Valerian Liehr [Sun, 13 Nov 2022 04:12:44 +0000 (05:12 +0100)]
respect visibility & stability of inherent associated types

20 months agorustdoc: add test case for font size in help popover
Michael Howell [Mon, 14 Nov 2022 21:34:46 +0000 (14:34 -0700)]
rustdoc: add test case for font size in help popover

20 months agorustdoc: remove no-op CSS `.popover { font-size: 1rem }`
Michael Howell [Mon, 14 Nov 2022 21:11:30 +0000 (14:11 -0700)]
rustdoc: remove no-op CSS `.popover { font-size: 1rem }`

This rule was added in cc4f804829ae because the help popover inherited the
font-size from the help button "?" icon.

It doesn't inherit this any more, because it was moved from being nested
inside the link to sharing a wrapper DIV with it.

20 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

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

20 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

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

20 months agoDrive-by: actual -> rcvr_ty
Michael Goulet [Mon, 14 Nov 2022 17:25:37 +0000 (17:25 +0000)]
Drive-by: actual -> rcvr_ty
20 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.

20 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

20 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.

20 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.

20 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.

20 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

20 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.

20 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

20 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

20 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

20 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`).

20 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.

20 months agoFix test/ui/issues/issue-30490.rs
Ayush Singh [Mon, 14 Nov 2022 18:22:41 +0000 (23:52 +0530)]
Fix test/ui/issues/issue-30490.rs

Since the empty main is used for `not(unix)`, all the targets that will
use this empty main will also need `allow(unused_imports)`.

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

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
20 months agoassert that we are (de)seiralizing ProvenanceMap correctly
Ralf Jung [Mon, 14 Nov 2022 12:37:08 +0000 (13:37 +0100)]
assert that we are (de)seiralizing ProvenanceMap correctly

20 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

20 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

20 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

20 months agoBless graphviz tests
Jannis Christopher Köhl [Mon, 14 Nov 2022 14:11:30 +0000 (15:11 +0100)]
Bless graphviz tests

20 months agoRemove redundant graphviz escaping
Jannis Christopher Köhl [Mon, 14 Nov 2022 14:11:18 +0000 (15:11 +0100)]
Remove redundant graphviz escaping

20 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

20 months agoavoid memory leak in mpsc test
Ralf Jung [Mon, 14 Nov 2022 12:38:53 +0000 (13:38 +0100)]
avoid memory leak in mpsc test

20 months agoManually implement `Encodable` for ProvenanceMap to avoid serializing an always-none...
Oli Scherer [Mon, 14 Nov 2022 09:49:32 +0000 (09:49 +0000)]
Manually implement `Encodable` for ProvenanceMap to avoid serializing an always-none option

20 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

20 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

20 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.

20 months agoAdd rustc_deny_explicit_impl
Michael Goulet [Sat, 12 Nov 2022 23:37:52 +0000 (23:37 +0000)]
Add rustc_deny_explicit_impl

20 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`

20 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.

20 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`.

20 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)

20 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.

20 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.

20 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

20 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.

20 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>
20 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``````

20 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

20 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.

20 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.

20 months agoAdd `Vec` storage optimization to `Arc` and add tests
clubby789 [Mon, 14 Nov 2022 00:51:05 +0000 (00:51 +0000)]
Add `Vec` storage optimization to `Arc` and add tests

20 months agoReuse `Vec<T>` backing storage for `Rc<[T]>`
clubby789 [Wed, 9 Nov 2022 15:17:42 +0000 (15:17 +0000)]
Reuse `Vec<T>` backing storage for `Rc<[T]>`

Co-authored-by: joboet <jonas.boettiger@icloud.com>
20 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`

20 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

20 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...

20 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.

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