]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errors
Dylan DPC [Mon, 25 Apr 2022 23:21:24 +0000 (01:21 +0200)]
Rollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errors

do not consider two extern types to be similar

2 years agoRollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errors
Dylan DPC [Mon, 25 Apr 2022 23:21:23 +0000 (01:21 +0200)]
Rollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errors

delay bug when adjusting `NeverToAny` twice during diagnostic code

Addresses Issue 96335 (https://github.com/rust-lang/rust/issues/96335) by using `delay_span_bug` instead of an assert and returning an error type from `check_expr_meets_expectation_or_error`.

Fixes #96335

2 years agoRollup merge of #96355 - estebank:issue-95030, r=compiler-errors
Dylan DPC [Mon, 25 Apr 2022 23:21:22 +0000 (01:21 +0200)]
Rollup merge of #96355 - estebank:issue-95030, r=compiler-errors

Better handle too many `#` recovery in raw str

Point at all the unnecessary trailing `#`.
Better handle interaction with outer attributes when `;` is missing.

Fix #95030.

2 years agoRollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jsha
Dylan DPC [Mon, 25 Apr 2022 23:21:21 +0000 (01:21 +0200)]
Rollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jsha

rustdoc: Remove .woff font files

Copying `@jsha's` great comment:

> Right now we ship 1.5MB of woff files in the rustdoc binary, and 1MB of woff2 files, for a total of 2.5MB.
>
> Per:
>
> https://caniuse.com/woff
> https://caniuse.com/woff2
>
> The only listed browser that supports woff and not woff2 is IE, which is not supported per https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md.
>
> I propose we stop shipping woff files and save 1.5MB from the rustdoc binary (and from each doc build).

r? `@jsha`

2 years agoRollup merge of #96149 - est31:remove_unused_macro_matchers, r=petrochenkov
Dylan DPC [Mon, 25 Apr 2022 23:21:20 +0000 (01:21 +0200)]
Rollup merge of #96149 - est31:remove_unused_macro_matchers, r=petrochenkov

Remove unused macro rules

Removes rules of internal macros that weren't triggered.

2 years agoRollup merge of #90312 - r00ster91:search, r=Dylan-DPC
Dylan DPC [Mon, 25 Apr 2022 23:21:20 +0000 (01:21 +0200)]
Rollup merge of #90312 - r00ster91:search, r=Dylan-DPC

Fix some confusing wording and improve slice-search-related docs

This adds more links between `contains` and `binary_search` because I do think they have some relevant connections. If your (big) slice happens to be sorted and you know it, surely you should be using `[3; 100].binary_search(&5).is_ok()` over `[3; 100].contains(&5)`?
This also fixes the confusing "searches this sorted X" wording which just sounds really weird because it doesn't know whether it's actually sorted. It should be but it may not be. The new wording should make it clearer that you will probably want to sort it and in the same sentence it also mentions the related function `contains`.
Similarly, this mentions `binary_search` on `contains`' docs.
This also fixes some other minor stuff and inconsistencies.

2 years agoAuto merge of #96116 - ouz-a:mir-opt, r=oli-obk
bors [Mon, 25 Apr 2022 19:34:52 +0000 (19:34 +0000)]
Auto merge of #96116 - ouz-a:mir-opt, r=oli-obk

Make derefer work everwhere

Follow up work on previous PR's #95649 and #95857.

r? rust-lang/mir-opt

_Co-Authored-By: `@oli-obk_`

2 years agoAuto merge of #95604 - nbdd0121:used2, r=petrochenkov
bors [Mon, 25 Apr 2022 16:14:54 +0000 (16:14 +0000)]
Auto merge of #95604 - nbdd0121:used2, r=petrochenkov

Generate synthetic object file to ensure all exported and used symbols participate in the linking

Fix #50007 and #47384

This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed.

Related #93791, #95363

r? `@petrochenkov`
cc `@carbotaniuman`

2 years agoStop exporting rust_eh_personality and friends from cdylib
Gary Guo [Mon, 25 Apr 2022 13:06:30 +0000 (14:06 +0100)]
Stop exporting rust_eh_personality and friends from cdylib

2 years agoAuto merge of #96246 - SparrowLii:bound_contxet, r=compiler-errors
bors [Mon, 25 Apr 2022 10:46:58 +0000 (10:46 +0000)]
Auto merge of #96246 - SparrowLii:bound_contxet, r=compiler-errors

Add `BoundKind` in `visit_param_bounds` to check questions in bounds

From the FIXME in the impl of `AstValidator`. Better bound checks by adding `BoundCtxt` type parameter to `visit_param_bound`

cc `@ecstatic-morse`

2 years agoAuto merge of #95246 - ChrisDenton:command-args, r=joshtriplett
bors [Mon, 25 Apr 2022 07:28:09 +0000 (07:28 +0000)]
Auto merge of #95246 - ChrisDenton:command-args, r=joshtriplett

Windows Command: Don't run batch files using verbatim paths

Fixes #95178

Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.

2 years agodo not consider two extern types to be similar
lcnr [Mon, 25 Apr 2022 06:51:26 +0000 (08:51 +0200)]
do not consider two extern types to be similar

2 years agoDelay bug when adjusting NeverToAny twice during diagnostic
Preston From [Sun, 24 Apr 2022 08:00:12 +0000 (02:00 -0600)]
Delay bug when adjusting NeverToAny twice during diagnostic

2 years agoAuto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrum
bors [Mon, 25 Apr 2022 04:24:10 +0000 (04:24 +0000)]
Auto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrum

Add type_name info to [TIMING] log output

Adds type_name to the [TIMING] log output:
```
[TIMING] (bootstrap::compile::Sysroot) Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } -- 0.020
[TIMING] (bootstrap::builder::Builder::sysroot_libdir::Libdir) Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } -- 0.007
```

Not sure if that's the best way to format it. Thought about replacing the struct's name with the type_name output, but that feels kind of hacky?

Closes #96060

2 years agoAuto merge of #96369 - matthiaskrgr:rollup-q18w4v2, r=matthiaskrgr
bors [Sun, 24 Apr 2022 22:20:56 +0000 (22:20 +0000)]
Auto merge of #96369 - matthiaskrgr:rollup-q18w4v2, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #95395 (Better error message for `_` in function signature in `impl Trait for Ty`)
 - #96090 (Implement MIR opt unit tests)
 - #96107 ([test] Add test cases for untested functions for VecDeque)
 - #96212 (Use revisions instead of nll compare mode for `/regions/` ui tests)
 - #96215 (Drop support for legacy PM with LLVM 15)
 - #96366 (bootstrap: Remove dead code in rustdoc shim)

Failed merges:

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

2 years agoRollup merge of #96366 - jyn514:remove-dead-code, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 22:11:03 +0000 (00:11 +0200)]
Rollup merge of #96366 - jyn514:remove-dead-code, r=Mark-Simulacrum

bootstrap: Remove dead code in rustdoc shim

The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.

2 years agoRollup merge of #96215 - nikic:legacy-pm-removal, r=nagisa
Matthias Krüger [Sun, 24 Apr 2022 22:11:02 +0000 (00:11 +0200)]
Rollup merge of #96215 - nikic:legacy-pm-removal, r=nagisa

Drop support for legacy PM with LLVM 15

LLVM 15 already removes some of the legacy PM APIs we're using. This patch forces use of NewPM with LLVM 15 (with `-Z new-llvm-pass-manager=no` throwing a warning) and stubs out various FFI methods with a report_fatal_error on LLVM 15.

For LLVMPassManagerBuilderPopulateLTOPassManager() I went with adding our own wrapper, as the alternative would be to muck about with weak symbols, which seems to be non-trivial as far as cross-platform support is concerned (std has `weak!` for this purpose, but only as an internal utility.)

Fixes #96072.
Fixes #96362.

2 years agoRollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726
Matthias Krüger [Sun, 24 Apr 2022 22:11:01 +0000 (00:11 +0200)]
Rollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726

Use revisions instead of nll compare mode for `/regions/` ui tests

Created https://github.com/rust-lang/rust/issues/96211 for the duplicated mismatched types errors

r? `@jackh726`

2 years agoRollup merge of #96107 - Gumichocopengin8:test/vec-deque, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 22:11:00 +0000 (00:11 +0200)]
Rollup merge of #96107 - Gumichocopengin8:test/vec-deque, r=Mark-Simulacrum

[test] Add test cases for untested functions for VecDeque

Added test cases of the following functions
- get
- get_mut
- swap
- reserve_exact
- try_reserve_exact
- try_reserve
- contains
- rotate_left
- rotate_right
- binary_search
- binary_search_by
- binary_search_by_key

2 years agoRollup merge of #96090 - JakobDegen:mir-tests, r=nagisa
Matthias Krüger [Sun, 24 Apr 2022 22:10:59 +0000 (00:10 +0200)]
Rollup merge of #96090 - JakobDegen:mir-tests, r=nagisa

Implement MIR opt unit tests

This implements rust-lang/compiler-team#502 .

There's not much to say here, this implementation does everything as proposed. I also added the flag to a bunch of existing tests (mostly those to which I could add it without causing huge diffs due to changes in line numbers). Summarizing the changes to test outputs:
 - Every time an `MirPatch` is created, it adds a cleanup block to the body if it did not exist already. If this block is unused (as is usually the case), it usually gets removed soon after by some pass calling `SimplifyCFG` for unrelated reasons (in many cases this cycle happens quite a few times for a single body). We now run `SimplifyCFG` less often, so those blocks end up in some of our outputs. I looked at changing `MirPatch` to not do this, but that seemed too complicated for this PR. I may still do that in a follow-up.
 - The `InstCombine` test had set `-C opt-level=0` in its flags and so there were no storage markers. I don't really see a good motivation for doing this, so bringing it back in line with what everything else does seems correct.
 - One of the `EarlyOtherwiseBranch` tests had `UnreachableProp` running on it. Preventing that kind of thing is the goal of this feature, so this seems fine.

For the remaining tests for which this feature might be useful, we can gradually migrate them as opportunities present themselves.

In terms of documentation, I plan on submitting a PR to the rustc dev guide in the near future documenting this and other recent changes to MIR. If there's any other places to update, do let me know

r? `@nagisa`

2 years agoRollup merge of #95395 - compiler-errors:infer-on-impl-for-trait, r=oli-obk
Matthias Krüger [Sun, 24 Apr 2022 22:10:59 +0000 (00:10 +0200)]
Rollup merge of #95395 - compiler-errors:infer-on-impl-for-trait, r=oli-obk

Better error message for `_` in function signature in `impl Trait for Ty`

Provides a replacement suggestion for when `_` is present in the function signature for `impl Trait for Ty`, using the substitutions from the trait to compute the exact type.

Fixes #95097

2 years agoFix suggestion for `_` on return type for fn in impl for Trait
Michael Goulet [Mon, 28 Mar 2022 02:43:08 +0000 (19:43 -0700)]
Fix suggestion for `_` on return type for fn in impl for Trait

2 years agoSuggest replacing `_` in type signature of impl for Trait
Michael Goulet [Mon, 28 Mar 2022 02:43:05 +0000 (19:43 -0700)]
Suggest replacing `_` in type signature of impl for Trait

2 years agoEnsure `#[used]` symbols are preserved in LTO
Gary Guo [Sun, 24 Apr 2022 21:32:05 +0000 (22:32 +0100)]
Ensure `#[used]` symbols are preserved in LTO

2 years agoRemove dead code in rustdoc shim
Joshua Nelson [Sun, 24 Apr 2022 19:53:49 +0000 (14:53 -0500)]
Remove dead code in rustdoc shim

The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.

2 years agoUse revisions instead of nll compare mode for `/regions/` ui tests
marmeladema [Tue, 19 Apr 2022 10:56:18 +0000 (12:56 +0200)]
Use revisions instead of nll compare mode for `/regions/` ui tests

2 years agoAuto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrum
bors [Sun, 24 Apr 2022 19:16:20 +0000 (19:16 +0000)]
Auto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrum

espidf: fix stat

Marking as draft as currently dependant on [a libc fix](https://github.com/rust-lang/libc/pull/2708) and release.

2 years agotest: add test cases for VecDeque
Keita Nonaka [Fri, 15 Apr 2022 23:33:55 +0000 (16:33 -0700)]
test: add test cases for VecDeque

2 years agoAuto merge of #96363 - matthiaskrgr:rollup-mthdja5, r=matthiaskrgr
bors [Sun, 24 Apr 2022 16:22:40 +0000 (16:22 +0000)]
Auto merge of #96363 - matthiaskrgr:rollup-mthdja5, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #94893 (diagnostics: regression test for `<usize as Iterator>::rev`)
 - #95504 (Add `x {check,build,doc} {compiler,library}` aliases.)
 - #96237 (compiletest: combine `--*-python` args)
 - #96303 (Improve bootstrap tests)
 - #96352 (Improve span for `consider adding an explicit lifetime bound` suggestions under NLL)

Failed merges:

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

2 years agoRollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, r=jackh726
Matthias Krüger [Sun, 24 Apr 2022 16:00:27 +0000 (18:00 +0200)]
Rollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, r=jackh726

Improve span for `consider adding an explicit lifetime bound` suggestions under NLL

Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound.
We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body.

This helps with #96332

2 years agoRollup merge of #96303 - jyn514:improved-bootstrap-tests, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 16:00:27 +0000 (18:00 +0200)]
Rollup merge of #96303 - jyn514:improved-bootstrap-tests, r=Mark-Simulacrum

Improve bootstrap tests

- Don't checkout submodules in bootstrap tests

  This doesn't cause any tests to fail, and can greatly speed them up.

- Add a test for --exclude test::XXX

  I didn't know that the `test::` syntax was valid before, and it doesn't seem to be documented anywhere. Add a test so it doesn't regress accidentally, and as executable documentation.
  This also moves the `exclude` tests out of `dist`, to avoid assertion errors when the `cmd` passed to configure didn't match the `subcommand` used.

- Use run_build helper consistently across most bootstrap tests
  This is not super important to do, but the consistency is nice.

  I didn't change any tests that call `configure("dist")` and then override the subcommand - doing
that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor.

Found while working on the "one call to Step for all paths" change mentioned in https://github.com/rust-lang/rust/pull/95503#issuecomment-1105914384, but independent of that work.

cc `@pietroalbini` for the `--exclude` test, git blame says you added support for it originally.

2 years agoRollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 16:00:26 +0000 (18:00 +0200)]
Rollup merge of #96237 - AlecGoncharow:issue-96011-fix, r=Mark-Simulacrum

compiletest: combine `--*-python` args

Since these arguments are now always the same, combine them into a
singular `--python` argument.

Fixes #96011

2 years agoRollup merge of #95504 - jyn514:library-alias, r=Mark-Simulacrum
Matthias Krüger [Sun, 24 Apr 2022 16:00:25 +0000 (18:00 +0200)]
Rollup merge of #95504 - jyn514:library-alias, r=Mark-Simulacrum

Add `x {check,build,doc} {compiler,library}` aliases.

While working on https://github.com/rust-lang/rust/pull/95503, I realized that it will interfere with existing command lines:
Currently people run `x build library/std` expecting it to "add all library crates to the sysroot",
but after that change, it will *only* build `libstd` and its dependencies (and add them to the sysroot), not libtest or libproc_macro.

That will work for local testing in most cases, but could be confusing. Even if not, though, I think `x build library` is more clear about what actually happens than the current `x build library/std`.

The intended end goal is something like:
- For check/build/doc, we have library + compiler aliases, which correspond to basically "most possible" for that piece. This is the intended path of entry (rather than library/test or similar as today) for when you just want the thing to work -- for example, getting a compiler that is "crates.io-compatible" would be roughly `x.py build library`). #95504
- Specific crate invocations build up to that crate, which means that if you don't care about tests you probably want x.py build library/proc_macro or library/std for faster build times. #95503

