]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agotut tut tut
Ellen [Wed, 27 Apr 2022 07:51:33 +0000 (08:51 +0100)]
tut tut tut

2 years agoAuto merge of #96326 - JakobDegen:relax-operand, r=oli-obk
bors [Sat, 23 Apr 2022 19:32:05 +0000 (19:32 +0000)]
Auto merge of #96326 - JakobDegen:relax-operand, r=oli-obk

Relax restrictions for copy operands

This was [discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Removing.20requirement.20that.20.60Copy.60.20operands.20have.20.60Copy.60.20types/near/279102313). Details about motivation and such can be found there

r? `@oli-obk`

2 years agoAuto merge of #90602 - mbartlett21:const-intoiterator, r=oli-obk
bors [Sat, 23 Apr 2022 15:41:45 +0000 (15:41 +0000)]
Auto merge of #90602 - mbartlett21:const-intoiterator, r=oli-obk

Unstably constify `impl<I: Iterator> IntoIterator for I`

This constifies the default `IntoIterator` implementation under the `const_intoiterator_identity` feature.

Tracking Issue: #90603

2 years agoAuto merge of #95971 - workingjubilee:no-weird-fp-in-const, r=oli-obk
bors [Sat, 23 Apr 2022 13:00:54 +0000 (13:00 +0000)]
Auto merge of #95971 - workingjubilee:no-weird-fp-in-const, r=oli-obk

No "weird" floats in const fn {from,to}_bits

I suspect this code is subtly incorrect and that we don't even e.g. use x87-style floats in CTFE, so I don't have to guard against that case. A future PR will be hopefully removing them from concern entirely, anyways. But at the moment I wanted to get this rolling because small questions like that one seem best answered by review.

r? `@oli-obk`
cc `@eddyb` `@thomcc`

2 years agoAuto merge of #96323 - bjorn3:sync_cg_clif-2022-04-22, r=bjorn3
bors [Sat, 23 Apr 2022 10:37:35 +0000 (10:37 +0000)]
Auto merge of #96323 - bjorn3:sync_cg_clif-2022-04-22, r=bjorn3

Sync rustc_codegen_cranelift

Mostly fixing bugs this time, but also a Cranelift update.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler

2 years agoAuto merge of #96316 - michaelwoerister:debuginfo-fix-unit-msvc, r=wesleywiser
bors [Sat, 23 Apr 2022 07:12:52 +0000 (07:12 +0000)]
Auto merge of #96316 - michaelwoerister:debuginfo-fix-unit-msvc, r=wesleywiser

debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo is enabled

As already discovered in https://github.com/rust-lang/rust/commit/24a728a8eb4832568509eb757c2374934a76cb98, PDB does not play well with custom basic types. This PR extends to the fix to `()`: Instead of a custom basic type, we treat it like an empty tuple (i.e. it is described as a struct which happens to have no fields).

Before this change anything with a `()` in it would cause trouble, which is especially bad for `*const ()` and `*mut ()` which are often used for opaque pointers. E.g. the test case added in this PR would look like:
```
0:000>  dx _ref
Error: Unable to bind name '_ref'
0:000>  dx _ptr
Error: Unable to bind name '_ptr'
0:000>  dx _local
Error: Unable to bind name '_local'
0:000>  dx _field,d
_field,d         [Type: unit_type::_TypeContainingUnitField]
    [+0x008] _a               : 123 [Type: unsigned int]
    [+0x000] _unit            : Unexpected failure to dereference object
    [+0x000] _b               : 456 [Type: unsigned __int64]
0:000>  dx ((__int64 *)_ptr),x
Error: Unable to bind name '_ptr'
```

With the PR it produces the expected output:
```
0:000>  dx _ref
_ref             : 0x7ff6f2012230 : () [Type: tuple$<> *]
0:000>  dx _ptr
_ptr             : 0x7e8ddffc20 : () [Type: tuple$<> *]
0:000>  dx _local
_local           : () [Type: tuple$<>]
0:000>  dx _field,d
_field,d         [Type: unit_type::_TypeContainingUnitField]
    [+0x008] _a               : 123 [Type: unsigned int]
    [+0x000] _unit            : () [Type: tuple$<>]
    [+0x000] _b               : 456 [Type: unsigned __int64]
0:000>  dx ((__int64 *)_ptr),x
((__int64 *)_ptr),x : 0x7e8ddffc20 : 0x1122334455667788 [Type: __int64 *]
```

r? `@wesleywiser`

2 years agoAuto merge of #96314 - AronParker:issue-96297-fix, r=thomcc
bors [Sat, 23 Apr 2022 04:17:50 +0000 (04:17 +0000)]
Auto merge of #96314 - AronParker:issue-96297-fix, r=thomcc

Reduce allocations for path conversions on Windows

Previously, UTF-8 to UTF-16 Path conversions on Windows unnecessarily allocate twice, as described in #96297. This commit fixes that issue.

2 years agoRemove unnecessary const-time x87-related checks
Jubilee Young [Sat, 23 Apr 2022 01:39:25 +0000 (18:39 -0700)]
Remove unnecessary const-time x87-related checks

2 years agoFix comments for float classify
Jubilee Young [Tue, 12 Apr 2022 22:07:48 +0000 (15:07 -0700)]
Fix comments for float classify

2 years agoAuto merge of #94887 - dylni:move-normpath-crate-impl-to-libstd, r=ChrisDenton
bors [Sat, 23 Apr 2022 00:58:22 +0000 (00:58 +0000)]
Auto merge of #94887 - dylni:move-normpath-crate-impl-to-libstd, r=ChrisDenton

 Improve Windows path prefix parsing

