]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #95368 - lopopolo:lopopolo/string-try-reserve-exact-doc-typo, r=Dylan-DPC
Dylan DPC [Sun, 27 Mar 2022 20:51:42 +0000 (22:51 +0200)]
Rollup merge of #95368 - lopopolo:lopopolo/string-try-reserve-exact-doc-typo, r=Dylan-DPC

Fix typo in `String::try_reserve_exact` docs

Copying the pattern from `Vec::try_reserve_exact` and `String::try_reserve`,
it looks like this doc comment is intending to refer to the currently-being-documented
function.

2 years agoRollup merge of #95366 - c410-f3r:moar-tests, r=petrochenkov
Dylan DPC [Sun, 27 Mar 2022 20:51:41 +0000 (22:51 +0200)]
Rollup merge of #95366 - c410-f3r:moar-tests, r=petrochenkov

Remove test files with duplicated checksums

cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`

2 years agoRollup merge of #95364 - GuillaumeGomez:long-error-explanation-e0667, r=Dylan-DPC
Dylan DPC [Sun, 27 Mar 2022 20:51:40 +0000 (22:51 +0200)]
Rollup merge of #95364 - GuillaumeGomez:long-error-explanation-e0667, r=Dylan-DPC

Add long error explanation for E0667

Part of #61137.

2 years agoRollup merge of #95120 - smoelius:backward-switch-int, r=ecstatic-morse
Dylan DPC [Sun, 27 Mar 2022 20:51:39 +0000 (22:51 +0200)]
Rollup merge of #95120 - smoelius:backward-switch-int, r=ecstatic-morse

Implement `apply_switch_int_edge_effects` for backward analyses

See #94576 for some discussion.

r? `@ecstatic-morse`

2 years agoRollup merge of #94939 - notriddle:notriddle/fru-comma-suggestion, r=cjgillot
Dylan DPC [Sun, 27 Mar 2022 20:51:38 +0000 (22:51 +0200)]
Rollup merge of #94939 - notriddle:notriddle/fru-comma-suggestion, r=cjgillot

diagnostics: suggest missing comma in bad FRU syntax

Fixes #51103

2 years agoNit
Dylan MacKenzie [Sun, 27 Mar 2022 17:58:55 +0000 (10:58 -0700)]
Nit

2 years agoUpdate ui test output
Guillaume Gomez [Sun, 27 Mar 2022 17:21:50 +0000 (19:21 +0200)]
Update ui test output

2 years agodiagnostics: suggest missing comma in bad FRU syntax
Michael Howell [Mon, 14 Mar 2022 18:46:12 +0000 (11:46 -0700)]
diagnostics: suggest missing comma in bad FRU syntax

Fixes #51103

2 years agoAuto merge of #95345 - dtolnay:escape0, r=Dylan-DPC
bors [Sun, 27 Mar 2022 16:36:05 +0000 (16:36 +0000)]
Auto merge of #95345 - dtolnay:escape0, r=Dylan-DPC

Debug print char 0 as '\0' rather than '\u{0}'

```rust
println!("{:?}", "foo\0");
```

- **Before:** `"foo\u{0}"`
- **After:** `"foo\0"`

```rust
println!("{:?}", '\0');
```

- **Before:** `'\u{0}'`
- **After:** `'\0'`

`'\0'` will be more recognizable to everyone than `'\u{0}'` because it's how we talk about character 0 in all of our docs and example code, such as https://doc.rust-lang.org/std/ffi/index.html, https://doc.rust-lang.org/std/ffi/struct.CStr.html, https://doc.rust-lang.org/std/ffi/struct.CString.html.

2 years agoFix typo in `String::try_reserve_exact` docs
Ryan Lopopolo [Sun, 27 Mar 2022 13:53:55 +0000 (06:53 -0700)]
Fix typo in `String::try_reserve_exact` docs

Copying the pattern from `Vec::try_reserve_exact` and `String::try_reserve`,
it looks like this doc comment is intending to refer to the currently-being-documented
function.

2 years agoRemove duplicated test files
Caio [Sun, 27 Mar 2022 12:19:34 +0000 (09:19 -0300)]
Remove duplicated test files

2 years agoAdd long error explanation for E0667
Guillaume Gomez [Sun, 27 Mar 2022 11:58:06 +0000 (13:58 +0200)]
Add long error explanation for E0667

2 years agoDebug print char 0 as '\0' rather than '\u{0}'
David Tolnay [Sat, 26 Mar 2022 20:35:58 +0000 (13:35 -0700)]
Debug print char 0 as '\0' rather than '\u{0}'

2 years agoAuto merge of #95355 - dtolnay:ripgreptest, r=Dylan-DPC
bors [Sun, 27 Mar 2022 09:19:50 +0000 (09:19 +0000)]
Auto merge of #95355 - dtolnay:ripgreptest, r=Dylan-DPC

Bump the ripgrep commit exercised by cargotest

This update goes from https://github.com/BurntSushi/ripgrep/commit/3de31f752729525d85a3d1575ac1978733b3f7e7 (Aug 1, 2019) to current master, https://github.com/BurntSushi/ripgrep/commit/ced5b92aa93eb47e892bd2fd26ab454008721730 (March 21, 2022).

I need this in order to pick up https://github.com/BurntSushi/ripgrep/pull/1722, which picked up https://github.com/BurntSushi/bstr/pull/58, which unblocks https://github.com/rust-lang/rust/pull/95345. Ripgrep uses the Debug representation of a `BStr` in some of its tests. In old versions of bstr, that used to just use the standard library's `escape_debug()` implementation, so the output ends up being sensitive to whether the standard library renders character 0 as `\u{0}` or as `\0`. The newer bstr always renders character 0 as `\0` and ripgrep's test suite has been correspondingly updated.

2 years agoAuto merge of #93957 - SaltyKitkat:stablize_const_ptr_offset, r=dtolnay
bors [Sun, 27 Mar 2022 07:01:29 +0000 (07:01 +0000)]
Auto merge of #93957 - SaltyKitkat:stablize_const_ptr_offset, r=dtolnay

Stabilize const_ptr_offset

Close #71499

2 years agoBump the ripgrep commit exercised by cargotest
David Tolnay [Sun, 27 Mar 2022 04:55:16 +0000 (21:55 -0700)]
Bump the ripgrep commit exercised by cargotest

2 years agoAuto merge of #95351 - Dylan-DPC:rollup-o1il7tx, r=Dylan-DPC
bors [Sun, 27 Mar 2022 04:20:07 +0000 (04:20 +0000)]
Auto merge of #95351 - Dylan-DPC:rollup-o1il7tx, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #91981 (Recover suggestions and useful information lost in previous PR)
 - #93469 (Skip pointing out ambiguous impls in alloc/std crates too in inference errors)
 - #95335 (Move resolve_path to rustc_builtin_macros and make it private)
 - #95340 (interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers))
 - #95341 (ARMv6K Horizon OS has_thread_local support)

Failed merges:

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

2 years agoBump const_ptr_offset stabilization to 1.61
David Tolnay [Sat, 26 Mar 2022 21:19:41 +0000 (14:19 -0700)]
Bump const_ptr_offset stabilization to 1.61

2 years agoRollup merge of #95341 - Meziu:armv6k-3ds-target, r=nagisa
Dylan DPC [Sun, 27 Mar 2022 03:36:11 +0000 (05:36 +0200)]
Rollup merge of #95341 - Meziu:armv6k-3ds-target, r=nagisa

ARMv6K Horizon OS has_thread_local support

cc. ```@ian-h-chamberlain```
cc. ```@AzureMarker```

Being an ARM target, it has always had built-in support for `#[thread_local]`. This PR comes in just now because we were testing `std::thread` support with `thread_local_dtor`s. This will hopefully be the last PR for the target specification, unless anymore features will be needed as time goes on.