Note that this is already implemented today for the `doc` command and seems to work pretty well in practice.

I plan to change the dev-guide and various instructions in the README to `build library` once this is merged.

`@rustbot` label +A-rustbuild

2 years agoRollup merge of #94893 - notriddle:notriddle/regression-test-issue-90315, r=Mark...
Matthias Krüger [Sun, 24 Apr 2022 16:00:24 +0000 (18:00 +0200)]
Rollup merge of #94893 - notriddle:notriddle/regression-test-issue-90315, r=Mark-Simulacrum

diagnostics: regression test for `<usize as Iterator>::rev`

Closes #90315

2 years agoAdd type_name info to [TIMING] log output
James Higgins [Sat, 16 Apr 2022 03:32:18 +0000 (00:32 -0300)]
Add type_name info to [TIMING] log output

2 years agodiagnostics: regression test for <usize as Iterator>::rev
Michael Howell [Sat, 12 Mar 2022 20:09:57 +0000 (13:09 -0700)]
diagnostics: regression test for <usize as Iterator>::rev

Closes #90315

2 years agoBless tests
marmeladema [Sun, 24 Apr 2022 15:04:31 +0000 (17:04 +0200)]
Bless tests

2 years agoAuto merge of #96359 - SparrowLii:drop_kind, r=oli-obk
bors [Sun, 24 Apr 2022 12:58:16 +0000 (12:58 +0000)]
Auto merge of #96359 - SparrowLii:drop_kind, r=oli-obk