This PR fixes improves parsing of Windows path prefixes. `parse_prefix` now supports both types of separators on Windows (`/` and `\`).

2 years agoAuto merge of #95739 - lqd:proc-macro-expansions, r=wesleywiser
bors [Fri, 22 Apr 2022 22:12:32 +0000 (22:12 +0000)]
Auto merge of #95739 - lqd:proc-macro-expansions, r=wesleywiser

self-profiler: record spans for proc-macro expansions

This PR is a follow-up to #95473, using the arg recorder feature from #95689:
- it adds support code to easily record spans in the event's arguments, when using `generic_activity_with_arg_recorder`.
- uses that to record the spans where proc-macro expansions happen in addition to their name.

As for the other 2 PRs, the goal here is to provide visibility into proc-macro expansion performance, so that users can diagnose which uses of proc-macros in their code could be causing compile time issues.

Some areas where I'd love feedback:
- [x] the API and names: the `SpannedEventArgRecorder` trait and its method, much like #95689 had the same question about the `EventArgRecorder` naming
- [x] we don't currently have a way to record the names of the event arguments, so should `record_arg_spanned` record the span as "location: {}" or similar ?

2 years agoRelax restrictions for copy operands
Jakob Degen [Fri, 22 Apr 2022 20:43:26 +0000 (16:43 -0400)]
Relax restrictions for copy operands

2 years agoAuto merge of #96322 - matthiaskrgr:rollup-9xejxrf, r=matthiaskrgr
bors [Fri, 22 Apr 2022 19:28:05 +0000 (19:28 +0000)]
Auto merge of #96322 - matthiaskrgr:rollup-9xejxrf, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - #96272 (Update `validate_uninhabited_zsts.rs` test after MIR building changes)
 - #96273 (Make `E0117` error clear)
 - #96315 (Make the lifetime accurate which is used in the region constraints part)

Failed merges:

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

2 years agoMerge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22
bjorn3 [Fri, 22 Apr 2022 19:11:38 +0000 (21:11 +0200)]
Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22

2 years agoRollup merge of #96315 - SparrowLii:graph_lt, r=petrochenkov
Matthias Krüger [Fri, 22 Apr 2022 16:56:26 +0000 (18:56 +0200)]
Rollup merge of #96315 - SparrowLii:graph_lt, r=petrochenkov

Make the lifetime accurate which is used in the region constraints part

This PR fixes the FIXME about lifetime using in the region constraints part.
We cannot write `<'graph, 'tcx, D>` because the definition of `Successors<'0, '1, D>` requires `'1 : '0`.
We cannot add bound to `'graph` either because `'graph` is required to be an arbitrary value in the definition of `WithSuccessors`
So the most accurate way is to use `<'s, 'tcx, D>`.
cc `@Aaron1011` who added this FIXME in #85343

2 years agoRollup merge of #96273 - TaKO8Ki:make-E0117-error-clear, r=davidtwco
Matthias Krüger [Fri, 22 Apr 2022 16:56:25 +0000 (18:56 +0200)]
Rollup merge of #96273 - TaKO8Ki:make-E0117-error-clear, r=davidtwco

Make `E0117` error clear

closes #96227

2 years agoRollup merge of #96272 - tmiasko:validate-uninhabited, r=RalfJung
Matthias Krüger [Fri, 22 Apr 2022 16:56:24 +0000 (18:56 +0200)]
Rollup merge of #96272 - tmiasko:validate-uninhabited, r=RalfJung

Update `validate_uninhabited_zsts.rs` test after MIR building changes

to ensure that it still tests validation, instead of failing earlier on
during evaluation.

r? `@RalfJung`

2 years agoAuto merge of #96301 - notriddle:notriddle/synthetic-impl-prim, r=GuillaumeGomez
bors [Fri, 22 Apr 2022 16:47:13 +0000 (16:47 +0000)]
Auto merge of #96301 - notriddle:notriddle/synthetic-impl-prim, r=GuillaumeGomez

rustdoc: make primitive synthetic impls for correct doc module

This improves the accuracy of libcore primitive docs, which was missing the blanket and auto impls for most primitive types. To test this, compare nightly [libcore::str] docs, which lack auto traits like Send, with [std::str] docs, which show them.

[libcore::str]: https://doc.rust-lang.org/nightly/core/primitive.str.html
[libstd::str]: https://doc.rust-lang.org/nightly/std/primitive.str.html

It also avoids getting synthetic impls for primitive types on crates that do not actually show them.

<details>

<summary>Before and After trace logs</summary>

## Before

[notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +nightly test.rs 2>&1 | grep -E 'get_blanket_impls\('
TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(isize)
TRACE rustdoc::clean::blanket_impl get_blanket_impls([T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8])
TRACE rustdoc::clean::blanket_impl get_blanket_impls(char)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u128)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u16)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i128)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i16)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(str)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(str)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u8)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i8)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const T)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut T)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const [T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut [T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([T; N])
TRACE rustdoc::clean::blanket_impl get_blanket_impls(bool)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u32)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(usize)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i32)

## After

[notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +dev test.rs 2>&1 | grep -E 'get_blanket_impls\('
TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever)

</details>

2 years agostart tracking proc-macros expansion spans in the self-profiler
Rémy Rakic [Fri, 1 Apr 2022 19:00:51 +0000 (21:00 +0200)]
start tracking proc-macros expansion spans in the self-profiler

2 years agoextend `EventArgRecorder` into span-aware `SpannedEventArgRecorder`
Rémy Rakic [Fri, 1 Apr 2022 18:59:23 +0000 (20:59 +0200)]
extend `EventArgRecorder` into span-aware `SpannedEventArgRecorder`

The self-profiler's `EventArgRecorder` is general-purpose in its ability to record Strings (and `rustc_span` depends on the crate its defined in, `rustc_data_structure`).

Some generic activities could use recording locations where they happen in the user's code: to allow e.g. to track macro expansions and diagnose performance issues there.

This adds a `SpannedEventArgRecorder` that can record an argument given as a span, rather than a String, since turning spans into Strings can be tricky if you're not happy with its default Debug output. This way the recorder can have a `record_arg_spanned` method which will do that.

2 years agoAuto merge of #96226 - xldenis:thir-clone, r=oli-obk
bors [Fri, 22 Apr 2022 13:56:10 +0000 (13:56 +0000)]
Auto merge of #96226 - xldenis:thir-clone, r=oli-obk

Make all thir types implement clone

This PR adds `Clone` impl to all of the `Thir<'tcx>` types.

I would like to be able to clone a `Thir` body so that I can make a copy in my rustc driver without breaking further compilation. Without this my driver is forced to run in the `after_expansion` callback and thus doesn't benefit from running all the safety checks that `rustc` usually does, instead i need to do them all myself.

2 years agodebuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo is enabled...
Michael Woerister [Fri, 22 Apr 2022 10:07:32 +0000 (12:07 +0200)]
debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo is enabled (instead of custom basic type).

2 years agoMake the lifetime accurate which is used in the region constraints part
SparrowLii [Fri, 22 Apr 2022 12:05:39 +0000 (20:05 +0800)]
Make the lifetime accurate which is used in the region constraints part

2 years agoAuto merge of #96197 - erikdesjardins:scalarpairenum, r=oli-obk
bors [Fri, 22 Apr 2022 10:50:23 +0000 (10:50 +0000)]
Auto merge of #96197 - erikdesjardins:scalarpairenum, r=oli-obk

Mark payload fields of ScalarPair enums as Scalar::Union when they're not always initialized

Fixes #96158

r? `@RalfJung`

2 years agoRemove redundant type annotation
Aron Parker [Fri, 22 Apr 2022 09:42:53 +0000 (11:42 +0200)]
Remove redundant type annotation

2 years agoReduce allocations for path conversions on Windows
Aron Parker [Fri, 22 Apr 2022 09:02:04 +0000 (11:02 +0200)]
Reduce allocations for path conversions on Windows

Previously, UTF-8 to UTF-16 Path conversions on Windows unnecessarily allocate twice, as described in #96297. This commit fixes that issue.

2 years agoAuto merge of #96207 - nikic:distcheck-dir, r=Mark-Simulacrum
bors [Fri, 22 Apr 2022 08:01:28 +0000 (08:01 +0000)]
Auto merge of #96207 - nikic:distcheck-dir, r=Mark-Simulacrum

Ensure existance of dist directory when creating tarball

I'm not sure why this works in CI, but this is necessary to make distcheck (including the `x86_64-linux-distcheck` image) run on Fedora 35.

2 years agonormalize out pref_align (copied from another test)
Erik Desjardins [Fri, 22 Apr 2022 05:46:24 +0000 (01:46 -0400)]
normalize out pref_align (copied from another test)

2 years agoAuto merge of #96144 - c410-f3r:z-errors, r=petrochenkov
bors [Fri, 22 Apr 2022 05:15:47 +0000 (05:15 +0000)]
Auto merge of #96144 - c410-f3r:z-errors, r=petrochenkov

Move some tests to more reasonable places

cc #73494
r? `@petrochenkov`

2 years agoAuto merge of #96282 - petrochenkov:unindent, r=GuillaumeGomez
bors [Fri, 22 Apr 2022 02:30:27 +0000 (02:30 +0000)]
Auto merge of #96282 - petrochenkov:unindent, r=GuillaumeGomez

rustdoc: Unindent doc fragments on `Attributes` construction

`Attributes` can be constructed at arbitrary points, even after the `unindent_comments` pass.
`Attributes` that are constructed too late end up unindented.

All doc fragments need to be eventually indented before use, so there are no reasons to not do this immediately during their construction.

Fixes https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60unindent_comments.60.20cannot.20work.20as.20a.20separate.20pass.
I'm not sure how to make a minimized reproduction, but unindenting the fragments during their construction should fix the issue.. by construction, and I also verified that all doc strings now hit the `resolver_caches.markdown_links` cache in https://github.com/rust-lang/rust/pull/94857.

2 years agoremove an error for type params
Takayuki Maeda [Fri, 22 Apr 2022 02:25:42 +0000 (11:25 +0900)]
remove an error for type params

2 years agorustdoc: make primitive synthetic impls for correct doc module
Michael Howell [Thu, 21 Apr 2022 23:22:03 +0000 (16:22 -0700)]
rustdoc: make primitive synthetic impls for correct doc module

This improves the accuracy of libcore primitive docs, which was missing the
blanket and auto impls for most primitive types. To test this, compare nightly
[libcore::str] docs, which lack auto traits like Send, with [std::str] docs,
which show them.

[libcore::str]: https://doc.rust-lang.org/nightly/core/primitive.str.html
[libstd::str]: https://doc.rust-lang.org/nightly/std/primitive.str.html

It also avoids getting synthetic impls for primitive types on crates that
do not actually show them.

<details>

<summary>Before and After trace logs</summary>

Before:

[notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +nightly test.rs 2>&1 | grep -E 'get_blanket_impls\('
TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(isize)
TRACE rustdoc::clean::blanket_impl get_blanket_impls([T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8])
TRACE rustdoc::clean::blanket_impl get_blanket_impls(char)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u128)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u16)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i128)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i16)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(str)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(str)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u8)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i64)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i8)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const T)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut T)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const [T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut [T])
TRACE rustdoc::clean::blanket_impl get_blanket_impls([T; N])
TRACE rustdoc::clean::blanket_impl get_blanket_impls(bool)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(u32)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(usize)
TRACE rustdoc::clean::blanket_impl get_blanket_impls(i32)