2 years agoRollup merge of #95340 - RalfJung:pnvi, r=oli-obk
Dylan DPC [Sun, 27 Mar 2022 03:36:10 +0000 (05:36 +0200)]
Rollup merge of #95340 - RalfJung:pnvi, r=oli-obk

interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers)

This is required for https://github.com/rust-lang/miri/pull/2040

r? ```@oli-obk```

2 years agoRollup merge of #95335 - Badel2:resolve-path, r=Dylan-DPC
Dylan DPC [Sun, 27 Mar 2022 03:36:09 +0000 (05:36 +0200)]
Rollup merge of #95335 - Badel2:resolve-path, r=Dylan-DPC

Move resolve_path to rustc_builtin_macros and make it private

Fixing a FIXME introduced by `@jyn514` in #85457

2 years agoRollup merge of #93469 - compiler-errors:issue-93450, r=estebank
Dylan DPC [Sun, 27 Mar 2022 03:36:08 +0000 (05:36 +0200)]
Rollup merge of #93469 - compiler-errors:issue-93450, r=estebank

Skip pointing out ambiguous impls in alloc/std crates too in inference errors

This generalizes the logic in `annotate_source_of_ambiguity` to skip printing ambiguity errors traits in `alloc` and `std` as well, not just `core`.