make `classify_drop_access_kind` iterate

This PR:
1. fixes the FIXME of `classify_drop_access_kind` func in the borrowck part. The process of obtaining `StorageDeadOrDrop` has been changed from recursive to iterative.
2. gets `place_ty` in each iteration, avoid repeatedly getting the `ty` of the same place (O(n^2) => O(n))

2 years agoFix MSVC hang issue
Gary Guo [Sun, 24 Apr 2022 12:13:41 +0000 (13:13 +0100)]
Fix MSVC hang issue

2 years agomake `classify_drop_access_kind` iterate
SparrowLii [Sun, 24 Apr 2022 09:27:05 +0000 (17:27 +0800)]
make `classify_drop_access_kind` iterate

2 years agoRecover missing suggestion part under NLL
marmeladema [Sun, 24 Apr 2022 07:36:23 +0000 (09:36 +0200)]
Recover missing suggestion part under NLL

2 years agoImprove span for `consider adding an explicit lifetime bound` suggestions under NLL
marmeladema [Sat, 23 Apr 2022 22:17:33 +0000 (00:17 +0200)]
Improve span for `consider adding an explicit lifetime bound` suggestions under NLL

Because NLL borrowck is run after typeck, `in_progress_typeck_results`
was always `None` which was preventing the retrieval of the span to which
the suggestion is suppose to add the lifetime bound.