After:

[notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +dev test.rs 2>&1 | grep -E 'get_blanket_impls\('
TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever)

</details>

2 years agoAuto merge of #96261 - petrochenkov:doclink7, r=GuillaumeGomez
bors [Fri, 22 Apr 2022 00:05:17 +0000 (00:05 +0000)]
Auto merge of #96261 - petrochenkov:doclink7, r=GuillaumeGomez

rustdoc: Resolve some more doc links early

Trying another subset of https://github.com/rust-lang/rust/pull/94857 that is not too expensive.

2 years agoAuto merge of #96293 - Dylan-DPC:rollup-saipx8c, r=Dylan-DPC
bors [Thu, 21 Apr 2022 21:20:14 +0000 (21:20 +0000)]
Auto merge of #96293 - Dylan-DPC:rollup-saipx8c, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #95434 (Only output DepKind in dump-dep-graph.)
 - #96248 (Stop using a string literal as a format argument)
 - #96251 (Update books)
 - #96269 (errors: minor translation-related changes)
 - #96289 (Remove redundant `format!`s)

Failed merges:

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

2 years agoUpdate `validate_uninhabited_zsts.rs` test after MIR building changes
Tomasz Miąsko [Thu, 21 Apr 2022 00:00:00 +0000 (00:00 +0000)]
Update `validate_uninhabited_zsts.rs` test after MIR building changes