While this does spot-fix the issue mentioned below, it would be nicer to generalize this logic, for example to detect when the trait predicate's `self_ty` has any numerical inference variables. Is it worthwhile to scrap this solution for one like that?

Fixes #93450

r? `@estebank`
feel free to reassign

2 years agoRollup merge of #91981 - estebank:tweakaroo, r=lcnr
Dylan DPC [Sun, 27 Mar 2022 03:36:08 +0000 (05:36 +0200)]
Rollup merge of #91981 - estebank:tweakaroo, r=lcnr

Recover suggestions and useful information lost in previous PR

Follow up to #91898.

2 years agoreview comments and rebase
Esteban Kuber [Sun, 27 Mar 2022 02:40:07 +0000 (02:40 +0000)]
review comments and rebase

2 years agoChange wording of missing return type suggestion
Esteban Kuber [Wed, 15 Dec 2021 23:49:03 +0000 (23:49 +0000)]
Change wording of missing return type suggestion

2 years agoDrive by: handle references in `same_type_modulo_infer`
Esteban Kuber [Wed, 15 Dec 2021 23:25:03 +0000 (23:25 +0000)]
Drive by: handle references in `same_type_modulo_infer`

2 years agoPoint (again) to more expressions with their type, even if not fully resolved
Esteban Kuber [Wed, 15 Dec 2021 23:16:21 +0000 (23:16 +0000)]
Point (again) to more expressions with their type, even if not fully resolved

2 years agoAlso resolve `const` param suggestion
Esteban Kuber [Wed, 15 Dec 2021 23:11:26 +0000 (23:11 +0000)]
Also resolve `const` param suggestion

2 years agoEagerly replace `{integer}`/`{float}` with `i32`/`f64` for suggestion
Esteban Kuber [Wed, 15 Dec 2021 22:59:32 +0000 (22:59 +0000)]
Eagerly replace `{integer}`/`{float}` with `i32`/`f64` for suggestion

2 years agoAuto merge of #95338 - bjorn3:sync_cg_gcc-2022-03-26, r=antoyo
bors [Sun, 27 Mar 2022 01:55:15 +0000 (01:55 +0000)]
Auto merge of #95338 - bjorn3:sync_cg_gcc-2022-03-26, r=antoyo

Sync rustc_codegen_gcc

r? `@ghost`

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

cc `@antoyo`

2 years agoAuto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011
bors [Sat, 26 Mar 2022 23:01:12 +0000 (23:01 +0000)]
Auto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011

proc-macro: Stop wrapping `ident` matchers into groups

`ident` is always a single token and can be treated in the same way as `tt`.
r? `@Aaron1011`

2 years agoAuto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPC
bors [Sat, 26 Mar 2022 20:17:04 +0000 (20:17 +0000)]
Auto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPC

add #[must_use] to functions of slice and its iterators.

Continuation of #92853.

Tracking issue: #89692.

2 years agoMerge pull request #16 from ian-h-chamberlain/feature/target-thread-local
Meziu [Sat, 26 Mar 2022 19:49:19 +0000 (20:49 +0100)]
Merge pull request #16 from ian-h-chamberlain/feature/target-thread-local

Enable #[thread_local] on armv6k-nintendo-3ds

2 years agointerpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i...
Ralf Jung [Sat, 26 Mar 2022 17:17:49 +0000 (13:17 -0400)]
interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers)

2 years agoMerge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
bjorn3 [Sat, 26 Mar 2022 17:29:37 +0000 (18:29 +0100)]
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26