We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure`
so that under NLL, we give the owner id of the current body.

2 years agoAuto merge of #96067 - jsgf:extern-nounused, r=compiler-errors
bors [Sun, 24 Apr 2022 07:17:20 +0000 (07:17 +0000)]
Auto merge of #96067 - jsgf:extern-nounused, r=compiler-errors

Add support for `nounused` --extern flag

This adds `nounused` to the set of extern flags:
`--extern nounused:core=/path/to/core/libcore.rlib`.

The effect of this flag is to suppress `unused-crate-dependencies`
warnings relating to the crate.

2 years agoAdd support for `nounused` --extern flag
Jeremy Fitzhardinge [Thu, 14 Apr 2022 22:09:00 +0000 (15:09 -0700)]
Add support for `nounused` --extern flag

This adds `nounused` to the set of extern flags:
`--extern nounused:core=/path/to/core/libcore.rlib`.

The effect of this flag is to suppress `unused-crate-dependencies`
warnings relating to the crate.

2 years agoBetter handle too many `#` recovery in raw str
Esteban Küber [Sun, 24 Apr 2022 02:44:25 +0000 (19:44 -0700)]
Better handle too many `#` recovery in raw str

Point at all the unnecessary trailing `#`.
Better handle interaction with outer attributes when `;` is missing.