to ensure that it still tests validation, instead of failing earlier on
during evaluation.

2 years agoRollup merge of #96289 - aDotInTheVoid:redundant-fmt, r=jackh726
Dylan DPC [Thu, 21 Apr 2022 18:55:21 +0000 (20:55 +0200)]
Rollup merge of #96289 - aDotInTheVoid:redundant-fmt, r=jackh726

Remove redundant `format!`s

2 years agoRollup merge of #96269 - davidtwco:diagnostic-translation-minor-changes, r=oli-obk
Dylan DPC [Thu, 21 Apr 2022 18:55:21 +0000 (20:55 +0200)]
Rollup merge of #96269 - davidtwco:diagnostic-translation-minor-changes, r=oli-obk

errors: minor translation-related changes

- For one error in typeck, specifying "suggestion" as the attribute for the only suggestion is unnecessary, it's the default of the derive.
- The documentation comment for the `SessionDiagnostic` derive is out-of-date, it should have been updated in #95512.

r? `@oli-obk`

2 years agoRollup merge of #96251 - ehuss:update-books, r=ehuss
Dylan DPC [Thu, 21 Apr 2022 18:55:20 +0000 (20:55 +0200)]
Rollup merge of #96251 - ehuss:update-books, r=ehuss

Update books

## book

3 commits in 765318b844569a642ceef7bf1adab9639cbf6af3..de0dbffc5812fd885700874e8d258dd334733ac4
2022-04-12 21:14:47 -0400 to 2022-04-18 19:29:45 -0400
- Remove duplicate text
- Add missing punctuation mark in ch16-01
- Update main.rs

## rust-by-example