2 years agointerpret: mark a dead match arm as dead
Ralf Jung [Sat, 26 Mar 2022 17:03:49 +0000 (13:03 -0400)]
interpret: mark a dead match arm as dead

2 years agoMerge pull request #146 from bjorn3/rustup
antoyo [Sat, 26 Mar 2022 17:00:39 +0000 (13:00 -0400)]
Merge pull request #146 from bjorn3/rustup

Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)

2 years agoReview comments
bjorn3 [Sat, 26 Mar 2022 16:27:06 +0000 (17:27 +0100)]
Review comments

2 years agoMove resolve_path to rustc_builtin_macros and make it private
Badel2 [Sat, 26 Mar 2022 15:47:13 +0000 (16:47 +0100)]
Move resolve_path to rustc_builtin_macros and make it private

2 years agoFix compiletest compilation
bjorn3 [Sat, 26 Mar 2022 15:14:39 +0000 (16:14 +0100)]
Fix compiletest compilation

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 15:23:55 +0000 (16:23 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 15:19:47 +0000 (16:19 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 14:47:22 +0000 (15:47 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 14:37:48 +0000 (15:37 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoAdd Destruct and Drop traits to static.rs
bjorn3 [Sat, 26 Mar 2022 13:25:37 +0000 (14:25 +0100)]
Add Destruct and Drop traits to static.rs

2 years agoEnable #[thread_local] on armv6k-nintendo-3ds
Ian Chamberlain [Fri, 18 Feb 2022 22:25:40 +0000 (17:25 -0500)]
Enable #[thread_local] on armv6k-nintendo-3ds

2 years agoRustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)
bjorn3 [Sat, 26 Mar 2022 13:12:44 +0000 (14:12 +0100)]
Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)

2 years agoAuto merge of #95326 - lupd:std-iter-doc, r=Dylan-DPC
bors [Sat, 26 Mar 2022 12:01:58 +0000 (12:01 +0000)]
Auto merge of #95326 - lupd:std-iter-doc, r=Dylan-DPC

Remove mention of `HashMap<K, V>` not offering `iter_mut`

HashMap<K, V> does offer iter_mut. Fixes #94755.

r? rust-lang/libs
`@rustbot` label +A-docs +T-libs

2 years agoAddress review comments
Samuel E. Moelius III [Sat, 26 Mar 2022 01:11:49 +0000 (21:11 -0400)]
Address review comments

* Add lazily computed `switch_sources` data structure
* Don't assume a target has only one associated value

2 years agoSync from rust bc881e83d1cced71046e844fa55c0b0e9f9af382
bjorn3 [Sat, 26 Mar 2022 11:52:21 +0000 (12:52 +0100)]
Sync from rust bc881e83d1cced71046e844fa55c0b0e9f9af382

2 years agoproc-macro: Stop wrapping `ident` matchers into groups
Vadim Petrochenkov [Sat, 1 Jan 2022 09:15:47 +0000 (17:15 +0800)]
proc-macro: Stop wrapping `ident` matchers into groups

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 09:24:25 +0000 (10:24 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoAuto merge of #95306 - est31:master, r=Dylan-DPC
bors [Sat, 26 Mar 2022 09:00:23 +0000 (09:00 +0000)]
Auto merge of #95306 - est31:master, r=Dylan-DPC

std::process docs: linkify references to output, spawn and status

2 years agoRemove mention of HashMap<K, V> not offering iter_mut
dlup [Sat, 26 Mar 2022 06:05:34 +0000 (02:05 -0400)]
Remove mention of HashMap<K, V> not offering iter_mut

2 years agoAuto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPC
bors [Sat, 26 Mar 2022 06:00:41 +0000 (06:00 +0000)]
Auto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPC

Prettify rustc_session with recent conveniences

No functional changes.

I felt like making something beautiful.

2 years agoAuto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplett
bors [Sat, 26 Mar 2022 03:19:49 +0000 (03:19 +0000)]
Auto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplett

Remove hermitkernel targets

RustyHermit now maintains custom json targets, which are distributed with the kernel: https://github.com/hermitcore/libhermit-rs/pull/395

See https://github.com/hermitcore/rusty-hermit/issues/197#issuecomment-1076667961
CC: `@stlankes,` `@bstrie`
2 years agoAuto merge of #95149 - cjgillot:once-diag, r=estebank
bors [Sat, 26 Mar 2022 00:54:54 +0000 (00:54 +0000)]
Auto merge of #95149 - cjgillot:once-diag, r=estebank

Remove `Session::one_time_diagnostic`

This is untracked mutable state, which modified the behaviour of queries.
It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes).

It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter.
A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics.

As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.

2 years agoAuto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle
bors [Fri, 25 Mar 2022 22:16:44 +0000 (22:16 +0000)]
Auto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle

Reduce wait-for instructions for rustdoc GUI tests

r? `@notriddle`

2 years agoReplace wait-for instructions for rustdoc GUI tests with wait-for-css
Guillaume Gomez [Mon, 21 Mar 2022 14:50:05 +0000 (15:50 +0100)]
Replace wait-for instructions for rustdoc GUI tests with wait-for-css

2 years agoUpdate browser-ui-test version to 0.8.4
Guillaume Gomez [Fri, 25 Mar 2022 20:08:59 +0000 (21:08 +0100)]
Update browser-ui-test version to 0.8.4

2 years agoAuto merge of #95304 - michaelwoerister:retry-finalize-session-dir, r=oli-obk
bors [Fri, 25 Mar 2022 19:47:19 +0000 (19:47 +0000)]
Auto merge of #95304 - michaelwoerister:retry-finalize-session-dir, r=oli-obk

incr. comp.: Let compiler retry finalizing session directory a few times.

In my local testing this fixed issue https://github.com/rust-lang/rust/issues/86929. I wasn't able to come up with a regression test for it though.

2 years agoAuto merge of #95282 - RalfJung:miri, r=RalfJung
bors [Fri, 25 Mar 2022 16:45:08 +0000 (16:45 +0000)]
Auto merge of #95282 - RalfJung:miri, r=RalfJung

update Miri

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

2 years agoAuto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, r=oli-obk
bors [Fri, 25 Mar 2022 14:16:13 +0000 (14:16 +0000)]
Auto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, r=oli-obk

Swap DtorckConstraint to DropckConstraint

This change was made as per suspicion that this struct was never renamed after consistent use of DropCk.

This also clarifies the meaning behind the name of this structure.

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

2 years agostd::process docs: linkify references to output, spawn and status
est31 [Fri, 25 Mar 2022 13:41:37 +0000 (14:41 +0100)]
std::process docs: linkify references to output, spawn and status

2 years agoincr. comp.: Let compiler retry finalizing session directory a few times.
Michael Woerister [Fri, 25 Mar 2022 13:14:22 +0000 (14:14 +0100)]
incr. comp.: Let compiler retry finalizing session directory a few times.

See https://github.com/rust-lang/rust/issues/86929.

2 years agoBless rustdoc tests.
Camille GILLOT [Fri, 25 Mar 2022 11:50:45 +0000 (12:50 +0100)]
Bless rustdoc tests.

2 years agoAuto merge of #95255 - petrochenkov:suggresolve, r=michaelwoerister
bors [Fri, 25 Mar 2022 11:35:19 +0000 (11:35 +0000)]
Auto merge of #95255 - petrochenkov:suggresolve, r=michaelwoerister

resolve: Do not build expensive suggestions if they are not actually used

And remove a bunch of (conditionally) unused parameters from path resolution functions.

This helps with performance issues in https://github.com/rust-lang/rust/pull/94857, and should be helpful in general even without that.

2 years agoRemove hermitkernel targets
Martin Kröning [Fri, 25 Mar 2022 10:46:34 +0000 (11:46 +0100)]
Remove hermitkernel targets

RustyHermit now maintains custom json targets, which are distributed with the kernel. [1]

[1]: https://github.com/hermitcore/libhermit-rs/pull/395

2 years agoAuto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakis
bors [Fri, 25 Mar 2022 09:09:48 +0000 (09:09 +0000)]
Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakis

Overlap inherent impls

r? `@nikomatsakis`

Closes #94526

2 years agoAuto merge of #95259 - nnethercote:more-macro-expansion-optimizations, r=petrochenkov
bors [Fri, 25 Mar 2022 06:28:58 +0000 (06:28 +0000)]
Auto merge of #95259 - nnethercote:more-macro-expansion-optimizations, r=petrochenkov

More macro expansion optimizations

A few nice wins for macro-heavy crates.

r? `@petrochenkov`

2 years agoUse a let-chain in _session::output (nfc)
Jubilee Young [Fri, 25 Mar 2022 05:31:46 +0000 (22:31 -0700)]
Use a let-chain in _session::output (nfc)

2 years agoVigorously refactor _session::code_stats (nfc)
Jubilee Young [Fri, 25 Mar 2022 05:30:38 +0000 (22:30 -0700)]
Vigorously refactor _session::code_stats (nfc)

2 years agoPrettify rustc_session fmt with capturing args (nfc)
Jubilee Young [Fri, 25 Mar 2022 05:11:05 +0000 (22:11 -0700)]
Prettify rustc_session fmt with capturing args (nfc)

2 years agoAuto merge of #92361 - vacuus:doctest-run-test-out-lines, r=CraftSpider
bors [Fri, 25 Mar 2022 04:01:00 +0000 (04:01 +0000)]
Auto merge of #92361 - vacuus:doctest-run-test-out-lines, r=CraftSpider

Remove `collect` in `doctest::run_test`

2 years agoShrink `MatcherPosRepetition`.
Nicholas Nethercote [Wed, 23 Mar 2022 05:04:33 +0000 (16:04 +1100)]
Shrink `MatcherPosRepetition`.

Currently it copies a `KleeneOp` and a `Token` out of a
`SequenceRepetition`. It's better to store a reference to the
`SequenceRepetition`, which is now possible due to #95159 having changed
the lifetimes.

2 years agoShrink `NamedMatchVec` to one inline element.
Nicholas Nethercote [Wed, 23 Mar 2022 02:09:55 +0000 (13:09 +1100)]
Shrink `NamedMatchVec` to one inline element.

This counters the `NamedMatchVec` size increase from the previous
commit, leaving `NamedMatchVec` smaller than before.

2 years agoSplit `NamedMatch::MatchNonterminal` in two.
Nicholas Nethercote [Wed, 23 Mar 2022 00:46:22 +0000 (11:46 +1100)]
Split `NamedMatch::MatchNonterminal` in two.

The `Lrc` is only relevant within `transcribe()`. There, the `Lrc` is
helpful for the non-`NtTT` cases, because the entire nonterminal is
cloned. But for the `NtTT` cases the inner token tree is cloned (a full
clone) and so the `Lrc` is of no help.

This commit splits the `NtTT` and non-`NtTT` cases, avoiding the useless
`Lrc` in the former case, for the following effect on macro-heavy
crates.
- It reduces the total number of allocations a lot.
- It increases the size of some of the remaining allocations.
- It doesn't affect *peak* memory usage, because the larger allocations
  are short-lived.

This overall gives a speed win.

2 years agoAuto merge of #95291 - Dylan-DPC:rollup-vrb4wlw, r=Dylan-DPC
bors [Fri, 25 Mar 2022 01:20:01 +0000 (01:20 +0000)]
Auto merge of #95291 - Dylan-DPC:rollup-vrb4wlw, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #94391 (Fix ice when error reporting recursion errors)
 - #94655 (Clarify which kinds of MIR are allowed during which phases.)
 - #95179 (Try to evaluate in try unify and postpone resolution of constants that contain inference variables)
 - #95270 (debuginfo: Fix debuginfo for Box<T> where T is unsized.)
 - #95276 (add diagnostic items for clippy's `trim_split_whitespace`)

Failed merges:

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

2 years agoRollup merge of #95276 - FoseFx:clippy_trim_split_whitespace, r=flip1995
Dylan DPC [Fri, 25 Mar 2022 00:34:32 +0000 (01:34 +0100)]
Rollup merge of #95276 - FoseFx:clippy_trim_split_whitespace, r=flip1995

add diagnostic items for clippy's `trim_split_whitespace`

Adding the following diagnostic items:
 * str_split_whitespace,
 * str_trim,
 * str_trim_start,
 * str_trim_end

They are needed for https://github.com/rust-lang/rust-clippy/pull/8575

r? `@flip1995`

2 years agoRollup merge of #95270 - michaelwoerister:fix-box-unsized-debuginfo, r=wesleywiser
Dylan DPC [Fri, 25 Mar 2022 00:34:31 +0000 (01:34 +0100)]
Rollup merge of #95270 - michaelwoerister:fix-box-unsized-debuginfo, r=wesleywiser

debuginfo: Fix debuginfo for Box<T> where T is unsized.

Before this fix, the debuginfo for the fields was generated from the struct defintion of Box<T>, but (at least at the moment) the compiler pretends that Box<T> is just a (fat) pointer, so the fields need to be `pointer` and `vtable` instead of `__0: Unique<T>` and `__1: Allocator`.

This is meant as a temporary mitigation until we can make sure that simply treating Box as a regular struct in debuginfo does not cause too much breakage in the ecosystem.

r? ````@wesleywiser````

2 years agoRollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnr
Dylan DPC [Fri, 25 Mar 2022 00:34:30 +0000 (01:34 +0100)]
Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnr

Try to evaluate in try unify and postpone resolution of constants that contain inference variables

We want code like that in [`ui/const-generics/generic_const_exprs/eval-try-unify.rs`](https://github.com/rust-lang/rust/compare/master...b-naber:eval-in-try-unify?expand=1#diff-8027038201cf07a6c96abf3cbf0b0f4fdd8a64ce6292435f01c8ed995b87fe9b) to compile. To do that we need to try to evaluate constants in `try_unify_abstract_consts`, this requires us to be more careful about what constants we try to resolve, specifically we cannot try to resolve constants that still contain inference variables.

r? `@lcnr`

2 years agoRollup merge of #94655 - JakobDegen:mir-phase-docs, r=oli-obk
Dylan DPC [Fri, 25 Mar 2022 00:34:29 +0000 (01:34 +0100)]
Rollup merge of #94655 - JakobDegen:mir-phase-docs, r=oli-obk

Clarify which kinds of MIR are allowed during which phases.

This enhances documentation with these details and extends the validator to check these requirements more thoroughly. Most of these conditions were already being checked.

There was also some disagreement between the `MirPhase` docs and validator as to what it meant for the `body.phase` field to have a certain value. This PR resolves those disagreements in favor of the `MirPhase` docs (which is what the pass manager implemented), adjusting the validator accordingly. The result is now that the `DropLowering` phase begins with the end of the elaborate drops pass, and lasts until the beginning of the generator lowring pass. This doesn't feel entirely natural to me, but as long as it's documented accurately it should be ok.

r? rust-lang/mir-opt

2 years agoRollup merge of #94391 - light4:issue-90319, r=estebank
Dylan DPC [Fri, 25 Mar 2022 00:34:28 +0000 (01:34 +0100)]
Rollup merge of #94391 - light4:issue-90319, r=estebank

Fix ice when error reporting recursion errors

Fixes: #90319, #92148, #93955
2 years agoImplement `apply_switch_int_edge_effects` for backward analyses
Samuel E. Moelius III [Sat, 19 Mar 2022 16:04:59 +0000 (12:04 -0400)]
Implement `apply_switch_int_edge_effects` for backward analyses

2 years agoresolve: Rename `CrateLint` to `Finalize`
Vadim Petrochenkov [Wed, 23 Mar 2022 23:55:22 +0000 (02:55 +0300)]
resolve: Rename `CrateLint` to `Finalize`

And `crate_lint`/`record_used` to `finalize`

2 years agoresolve: Stop passing unused spans and node ids to path resolution functions
Vadim Petrochenkov [Wed, 23 Mar 2022 21:32:00 +0000 (00:32 +0300)]
resolve: Stop passing unused spans and node ids to path resolution functions

2 years agoresolve: Optimize path resolution for rustdoc
Vadim Petrochenkov [Wed, 23 Mar 2022 21:03:12 +0000 (00:03 +0300)]
resolve: Optimize path resolution for rustdoc

Do not construct or pass unused data

2 years agoresolve: Do not build expensive suggestions if they are not actually used
Vadim Petrochenkov [Wed, 23 Mar 2022 19:47:19 +0000 (22:47 +0300)]
resolve: Do not build expensive suggestions if they are not actually used

Also remove a redundant parameter from `fn resolve_path(_with_ribs)`, `crate_lint: CrateLint` is a more detailed version of `record_used: bool` with `CrateLint::No` meaning `false` and anything else meaning `true`.

2 years agoAuto merge of #95273 - flip1995:clippyup, r=manishearth
bors [Thu, 24 Mar 2022 22:52:34 +0000 (22:52 +0000)]
Auto merge of #95273 - flip1995:clippyup, r=manishearth

Update Clippy

r? `@Manishearth`

2 years agoImplement impl_subject_and_oblig instead of repeating the impls
Santiago Pastorino [Thu, 24 Mar 2022 21:41:30 +0000 (18:41 -0300)]
Implement impl_subject_and_oblig instead of repeating the impls

2 years agoWhere bounds are checked on inherent impls
Santiago Pastorino [Thu, 24 Mar 2022 20:47:10 +0000 (17:47 -0300)]
Where bounds are checked on inherent impls

2 years agoAuto merge of #94934 - Lireer:const-prop-lint, r=oli-obk
bors [Thu, 24 Mar 2022 20:22:27 +0000 (20:22 +0000)]
Auto merge of #94934 - Lireer:const-prop-lint, r=oli-obk

Separate const prop lints from optimizations

r? `@oli-obk`

Separates lints and optimizations during const prop by moving the lints into their own file and checking them during post borrowck cleanup.
Thanks to `@oli-obk` for mentoring me.

2 years agoSwap DtorckConstraint to DropckConstraint
InfRandomness [Thu, 24 Mar 2022 18:21:41 +0000 (19:21 +0100)]
Swap DtorckConstraint to DropckConstraint

This change was made as per suspicion that this struct was never renamed after consistent use of DropCk.

This also clarifies the meaning behind the name of this structure.

2 years agoupdate Miri
Ralf Jung [Thu, 24 Mar 2022 19:05:27 +0000 (15:05 -0400)]
update Miri

2 years agoFix ice when error reporting recursion errors
lightning1141 [Sat, 26 Feb 2022 03:55:07 +0000 (11:55 +0800)]
Fix ice when error reporting recursion errors

Fixes: #90319, #92148, #93955
2 years agoAuto merge of #94517 - aDotInTheVoid:inline_wrapping_next_power_two, r=yaahc
bors [Thu, 24 Mar 2022 17:32:40 +0000 (17:32 +0000)]
Auto merge of #94517 - aDotInTheVoid:inline_wrapping_next_power_two, r=yaahc

Mark `uint::wrapping_next_power_of_two` as `#[inline]`

This brings it in line with `next_power_of_two` and `checked_next_power_of_two`

https://godbolt.org/z/Tr18GnqKj

<details>
<summary> Output as of `rustc 1.61.0-nightly (4ce374923 2022-02-28)` </summary>

```asm
example::npot:
        lea     eax, [rdi - 1]
        movzx   eax, al
        lzcnt   ecx, eax
        add     ecx, -24
        mov     al, -1
        shr     al, cl
        inc     al
        cmp     dil, 2
        movzx   ecx, al
        mov     eax, 1
        cmovae  eax, ecx
        ret

example::cnpot:
        lea     eax, [rdi - 1]
        movzx   eax, al
        lzcnt   ecx, eax
        add     ecx, -24
        mov     al, -1
        shr     al, cl
        xor     ecx, ecx
        cmp     dil, 2
        movzx   edx, al
        cmovb   edx, ecx
        inc     dl
        setne   al
        ret

example::wrapping_next_power_of_two:
        jmp     qword ptr [rip + _ZN4core3num20_$LT$impl$u20$u8$GT$26wrapping_next_power_of_two17hd879a85055735264E@GOTPCREL]
```

</details>

2 years agoadd diagnostic items for clippy's
Max Baumann [Thu, 24 Mar 2022 16:05:47 +0000 (17:05 +0100)]
add diagnostic items for clippy's

2 years agoNormalize both trait and inherent
Santiago Pastorino [Thu, 24 Mar 2022 17:17:54 +0000 (14:17 -0300)]
Normalize both trait and inherent

2 years agoExtract impl_subject_and_oglibations fn and make equate receive subjects
Santiago Pastorino [Thu, 24 Mar 2022 15:27:09 +0000 (12:27 -0300)]
Extract impl_subject_and_oglibations fn and make equate receive subjects

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Thu, 13 Jan 2022 13:57:57 +0000 (14:57 +0100)]
add #[must_use] to functions of slice and its iterators.