]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoRollup merge of #104024 - noeddl:unused-must-use, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:39 +0000 (15:51 +0800)]
Rollup merge of #104024 - noeddl:unused-must-use, r=compiler-errors

Fix `unused_must_use` warning for `Box::from_raw`

18 months agoRollup merge of #103945 - H4x5:remove-iter-empty-hack, r=compiler-errors
fee1-dead [Wed, 28 Dec 2022 07:51:38 +0000 (15:51 +0800)]
Rollup merge of #103945 - H4x5:remove-iter-empty-hack, r=compiler-errors

Remove `iter::Empty` hack

`iter::Empty` uses a newtype to work around `#![feature(const_fn_fn_ptr_basics)]`, which has been stable since 1.61.0.

18 months agoRollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514
fee1-dead [Wed, 28 Dec 2022 07:51:37 +0000 (15:51 +0800)]
Rollup merge of #94145 - ssomers:binary_heap_tests, r=jyn514

Test leaking of BinaryHeap Drain iterators

Add test cases about forgetting the `BinaryHeap::Drain` iterator, and slightly fortifies some other test cases.

Consists of separate commits that I don't think are relevant on their own (but I'll happily turn these into more PRs if desired).

18 months agoAuto merge of #100539 - joboet:horizon_timeout_clock, r=thomcc
bors [Wed, 28 Dec 2022 03:56:46 +0000 (03:56 +0000)]
Auto merge of #100539 - joboet:horizon_timeout_clock, r=thomcc

Use correct clock in `park_timeout` on Horizon

Horizon does not support using `CLOCK_MONOTONIC` with condition variables, so use the system time instead.

18 months agoAuto merge of #106193 - compiler-errors:rollup-0l54wka, r=compiler-errors
bors [Tue, 27 Dec 2022 20:54:06 +0000 (20:54 +0000)]
Auto merge of #106193 - compiler-errors:rollup-0l54wka, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #103718 (More inference-friendly API for lazy)
 - #105765 (Detect likely `.` -> `..` typo in method calls)
 - #105852 (Suggest rewriting a malformed hex literal if we expect a float)
 - #105965 (Provide local extern function arg names)
 - #106064 (Partially fix `explicit_outlives_requirements` lint in macros)
 - #106179 (Fix a formatting error in Iterator::for_each docs)
 - #106181 (Fix doc comment parsing description in book)
 - #106187 (Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`)
 - #106189 (Fix UnsafeCell Documentation Spelling Error)

Failed merges:

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

18 months agoRollup merge of #106189 - alexhrao:master, r=Nilstrieb
Michael Goulet [Tue, 27 Dec 2022 20:33:38 +0000 (12:33 -0800)]
Rollup merge of #106189 - alexhrao:master, r=Nilstrieb

Fix UnsafeCell Documentation Spelling Error

This fixes the spelling of "deallocated" (instead of the original "deallocted") In the `cell.rs` source file. Honestly probably not worth the time to evaluate, but since it doesn't involve any code change, I figure why not?