Fix #95030.

2 years agoAuto merge of #96281 - SparrowLii:const_prop, r=wesleywiser
bors [Sun, 24 Apr 2022 01:09:11 +0000 (01:09 +0000)]
Auto merge of #96281 - SparrowLii:const_prop, r=wesleywiser

Optimize `const_prop` mir-opt by accessing `local_decls` through `ecx`

From the FIXME in the impl of `ConstPropagator`. Accessing `local_decls` and `scource_scopes` from `ecx` can reduce `clone` calls and save compile time.
Besides, according to #96213 , the FIXME about writing `layouts` to `ecx` in advance can also be removed.

2 years agoAuto merge of #93970 - cjgillot:novis, r=petrochenkov
bors [Sat, 23 Apr 2022 22:25:51 +0000 (22:25 +0000)]
Auto merge of #93970 - cjgillot:novis, r=petrochenkov

Remove visibility information from HIR

The resolver exports all the necessary visibility information through the `tcx.visibility` query.
This PR stops having a dedicated visibility field in HIR, in order to use this query.
We keep a `vis_span` field for diagnostic purposes.

2 years agoBless pretty-print output.
Camille GILLOT [Mon, 14 Feb 2022 16:39:08 +0000 (17:39 +0100)]
Bless pretty-print output.

