]> git.lizzy.rs Git - rust.git/log
rust.git
17 months agoAuto merge of #84762 - cjgillot:resolve-span-opt, r=petrochenkov
bors [Mon, 2 Jan 2023 13:10:16 +0000 (13:10 +0000)]
Auto merge of #84762 - cjgillot:resolve-span-opt, r=petrochenkov

Encode spans relative to the enclosing item -- enable on nightly

Follow-up to #84373 with the flag `-Zincremental-relative-spans` set by default.

This PR seeks to remove one of the main shortcomings of incremental: the handling of spans.
Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed.
Within one file: all the spans in HIR change, so typechecking had to be re-done.
Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span).

The flag `-Zincremental-relative-spans` encodes local spans relative to the span of an item, stored inside the `source_span` query.

Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent.

In order to avoid too much traffic in the span interner, span encoding uses the `ctxt_or_tag` field to encode:
- the parent when the `SyntaxContext` is 0;
- the `SyntaxContext` when the parent is `None`.
Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans.

The last commit changes how queries of `LocalDefId` manage their cache. I can put this in a separate PR if required.

Possible future directions:
- validate that all spans are marked in HIR validation;
- mark macro-expanded spans relative to the def-site and not the use-site.

17 months agoAuto merge of #106301 - notriddle:notriddle/dir-entry, r=GuillaumeGomez
bors [Mon, 2 Jan 2023 10:21:53 +0000 (10:21 +0000)]
Auto merge of #106301 - notriddle:notriddle/dir-entry, r=GuillaumeGomez

rustdoc: use the regular arrow indicator for dir-entry CSS

This mostly reverts 468acca108e65101b802821bded17149dc1d86c9, while still fixing the problem it fixed by using an internal list-style-position. It results in a slight change in the hover indicator, but nothing misleading.

Preview: http://notriddle.com/notriddle-rustdoc-demos/dir-entry/src/std/lib.rs.html

## Before