1 commits in c2a98d9fc5d29c481d42052fbeccfde15ed03116..44a80e8d8bfc5881c9bd69a2cb3a570776ee4181
2022-04-08 06:44:18 -0300 to 2022-04-19 07:46:28 -0300
- Use rust 2018 module file hierarchy (rust-lang/rust-by-example#1532)

## rustc-dev-guide

6 commits in eeb5a83c15b6ae60df3e4f19207376b22c6fbc4c..043e60f4f191651e9f8bf52fa32df14defbb23d9
2022-04-11 23:29:48 +0900 to 2022-04-20 18:57:49 +0900
- Fix a small typo (rust-lang/rustc-dev-guide#1343)
- Extend debugging llvm section (rust-lang/rustc-dev-guide#1290)
- Send people doing *library* stabilizations over to the std-dev-guide (rust-lang/rustc-dev-guide#1317)
- Fix typo serious-&gt;series (rust-lang/rustc-dev-guide#1336)
- Minor type fix (rust-lang/rustc-dev-guide#1337)
- sessiondiagnostic: translation (rust-lang/rustc-dev-guide#1333)

## embedded-book

3 commits in a6de8b6e3ea5d4f0de8b7b9a7e5c1405dc2c2ddb..f7cefbb995eec8c6148f213235e9e2e03268e775
2022-03-17 21:21:39 +0000 to 2022-04-20 10:38:51 +0000
- Fix use of unaligned references in example  (rust-embedded/book#317)
- Correct C interop declarations  (rust-embedded/book#315)
- Update index.md  (rust-embedded/book#316)

2 years agoRollup merge of #96248 - TaKO8Ki:remove-unnecessary-format-args, r=compiler-errors
Dylan DPC [Thu, 21 Apr 2022 18:55:19 +0000 (20:55 +0200)]
Rollup merge of #96248 - TaKO8Ki:remove-unnecessary-format-args, r=compiler-errors

Stop using a string literal as a format argument

2 years agoRollup merge of #95434 - cjgillot:dump-dep-kind, r=oli-obk
Dylan DPC [Thu, 21 Apr 2022 18:55:18 +0000 (20:55 +0200)]
Rollup merge of #95434 - cjgillot:dump-dep-kind, r=oli-obk

Only output DepKind in dump-dep-graph.

When printing the whole DepNode, the output file is simply too massive to
be actually useful for profiling.

This trimmed down version mixes a lot of information together, but it also
allows to ask questions such that "why does this query ever access HIR?".

2 years agoRustup to rustc 1.62.0-nightly (879aff385 2022-04-20)
bjorn3 [Thu, 21 Apr 2022 18:54:50 +0000 (20:54 +0200)]
Rustup to rustc 1.62.0-nightly (879aff385 2022-04-20)

2 years agoAuto merge of #96260 - Kobzol:rustdoc-idmap, r=petrochenkov
bors [Thu, 21 Apr 2022 18:31:57 +0000 (18:31 +0000)]
Auto merge of #96260 - Kobzol:rustdoc-idmap, r=petrochenkov

rustdoc: Optimize IdMap

Slightly optimizes `IdMap`, which is hot in `markdown_links` (context [here](https://github.com/rust-lang/rust/pull/96135#issuecomment-1103539052)). There are more improvements that can be made near this place, but this seemed like an easy win locally (although I tried it on top of https://github.com/rust-lang/rust/pull/94857, so let's see what happens without that PR).

r? `@petrochenkov`

2 years agoSync from rust 1dec35a1b0df406da5d7cae55a7fa8d186a2b028
bjorn3 [Thu, 21 Apr 2022 18:23:21 +0000 (20:23 +0200)]
Sync from rust 1dec35a1b0df406da5d7cae55a7fa8d186a2b028

2 years agoUpdate Cranelift to 0.83.0
bjorn3 [Thu, 21 Apr 2022 17:22:12 +0000 (19:22 +0200)]
Update Cranelift to 0.83.0

2 years agoRemove redundant `format!`s
Nixon Enraght-Moony [Thu, 21 Apr 2022 15:46:03 +0000 (16:46 +0100)]
Remove redundant `format!`s

2 years agoAuto merge of #96210 - nnethercote:speed-up-TokenCursor, r=petrochenkov
bors [Thu, 21 Apr 2022 15:42:50 +0000 (15:42 +0000)]
Auto merge of #96210 - nnethercote:speed-up-TokenCursor, r=petrochenkov

Speed up `TokenCursor`

Plus a few related clean-ups.

r? `@petrochenkov`

2 years agoMove some tests to more reasonable directories
Caio [Thu, 21 Apr 2022 15:24:26 +0000 (12:24 -0300)]
Move some tests to more reasonable directories

2 years agorustdoc: Unindent doc fragments on `Attributes` construction
Vadim Petrochenkov [Thu, 21 Apr 2022 12:01:44 +0000 (15:01 +0300)]
rustdoc: Unindent doc fragments on `Attributes` construction

2 years agoAuto merge of #96003 - aswild:pr/bootstrap-subcommands-cleanup, r=jyn514
bors [Thu, 21 Apr 2022 10:38:43 +0000 (10:38 +0000)]
Auto merge of #96003 - aswild:pr/bootstrap-subcommands-cleanup, r=jyn514

bootstrap: consolidate subcommand parsing and matching

There's several places where the x.py command names are matched as
strings, leading to some inconsistencies and opportunities for cleanup.

* Add Format, Clean, and Setup variants to builder::Kind.
* Use Kind to parse the x.py subcommand name (including aliases)
* Match on the subcommand Kind rather than strings when handling
  options and help text.
* Several subcommands don't display any paths when run with `-h -v` even
  though the help text indicates that they should. Fix this and refactor
  so that manually keeping matches in sync isn't necessary.

Fixes #95937

2 years agoAuto merge of #95828 - vacuus:rustdoc-print-where-clause, r=notriddle
bors [Thu, 21 Apr 2022 08:12:38 +0000 (08:12 +0000)]
Auto merge of #95828 - vacuus:rustdoc-print-where-clause, r=notriddle

rustdoc: Clean up `html::format::print_where_clause`

(Arguably) closes https://github.com/rust-lang/rust/issues/95814

2 years agomake `E0117` error clear
Takayuki Maeda [Thu, 21 Apr 2022 07:47:01 +0000 (16:47 +0900)]
make `E0117` error clear

2 years agoAuto merge of #95612 - davidtwco:split-debuginfo-in-bootstrap, r=Mark-Simulacrum
bors [Thu, 21 Apr 2022 05:24:48 +0000 (05:24 +0000)]
Auto merge of #95612 - davidtwco:split-debuginfo-in-bootstrap, r=Mark-Simulacrum

bootstrap: add split-debuginfo config

Replace `run-dysutil` option with more general `split-debuginfo` option that works on all platforms.

r? `@Mark-Simulacrum`

2 years agoIntroduced `Cursor::next_with_spacing_ref`.
Nicholas Nethercote [Thu, 21 Apr 2022 03:49:40 +0000 (13:49 +1000)]
Introduced `Cursor::next_with_spacing_ref`.

This lets us clone just the parts within a `TokenTree` that need
cloning, rather than the entire thing. This is a surprisingly large
performance win, up to 4% on `async-std-1.10.0`.

2 years agomacros: update doc comment for diagnostic derive
David Wood [Thu, 21 Apr 2022 03:22:18 +0000 (04:22 +0100)]
macros: update doc comment for diagnostic derive

The documentation comment for this derive is out-of-date, it should have
been updated in #95512.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agotypeck: remove unnecessary fluent attr
David Wood [Thu, 21 Apr 2022 03:03:13 +0000 (04:03 +0100)]
typeck: remove unnecessary fluent attr

Specifying "suggestion" as the attribute for the only suggestion is
unnecessary, it's the default of the derive.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoProduce `CloseDelim` and pop the stack at the same time.
Nicholas Nethercote [Thu, 21 Apr 2022 02:26:58 +0000 (12:26 +1000)]
Produce `CloseDelim` and pop the stack at the same time.

This makes `CloseDelim` handling more like `OpenDelim` handling, which
produces `OpenDelim` and pushes the stack at the same time. It requires
some adjustment to `parse_token_tree` now that we don't remain within
the frame after getting the `CloseDelim`.

2 years agoAuto merge of #96263 - Dylan-DPC:rollup-0eofl13, r=Dylan-DPC
bors [Thu, 21 Apr 2022 02:16:32 +0000 (02:16 +0000)]
Auto merge of #96263 - Dylan-DPC:rollup-0eofl13, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #90630 (Create real parser for search queries)
 - #96193 ([fuchsia] Add implementation for `current_exe`)
 - #96196 (Remove assertion that all paths in `ShouldRun` exist)
 - #96228 (Fix locations for intrinsics impls and change to links)
 - #96236 (Add an explicit `Span` field to `OutlivesConstraint`)

Failed merges:

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

2 years agorustdoc: Clean up `html::format::print_where_clause`
Roc Yu [Thu, 21 Apr 2022 00:45:30 +0000 (20:45 -0400)]
rustdoc: Clean up `html::format::print_where_clause`

2 years agoAuto merge of #96254 - RalfJung:miri, r=RalfJung
bors [Wed, 20 Apr 2022 23:51:40 +0000 (23:51 +0000)]
Auto merge of #96254 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/96239
r? `@ghost`

2 years agoAvoid some tuple destructuring.
Nicholas Nethercote [Wed, 20 Apr 2022 06:34:33 +0000 (16:34 +1000)]
Avoid some tuple destructuring.

Surprisingly, this is a non-trivial performance win.

2 years agoRollup merge of #96236 - Aaron1011:constraint-debug, r=jackh726
Dylan DPC [Wed, 20 Apr 2022 23:14:17 +0000 (01:14 +0200)]
Rollup merge of #96236 - Aaron1011:constraint-debug, r=jackh726

Add an explicit `Span` field to `OutlivesConstraint`

Previously, we would retrieve the span from the `Body` using
the `locations` field. However, we may end up changing the
`locations` field when moving a constraint from a promoted
to a different body.

We now store the original `Span` in a dedication field, so that
changes to the `locations` do not affect the quality of our
diagnostics.

2 years agoRollup merge of #96228 - mbartlett21:patch-4, r=thomcc
Dylan DPC [Wed, 20 Apr 2022 23:14:16 +0000 (01:14 +0200)]
Rollup merge of #96228 - mbartlett21:patch-4, r=thomcc

Fix locations for intrinsics impls and change to links

These still referred to `rustc_mir`.

2 years agoRollup merge of #96196 - jyn514:no-assertion, r=Mark-Simulacrum
Dylan DPC [Wed, 20 Apr 2022 23:14:15 +0000 (01:14 +0200)]
Rollup merge of #96196 - jyn514:no-assertion, r=Mark-Simulacrum

Remove assertion that all paths in `ShouldRun` exist

This breaks on submodules (see #96188). Disable the assertion for now until I can think of a proper
fix.

This doesn't revert any of the changes in `Step`s themselves, only what
`ShouldRun::paths` does.

2 years agoRollup merge of #96193 - djkoloski:fuchsia_current_exe, r=tmandry
Dylan DPC [Wed, 20 Apr 2022 23:14:14 +0000 (01:14 +0200)]
Rollup merge of #96193 - djkoloski:fuchsia_current_exe, r=tmandry

[fuchsia] Add implementation for `current_exe`

This implementation returns a best attempt at the current exe path. On
fuchsia, fdio will always use `argv[0]` as the process name and if it is
not set then an error will be returned. Because this is not guaranteed
to be the case, this implementation returns an error if `argv` does not
contain any elements.

2 years agoRollup merge of #90630 - GuillaumeGomez:improve-rustdoc-search, r=notriddle
Dylan DPC [Wed, 20 Apr 2022 23:14:13 +0000 (01:14 +0200)]
Rollup merge of #90630 - GuillaumeGomez:improve-rustdoc-search, r=notriddle

Create real parser for search queries

You can test it [here](https://rustdoc.crud.net/imperio/improve-rustdoc-search/std/index.html).

This PR adds a real parser for the query engine in rustdoc. The parser is quite simple but it allows to makes query handling much easier. I added a new testsuite to ensure it works as expected and ran fuzzing checks on it for a few hours without problems.

So about the parser: as you can see in the screenshot, it handles recursive generics parsing. It also allows to set which item should use exact matching by adding double-quotes around it (look for `exact_search` in the screenshot).

Now about the query engine itself: I simplified it a lot thanks to the parsed query. It behaves mostly the same when there is only one argument, but is much more powerful when there are more than one.

When making this change, we also removed the support for multi-query.

PS: A big part of the PR is tests and test-related code. :)

r? `@camelid`

2 years agoupdate Miri
Ralf Jung [Wed, 20 Apr 2022 19:13:41 +0000 (15:13 -0400)]
update Miri

2 years ago[WIP] rustdoc: Resolve some more doc links early
Vadim Petrochenkov [Wed, 20 Apr 2022 22:09:48 +0000 (01:09 +0300)]
[WIP] rustdoc: Resolve some more doc links early

2 years agorustdoc: Optimize IdMap
Jakub Beránek [Wed, 20 Apr 2022 22:15:04 +0000 (00:15 +0200)]
rustdoc: Optimize IdMap

2 years agoAuto merge of #96187 - GuillaumeGomez:potential-intra-doc-links-filtering, r=notriddle
bors [Wed, 20 Apr 2022 21:32:01 +0000 (21:32 +0000)]
Auto merge of #96187 - GuillaumeGomez:potential-intra-doc-links-filtering, r=notriddle

Prevent `<>` links to be interpreted for intra-doc links

As discussed in [this thread](https://github.com/rust-lang/rust/pull/96135#discussion_r852107956). As mentioned, the intra-doc RFC states that `<>` links shouldn't be potential intra-doc links:  https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html#no-autolinks-style.

I renamed `markdown_links` into `potential_intra_doc_markdown_links` to make it more obvious what it's doing.

cc `@petrochenkov`
r? `@notriddle`

2 years agoExtend `handleSingleArg` documentation
Guillaume Gomez [Wed, 20 Apr 2022 19:11:39 +0000 (21:11 +0200)]
Extend `handleSingleArg` documentation

2 years agoAuto merge of #96253 - Dylan-DPC:rollup-87hpds5, r=Dylan-DPC
bors [Wed, 20 Apr 2022 18:40:13 +0000 (18:40 +0000)]
Auto merge of #96253 - Dylan-DPC:rollup-87hpds5, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #93313 (Check if call return type is visibly uninhabited when building MIR)
 - #96160 (Miri/interpreter debugging tweaks)
 - #96167 (Replace sys/unix/weak AtomicUsize with AtomicPtr)
 - #96168 (Improve AddrParseError description)
 - #96206 (Use sys::unix::locks::futex* on wasm+atomics.)
 - #96234 (remove_dir_all_recursive: treat ELOOP the same as ENOTDIR)

Failed merges:

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

2 years agoRemove `<>` links to be potential intra-doc links
Guillaume Gomez [Wed, 20 Apr 2022 18:11:18 +0000 (20:11 +0200)]
Remove `<>` links to be potential intra-doc links

2 years agoRollup merge of #96234 - goffrie:eloop, r=thomcc
Dylan DPC [Wed, 20 Apr 2022 16:26:06 +0000 (18:26 +0200)]
Rollup merge of #96234 - goffrie:eloop, r=thomcc

remove_dir_all_recursive: treat ELOOP the same as ENOTDIR

On older Linux kernels (I tested on 4.4, corresponding to Ubuntu 16.04), opening a symlink using `O_DIRECTORY | O_NOFOLLOW` returns `ELOOP` instead of `ENOTDIR`. We should handle it the same, since a symlink is still not a directory and needs to be `unlink`ed.

2 years agoRollup merge of #96206 - m-ou-se:wasm-futex-locks, r=alexcrichton
Dylan DPC [Wed, 20 Apr 2022 16:26:05 +0000 (18:26 +0200)]
Rollup merge of #96206 - m-ou-se:wasm-futex-locks, r=alexcrichton

Use sys::unix::locks::futex* on wasm+atomics.

This removes the wasm-specific lock implementations and instead re-uses the implementations from sys::unix.

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

cc ``@alexcrichton``

2 years agoRollup merge of #96168 - chris-morgan:AddrParseError-description-improvements, r...
Dylan DPC [Wed, 20 Apr 2022 16:26:04 +0000 (18:26 +0200)]
Rollup merge of #96168 - chris-morgan:AddrParseError-description-improvements, r=joshtriplett

Improve AddrParseError description

The existing description was incorrect for socket addresses, and misleading: users would see “invalid IP address syntax” and suppose they were supposed to provide an IP address rather than a socket address.

I contemplated making it two variants (IP, socket), but realised we can do still better for the IPv4 and IPv6 types, so here it is as six.

I contemplated more precise error descriptions (e.g. “invalid IPv6 socket address syntax: expected a decimal scope ID after %”), but that’s a more invasive change, and probably not worthwhile anyway.

2 years agoRollup merge of #96167 - CAD97:weak-dlsym-less-ptr-crime, r=thomcc
Dylan DPC [Wed, 20 Apr 2022 16:26:03 +0000 (18:26 +0200)]
Rollup merge of #96167 - CAD97:weak-dlsym-less-ptr-crime, r=thomcc

Replace sys/unix/weak AtomicUsize with AtomicPtr

Should fix #96163. Can't easily test on Windows though...

2 years agoRollup merge of #96160 - RalfJung:interpret-debug, r=oli-obk
Dylan DPC [Wed, 20 Apr 2022 16:26:02 +0000 (18:26 +0200)]
Rollup merge of #96160 - RalfJung:interpret-debug, r=oli-obk

Miri/interpreter debugging tweaks

Some changes I made to make debugging Miri with trace logging less terrible.

r? ``@oli-obk``

2 years agoRollup merge of #93313 - tmiasko:uninhabited, r=tmandry
Dylan DPC [Wed, 20 Apr 2022 16:26:01 +0000 (18:26 +0200)]
Rollup merge of #93313 - tmiasko:uninhabited, r=tmandry

Check if call return type is visibly uninhabited when building MIR

The main motivation behind the change is to expose information about diverging
calls to the generator transform and match the precision of drop range tracking
which already understands that call expressions with visibly uninhabited types
diverges.

This change should also accept strictly more programs than before. That is
programs that were previously rejected due to errors raised by control-flow
sensitive checks in a code that is no longer considered reachable.

Fixes #93161.

2 years agoAuto merge of #96250 - ehuss:update-cargo, r=ehuss
bors [Wed, 20 Apr 2022 16:15:54 +0000 (16:15 +0000)]
Auto merge of #96250 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in dba5baf4345858c591517b24801902a062c399f8..edffc4ada3d77799e5a04eeafd9b2f843d29fc23
2022-04-13 21:58:27 +0000 to 2022-04-19 17:38:29 +0000
- Document cargo-add (rust-lang/cargo#10578)
- feat: Support '-F' as an alias for '--features' (rust-lang/cargo#10576)
- Completion support for `cargo-add` (rust-lang/cargo#10577)
- Add a link to the document in the timings report (rust-lang/cargo#10492)
- feat: Import cargo-add into cargo (rust-lang/cargo#10472)
- Part 8 of RFC2906 - Keep `InheritableFields` in a `LazyCell` inside `… (rust-lang/cargo#10568)
- Part 7 of RFC2906 - Add support for inheriting `exclude` and `include` (rust-lang/cargo#10565)

2 years agoUpdate books
Eric Huss [Wed, 20 Apr 2022 14:04:50 +0000 (07:04 -0700)]
Update books

2 years agoUpdate cargo
Eric Huss [Wed, 20 Apr 2022 13:50:39 +0000 (06:50 -0700)]
Update cargo

2 years agoAuto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomez
bors [Wed, 20 Apr 2022 13:34:48 +0000 (13:34 +0000)]
Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomez

rustdoc: Optimize and refactor doc link resolution

One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it.
It's better to read individual commits and their descriptions to understand the changes.
The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857.

Closes https://github.com/rust-lang/rust/issues/96079

2 years agoremove an unnecessary format arg
Takayuki Maeda [Wed, 20 Apr 2022 12:16:56 +0000 (21:16 +0900)]
remove an unnecessary format arg

2 years agoAuto merge of #96022 - martingms:inline-const-getters, r=nnethercote
bors [Wed, 20 Apr 2022 11:12:55 +0000 (11:12 +0000)]
Auto merge of #96022 - martingms:inline-const-getters, r=nnethercote

Inline `ty::Const::ty()` and `ty::Const::val()` getters

These were not inlined into `super_relate_consts`, which is one of the hottest functions in a callgrind profile of compiling `bitmaps-3.1.0`.

Yields some small speedups across various benchmarks locally:

#### Primary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
unicode-normalization-0.1.19 | check | full | -0.56% | 2.78x
unicode-normalization-0.1.19 | check | incr-full | -0.43% | 2.15x
unicode-normalization-0.1.19 | opt | full | -0.35% | 1.77x
unicode-normalization-0.1.19 | debug | incr-full | -0.31% | 1.56x
unicode-normalization-0.1.19 | debug | full | -0.30% | 1.51x

#### Secondary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
bitmaps-3.1.0 | check | full | -1.88% | 9.39x
bitmaps-3.1.0 | debug | full | -1.79% | 8.96x
bitmaps-3.1.0 | opt | full | -1.69% | 8.43x
bitmaps-3.1.0 | check | incr-full | -1.54% | 7.68x
bitmaps-3.1.0 | debug | incr-full | -1.45% | 7.27x
bitmaps-3.1.0 | opt | incr-full | -1.39% | 6.96x
tt-muncher | opt | full | 1.28% | 6.38x
nalgebra-0.30.1 | check | full | -0.96% | 4.81x
nalgebra-0.30.1 | debug | full | -0.91% | 4.54x
nalgebra-0.30.1 | opt | full | -0.90% | 4.52x
nalgebra-0.30.1 | check | incr-full | -0.77% | 3.86x
nalgebra-0.30.1 | opt | incr-full | -0.76% | 3.79x
nalgebra-0.30.1 | debug | incr-full | -0.74% | 3.72x
hex-0.4.3 | check | full | -0.70% | 3.50x
hex-0.4.3 | debug | full | -0.59% | 2.95x
hex-0.4.3 | check | incr-full | -0.56% | 2.80x
hex-0.4.3 | opt | full | -0.56% | 2.78x
wf-projection-stress-65510 | opt | full | -0.48% | 2.42x
hex-0.4.3 | opt | incr-full | -0.48% | 2.40x
hex-0.4.3 | debug | incr-full | -0.45% | 2.24x
wf-projection-stress-65510 | check | full | -0.44% | 2.18x
wf-projection-stress-65510 | debug | full | -0.42% | 2.08x
wf-projection-stress-65510 | check | incr-full | -0.40% | 2.01x
deep-vector | debug | incr-patched: add vec item | -0.38% | 1.88x
wf-projection-stress-65510 | debug | incr-full | -0.37% | 1.86x
wf-projection-stress-65510 | opt | incr-full | -0.36% | 1.81x
deep-vector | debug | incr-patched: println | 0.33% | 1.63x

r? `@nnethercote`

2 years agoRemove `Eof` sanity check in `Parser::inlined_bump_with`.
Nicholas Nethercote [Wed, 20 Apr 2022 04:52:54 +0000 (14:52 +1000)]
Remove `Eof` sanity check in `Parser::inlined_bump_with`.

A Google search of the error message fails to return any relevant
resuts, suggesting this has never occurred in practice. And removeing it
reduces instruction counts by up to 2% on some benchmarks.

2 years agoInline `Parser::nonterminal_may_begin_with`.
Nicholas Nethercote [Wed, 20 Apr 2022 04:13:49 +0000 (14:13 +1000)]
Inline `Parser::nonterminal_may_begin_with`.

2 years agoInline `Parser::parse_nonterminal`.
Nicholas Nethercote [Wed, 20 Apr 2022 04:08:59 +0000 (14:08 +1000)]
Inline `Parser::parse_nonterminal`.

2 years agoOnly record `fallback_span` when necessary.
Nicholas Nethercote [Wed, 20 Apr 2022 04:04:22 +0000 (14:04 +1000)]
Only record `fallback_span` when necessary.

2 years agoAuto merge of #96082 - michaelwoerister:less_impl_stable_hash_via_hash, r=compiler...
bors [Wed, 20 Apr 2022 03:51:09 +0000 (03:51 +0000)]
Auto merge of #96082 - michaelwoerister:less_impl_stable_hash_via_hash, r=compiler-errors

incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.

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

2 years agoAdd an explicit `Span` field to `OutlivesConstraint`
Aaron Hill [Wed, 20 Apr 2022 00:53:35 +0000 (20:53 -0400)]
Add an explicit `Span` field to `OutlivesConstraint`

Previously, we would retrieve the span from the `Body` using
the `locations` field. However, we may end up changing the
`locations` field when moving a constraint from a promoted
to a different body.

We now store the original `Span` in a dedication field, so that
changes to the `locations` do not affect the quality of our
diagnostics.

2 years agoChange file locations to be links to GitHub
mbartlett21 [Wed, 20 Apr 2022 03:14:32 +0000 (13:14 +1000)]
Change file locations to be links to GitHub

2 years agoInline `Cursor::next_with_spacing`.
Nicholas Nethercote [Wed, 20 Apr 2022 02:43:25 +0000 (12:43 +1000)]
Inline `Cursor::next_with_spacing`.

2 years agoRemove the loop from `Parser::bump()`.
Nicholas Nethercote [Wed, 20 Apr 2022 02:22:42 +0000 (12:22 +1000)]
Remove the loop from `Parser::bump()`.

The loop is there to handle a `NoDelim` open/close token. This commit
changes `TokenCursor::inlined_next` so it never returns such a token.
This is a performance win because the conditional test in `bump()` is
removed.

If the parser needs changing in the future to handle `NoDelim` tokens,
then `inlined_next()` can easily be changed to return them.

2 years agoRemove `TokenCursorFrame::open_delim`.
Nicholas Nethercote [Wed, 20 Apr 2022 02:22:03 +0000 (12:22 +1000)]
Remove `TokenCursorFrame::open_delim`.

Because it's now always true.

2 years agoUse `true` for `open_delim`/`close_delim` in one spot.
Nicholas Nethercote [Wed, 20 Apr 2022 01:49:15 +0000 (11:49 +1000)]
Use `true` for `open_delim`/`close_delim` in one spot.

The `DelimToken` here is `NoDelim`, which means the returned delim
tokens will just be ignored by `Parser::bump()`. This commit changes
things so the delim tokens won't be returned.

2 years agobootstrap: non-bootstrap windows split debuginfo
David Wood [Tue, 19 Apr 2022 02:32:30 +0000 (03:32 +0100)]
bootstrap: non-bootstrap windows split debuginfo

Temporarily, only enable split debuginfo on Windows if not building with
the boostrap compiler as there is a bug that isn't fixed in the
bootstrap compiler which would result in `thorin` being run on Windows.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoAdd a size assertion for `Parser`.
Nicholas Nethercote [Tue, 19 Apr 2022 23:31:34 +0000 (09:31 +1000)]
Add a size assertion for `Parser`.

2 years agoAuto merge of #96224 - Dylan-DPC:rollup-h2h3j93, r=Dylan-DPC
bors [Wed, 20 Apr 2022 01:34:43 +0000 (01:34 +0000)]
Auto merge of #96224 - Dylan-DPC:rollup-h2h3j93, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #95740 (asm: Add a kreg0 register class on x86 which includes k0)
 - #95813 (Remove extra space before a where clause)
 - #96029 (Refactor loop into iterator; simplify negation logic.)
 - #96162 (interpret: Fix writing uninit to an allocation)
 - #96165 (Miri provenance cleanup)
 - #96205 (Use futex locks on emscripten.)

Failed merges:

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

2 years agoremove_dir_all_recursive: treat ELOOP the same as ENOTDIR
Geoffry Song [Wed, 20 Apr 2022 00:46:50 +0000 (00:46 +0000)]
remove_dir_all_recursive: treat ELOOP the same as ENOTDIR

2 years agoFix locations for intrinsics impls
mbartlett21 [Tue, 19 Apr 2022 23:28:07 +0000 (09:28 +1000)]
Fix locations for intrinsics impls