18 months agoRollup merge of #106187 - ChayimFriedman2:patch-4, r=compiler-errors
Michael Goulet [Tue, 27 Dec 2022 20:33:37 +0000 (12:33 -0800)]
Rollup merge of #106187 - ChayimFriedman2:patch-4, r=compiler-errors

Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`

Another option is to use `extend_from_slice()` (that may be faster), but I find this approach cleaner.

18 months agoRollup merge of #106181 - kraktus:fix_doc_parsing, r=notriddle
Michael Goulet [Tue, 27 Dec 2022 20:33:37 +0000 (12:33 -0800)]
Rollup merge of #106181 - kraktus:fix_doc_parsing, r=notriddle

Fix doc comment parsing description in book

This can actually make a difference for the user if they rely on unicode formating.

Prompted by https://github.com/dtolnay/syn/issues/771

18 months agoRollup merge of #106179 - RetroSeven:typo_fix, r=compiler-errors
Michael Goulet [Tue, 27 Dec 2022 20:33:36 +0000 (12:33 -0800)]
Rollup merge of #106179 - RetroSeven:typo_fix, r=compiler-errors

Fix a formatting error in Iterator::for_each docs

There is a formatting error (extra space in an assignment) in the documentation of `core::iter::Iterator::for_each`, which I have fixed in this pull request.

18 months agoRollup merge of #106064 - lukas-code:outlives-macro, r=cjgillot
Michael Goulet [Tue, 27 Dec 2022 20:33:35 +0000 (12:33 -0800)]
Rollup merge of #106064 - lukas-code:outlives-macro, r=cjgillot

Partially fix `explicit_outlives_requirements` lint in macros

Show the suggestion if and only if the bounds are from the same source context.

fixes https://github.com/rust-lang/rust/issues/106044
fixes https://github.com/rust-lang/rust/issues/106063

18 months agoRollup merge of #105965 - compiler-errors:issue-105896, r=cjgillot
Michael Goulet [Tue, 27 Dec 2022 20:33:35 +0000 (12:33 -0800)]
Rollup merge of #105965 - compiler-errors:issue-105896, r=cjgillot

Provide local extern function arg names

Fixes #105896

18 months agoRollup merge of #105852 - compiler-errors:hex-float-lit, r=cjgillot
Michael Goulet [Tue, 27 Dec 2022 20:33:34 +0000 (12:33 -0800)]
Rollup merge of #105852 - compiler-errors:hex-float-lit, r=cjgillot

Suggest rewriting a malformed hex literal if we expect a float

Fixes #104706

18 months agoRollup merge of #105765 - estebank:range-typo, r=compiler-errors
Michael Goulet [Tue, 27 Dec 2022 20:33:34 +0000 (12:33 -0800)]
Rollup merge of #105765 - estebank:range-typo, r=compiler-errors

Detect likely `.` -> `..` typo in method calls

Fix #65015.

18 months agoRollup merge of #103718 - matklad:infer-lazy, r=dtolnay
Michael Goulet [Tue, 27 Dec 2022 20:33:33 +0000 (12:33 -0800)]
Rollup merge of #103718 - matklad:infer-lazy, r=dtolnay

More inference-friendly API for lazy

The signature for new was

```
fn new<F>(f: F) -> Lazy<T, F>
```

Notably, with `F` unconstrained, `T` can be literally anything, and just `let _ = Lazy::new(|| 92)` would not typecheck.

This historiacally was a necessity -- `new` is a `const` function, it couldn't have any bounds. Today though, we can move `new` under the `F: FnOnce() -> T` bound, which gives the compiler enough data to infer the type of T from closure.

18 months agoMake resolve suggestion more generic
Esteban Küber [Tue, 27 Dec 2022 20:16:25 +0000 (12:16 -0800)]
Make resolve suggestion more generic

18 months agoFix UnsafeCell Documentation Spelling Error
Alex Rao [Tue, 27 Dec 2022 18:17:56 +0000 (12:17 -0600)]
Fix UnsafeCell Documentation Spelling Error

This fixes the spelling of "deallocated" (instead of the original "deallocted") In the `cell.rs` source file

18 months agoAuto merge of #97176 - kraktus:cmd_debug, r=the8472
bors [Tue, 27 Dec 2022 18:13:23 +0000 (18:13 +0000)]
Auto merge of #97176 - kraktus:cmd_debug, r=the8472

More verbose `Debug` implementation of `std::process:Command`

Mainly based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis

close https://github.com/rust-lang/rust/issues/42200

18 months agoUpdate the documentation of `Vec` to use `extend(array)` instead of `extend(array...
Chayim Refael Friedman [Tue, 27 Dec 2022 17:44:58 +0000 (19:44 +0200)]
Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`

18 months agoreview comments: make suggestion more accurate
Esteban Küber [Tue, 27 Dec 2022 17:25:00 +0000 (09:25 -0800)]
review comments: make suggestion more accurate

18 months agoProvide local extern function arg names
Michael Goulet [Tue, 27 Dec 2022 17:10:21 +0000 (17:10 +0000)]
Provide local extern function arg names

18 months agoSuggest rewriting a malformed hex literal if we expect a float
Michael Goulet [Sat, 17 Dec 2022 23:20:16 +0000 (23:20 +0000)]
Suggest rewriting a malformed hex literal if we expect a float

18 months agoAuto merge of #106183 - matthiaskrgr:rollup-ww6yzhi, r=matthiaskrgr
bors [Tue, 27 Dec 2022 15:44:53 +0000 (15:44 +0000)]
Auto merge of #106183 - matthiaskrgr:rollup-ww6yzhi, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - #105817 (Remove unreasonable help message for auto trait)
 - #105994 (Add regression test for #99647)
 - #106066 (Always suggest as `MachineApplicable` in `recover_intersection_pat`)

Failed merges:

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

18 months agoRollup merge of #106066 - JohnTitor:rm-bindings-after-at-fixme, r=compiler-errors
Matthias Krüger [Tue, 27 Dec 2022 15:37:48 +0000 (16:37 +0100)]
Rollup merge of #106066 - JohnTitor:rm-bindings-after-at-fixme, r=compiler-errors

Always suggest as `MachineApplicable` in `recover_intersection_pat`

This resolves one FIXME in `recover_intersection_pat` by always applying `MachineApplicable` when suggesting, as `bindings_after_at` is now stable.
This also separates a test to apply `// run-rustfix`.

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105994 - JohnTitor:issue-99647, r=compiler-errors
Matthias Krüger [Tue, 27 Dec 2022 15:37:47 +0000 (16:37 +0100)]
Rollup merge of #105994 - JohnTitor:issue-99647, r=compiler-errors

Add regression test for #99647

Closes #99647
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105817 - chenyukang:yukang/fix-105788-sugg-for-auto-trait, r=TaKO8Ki
Matthias Krüger [Tue, 27 Dec 2022 15:37:47 +0000 (16:37 +0100)]
Rollup merge of #105817 - chenyukang:yukang/fix-105788-sugg-for-auto-trait, r=TaKO8Ki

Remove unreasonable help message for auto trait

Fixes #105788

18 months agoAuto merge of #106168 - jyn514:clean-crates, r=Mark-Simulacrum
bors [Tue, 27 Dec 2022 13:04:08 +0000 (13:04 +0000)]
Auto merge of #106168 - jyn514:clean-crates, r=Mark-Simulacrum

Allow cleaning individual crates

As a bonus, this stops special casing `clean` in `Builder`.

## Motivation

Cleaning artifacts isn't strictly necessary to get cargo to rebuild; `touch compiler/rustc_driver/src/lib.rs` (for example) will also work. There's two reasons I thought making this part of bootstrap proper was a better approach:
1. `touch` does not *remove* artifacts, it just causes a rebuild. This is unhelpful for when you want to measure how long the compiler itself takes to build (e.g. for https://github.com/rust-lang/rust/issues/65031).
2. It seems a little more discoverable; and I want to extend it in the future to things like `x clean --stage 1 rustc`, which makes it easier to work around https://github.com/rust-lang/rust/issues/76720 without having to completely wipe all the stage 0 artifacts, or having to be intimately familiar with which directories to remove.

18 months agoFix doc comment parsing
kraktus [Tue, 27 Dec 2022 12:31:53 +0000 (13:31 +0100)]
Fix doc comment parsing

This can actually make a difference for the user if they rely on unicode formating.

Prompted by https://github.com/dtolnay/syn/issues/771

18 months agoAuto merge of #106177 - matthiaskrgr:rollup-oe7z8ix, r=matthiaskrgr
bors [Tue, 27 Dec 2022 10:23:32 +0000 (10:23 +0000)]
Auto merge of #106177 - matthiaskrgr:rollup-oe7z8ix, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #105515 (Account for macros in const generics)
 - #106146 (Readme: update section on how to run `x.py`)
 - #106150 (Detect when method call on LHS might be shadowed)
 - #106174 (Remove unused empty CSS rules in ayu theme)

Failed merges:

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

18 months agoFix a formatting error
RetroSeven [Tue, 27 Dec 2022 10:07:44 +0000 (11:07 +0100)]
Fix a formatting error

18 months agoMore verbose `Debug` implementation of `std::process:Command`
kraktus [Thu, 19 May 2022 13:50:27 +0000 (15:50 +0200)]
More verbose `Debug` implementation of `std::process:Command`

based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis

close https://github.com/rust-lang/rust/issues/42200

Add env variables and cwd to the shell-like debug output.

Also use the alternate syntax to display a more verbose display, while not showing internal fields and hiding fields when they have their default value.

18 months agoRollup merge of #106174 - GuillaumeGomez:rm-unused-ayu-css-rules, r=notriddle
Matthias Krüger [Tue, 27 Dec 2022 07:57:48 +0000 (08:57 +0100)]
Rollup merge of #106174 - GuillaumeGomez:rm-unused-ayu-css-rules, r=notriddle

Remove unused empty CSS rules in ayu theme

r? `@notriddle`

18 months agoRollup merge of #106150 - estebank:issue-39232, r=compiler-errors
Matthias Krüger [Tue, 27 Dec 2022 07:57:48 +0000 (08:57 +0100)]
Rollup merge of #106150 - estebank:issue-39232, r=compiler-errors

Detect when method call on LHS might be shadowed

Address #39232.

18 months agoRollup merge of #106146 - kadiwa4:readme-x-py, r=jyn514
Matthias Krüger [Tue, 27 Dec 2022 07:57:46 +0000 (08:57 +0100)]
Rollup merge of #106146 - kadiwa4:readme-x-py, r=jyn514

Readme: update section on how to run `x.py`

`./x.py` currently looks for `python3` (not `python`) in the `PATH`. I updated that in the readme and also mentioned a convenient way to run `x.py` on Windows. The PowerShell script is actually quite inconvenient to use (and not really necessary on the `cmd.exe` prompt) so I left it out.

In addition I adapted `./x` in one of the CI scripts.

18 months agoRollup merge of #105515 - estebank:issue-104141, r=oli-obk
Matthias Krüger [Tue, 27 Dec 2022 07:57:45 +0000 (08:57 +0100)]
Rollup merge of #105515 - estebank:issue-104141, r=oli-obk

Account for macros in const generics

Fix #104141.

18 months agoAuto merge of #106095 - estebank:pin-mut-reborrow, r=compiler-errors
bors [Tue, 27 Dec 2022 07:31:42 +0000 (07:31 +0000)]
Auto merge of #106095 - estebank:pin-mut-reborrow, r=compiler-errors

Suggest `Pin::as_mut` when encountering borrow error

Fix #65409 for `Pin<&mut T>`.

18 months agofix #105788, Remove unreasonable help message for auto trait
yukang [Sat, 17 Dec 2022 00:20:46 +0000 (08:20 +0800)]
fix #105788, Remove unreasonable help message for auto trait

18 months agoAuto merge of #106166 - jyn514:print-paths, r=Mark-Simulacrum
bors [Tue, 27 Dec 2022 04:44:42 +0000 (04:44 +0000)]
Auto merge of #106166 - jyn514:print-paths, r=Mark-Simulacrum

Fix panic on `x build --help --verbose`

See https://github.com/rust-lang/rust/issues/106165 for a detailed description of what went wrong here.

This also makes the panic message a little more informative in case it happens again.

18 months agoRemove unused empty CSS rules in ayu theme
Guillaume Gomez [Tue, 27 Dec 2022 03:57:30 +0000 (04:57 +0100)]
Remove unused empty CSS rules in ayu theme

18 months agoDetect likely `.` -> `..` typo in method calls
Esteban Küber [Fri, 16 Dec 2022 00:24:42 +0000 (16:24 -0800)]
Detect likely `.` -> `..` typo in method calls

Fix #65015.

18 months agoAllow cleaning individual crates
Joshua Nelson [Tue, 27 Dec 2022 01:00:26 +0000 (19:00 -0600)]
Allow cleaning individual crates

As a bonus, this stops special casing `clean` in `Builder`.

18 months agoFix panic on `x build --help --verbose`
Joshua Nelson [Mon, 26 Dec 2022 23:53:39 +0000 (17:53 -0600)]
Fix panic on `x build --help --verbose`

This also makes the panic message a little more informative in case it
happens again.

18 months agoAuto merge of #103020 - lyming2007:issue-102598-fix, r=jackh726
bors [Mon, 26 Dec 2022 21:50:05 +0000 (21:50 +0000)]
Auto merge of #103020 - lyming2007:issue-102598-fix, r=jackh726

error parsing lifetime following by Sized and message + between them

Fixes #102598

18 months agoreview comments
Esteban Küber [Mon, 26 Dec 2022 21:35:35 +0000 (13:35 -0800)]
review comments

18 months agofix rebase
Esteban Küber [Mon, 26 Dec 2022 20:47:08 +0000 (12:47 -0800)]
fix rebase

18 months agoFix suggestion when there are arguments in the method
Esteban Küber [Mon, 26 Dec 2022 20:29:16 +0000 (12:29 -0800)]
Fix suggestion when there are arguments in the method

18 months agoTweak wording
Esteban Küber [Mon, 26 Dec 2022 20:00:22 +0000 (12:00 -0800)]
Tweak wording

18 months agoDetect when method call on LHS might be shadowed
Esteban Küber [Mon, 26 Dec 2022 05:50:30 +0000 (21:50 -0800)]
Detect when method call on LHS might be shadowed

Address #39232.

18 months agoAuto merge of #106156 - fee1-dead-contrib:rollup-3ir0951, r=fee1-dead
bors [Mon, 26 Dec 2022 18:36:10 +0000 (18:36 +0000)]
Auto merge of #106156 - fee1-dead-contrib:rollup-3ir0951, r=fee1-dead

Rollup of 2 pull requests

Successful merges:

 - #106151 (Remove unused imports)
 - #106153 (Fix missing renaming for #titles into #search-tabs)

Failed merges:

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

18 months agoRollup merge of #106153 - GuillaumeGomez:search-tabs-headers, r=notriddle
fee1-dead [Mon, 26 Dec 2022 16:34:53 +0000 (00:34 +0800)]
Rollup merge of #106153 - GuillaumeGomez:search-tabs-headers, r=notriddle

Fix missing renaming for #titles into #search-tabs

We forgot to update this selector in the themes in https://github.com/rust-lang/rust/pull/106069.

r? `@notriddle`

18 months agoRollup merge of #106151 - TaKO8Ki:remove-unused-imports, r=jackh726
fee1-dead [Mon, 26 Dec 2022 16:34:53 +0000 (00:34 +0800)]
Rollup merge of #106151 - TaKO8Ki:remove-unused-imports, r=jackh726

Remove unused imports

18 months agoAuto merge of #106149 - notriddle:notriddle/src-sidebar-toggle-pos, r=GuillaumeGomez
bors [Mon, 26 Dec 2022 15:46:53 +0000 (15:46 +0000)]
Auto merge of #106149 - notriddle:notriddle/src-sidebar-toggle-pos, r=GuillaumeGomez

rustdoc: clean up src sidebar toggle position CSS

This PR makes the `464px` version of `#src-sidebar-toggle` the same as the `700px` version, with the button lower on the page so that it doesn't cover up the search form, and removes the left margin to make space for it.

## Before

![image](https://user-images.githubusercontent.com/1593513/209507474-0463e4b2-0bd4-497b-958c-ec4fdbb524fb.png)

## After

![image](https://user-images.githubusercontent.com/1593513/209507499-a32c1728-d4c9-46d9-821d-ba6f8d4d94d4.png)

18 months agoaddress review comments + better tests
Lukas Markeffsky [Sun, 25 Dec 2022 21:16:04 +0000 (22:16 +0100)]
address review comments + better tests

18 months agoAdd GUI test for search tab headers
Guillaume Gomez [Mon, 26 Dec 2022 12:09:40 +0000 (13:09 +0100)]
Add GUI test for search tab headers

18 months agoFix missing renaming for #titles into #search-tabs
Guillaume Gomez [Mon, 26 Dec 2022 12:09:23 +0000 (13:09 +0100)]
Fix missing renaming for #titles into #search-tabs

18 months agoAuto merge of #103828 - cassaundra:fix-format-args-span2, r=cjgillot
bors [Mon, 26 Dec 2022 12:03:47 +0000 (12:03 +0000)]
Auto merge of #103828 - cassaundra:fix-format-args-span2, r=cjgillot

Fix incorrect span when using byte-escaped rbrace

Fix #103826, a format args span issue introduced in #102214.

The current solution for tracking skipped characters made it so that certain situations were ambiguous enough that the original span couldn't be worked out later. This PR improves on the original solution by keeping track of groups of skipped characters using a map, and fixes the previous bug. See an example of this ambiguity in the [previous PR's discussion](https://github.com/rust-lang/rust/pull/102214#issuecomment-1258711015).

18 months agoAuto merge of #105605 - inquisitivecrystal:attr-validation, r=cjgillot
bors [Mon, 26 Dec 2022 09:06:51 +0000 (09:06 +0000)]
Auto merge of #105605 - inquisitivecrystal:attr-validation, r=cjgillot

Don't perform invalid checks in `codegen_attrs`

The attributes `#[track_caller]` and `#[cmse_nonsecure_entry]` are only valid on functions. When validating one of these attributes, codegen_attrs previously called `fn_sig`, [which can only be used on functions](https://github.com/rust-lang/rust/pull/105201), on the item the attribute was attached to, assuming that the item was a function without checking. This led to [ICEs in situations where the attribute was incorrectly used on non-functions](https://github.com/rust-lang/rust/issues/105594).

With this change, we skip calling `fn_sig` if the item the attribute is attached to must be a function but isn't, because `check_attr` will reject such cases without codegen_attrs's intervention.

As a side note, some of the attributes in codegen_attrs are only valid on functions, but that property isn't actually checked. I'm planning to fix that in a follow up PR since it's a behavior change that will need to be validated rather than an obvious bugfix. Thankfully, all the attributes like that I've found so far are unstable.

Fixes #105594.

r? `@cjgillot`

18 months agoremove unused imports
Takayuki Maeda [Mon, 26 Dec 2022 06:01:20 +0000 (15:01 +0900)]
remove unused imports

18 months agorustdoc: clean up src sidebar toggle position CSS
Michael Howell [Mon, 26 Dec 2022 05:35:34 +0000 (22:35 -0700)]
rustdoc: clean up src sidebar toggle position CSS

This PR makes the `464px` version of `#src-sidebar-toggle` the same as the
`700px` version, with the button lower on the page so that it doesn't cover
up the search form, and removes the left margin to make space for it.

18 months agoRemove redundant clone suggestion
Esteban Küber [Mon, 26 Dec 2022 01:16:54 +0000 (17:16 -0800)]
Remove redundant clone suggestion

18 months agoCreate new inference context
Esteban Küber [Mon, 26 Dec 2022 00:51:11 +0000 (16:51 -0800)]
Create new inference context

18 months agoAuto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
bors [Sun, 25 Dec 2022 23:47:11 +0000 (23:47 +0000)]
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #105375 (Fix an outdated comment mentioning parameter that doesn't exist anymore)
 - #105955 (Remove wrapper functions for some unstable options)
 - #106137 (fix more clippy::style findings)
 - #106140 (Migrate links-color.goml to functions)

Failed merges:

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

18 months agoreadme: update section on how to run x.py
KaDiWa [Sun, 25 Dec 2022 23:33:32 +0000 (00:33 +0100)]
readme: update section on how to run x.py

18 months agoRollup merge of #106140 - GuillaumeGomez:migrate-links-color, r=notriddle
Matthias Krüger [Sun, 25 Dec 2022 21:15:01 +0000 (22:15 +0100)]
Rollup merge of #106140 - GuillaumeGomez:migrate-links-color, r=notriddle

Migrate links-color.goml to functions

r? `@notriddle`

18 months agoRollup merge of #106137 - matthiaskrgr:clippy_style, r=jyn514
Matthias Krüger [Sun, 25 Dec 2022 21:15:00 +0000 (22:15 +0100)]
Rollup merge of #106137 - matthiaskrgr:clippy_style, r=jyn514

fix more clippy::style findings

match_result_ok
obfuscated_if_else
single_char_add
writeln_empty_string
collapsible_match
iter_cloned_collect
unnecessary_mut_passed

r? `@compiler-errors`

18 months agoRollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
Matthias Krüger [Sun, 25 Dec 2022 21:15:00 +0000 (22:15 +0100)]
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses-for-that, r=cjgillot

Remove wrapper functions for some unstable options

They are trivial and just forward to the option. Like most other options, we can just access it directly.

18 months agoRollup merge of #105375 - WaffleLapkin:docfix, r=cjgillot
Matthias Krüger [Sun, 25 Dec 2022 21:14:59 +0000 (22:14 +0100)]
Rollup merge of #105375 - WaffleLapkin:docfix, r=cjgillot

Fix an outdated comment mentioning parameter that doesn't exist anymore

I'm not too familiar with the code in question, but from what I see I think the new comment makes sense.

r? `@cjgillot` (you touched these arguments lately https://github.com/rust-lang/rust/pull/91557/files#diff-ad0c15bbde97a607d4758ec7eaf88248be5d6b8ae084dfc84127f81e3f7a9bb4L1702, https://github.com/rust-lang/rust/pull/104048/files#diff-ad0c15bbde97a607d4758ec7eaf88248be5d6b8ae084dfc84127f81e3f7a9bb4L1682)

18 months agoAuto merge of #105997 - RalfJung:immediate-abort, r=eholk
bors [Sun, 25 Dec 2022 20:51:37 +0000 (20:51 +0000)]
Auto merge of #105997 - RalfJung:immediate-abort, r=eholk

abort immediately on bad mem::zeroed/uninit

Now that we have non-unwinding panics, let's use them for these assertions. This re-establishes the property that `mem::uninitialized` and `mem::zeroed` will never unwind -- the earlier approach of causing panics here sometimes led to hard-to-debug segfaults when the surrounding code was not able to cope with the unexpected unwinding.

Cc `@bjorn3` I did not touch cranelift but I assume it needs a similar patch. However it has a `codegen_panic` abstraction that I did not want to touch since I didn't know how else it is used.

18 months agoMigrate links-color.goml to functions
Guillaume Gomez [Sun, 25 Dec 2022 19:14:40 +0000 (20:14 +0100)]
Migrate links-color.goml to functions

18 months agoAuto merge of #106121 - RalfJung:miri, r=RalfJung
bors [Sun, 25 Dec 2022 17:39:06 +0000 (17:39 +0000)]
Auto merge of #106121 - RalfJung:miri, r=RalfJung

update Miri

Noteworthy PRs:
- https://github.com/rust-lang/miri/pull/2357
- https://github.com/rust-lang/miri/pull/2646
- https://github.com/rust-lang/miri/pull/2718
- https://github.com/rust-lang/miri/pull/2721
- https://github.com/rust-lang/miri/pull/2725

18 months agodocument that `Span::to` can go backwards
Lukas Markeffsky [Sun, 25 Dec 2022 16:41:31 +0000 (17:41 +0100)]
document that `Span::to` can go backwards

18 months agofix more clippy::style findings
Matthias Krüger [Sun, 25 Dec 2022 15:42:35 +0000 (16:42 +0100)]
fix more clippy::style findings

match_result_ok
obfuscated_if_else
single_char_add
writeln_empty_string
collapsible_match
iter_cloned_collect
unnecessary_mut_passed

18 months agofix codegen test
Ralf Jung [Sun, 25 Dec 2022 14:46:20 +0000 (15:46 +0100)]
fix codegen test

18 months agoAuto merge of #105701 - RedDocMD:bug-105634, r=cjgillot
bors [Sun, 25 Dec 2022 14:42:49 +0000 (14:42 +0000)]
Auto merge of #105701 - RedDocMD:bug-105634, r=cjgillot

Allow .. to be parsed as let initializer

.. and ..= are valid expressions, however when used in a let statement
it is not parsed.
Fixes #105634

18 months agoAuto merge of #2739 - RalfJung:misc, r=RalfJung
bors [Sun, 25 Dec 2022 13:21:26 +0000 (13:21 +0000)]
Auto merge of #2739 - RalfJung:misc, r=RalfJung

enable some warnings that rustc bootstrap enables

also use cargo-install to install josh-proxy, since the docker version cannot access SSH keys (needed for pushing)

18 months agoenable some warnings that rustc bootstrap enables
Ralf Jung [Sun, 25 Dec 2022 13:18:41 +0000 (14:18 +0100)]
enable some warnings that rustc bootstrap enables

18 months agouse cargo-install to install josh-proxy
Ralf Jung [Sun, 25 Dec 2022 13:16:10 +0000 (14:16 +0100)]
use cargo-install to install josh-proxy

18 months agoAuto merge of #106112 - RalfJung:into-iter, r=thomcc
bors [Sun, 25 Dec 2022 04:26:14 +0000 (04:26 +0000)]
Auto merge of #106112 - RalfJung:into-iter, r=thomcc

add lib tests for vec::IntoIter alignment issues

This adds non-Miri tests for the issue fixed in https://github.com/rust-lang/rust/pull/106084

r? `@thomcc`

18 months agoAuto merge of #106132 - kadiwa4:typos, r=compiler-errors
bors [Sun, 25 Dec 2022 01:44:28 +0000 (01:44 +0000)]
Auto merge of #106132 - kadiwa4:typos, r=compiler-errors

Fix some typos

18 months agofix some typos
KaDiWa [Sat, 24 Dec 2022 23:43:50 +0000 (00:43 +0100)]
fix some typos

18 months agoAuto merge of #106123 - gimbles:patch-1, r=jyn
bors [Sat, 24 Dec 2022 23:22:42 +0000 (23:22 +0000)]
Auto merge of #106123 - gimbles:patch-1, r=jyn

Make note bold

~~this seems to be have occurred in a recent edit, i clearly remember just note being bold~~

the entire note was bold

18 months agoAuto merge of #106110 - GuillaumeGomez:toggle-line-background, r=notriddle
bors [Sat, 24 Dec 2022 20:23:45 +0000 (20:23 +0000)]
Auto merge of #106110 - GuillaumeGomez:toggle-line-background, r=notriddle

Migrate toggle-line-inner background to CSS variable

r? `@notriddle`

18 months agoAuto merge of #104977 - RalfJung:ptr-from-ref, r=dtolnay
bors [Sat, 24 Dec 2022 17:14:26 +0000 (17:14 +0000)]
Auto merge of #104977 - RalfJung:ptr-from-ref, r=dtolnay

add ptr::from_{ref,mut}

We have methods to avoid almost all `as` casts around raw pointer handling, except for the initial cast from reference to raw pointer. These new methods close that gap.

(I also moved `null_mut` next to `null` to keep the file consistently organized.)

r? libs-api

Tracking issue: https://github.com/rust-lang/rust/issues/106116

18 months agoUpdate README.md
Gimbles [Sat, 24 Dec 2022 15:48:35 +0000 (21:18 +0530)]
Update README.md

18 months agoUpdate README.md
Gimbles [Sat, 24 Dec 2022 15:46:14 +0000 (21:16 +0530)]
Update README.md

18 months agoBold
Gimbles [Sat, 24 Dec 2022 15:32:15 +0000 (21:02 +0530)]
Bold

18 months agoAuto merge of #105085 - oli-obk:stop_promoting_all_the_things, r=RalfJung
bors [Sat, 24 Dec 2022 14:00:37 +0000 (14:00 +0000)]
Auto merge of #105085 - oli-obk:stop_promoting_all_the_things, r=RalfJung

Stop promoting all the things

fixes #91009

r? `@RalfJung`

18 months agoAuto merge of #106111 - matthiaskrgr:rollup-nnpoe5h, r=matthiaskrgr
bors [Sat, 24 Dec 2022 10:46:43 +0000 (10:46 +0000)]
Auto merge of #106111 - matthiaskrgr:rollup-nnpoe5h, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #105465 (Improve top-level docs)
 - #105872 (Suggest remove last method call when type coerce with expected  type)
 - #106032 (std: only use LFS function on glibc)
 - #106078 (Provide more context on FileCheck failures)
 - #106100 (Codegen test for derived `<` on trivial newtype [TEST ONLY])
 - #106109 (rustdoc: make line number CSS for doc comment and scraped the same)

Failed merges:

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

18 months agoadd tracking issue, fix typo
Ralf Jung [Sat, 24 Dec 2022 09:47:31 +0000 (10:47 +0100)]
add tracking issue, fix typo

18 months agoAuto merge of #2738 - RalfJung:rustup, r=RalfJung
bors [Sat, 24 Dec 2022 09:41:11 +0000 (09:41 +0000)]
Auto merge of #2738 - RalfJung:rustup, r=RalfJung

Rustup

18 months agofix warnings
Ralf Jung [Sat, 24 Dec 2022 09:12:28 +0000 (10:12 +0100)]
fix warnings

18 months agoMerge from rustc
Ralf Jung [Sat, 24 Dec 2022 09:12:14 +0000 (10:12 +0100)]
Merge from rustc

18 months agoadd lib tests for vec::IntoIter alignment issues
Ralf Jung [Sat, 24 Dec 2022 08:09:34 +0000 (09:09 +0100)]
add lib tests for vec::IntoIter alignment issues

18 months agoPreparing for merge from rustc
Ralf Jung [Sat, 24 Dec 2022 08:58:29 +0000 (09:58 +0100)]
Preparing for merge from rustc

18 months agoAuto merge of #2646 - saethlin:data-race-spans, r=RalfJung
bors [Sat, 24 Dec 2022 08:13:31 +0000 (08:13 +0000)]
Auto merge of #2646 - saethlin:data-race-spans, r=RalfJung

Data race spans

Fixes https://github.com/rust-lang/miri/issues/2205

This adds output to data race errors very similar to the spans we emit for Stacked Borrows errors. For example, from our test suite:
```
help: The Atomic Load on thread `<unnamed>` is here
  --> tests/fail/data_race/atomic_read_na_write_race1.rs:23:13
   |
23 | ...   (&*c.0).load(Ordering::SeqCst) //~ ERROR: Data race detected between Atomic Load on thread `<unnamed>` and Write o...
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: The Write on thread `<unnamed>` is here
  --> tests/fail/data_race/atomic_read_na_write_race1.rs:19:13
   |
19 |             *(c.0 as *mut usize) = 32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^```
```

Because of https://github.com/rust-lang/miri/pull/2647 this comes without a perf regression, according to our benchmarks.

18 months agoRollup merge of #106109 - notriddle:notriddle/source-lines, r=GuillaumeGomez
Matthias Krüger [Sat, 24 Dec 2022 07:53:48 +0000 (08:53 +0100)]
Rollup merge of #106109 - notriddle:notriddle/source-lines, r=GuillaumeGomez

rustdoc: make line number CSS for doc comment and scraped the same

![image](https://user-images.githubusercontent.com/1593513/209423540-2657bb43-e6d7-4af3-9cb3-c790a8dd8cd9.png)

Discussed in
https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Line.20number.20styling

Preview: http://notriddle.com/notriddle-rustdoc-demos/source-lines/test_dingus/fn.test.html

18 months agoRollup merge of #106100 - scottmcm:derived-less-than-test, r=compiler-errors
Matthias Krüger [Sat, 24 Dec 2022 07:53:48 +0000 (08:53 +0100)]
Rollup merge of #106100 - scottmcm:derived-less-than-test, r=compiler-errors

Codegen test for derived `<` on trivial newtype [TEST ONLY]

I originally wrote this for #106065, but the libcore changes there aren't necessarily a win.

So I pulled out this test to be its own PR since it's important (see https://github.com/rust-lang/rust/pull/105840#discussion_r1056030324) and well-intentioned changes to core or the derive could accidentally break it without that being obvious (other than by massive unexplained perf changes).

18 months agoRollup merge of #106078 - nikic:filecheck-context, r=Mark-Simulacrum
Matthias Krüger [Sat, 24 Dec 2022 07:53:48 +0000 (08:53 +0100)]
Rollup merge of #106078 - nikic:filecheck-context, r=Mark-Simulacrum

Provide more context on FileCheck failures

FileCheck provides 5 lines of context by default. This is often insufficient to analyze failures that happen in CI. Increase the amount of context to 100 lines.

18 months agoRollup merge of #106032 - mcha-forks:lfs-musl-fix, r=thomcc
Matthias Krüger [Sat, 24 Dec 2022 07:53:47 +0000 (08:53 +0100)]
Rollup merge of #106032 - mcha-forks:lfs-musl-fix, r=thomcc

std: only use LFS function on glibc

see #94173 and commit 27011b4185f5341e579d2a02cabd3dc7d7aa7149.

18 months agoRollup merge of #105872 - chenyukang:yukang/fix-105494-remove-method-call, r=eholk
Matthias Krüger [Sat, 24 Dec 2022 07:53:47 +0000 (08:53 +0100)]
Rollup merge of #105872 - chenyukang:yukang/fix-105494-remove-method-call, r=eholk

Suggest remove last method call when type coerce with expected  type

Fixes #105494

18 months agoRollup merge of #105465 - jyn514:docs, r=Mark-Simulacrum
Matthias Krüger [Sat, 24 Dec 2022 07:53:46 +0000 (08:53 +0100)]
Rollup merge of #105465 - jyn514:docs, r=Mark-Simulacrum

Improve top-level docs

See a detailed explanation in the commit messages. This is a companion PR to https://github.com/rust-lang/rustc-dev-guide/pull/1528.

* Link to other resources instead of inlining their information
* Remove ancient and outdated reference to `config.mk`
* Suggest `profile = "user"` in the README
* Add detail about dependencies from the dev-guide
* Link to CONTRIBUTING.md instead of rustc-dev-guide in the main readme
* Link to `std-dev-guide` in CONTRIBUTING.md