![image](https://user-images.githubusercontent.com/1593513/210104247-642e6df0-07d3-452a-a2ab-4c700bc22e0e.png)

## After

![image](https://user-images.githubusercontent.com/1593513/210104271-a3832784-1e4d-4516-983e-6ecb9051857b.png)

17 months agoAuto merge of #106284 - estebank:merge-mut-errors, r=jyn514
bors [Mon, 2 Jan 2023 07:30:23 +0000 (07:30 +0000)]
Auto merge of #106284 - estebank:merge-mut-errors, r=jyn514

Merge multiple mutable borrows of immutable binding errors

Fix #53466.

17 months agoVerbose suggestions
Esteban Küber [Sun, 1 Jan 2023 08:06:31 +0000 (00:06 -0800)]
Verbose suggestions

17 months agoAuto merge of #106358 - TroyNeubauer:improve-foreign-orphan-error, r=estebank
bors [Mon, 2 Jan 2023 04:32:39 +0000 (04:32 +0000)]
Auto merge of #106358 - TroyNeubauer:improve-foreign-orphan-error, r=estebank

Implement fix for #67535

Implements a fix for #67535
r? `@estebank`

17 months agorustdoc: add test case for dir entry summary position
Michael Howell [Sat, 31 Dec 2022 18:23:30 +0000 (11:23 -0700)]
rustdoc: add test case for dir entry summary position

17 months agoImplement fix for #67535
Troy Neubauer [Mon, 2 Jan 2023 02:08:02 +0000 (18:08 -0800)]
Implement fix for #67535

17 months agoAuto merge of #106352 - kornelski:read_line-doc, r=scottmcm
bors [Mon, 2 Jan 2023 01:15:25 +0000 (01:15 +0000)]
Auto merge of #106352 - kornelski:read_line-doc, r=scottmcm

Document read_line gotchas

1. The "You do not need to clear the buffer before appending" advice is ambiguous, because it depends what you use this function for. For a rather common case of reading individual lines in a loop, it _is_ necessary to clear the buffer.

2. The docs warn about a DoS risk. I've added a hint how to mitigate unbounded memory growth.

17 months agoAuto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
bors [Sun, 1 Jan 2023 21:41:35 +0000 (21:41 +0000)]
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726

Use the correct tracking issue for `dyn_star`

`#![feature(dyn_star)]` now has its own tracking issue, #102425.

17 months agoUse the correct tracking issue for `dyn_star`
Léo Lanteri Thauvin [Sun, 1 Jan 2023 11:25:21 +0000 (12:25 +0100)]
Use the correct tracking issue for `dyn_star`

17 months agoAuto merge of #106350 - GuillaumeGomez:gui-test-explanation-2, r=notriddle
bors [Sun, 1 Jan 2023 18:35:04 +0000 (18:35 +0000)]
Auto merge of #106350 - GuillaumeGomez:gui-test-explanation-2, r=notriddle

Add comment explaining what docblock-table GUI test is about

r? `@notriddle`

17 months agoMerge multiple mutable borrows of immutable binding errors
Esteban Küber [Fri, 30 Dec 2022 06:46:17 +0000 (22:46 -0800)]
Merge multiple mutable borrows of immutable binding errors

Fix #53466.

17 months agoDocument a way to limit read_line length
Kornel [Sun, 1 Jan 2023 18:04:26 +0000 (18:04 +0000)]
Document a way to limit read_line length

17 months agoDocument read_line gotcha
Kornel [Sun, 1 Jan 2023 17:49:05 +0000 (17:49 +0000)]
Document read_line gotcha

17 months agoAdd comment explaining what docblock-table GUI test is about
Guillaume Gomez [Sun, 1 Jan 2023 16:21:19 +0000 (17:21 +0100)]
Add comment explaining what docblock-table GUI test is about

17 months agoAuto merge of #106312 - tgross35:update-book-target, r=JohnTitor
bors [Sun, 1 Jan 2023 05:20:48 +0000 (05:20 +0000)]
Auto merge of #106312 - tgross35:update-book-target, r=JohnTitor

Added link from Targets to Platform Support in the book

If you search the web for "rust targets", the first result is the [targets page](https://doc.rust-lang.org/nightly/rustc/targets/index.html). However, usually when searching for this I'm interested in seeing the available triples with host information, so I just added a link to the correct page.

The entire `Targets` chapter could probably be combined into one page, since its three subchapters each only have a tiny section (I'll do this if requested)

17 months agoAuto merge of #106336 - matthiaskrgr:rollup-4p6bgwf, r=matthiaskrgr
bors [Sat, 31 Dec 2022 23:22:06 +0000 (23:22 +0000)]
Auto merge of #106336 - matthiaskrgr:rollup-4p6bgwf, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #106280 (docs: add link to `Path::join` in `PathBuf::push`)
 - #106297 (rustdoc: merge scrape-help CSS)
 - #106328 (Add comment explaining what the GUI scrape-examples-fonts test is about)
 - #106334 (Fix tidy unittest.)

Failed merges:

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

17 months agoRollup merge of #106334 - ehuss:fix-tidy-unittests, r=jyn514
Matthias Krüger [Sat, 31 Dec 2022 22:51:35 +0000 (23:51 +0100)]
Rollup merge of #106334 - ehuss:fix-tidy-unittests, r=jyn514

Fix tidy unittest.

The tidy unittests weren't compiling due to a change made a long while ago to the `Version` type.

17 months agoRollup merge of #106328 - GuillaumeGomez:gui-test-explanation, r=notriddle
Matthias Krüger [Sat, 31 Dec 2022 22:51:35 +0000 (23:51 +0100)]
Rollup merge of #106328 - GuillaumeGomez:gui-test-explanation, r=notriddle

Add comment explaining what the GUI scrape-examples-fonts test is about

r? `@notriddle`

17 months agoRollup merge of #106297 - notriddle:notriddle/scrape-help, r=GuillaumeGomez
Matthias Krüger [Sat, 31 Dec 2022 22:51:34 +0000 (23:51 +0100)]
Rollup merge of #106297 - notriddle:notriddle/scrape-help, r=GuillaumeGomez

rustdoc: merge scrape-help CSS

17 months agoRollup merge of #106280 - Ezrashaw:path-join-docs-better, r=thomcc
Matthias Krüger [Sat, 31 Dec 2022 22:51:34 +0000 (23:51 +0100)]
Rollup merge of #106280 - Ezrashaw:path-join-docs-better, r=thomcc

docs: add link to `Path::join` in `PathBuf::push`

Fixes #106219

Hopefully my wording is alright.

17 months agoRun `cargo test` on tidy itself.
Eric Huss [Sat, 31 Dec 2022 20:31:42 +0000 (12:31 -0800)]
Run `cargo test` on tidy itself.

17 months agoAuto merge of #106282 - Ezrashaw:merge-e0465, r=estebank
bors [Sat, 31 Dec 2022 20:10:02 +0000 (20:10 +0000)]
Auto merge of #106282 - Ezrashaw:merge-e0465, r=estebank

refactor: merge error code `E0465` into `E0464`

`E0465` is an undocumented and untested error code that is functionally identical to `E0464`. This PR merges `E0465` into `E0464`, thus documenting and testing another error code (#61137).

r? `@GuillaumeGomez` (not sure if you want to review this but it's relevant to my other PRs that you have reviewed)

17 months agoFix tidy unittest.
Eric Huss [Sat, 31 Dec 2022 19:52:16 +0000 (11:52 -0800)]
Fix tidy unittest.

17 months agoAuto merge of #106275 - Nilstrieb:const-eval-select-me-some-compile-time, r=thomcc
bors [Sat, 31 Dec 2022 17:19:10 +0000 (17:19 +0000)]
Auto merge of #106275 - Nilstrieb:const-eval-select-me-some-compile-time, r=thomcc

Use some more `const_eval_select` in pointer methods for compile times

Builds on top of #105435

`is_aligned_to` is _huge_ with calling `align_offset`, so this should cut it down a lot.

This shows up in https://github.com/rust-lang/rust/issues/65031#issuecomment-1367574340

17 months agoAuto merge of #106302 - compiler-errors:terr-coerce-w-infer, r=estebank
bors [Sat, 31 Dec 2022 11:32:15 +0000 (11:32 +0000)]
Auto merge of #106302 - compiler-errors:terr-coerce-w-infer, r=estebank

Suppress errors due to TypeError not coercing with inference variables

Fixes #75331
Fixes #68507
Fixes #82323

cc `@estebank`

17 months agoAdd comment explaining what the GUI scrape-examples-fonts test is about
Guillaume Gomez [Sat, 31 Dec 2022 10:15:02 +0000 (11:15 +0100)]
Add comment explaining what the GUI scrape-examples-fonts test is about

17 months agoAuto merge of #106245 - estebank:mutability-suggestions, r=jyn514
bors [Sat, 31 Dec 2022 08:43:24 +0000 (08:43 +0000)]
Auto merge of #106245 - estebank:mutability-suggestions, r=jyn514

Use verbose suggestions for mutability errors

17 months agorefactor: merge `E0465` into `E0464`
Ezra Shaw [Thu, 22 Dec 2022 07:21:43 +0000 (20:21 +1300)]
refactor: merge `E0465` into `E0464`

17 months agoAuto merge of #106324 - compiler-errors:rollup-2m9njin, r=compiler-errors
bors [Sat, 31 Dec 2022 05:27:07 +0000 (05:27 +0000)]
Auto merge of #106324 - compiler-errors:rollup-2m9njin, r=compiler-errors

Rollup of 9 pull requests

Successful merges:

 - #105903 (Unify id-based thread parking implementations)
 - #106232 (CFI: Monomorphize transparent ADTs before typeid)
 - #106248 (Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint")
 - #106286 (Make tidy errors red)
 - #106295 (Extend scraped examples layout GUI test for position of buttons)
 - #106305 ( bootstrap: Get rid of tail_args in stream_cargo)
 - #106310 (Dont use `--merge-base` during bootstrap formatting subcommand)
 - #106314 (Fix panic on `x build --help`)
 - #106317 (Only deduplicate stack traces for good path bugs)

Failed merges:

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

17 months agoRollup merge of #106317 - compiler-errors:restore-the-backtraces, r=jyn514
Michael Goulet [Sat, 31 Dec 2022 05:26:36 +0000 (21:26 -0800)]
Rollup merge of #106317 - compiler-errors:restore-the-backtraces, r=jyn514

Only deduplicate stack traces for good path bugs

Fixes #106267

Restores backtraces for `bug!` and `delay_span_bug` after #106056. Only `delay_good_path_bug` needed its backtraces to be deduplicated, since it spits out the backtrace where it was created when it's being emitted.

Before:

```
error: internal compiler error: /home/ubuntu/rust2/compiler/rustc_middle/src/ty/relate.rs:638:13: var types encountered in super_relate_consts: Const { ty: usize, kind: Infer(Var(_#0c)) } Const { ty: usize, kind: Param(N/#1) }

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.68.0-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `<impl at /home/ubuntu/test.rs:7:1: 7:34>::trigger`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors
```

Hmm... that's a little bare.

After:

```
error: internal compiler error: /home/ubuntu/rust2/compiler/rustc_middle/src/ty/relate.rs:638:13: var types encountered in super_relate_consts: Const { ty: usize, kind: Infer(Var(_#0c)) } Const { ty: usize, kind: Param(N/#1) }

thread 'rustc' panicked at 'Box<dyn Any>', /home/ubuntu/rust2/compiler/rustc_errors/src/lib.rs:1599:9
stack backtrace:
   0:     0x7ffb5b41bdd1 - std::backtrace_rs::backtrace::libunwind::trace::h26056f81198c6594
                               at /home/ubuntu/rust2/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7ffb5b41bdd1 - std::backtrace_rs::backtrace::trace_unsynchronized::hacfb345a0c6d5bb1
                               at /home/ubuntu/rust2/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ffb5b41bdd1 - std::sys_common::backtrace::_print_fmt::h18ea6016ac8030f3
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7ffb5b41bdd1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he35dde201d0c2d09
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ffb5b4a0308 - core::fmt::write::h094ad263467a053c
                               at /home/ubuntu/rust2/library/core/src/fmt/mod.rs:1208:17
   5:     0x7ffb5b43caf1 - std::io::Write::write_fmt::hd47b4e2324b4d9b7
                               at /home/ubuntu/rust2/library/std/src/io/mod.rs:1682:15
   6:     0x7ffb5b41bbfa - std::sys_common::backtrace::_print::h43044162653a17fc
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7ffb5b41bbfa - std::sys_common::backtrace::print::hc8605da258fa5aeb
                               at /home/ubuntu/rust2/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7ffb5b3ffb87 - std::panicking::default_hook::{{closure}}::h9e37f23f75122a15
   9:     0x7ffb5b3ff97b - std::panicking::default_hook::h602873a063f84da2
                               at /home/ubuntu/rust2/library/std/src/panicking.rs:286:9
  10:     0x7ffb5be192b2 - <alloc[48d7b30605060536]::boxed::Box<dyn for<'a, 'b> core[672e3947e150d6c6]::ops::function::Fn<(&'a core[672e3947e150d6c6]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[672e3947e150d6c6]::marker::Send + core[672e3947e150d6c6]::marker::Sync> as core[672e3947e150d6c6]::ops::function::Fn<(&core[672e3947e150d6c6]::panic::panic_info::PanicInfo,)>>::call
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:2002:9
  11:     0x7ffb5be192b2 - rustc_driver[f5b6d32d8905ecdd]::DEFAULT_HOOK::{closure#0}::{closure#0}
                               at /home/ubuntu/rust2/compiler/rustc_driver/src/lib.rs:1204:17
  12:     0x7ffb5b4000d3 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hfd13333ca953ae8e
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:2002:9
  13:     0x7ffb5b4000d3 - std::panicking::rust_panic_with_hook::h45753e10264ebe7e
                               at /home/ubuntu/rust2/library/std/src/panicking.rs:692:13
  14:     0x7ffb5e8b3a63 - std[3330b4673efabfce]::panicking::begin_panic::<rustc_errors[1b15f4e7e49d1fd5]::ExplicitBug>::{closure#0}

[... FRAMES INTENTIONALLY OMITTED BECAUSE GITHUB GOT ANGRY ...]

 186:     0x7ffb5bea5554 - <std[3330b4673efabfce]::thread::Builder>::spawn_unchecked_::<rustc_interface[947706ead88047d0]::util::run_in_thread_pool_with_globals<rustc_interface[947706ead88047d0]::interface::run_compiler<core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>, rustc_driver[f5b6d32d8905ecdd]::run_compiler::{closure#1}>::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#1}
                               at /home/ubuntu/rust2/library/std/src/thread/mod.rs:549:30
 187:     0x7ffb5bea5554 - <<std[3330b4673efabfce]::thread::Builder>::spawn_unchecked_<rustc_interface[947706ead88047d0]::util::run_in_thread_pool_with_globals<rustc_interface[947706ead88047d0]::interface::run_compiler<core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>, rustc_driver[f5b6d32d8905ecdd]::run_compiler::{closure#1}>::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[672e3947e150d6c6]::result::Result<(), rustc_errors[1b15f4e7e49d1fd5]::ErrorGuaranteed>>::{closure#1} as core[672e3947e150d6c6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                               at /home/ubuntu/rust2/library/core/src/ops/function.rs:250:5
 188:     0x7ffb5b433968 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he8b26fc22c6f51ec
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:1988:9
 189:     0x7ffb5b433968 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5cf9cbe75a8c3ddc
                               at /home/ubuntu/rust2/library/alloc/src/boxed.rs:1988:9
 190:     0x7ffb5b41199c - std::sys::unix::thread::Thread::new::thread_start::h2d6dd4455e97d031
                               at /home/ubuntu/rust2/library/std/src/sys/unix/thread.rs:108:17
 191:     0x7ffb5441b609 - start_thread
 192:     0x7ffb5b282133 - clone
 193:                0x0 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.68.0-dev running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck] type-checking `<impl at /home/ubuntu/test.rs:7:1: 7:34>::trigger`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0601`.
```

17 months agoRollup merge of #106314 - jyn514:fix-panic, r=jyn514
Michael Goulet [Sat, 31 Dec 2022 05:26:36 +0000 (21:26 -0800)]
Rollup merge of #106314 - jyn514:fix-panic, r=jyn514

Fix panic on `x build --help`

Fixes https://github.com/rust-lang/rust/issues/106313. This avoids trying to run `get_help` unless we actually need to see the paths that are available for the subcommand.

This originally regressed in https://github.com/rust-lang/rust/pull/106166.

17 months agoRollup merge of #106310 - compiler-errors:old-git, r=jyn514
Michael Goulet [Sat, 31 Dec 2022 05:26:36 +0000 (21:26 -0800)]
Rollup merge of #106310 - compiler-errors:old-git, r=jyn514

Dont use `--merge-base` during bootstrap formatting subcommand

I use a development image with Ubuntu 20.04 LTS, which has git 2.25.

Recently, `./x.py test tidy --bless` regressed in #105702 because it uses the `--merge-base` option on `diff-index`, which was only introduced in git 2.30 (git/git@0f5a1d449b9538c2765de9d6683abbb83a7fb4e2). Luckily, it can be replicated via two calls to `git merge-base` + `git diff-index`, so let's just use that.

17 months agoRollup merge of #106305 - jyn514:tail-args, r=Mark-Simulacrum
Michael Goulet [Sat, 31 Dec 2022 05:26:35 +0000 (21:26 -0800)]
Rollup merge of #106305 - jyn514:tail-args, r=Mark-Simulacrum

 bootstrap: Get rid of tail_args in stream_cargo

Based on https://github.com/rust-lang/rust/pull/106303 for convenience.

r? ````@Mark-Simulacrum````

17 months agoRollup merge of #106295 - GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle
Michael Goulet [Sat, 31 Dec 2022 05:26:35 +0000 (21:26 -0800)]
Rollup merge of #106295 - GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle

Extend scraped examples layout GUI test for position of buttons

This is a regression test for https://github.com/rust-lang/rust/pull/106279.

r? ````@notriddle````

17 months agoRollup merge of #106286 - Nilstrieb:tidy-cowows, r=jyn514
Michael Goulet [Sat, 31 Dec 2022 05:26:34 +0000 (21:26 -0800)]
Rollup merge of #106286 - Nilstrieb:tidy-cowows, r=jyn514

Make tidy errors red

This makes it easier to see them (and makes people go owo).

I also changes the error codes check to not print too many things and use `tidy_error`.

r? ```@jyn514```

17 months agoRollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726
Michael Goulet [Sat, 31 Dec 2022 05:26:34 +0000 (21:26 -0800)]
Rollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726

Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint"

This is a clean revert of #105484.

I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe.

FYI `@nbdd0121` `@compiler-errors`

17 months agoRollup merge of #106232 - maurer:transparent-subst, r=rcvalle
Michael Goulet [Sat, 31 Dec 2022 05:26:33 +0000 (21:26 -0800)]
Rollup merge of #106232 - maurer:transparent-subst, r=rcvalle

CFI: Monomorphize transparent ADTs before typeid

Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String.

`#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution.

Fixes #106230

17 months agoRollup merge of #105903 - joboet:unify_parking, r=m-ou-se
Michael Goulet [Sat, 31 Dec 2022 05:26:33 +0000 (21:26 -0800)]
Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se

Unify id-based thread parking implementations

Multiple platforms currently use thread-id-based parking implementations (NetBSD and SGX[^1]). Even though the strategy does not differ, these are duplicated for each platform, as the id is encoded into an atomic thread variable in different ways for each platform.

Since `park` is only called by one thread, it is possible to move the thread id into a separate field. By ensuring that the field is only written to once, before any other threads access it, these accesses can be unsynchronized, removing any restrictions on the size and niches of the thread id.

This PR also renames the internal `thread_parker` modules to `thread_parking`, as that name now better reflects their contents. I hope this does not add too much reviewing noise.

r? `@m-ou-se`

`@rustbot` label +T-libs

[^1]: SOLID supports this as well, I will switch it over in a follow-up PR.

17 months agoOnly deduplicate stack traces for good path bugs
Michael Goulet [Sat, 31 Dec 2022 01:20:59 +0000 (01:20 +0000)]
Only deduplicate stack traces for good path bugs

17 months agoAuto merge of #106320 - jyn514:revert-merge-check, r=jyn514
bors [Sat, 31 Dec 2022 01:58:51 +0000 (01:58 +0000)]
Auto merge of #106320 - jyn514:revert-merge-check, r=jyn514

Revert "Auto merge of #105058 - Nilstrieb:no-merge-commits, r=jyn514"

This reverts commit 4839886f0abe208ab8f2bb73a3076a59fe2ab60c, reversing changes made to ce85c98575e3016cf2007d90a85be321e592aa96.

Fixes https://github.com/rust-lang/rust/pull/106232#issuecomment-1368144655.

r? `@jyn514`

17 months agoRevert "Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allow...
Joshua Nelson [Sat, 31 Dec 2022 01:55:24 +0000 (01:55 +0000)]
Revert "Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to-do-that, r=jyn514"

This reverts commit 4839886f0abe208ab8f2bb73a3076a59fe2ab60c, reversing
changes made to ce85c98575e3016cf2007d90a85be321e592aa96.

17 months agoFix panic on `x build --help`
Joshua Nelson [Sat, 31 Dec 2022 00:53:46 +0000 (00:53 +0000)]
Fix panic on `x build --help`

17 months agoAdded link from Targets to Platform Support in the book
Trevor Gross [Fri, 30 Dec 2022 23:06:13 +0000 (18:06 -0500)]
Added link from Targets to Platform Support in the book

17 months agoAuto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to...
bors [Fri, 30 Dec 2022 22:55:51 +0000 (22:55 +0000)]
Auto merge of #105058 - Nilstrieb:no-merge-commits-for-you-only-bors-is-allowed-to-do-that, r=jyn514

Add tidy check to deny merge commits

This will prevent users with the pre-push hook from pushing a merge commit.

Exceptions are added for subtree updates. These exceptions are a little hacky and may be non-exhaustive but can be extended in the future.

I added a link to `@jyn514's` blog post for the error case because that's the best resource to solve merge commits. But it would probably be better if it was integrated into https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy, then we could link that instead.

r? `@jyn514`

17 months agoDont use `--merge-base` during bootstrap formatting subcommand
Michael Goulet [Fri, 30 Dec 2022 22:43:54 +0000 (22:43 +0000)]
Dont use `--merge-base` during bootstrap formatting subcommand

17 months agoMake tidy errors red
Nilstrieb [Fri, 30 Dec 2022 11:23:05 +0000 (12:23 +0100)]
Make tidy errors red

This makes it easier to see them (and makes people go owo).

17 months agobootstrap: Get rid of `tail_args` in `stream_cargo`
Joshua Nelson [Fri, 30 Dec 2022 20:36:31 +0000 (20:36 +0000)]
bootstrap: Get rid of `tail_args` in `stream_cargo`

17 months agoUse more consistent progress messages in bootstrap
Joshua Nelson [Fri, 30 Dec 2022 20:03:24 +0000 (20:03 +0000)]
Use more consistent progress messages in bootstrap

Before:
```
Testing ["rustc_interface"] stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```

After:
```
Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```

Note there is a slight consistency between `build` and `test`: The
former doesn't print "compiler artifacts". It would be annoying to fix
and doesn't hurt anything, so I left it be.

```
; x t rustc_interface --stage 0 --dry-run
Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
; x b rustc_interface --stage 0 --dry-run
Building {rustc_interface} stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```

17 months agoSuppress errors due to TypeError not coercing with inference variables
Michael Goulet [Fri, 30 Dec 2022 18:40:16 +0000 (18:40 +0000)]
Suppress errors due to TypeError not coercing with inference variables

17 months agoAdd `build_helper` crate to share code between tidy and bootstrap
Nilstrieb [Fri, 30 Dec 2022 10:11:33 +0000 (11:11 +0100)]
Add `build_helper` crate to share code between tidy and bootstrap

17 months agoAuto merge of #105651 - tgross35:once-cell-inline, r=m-ou-se
bors [Fri, 30 Dec 2022 19:22:33 +0000 (19:22 +0000)]
Auto merge of #105651 - tgross35:once-cell-inline, r=m-ou-se

Add #[inline] markers to once_cell methods

Added inline markers to all simple methods under the `once_cell` feature. Relates to #74465 and  #105587

This should not block #105587

17 months agorustdoc: use the regular arrow indicator for dir-entry CSS
Michael Howell [Fri, 30 Dec 2022 18:58:58 +0000 (11:58 -0700)]
rustdoc: use the regular arrow indicator for dir-entry CSS

This mostly reverts 468acca108e65101b802821bded17149dc1d86c9, while still
fixing the problem it fixed by using an internal list-style-position. It
results in a slight change in the hover indicator, but nothing misleading.

17 months agoRegression test for issue 106247
Gary Guo [Thu, 29 Dec 2022 09:59:49 +0000 (09:59 +0000)]
Regression test for issue 106247

17 months agorustdoc: merge scrape-help CSS
Michael Howell [Fri, 30 Dec 2022 17:43:06 +0000 (10:43 -0700)]
rustdoc: merge scrape-help CSS

17 months agoAuto merge of #106296 - matthiaskrgr:rollup-ukdbqwx, r=matthiaskrgr
bors [Fri, 30 Dec 2022 16:10:00 +0000 (16:10 +0000)]
Auto merge of #106296 - matthiaskrgr:rollup-ukdbqwx, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #99244 (doc: clearer and more correct Iterator::scan)
 - #103707 (Replace libstd, libcore, liballoc terminology in docs)
 - #104182 (`IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` documentation.)
 - #106273 (rustdoc: remove redundant CSS `.source .content { overflow: visible }`)

Failed merges:

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

17 months agoRollup merge of #106273 - notriddle:notriddle/source-content-overflow, r=GuillaumeGomez
Matthias Krüger [Fri, 30 Dec 2022 16:01:40 +0000 (17:01 +0100)]
Rollup merge of #106273 - notriddle:notriddle/source-content-overflow, r=GuillaumeGomez

rustdoc: remove redundant CSS `.source .content { overflow: visible }`

When added in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99 / #16066, the page itself was set to scroll. Now it's set so that the `example-wrap` is scrolling inside the page, so the overflow setting for the content is irrelevant.

17 months agoRollup merge of #104182 - gabhijit:ipv6-in6addr-any-doc-fix, r=m-ou-se
Matthias Krüger [Fri, 30 Dec 2022 16:01:39 +0000 (17:01 +0100)]
Rollup merge of #104182 - gabhijit:ipv6-in6addr-any-doc-fix, r=m-ou-se

`IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` documentation.

Added documentation for IPv6 Addresses `IN6ADDR_ANY_INIT` also known as `in6addr_any` and `IN6ADDR_LOOPBACK_INIT` also known as `in6addr_loopback` similar to `INADDR_ANY` for IPv4 Addresses.

17 months agoRollup merge of #103707 - jonathanCogan:master, r=m-ou-se
Matthias Krüger [Fri, 30 Dec 2022 16:01:39 +0000 (17:01 +0100)]
Rollup merge of #103707 - jonathanCogan:master, r=m-ou-se

Replace libstd, libcore, liballoc terminology in docs

Fixes #103551.  I changed line comments containing the outdated terms as well.

It would be great if someone with more experience could weigh in on whether these changes introduce ambiguity as suggested in https://github.com/rust-lang/rust/issues/103551#issuecomment-1291225315.

17 months agoRollup merge of #99244 - gthb:doc-improve-iterator-scan, r=m-ou-se
Matthias Krüger [Fri, 30 Dec 2022 16:01:38 +0000 (17:01 +0100)]
Rollup merge of #99244 - gthb:doc-improve-iterator-scan, r=m-ou-se

doc: clearer and more correct Iterator::scan

The `Iterator::scan` documentation seemed a little misleading to my newcomer
eyes, and this tries to address that.

* I found “similar to `fold`” unhelpful because (a) the similarity is only that
  they maintain state between iterations, and (b) the _dissimilarity_ is no less
  important: one returns a final value and the other an iterator. So this
  replaces that with “which, like `fold`, holds internal state, but unlike
  `fold`, produces a new iterator.

* I found “the return value from the closure, an `Option`, is yielded by the
  iterator” to be downright incorrect, because “yielded by the iterator” means
  “returned by the `next` method wrapped in `Some`”, so this implied that `scan`
  would convert an input iterator of `T` to an output iterator of `Option<T>`.
  So this replaces “yielded by the iterator” with “returned by the `next`
  method” and elaborates: “Thus the closure can return `Some(value)` to yield
  `value`, or `None` to end the iteration.”

* This also changes the example to illustrate the latter point by returning
  `None` to terminate the iteration early based on `state`.

17 months agoUse some more `const_eval_select` in pointer methods for compile times
Nilstrieb [Thu, 29 Dec 2022 22:01:31 +0000 (23:01 +0100)]
Use some more `const_eval_select` in pointer methods for compile times

17 months agoExtend scraped examples layout GUI test for position of buttons
Guillaume Gomez [Fri, 30 Dec 2022 15:27:56 +0000 (16:27 +0100)]
Extend scraped examples layout GUI test for position of buttons

17 months agostd: remove unnecessary `#[cfg]` on NetBSD
joboet [Fri, 30 Dec 2022 14:50:31 +0000 (15:50 +0100)]
std: remove unnecessary `#[cfg]` on NetBSD

17 months agostd: rename `Parker::new` to `Parker::new_in_place`, add safe `Parker::new` construct...
joboet [Fri, 30 Dec 2022 14:49:47 +0000 (15:49 +0100)]
std: rename `Parker::new` to `Parker::new_in_place`, add safe `Parker::new` constructor for SGX

17 months agoUpdate paths in comments.
jonathanCogan [Thu, 3 Nov 2022 22:59:23 +0000 (15:59 -0700)]
Update paths in comments.

17 months agoReplace libstd, libcore, liballoc in line comments.
jonathanCogan [Fri, 28 Oct 2022 23:48:00 +0000 (16:48 -0700)]
Replace libstd, libcore, liballoc in line comments.

17 months agoReplace libstd, libcore, liballoc in docs.
jonathanCogan [Fri, 28 Oct 2022 22:34:29 +0000 (15:34 -0700)]
Replace libstd, libcore, liballoc in docs.

17 months agoAuto merge of #105426 - flba-eb:fix_tls_destructor_unwinding, r=m-ou-se
bors [Fri, 30 Dec 2022 12:58:50 +0000 (12:58 +0000)]
Auto merge of #105426 - flba-eb:fix_tls_destructor_unwinding, r=m-ou-se

Catch panics/unwinding in destruction of TLS values

`destroy_value` is/can be called from C code (libc). Unwinding from Rust to C code is undefined behavior, which is why unwinding is caught here.

This problem caused an infinite loop inside the unwinding code when running `src/test/ui/threads-sendsync/issue-24313.rs` on a tier 3 target (QNX/Neutrino) on aarch64.

See also https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Infinite.20unwinding.20bug.

17 months agoTidy up tidy error codes check
Nilstrieb [Fri, 30 Dec 2022 11:11:05 +0000 (12:11 +0100)]
Tidy up tidy error codes check

17 months agoCheckout `master` branch in CI
Nilstrieb [Fri, 23 Dec 2022 13:58:32 +0000 (14:58 +0100)]
Checkout `master` branch in CI

17 months agoAdd tidy check to deny merge commits
Nilstrieb [Wed, 14 Dec 2022 19:22:03 +0000 (20:22 +0100)]
Add tidy check to deny merge commits

This will prevent users with the pre-push hook from pushing a merge
commit.

Exceptions are added for subtree updates. These exceptions are a little
hacky and may be non-exhaustive but can be extended in the future.

17 months agoAuto merge of #106264 - Swatinem:higher-lifetime-regression, r=petrochenkov
bors [Fri, 30 Dec 2022 09:47:19 +0000 (09:47 +0000)]
Auto merge of #106264 - Swatinem:higher-lifetime-regression, r=petrochenkov

Add regression test for #105501

The test was minified from the published crate `msf-ice:0.2.1` which failed in a crater run.

A faulty compiler was triggering a `higher-ranked lifetime error`:
> could not prove `[async block@...]: Send`

The testcase has some complexity, as it has a simplified subset of `futures::StreamExt` in it, but the error is only being triggered by a few layers of nesting. For example removing the noop `then` call would have been enough to make the error go away.

17 months agoAdd regression test for #105501
Arpad Borsos [Thu, 29 Dec 2022 16:25:40 +0000 (17:25 +0100)]
Add regression test for #105501

The test was minified from the published `msf-ice:0.2.1` crate which failed in a crater run.

A faulty compiler was triggering a `higher-ranked lifetime error`:

> could not prove `[async block@...]: Send`

17 months agoAuto merge of #106268 - kraktus:patch-2, r=Nilstrieb
bors [Fri, 30 Dec 2022 06:59:13 +0000 (06:59 +0000)]
Auto merge of #106268 - kraktus:patch-2, r=Nilstrieb

fix comment for `TokenCursor::desugar`

the hashes of the text were forgotten.

17 months agoAuto merge of #106262 - GuillaumeGomez:migrate-more-scraped-examples-css, r=notriddle
bors [Fri, 30 Dec 2022 03:58:49 +0000 (03:58 +0000)]
Auto merge of #106262 - GuillaumeGomez:migrate-more-scraped-examples-css, r=notriddle

Migrate more scraped examples CSS rules to CSS variables

It's based on https://github.com/rust-lang/rust/pull/106218 so it will need to wait for it to be merged first.

r? `@notriddle`

17 months agodocs: add link to `Path::join` in `PathBuf::push`
Ezra Shaw [Fri, 30 Dec 2022 01:24:12 +0000 (14:24 +1300)]
docs: add link to `Path::join` in `PathBuf::push`

17 months agoAuto merge of #106210 - fee1-dead-contrib:const-closure-trait-method, r=compiler...
bors [Fri, 30 Dec 2022 01:09:31 +0000 (01:09 +0000)]
Auto merge of #106210 - fee1-dead-contrib:const-closure-trait-method, r=compiler-errors

Allow trait method paths to satisfy const Fn bounds

r? `@oli-obk`

18 months agoAuto merge of #105920 - MarcusCalhoun-Lopez:respect_set, r=jyn514
bors [Thu, 29 Dec 2022 22:21:16 +0000 (22:21 +0000)]
Auto merge of #105920 - MarcusCalhoun-Lopez:respect_set, r=jyn514

Respect --set=target.platform when building rustbuild itself

`--set=target.platform.cc` and `--set=target.platform.cxx` are ignored if target is quoted.

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.

Undo parts of
https://github.com/rust-lang/rust/commit/d1291dc8b4ac9a98ff1d286402559e4ba5d68488 and
https://github.com/rust-lang/rust/commit/1532fd8cd0db93f469e414f9da31ef083a44fcba

18 months agoSupport `x clean --stage 1 rustc_query_impl`
Joshua Nelson [Thu, 29 Dec 2022 20:57:54 +0000 (20:57 +0000)]
Support `x clean --stage 1 rustc_query_impl`

Previously, clean only supported `--stage 0` for specific crates.

The new `crate_description` function generates a string that looks
like
```
: {rustc_query_impl}
```

18 months agorustdoc: remove redundant CSS `.source .content { overflow: visible }`
Michael Howell [Thu, 29 Dec 2022 21:16:33 +0000 (14:16 -0700)]
rustdoc: remove redundant CSS `.source .content { overflow: visible }`

When added in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99 / #16066, the page
itself was set to scroll. Now it's set so that the `example-wrap` is
scrolling inside the page, so the overflow setting for the content is
irrelevant.

18 months agoAuto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgr
bors [Thu, 29 Dec 2022 19:40:06 +0000 (19:40 +0000)]
Auto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params)
 - #105899 (`./x doc library --open` opens `std`)
 - #106190 (Account for multiple multiline spans with empty padding)
 - #106202 (Trim more paths in obligation types)
 - #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing)
 - #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`)
 - #106259 (Update Clippy)
 - #106260 (Fix index out of bounds issues in rustdoc)
 - #106263 (Formatter should not try to format non-Rust files)

Failed merges:

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

18 months agoRespect --set=target.platform during build
Marcus Calhoun-Lopez [Mon, 26 Dec 2022 03:52:14 +0000 (20:52 -0700)]
Respect --set=target.platform during build

Avoid quoting targets that do not contain a period.
See https://github.com/rust-lang/rust/commit/1532fd8cd0db93f469e414f9da31ef083a44fcba

`--set=target.platform.linker` is ignored if RUSTFLAGS is not set.
Undo parts of https://github.com/rust-lang/rust/commit/d1291dc8b4ac9a98ff1d286402559e4ba5d68488

18 months agofix comment for `TokenCursor::desugar`
kraktus [Thu, 29 Dec 2022 18:45:31 +0000 (19:45 +0100)]
fix comment for `TokenCursor::desugar`

the hashes of the text were forgotten.

18 months agoCFI: Monomorphize transparent ADTs before typeid
Matthew Maurer [Wed, 28 Dec 2022 22:31:31 +0000 (14:31 -0800)]
CFI: Monomorphize transparent ADTs before typeid

Monomorphise `#[repr(transparent)]` parameterized ADTs before turning
them into an Itanium mangled String.

`#[repr(transparent)]` ADTs currently use the single field to represent
them in their CFI type ID to ensure that they are compatible. However,
if that type involves a type parameter instantiated at the ADT level, as
in `ManuallyDrop`, this will currently ICE as the `Parameter` type
cannot be mangled. Since this happens at lowering time, it should always
be concrete after substitution.

Fixes #106230

18 months agoRollup merge of #106263 - chenyukang:yukang/fix-106261-formater, r=jyn514
Matthias Krüger [Thu, 29 Dec 2022 17:24:34 +0000 (18:24 +0100)]
Rollup merge of #106263 - chenyukang:yukang/fix-106261-formater, r=jyn514

Formatter should not try to format non-Rust files

Fixes #106261

18 months agoRollup merge of #106260 - chenyukang:yukang/fix-106213-doc, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 17:24:33 +0000 (18:24 +0100)]
Rollup merge of #106260 - chenyukang:yukang/fix-106213-doc, r=GuillaumeGomez

Fix index out of bounds issues in rustdoc

Fixes #106213
r? `@matthiaskrgr`

18 months agoRollup merge of #106259 - flip1995:clippyup, r=matthiaskrgr
Matthias Krüger [Thu, 29 Dec 2022 17:24:32 +0000 (18:24 +0100)]
Rollup merge of #106259 - flip1995:clippyup, r=matthiaskrgr

Update Clippy

r? `@Manishearth`

I think this was the very first sync with no conflicts whatsoever. I love this time of the year :D

18 months agoRollup merge of #106236 - Ezrashaw:add-test+docs-e0519-e0514, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 17:24:32 +0000 (18:24 +0100)]
Rollup merge of #106236 - Ezrashaw:add-test+docs-e0519-e0514, r=GuillaumeGomez

docs/test: add docs and a UI test for `E0514` and `E0519`

No UI test on `E0514`, it would need to compile with a different `rustc` version.

r? `@GuillaumeGomez`

18 months agoRollup merge of #106234 - notriddle:notriddle/button-width, r=GuillaumeGomez
Matthias Krüger [Thu, 29 Dec 2022 17:24:31 +0000 (18:24 +0100)]
Rollup merge of #106234 - notriddle:notriddle/button-width, r=GuillaumeGomez

rustdoc: simplify settings, help, and copy button CSS by not reusing

Since there remains only one common CSS rule shared between them, there's no point to it: the block and selector costs more than the single `width` rule saves.

18 months agoRollup merge of #106202 - estebank:trim-paths, r=Nilstrieb
Matthias Krüger [Thu, 29 Dec 2022 17:24:31 +0000 (18:24 +0100)]
Rollup merge of #106202 - estebank:trim-paths, r=Nilstrieb

Trim more paths in obligation types

18 months agoRollup merge of #106190 - estebank:multiline-start-tweak, r=jackh726
Matthias Krüger [Thu, 29 Dec 2022 17:24:30 +0000 (18:24 +0100)]
Rollup merge of #106190 - estebank:multiline-start-tweak, r=jackh726

Account for multiple multiline spans with empty padding

Instead of

```
LL |    fn oom(
   |  __^
   | | _|
   | ||
LL | || ) {
   | ||_-
LL | |  }
   | |__^
```

emit

```
LL | // fn oom(
LL | || ) {
   | ||_-
LL | |  }
   | |__^
   ```

18 months agoRollup merge of #105899 - lukas-code:stage-1-docs, r=jyn514
Matthias Krüger [Thu, 29 Dec 2022 17:24:30 +0000 (18:24 +0100)]
Rollup merge of #105899 - lukas-code:stage-1-docs, r=jyn514

`./x doc library --open` opens `std`

fix https://github.com/rust-lang/rust/issues/105898

18 months agoRollup merge of #104531 - ohno418:recover-fn-traits-with-lifetime-params, r=estebank
Matthias Krüger [Thu, 29 Dec 2022 17:24:29 +0000 (18:24 +0100)]
Rollup merge of #104531 - ohno418:recover-fn-traits-with-lifetime-params, r=estebank

Provide a better error and a suggestion for `Fn` traits with lifetime params

Given `Fn`-family traits with lifetime params in trait bounds like `fn f(_: impl Fn<'a>(&'a str) -> bool)`, we currently produce many unhelpful errors.

This PR allows these situations to suggest simply using Higher-Rank Trait Bounds like `for<'a> Fn(&'a str) -> bool`.

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

18 months agoAccount for multiple multiline spans with empty padding
Esteban Küber [Tue, 27 Dec 2022 19:03:59 +0000 (11:03 -0800)]
Account for multiple multiline spans with empty padding

Instead of

```
LL |    fn oom(
   |  __^
   | | _|
   | ||
LL | || ) {
   | ||_-
LL | |  }
   | |__^
```

emit

```
LL | // fn oom(
LL | || ) {
   | ||_-
LL | |  }
   | |__^
   ```

18 months agostd: pass hint to id-based parking functions
joboet [Thu, 29 Dec 2022 16:54:09 +0000 (17:54 +0100)]
std: pass hint to id-based parking functions

18 months agoAuto merge of #106256 - matthiaskrgr:rollup-g1ovcqq, r=matthiaskrgr
bors [Thu, 29 Dec 2022 16:46:08 +0000 (16:46 +0000)]
Auto merge of #106256 - matthiaskrgr:rollup-g1ovcqq, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #106208 (Make trait/impl `where` clause mismatch on region error a bit more actionable)
 - #106216 (Powershell: Use `WaitForExit` instead of `-Wait`)
 - #106217 (rustdoc: remove unnecessary `.tooltip::after { text-align: center }`)
 - #106218 (Migrate css var scraped examples)
 - #106221 (Rename `Rptr` to `Ref` in AST and HIR)
 - #106223 (On unsized locals with explicit types suggest `&`)
 - #106225 (Remove CraftSpider from review rotation)
 - #106229 (update Miri)
 - #106242 (Detect diff markers in the parser)

Failed merges:

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

18 months agostd: unify id-based thread parking implementations
joboet [Mon, 19 Dec 2022 14:59:00 +0000 (15:59 +0100)]
std: unify id-based thread parking implementations

18 months agofix #106261, formater should not try to format non-Rust files
yukang [Thu, 29 Dec 2022 15:38:46 +0000 (23:38 +0800)]
fix #106261, formater should not try to format non-Rust files

18 months agoAuto merge of #106196 - Mark-Simulacrum:bump-installer, r=jyn514
bors [Thu, 29 Dec 2022 13:48:46 +0000 (13:48 +0000)]
Auto merge of #106196 - Mark-Simulacrum:bump-installer, r=jyn514

Bump rust-installer

`--without=component-a,component-b` now requires full component names. This fixes rust-lang/rust#105755 (rust-lang/rust-installer#119).

dev-static build succeeded, and installer script seems to work (see comment in thread).

18 months agoFix index out of bounds issues in rustdoc
yukang [Thu, 29 Dec 2022 13:48:40 +0000 (21:48 +0800)]
Fix index out of bounds issues in rustdoc