2 years agoHash visibilities in crate_hash.
Camille GILLOT [Fri, 18 Feb 2022 21:37:04 +0000 (22:37 +0100)]
Hash visibilities in crate_hash.

2 years agoCompute has_pub_restricted in the resolver.
Camille GILLOT [Mon, 18 Apr 2022 13:35:40 +0000 (15:35 +0200)]
Compute has_pub_restricted in the resolver.

2 years agoMake clippy inspector more precise.
Camille GILLOT [Mon, 14 Feb 2022 12:20:47 +0000 (13:20 +0100)]
Make clippy inspector more precise.

2 years agoFix lints.
Camille GILLOT [Sun, 13 Feb 2022 18:38:36 +0000 (19:38 +0100)]
Fix lints.

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 agoBless incremental tests.
Camille GILLOT [Sun, 13 Feb 2022 11:09:50 +0000 (12:09 +0100)]
Bless incremental tests.

2 years agoDrop vis in Item.
Camille GILLOT [Sun, 13 Feb 2022 10:30:48 +0000 (11:30 +0100)]
Drop vis in Item.

2 years agoDrop vis in ImplItem.
Camille GILLOT [Sun, 13 Feb 2022 09:54:07 +0000 (10:54 +0100)]
Drop vis in ImplItem.

2 years agoDrop vis from ForeignItem.
Camille GILLOT [Sun, 13 Feb 2022 09:29:46 +0000 (10:29 +0100)]
Drop vis from ForeignItem.

2 years agoDrop vis in FieldDef.
Camille GILLOT [Sun, 13 Feb 2022 00:54:13 +0000 (01:54 +0100)]
Drop vis in FieldDef.

2 years agoStop pretty-printing HIR visibility.
Camille GILLOT [Sun, 13 Feb 2022 14:48:01 +0000 (15:48 +0100)]
Stop pretty-printing HIR visibility.

2 years agoStop visiting visibility.
Camille GILLOT [Sun, 13 Feb 2022 14:40:08 +0000 (15:40 +0100)]
Stop visiting visibility.

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 agoUse `run_build` helper consistently across most bootstrap tests
Joshua Nelson [Fri, 22 Apr 2022 02:50:33 +0000 (21:50 -0500)]
Use `run_build` helper consistently across most bootstrap tests

This is not super important to do, but the consistency is nice.

I didn't change any tests that call `configure("dist")` and then override the subcommand - doing
that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor.

2 years agoAdd a test for `--exclude test::XXX`
Joshua Nelson [Fri, 22 Apr 2022 02:29:37 +0000 (21:29 -0500)]
Add a test for `--exclude test::XXX`

I didn't know that the `test::` syntax was valid before, and it doesn't
seem to be documented anywhere. Add a test so it doesn't regress accidentally,
and as executable documentation.

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 agoDon't checkout submodules in bootstrap tests
Joshua Nelson [Fri, 22 Apr 2022 02:27:15 +0000 (21:27 -0500)]
Don't checkout submodules in bootstrap tests

This doesn't cause any tests to fail, and can greatly speed them up.

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 agouse references to avoid function calls
SparrowLii [Fri, 22 Apr 2022 00:42:38 +0000 (08:42 +0800)]
use references to avoid function calls

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)