]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #98145 - ouz-a:some_branch, r=oli-obk
bors [Wed, 13 Jul 2022 14:32:33 +0000 (14:32 +0000)]
Auto merge of #98145 - ouz-a:some_branch, r=oli-obk

Pull Derefer before ElaborateDrops

_Follow up work to #97025 #96549 #96116 #95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? `@oli-obk`

2 years agoAuto merge of #99203 - GuillaumeGomez:rollup-b2re0dv, r=GuillaumeGomez
bors [Wed, 13 Jul 2022 11:10:51 +0000 (11:10 +0000)]
Auto merge of #99203 - GuillaumeGomez:rollup-b2re0dv, r=GuillaumeGomez

Rollup of 10 pull requests

Successful merges:

 - #98789 (rustdoc-json-types: Clean up derives.)
 - #98848 (Build the Clippy book as part of x.py doc)
 - #99020 (check non_exhaustive attr and private fields for transparent types)
 - #99132 (Add some autolabels for A-bootstrap and T-infra)
 - #99148 (Clarify that [iu]size bounds were only defined for the target arch)
 - #99152 (Use CSS variables to handle theming (part 2))
 - #99168 (Add regression test for #74713)
 - #99176 (:arrow_up: rust-analyzer)
 - #99183 (Mention rust-analyzer maintainers when `proc_macro` bridge is changed)
 - #99185 (llvm-wrapper: adapt for LLVM API change)

Failed merges:

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

2 years agoRollup merge of #99185 - krasimirgg:llvm-wrapper-inlineasm, r=nikic
Guillaume Gomez [Wed, 13 Jul 2022 08:38:50 +0000 (10:38 +0200)]
Rollup merge of #99185 - krasimirgg:llvm-wrapper-inlineasm, r=nikic

llvm-wrapper: adapt for LLVM API change

This adapts RustWrapper's ` LLVMRustInlineAsmVerify` for LLVM commit https://github.com/llvm/llvm-project/commit/00797b88e0113aeea03045b18b3f63332f850dfe.

2 years agoRollup merge of #99183 - jonas-schievink:proc_macro-mention-r-a, r=jyn514
Guillaume Gomez [Wed, 13 Jul 2022 08:38:49 +0000 (10:38 +0200)]
Rollup merge of #99183 - jonas-schievink:proc_macro-mention-r-a, r=jyn514

Mention rust-analyzer maintainers when `proc_macro` bridge is changed

rust-analyzer vendors a modified copy of the `proc_macro` crate in order to expand procedural macros built by Cargo. Since the ABI used by proc macros can change, we need to follow along with those changes. Getting notified when the proc macro bridge changes should make that easier, since that's what defines the ABI.

cc ```@rust-lang/wg-rls-2```

2 years agoRollup merge of #99176 - lnicola:rust-analyzer-2022-07-12, r=lnicola
Guillaume Gomez [Wed, 13 Jul 2022 08:38:48 +0000 (10:38 +0200)]
Rollup merge of #99176 - lnicola:rust-analyzer-2022-07-12, r=lnicola

:arrow_up: rust-analyzer

r? ``@ghost``

2 years agoRollup merge of #99168 - TaKO8Ki:add-regression-test-for-74713, r=Dylan-DPC
Guillaume Gomez [Wed, 13 Jul 2022 08:38:47 +0000 (10:38 +0200)]
Rollup merge of #99168 - TaKO8Ki:add-regression-test-for-74713, r=Dylan-DPC

Add regression test for #74713

closes #74713

2 years agoRollup merge of #99152 - GuillaumeGomez:css-theme-var, r=jsha
Guillaume Gomez [Wed, 13 Jul 2022 08:38:46 +0000 (10:38 +0200)]
Rollup merge of #99152 - GuillaumeGomez:css-theme-var, r=jsha

Use CSS variables to handle theming (part 2)

Follow-up of https://github.com/rust-lang/rust/pull/98460.

As usual, there shouldn't be any UI change.

You can test it [here](https://rustdoc.crud.net/imperio/css-theme-var/bar/index.html).

r? `@jsha`

2 years agoRollup merge of #99148 - SOF3:clarify-xsize-bound, r=scottmcm
Guillaume Gomez [Wed, 13 Jul 2022 08:38:45 +0000 (10:38 +0200)]
Rollup merge of #99148 - SOF3:clarify-xsize-bound, r=scottmcm

Clarify that [iu]size bounds were only defined for the target arch

2 years agoRollup merge of #99132 - jyn514:autolabel, r=Mark-Simulacrum
Guillaume Gomez [Wed, 13 Jul 2022 08:38:44 +0000 (10:38 +0200)]
Rollup merge of #99132 - jyn514:autolabel, r=Mark-Simulacrum

Add some autolabels for A-bootstrap and T-infra

2 years agoRollup merge of #99020 - fee1-dead-contrib:repr_transparent_non_exhaustive, r=oli-obk
Guillaume Gomez [Wed, 13 Jul 2022 08:38:43 +0000 (10:38 +0200)]
Rollup merge of #99020 - fee1-dead-contrib:repr_transparent_non_exhaustive, r=oli-obk

check non_exhaustive attr and private fields for transparent types

Fixes #78586.

2 years agoRollup merge of #98848 - flip1995:clippy-book, r=jyn514
Guillaume Gomez [Wed, 13 Jul 2022 08:38:42 +0000 (10:38 +0200)]
Rollup merge of #98848 - flip1995:clippy-book, r=jyn514

Build the Clippy book as part of x.py doc

r? ``@ehuss`` since you said you would be interested in helping moving this forward.

cc ``@jyn514`` as part of the bootstrap team.

2 years agoRollup merge of #98789 - aDotInTheVoid:rjdt-derives, r=jsha
Guillaume Gomez [Wed, 13 Jul 2022 08:38:41 +0000 (10:38 +0200)]
Rollup merge of #98789 - aDotInTheVoid:rjdt-derives, r=jsha

rustdoc-json-types: Clean up derives.

Closes #96189

Everything is `Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize` except `Crate` and `Item` which arn't `Hash`, as they have `HashMap`'s. See linked issue for reasoning.

``@rustbot`` modify labels: +T-rustdoc +A-rustdoc-json

2 years agoAuto merge of #99066 - est31:remove_box_librustdoc, r=jsha
bors [Wed, 13 Jul 2022 08:29:57 +0000 (08:29 +0000)]
Auto merge of #99066 - est31:remove_box_librustdoc, r=jsha

Remove most box syntax from librustdoc

This is the second attempt after the librustdoc specific changes have been reverted from #87781 in #89134, due to a minor, but exant regression caused by the changes. ~~There have been some changes to librustdoc in the past and maybe thanks to them there is no regression any more. If there is still a regression, one can investigate further and maybe find ways to fix the regressions. Thus, i request a perf run.~~ Edit: turns out there is still a regression, but it's caused only by a subset of the changes. So I've changed this PR to only contains the changes that don't cause any performance regressions, keeping the regression causing changes for a later PR.

2 years agoAuto merge of #99149 - ferrocene:pa-nightly-branch, r=Mark-Simulacrum
bors [Wed, 13 Jul 2022 05:24:18 +0000 (05:24 +0000)]
Auto merge of #99149 - ferrocene:pa-nightly-branch, r=Mark-Simulacrum

Configure nightly branch name in `stage0.json`

The beta version number detection code relies on git to know how many merge commits were made since we branched off, and in doing so hardcodes `master` as the default branch name. This works for rust-lang/rust, but is problematic for forks that use a different default branch name (in Ferrocene we use `main` instead).

This PR changes the code to instead load the default branch name from `src/stage0.json`. `bump-stage0` has also been updated to remove the need to update it every time a new field is added to `stage0.json`.

2 years agofix documentation
Deadbeef [Tue, 12 Jul 2022 10:33:52 +0000 (10:33 +0000)]
fix documentation

2 years agoAuto merge of #99101 - RalfJung:interpret-projections, r=oli-obk
bors [Wed, 13 Jul 2022 02:43:25 +0000 (02:43 +0000)]
Auto merge of #99101 - RalfJung:interpret-projections, r=oli-obk

interpret: refactor projection handling code

Moves our projection handling code into a common file, and avoids the use of a
general mplace-based fallback function by have more specialized implementations.

mplace_index (and the other slice-related functions) could be more efficient by
copy-pasting the body of operand_index. Or we could do some trait magic to share
the code between them. But for now this is probably fine.

This is the common part of https://github.com/rust-lang/rust/pull/99013 and https://github.com/rust-lang/rust/pull/99097. I am seeing some strange perf results so this probably should be its own change so we know which diff caused which perf changes...

r? `@oli-obk`

2 years agollvm-wrapper: adapt for LLVM API change
Krasimir Georgiev [Tue, 12 Jul 2022 15:36:28 +0000 (15:36 +0000)]
llvm-wrapper: adapt for LLVM API change

2 years agoMention rust-analyzer maintainers when `proc_macro` bridge is changed
Jonas Schievink [Tue, 12 Jul 2022 15:31:18 +0000 (17:31 +0200)]
Mention rust-analyzer maintainers when `proc_macro` bridge is changed

2 years agoignore wasm=32 & bless
ouz-a [Tue, 12 Jul 2022 13:02:17 +0000 (16:02 +0300)]
ignore wasm=32 & bless

2 years agoAuto merge of #99177 - Dylan-DPC:rollup-m0k9q2w, r=Dylan-DPC
bors [Tue, 12 Jul 2022 11:36:58 +0000 (11:36 +0000)]
Auto merge of #99177 - Dylan-DPC:rollup-m0k9q2w, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #98622 (rustc_target: Flip the default for `TargetOptions::executables` to true)
 - #98633 (Fix last `let_chains` blocker)
 - #98972 (Suggest adding a missing zero to a floating point number)
 - #99038 (Some more `EarlyBinder` cleanups)
 - #99154 (use PlaceRef::iter_projections to fix old FIXME)
 - #99171 (Put back UI test regex)

Failed merges:

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

2 years agoRollup merge of #99171 - GuillaumeGomez:rustdoc-ui-test-regex, r=Dylan-DPC
Dylan DPC [Tue, 12 Jul 2022 11:36:36 +0000 (17:06 +0530)]
Rollup merge of #99171 - GuillaumeGomez:rustdoc-ui-test-regex, r=Dylan-DPC

Put back UI test regex

I just realized I overwrote these two commits in https://github.com/rust-lang/rust/pull/99055 when force pushing to fix the stdout output...

r? `@Dylan-DPC`

2 years agoRollup merge of #99154 - rosehuds:master, r=cjgillot
Dylan DPC [Tue, 12 Jul 2022 11:36:35 +0000 (17:06 +0530)]
Rollup merge of #99154 - rosehuds:master, r=cjgillot

use PlaceRef::iter_projections to fix old FIXME

I added this function in 53481a5a8fde83ed1a5d7e8302be028a4c7d8da5

2 years agoRollup merge of #99038 - jackh726:earlybinder-cleanup, r=lcnr
Dylan DPC [Tue, 12 Jul 2022 11:36:34 +0000 (17:06 +0530)]
Rollup merge of #99038 - jackh726:earlybinder-cleanup, r=lcnr

Some more `EarlyBinder` cleanups

First commit has a couple unrelated cleanups, but otherwise each commit is self-explanatory

r? rust-lang/types

2 years agoRollup merge of #98972 - TaKO8Ki:suggest-adding-missing-zero-to-floating-point-number...
Dylan DPC [Tue, 12 Jul 2022 11:36:33 +0000 (17:06 +0530)]
Rollup merge of #98972 - TaKO8Ki:suggest-adding-missing-zero-to-floating-point-number, r=compiler-errors

Suggest adding a missing zero to a floating point number

fixes #98836

2 years agoRollup merge of #98633 - c410-f3r:yet-another-let-chain, r=estebank
Dylan DPC [Tue, 12 Jul 2022 11:36:33 +0000 (17:06 +0530)]
Rollup merge of #98633 - c410-f3r:yet-another-let-chain, r=estebank

Fix last `let_chains` blocker

In order to forbid things like `let x = (let y = 1);` or `if let a = 1 && { let x = let y = 1; } {}`, the parser **HAS** to know the context of `let`.

This context thing is not a surprise in the parser because you can see **a lot** of ad hoc fixes mixing parsing logic with validation logic creating code that looks more like spaghetti with tomato sauce.

To make things even greater, a new ad hoc fix was added to only allow `let`s in a valid `let_chains` context by checking the previously processed token. This was the only solution I could think of and believe me, I thought about it for a long time 👍

In the long term, it should be preferable to segregate different responsibilities or create a more robust and cleaner parser framework.

cc https://github.com/rust-lang/rust/pull/94927
cc https://github.com/rust-lang/rust/issues/53667

2 years agoRollup merge of #98622 - petrochenkov:executables, r=oli-obk
Dylan DPC [Tue, 12 Jul 2022 11:36:32 +0000 (17:06 +0530)]
Rollup merge of #98622 - petrochenkov:executables, r=oli-obk

rustc_target: Flip the default for `TargetOptions::executables` to true

This flag is true for most targets and the remaining targets may be mistakes.

2 years agoadd new rval, pull deref early
ouz-a [Mon, 13 Jun 2022 13:37:41 +0000 (16:37 +0300)]
add new rval, pull deref early

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Tue, 12 Jul 2022 11:18:31 +0000 (14:18 +0300)]
:arrow_up: rust-analyzer

2 years agoadd more tests
Deadbeef [Sun, 10 Jul 2022 13:31:58 +0000 (13:31 +0000)]
add more tests

2 years agocheck non_exhaustive attr and private fields for transparent types
Deadbeef [Thu, 7 Jul 2022 16:55:41 +0000 (16:55 +0000)]
check non_exhaustive attr and private fields for transparent types

2 years agoUpdate -zhelp and -chelp rustdoc-ui tests to use regex-error-pattern
Guillaume Gomez [Tue, 12 Jul 2022 09:20:36 +0000 (11:20 +0200)]
Update -zhelp and -chelp rustdoc-ui tests to use regex-error-pattern

2 years agoAdd regex-error-pattern flag in compiletest
Guillaume Gomez [Tue, 12 Jul 2022 09:19:52 +0000 (11:19 +0200)]
Add regex-error-pattern flag in compiletest

2 years agoadd regression test for #74713
Takayuki Maeda [Tue, 12 Jul 2022 05:21:09 +0000 (14:21 +0900)]
add regression test for #74713

2 years agoimplement a suggestion for a floating point number with a type suffix
Takayuki Maeda [Tue, 12 Jul 2022 04:59:51 +0000 (13:59 +0900)]
implement a suggestion for a floating point number with a type suffix

2 years agouse a loop rather than try_fold
Ralf Jung [Mon, 11 Jul 2022 17:42:08 +0000 (13:42 -0400)]
use a loop rather than try_fold

2 years agointerpret: refactor projection handling code
Ralf Jung [Mon, 4 Jul 2022 12:48:05 +0000 (08:48 -0400)]
interpret: refactor projection handling code

Moves our projection handling code into a common file, and avoids the use of a
general mplace-based fallback function by have more specialized implementations.

mplace_index (and the other slice-related functions) could be more efficient by
copy-pasting the body of operand_index. Or we could do some trait magic to share
the code between them. But for now this is probably fine.

2 years agoAuto merge of #99165 - matthiaskrgr:rollup-rqpelfa, r=matthiaskrgr
bors [Tue, 12 Jul 2022 00:25:45 +0000 (00:25 +0000)]
Auto merge of #99165 - matthiaskrgr:rollup-rqpelfa, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #97210 (Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`)
 - #99055 (Fix rustdoc help options)
 - #99075 (Fix duplicated type annotation suggestion)
 - #99124 (Fix sized check ICE in asm check)
 - #99142 (fix(doctest): treat fatal parse errors as incomplete attributes)
 - #99145 (Don't rerun the build script for the compiler each time on non-windows platforms)
 - #99146 (Do not error during method probe on `Sized` predicates for types that aren't the method receiver)
 - #99161 (compiletest: trim edition before passing as flag)

Failed merges:

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

2 years agoRemove box syntax from Box<BareFunctionDecl> construction
est31 [Sun, 10 Jul 2022 22:13:21 +0000 (00:13 +0200)]
Remove box syntax from Box<BareFunctionDecl> construction

The type has 144 bytes according to compiler internal rustdoc.

2 years agoRemove box syntax for Box<rustdoc::clean::types::Type> construction
est31 [Sun, 10 Jul 2022 21:59:33 +0000 (23:59 +0200)]
Remove box syntax for Box<rustdoc::clean::types::Type> construction

The type has 80 bytes according to compiler internal rustdoc.

2 years agoRemove box syntax for Box<ImplItem> construction
est31 [Sun, 10 Jul 2022 21:42:47 +0000 (23:42 +0200)]
Remove box syntax for Box<ImplItem> construction

ImplItem only has 80 bytes according to compiler internal rustdoc.

2 years agoRemove box syntax for Box<Attributes> construction
est31 [Sun, 10 Jul 2022 21:49:33 +0000 (23:49 +0200)]
Remove box syntax for Box<Attributes> construction

Attributes only has 48 bytes according to compiler internal rustdoc.

2 years agoRemove box syntax from Box<dyn Iterator> construction
est31 [Sun, 10 Jul 2022 22:16:01 +0000 (00:16 +0200)]
Remove box syntax from Box<dyn Iterator> construction

The iterators created should be pretty light weight.

2 years agoRollup merge of #99161 - fee1-dead-contrib:compile-test-edition-trim, r=jyn514
Matthias Krüger [Mon, 11 Jul 2022 20:39:10 +0000 (22:39 +0200)]
Rollup merge of #99161 - fee1-dead-contrib:compile-test-edition-trim, r=jyn514

compiletest: trim edition before passing as flag

This makes `edition: 2021` work instead of the ugly
`edition:2021` one has to write.

2 years agoRollup merge of #99146 - compiler-errors:issue-61525, r=lcnr
Matthias Krüger [Mon, 11 Jul 2022 20:39:09 +0000 (22:39 +0200)]
Rollup merge of #99146 - compiler-errors:issue-61525, r=lcnr

Do not error during method probe on `Sized` predicates for types that aren't the method receiver

Fixes #61525

This is safe even though we're skipping an error because we end up confirming the method, which means we're still checking the `Sized` predicate in the end. It just means that we don't emit an erroneous message as below:

```
error: the `query` method cannot be invoked on a trait object
  --> src/lib.rs:14:11
   |
14 |         1.query::<dyn ToString>("")
   |           ^^^^^
   |
   = note: another candidate was found in the following trait, perhaps add a `use` for it:
           `use crate::Example;`
```

Also fixes erroneously suggesting the same trait over again, as seen in the `issue-35976.rs` UI test.

2 years agoRollup merge of #99145 - jyn514:dont-rerun-build-script, r=wesleywiser
Matthias Krüger [Mon, 11 Jul 2022 20:39:08 +0000 (22:39 +0200)]
Rollup merge of #99145 - jyn514:dont-rerun-build-script, r=wesleywiser

Don't rerun the build script for the compiler each time on non-windows platforms

In practice, this doesn't matter very much because the script takes ~no time to run.
But this makes `CARGO_LOG=info` easier to read, and theoretically saves a few milliseconds.

2 years agoRollup merge of #99142 - notriddle:notriddle/doctest-multiline-crate-attributes,...
Matthias Krüger [Mon, 11 Jul 2022 20:39:07 +0000 (22:39 +0200)]
Rollup merge of #99142 - notriddle:notriddle/doctest-multiline-crate-attributes, r=GuillaumeGomez

fix(doctest): treat fatal parse errors as incomplete attributes

Fixes #99089

2 years agoRollup merge of #99124 - compiler-errors:issue-99122, r=oli-obk
Matthias Krüger [Mon, 11 Jul 2022 20:39:06 +0000 (22:39 +0200)]
Rollup merge of #99124 - compiler-errors:issue-99122, r=oli-obk

Fix sized check ICE in asm check

Fixes (beta nominated, so doesn't close) #99122

1. Moves a check for unresolved inference variables to _before_ other checks that could possibly ICE. We're not changing behavior here, just doing the same thing earlier in the function.
2. Erases region variables in sized check (which are not resolved at this point) because rustc will also ICE when region vars are passed to a query which does not canonicalize them.

2 years agoRollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkov
Matthias Krüger [Mon, 11 Jul 2022 20:39:05 +0000 (22:39 +0200)]
Rollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkov

Fix duplicated type annotation suggestion

Before, there was more or less duplicated suggestions to add type hints.
Fix by clearing more generic suggestions when a more specific suggestion
is possible.

This fixes #93506 .

2 years agoRollup merge of #99055 - GuillaumeGomez:rustdoc-help-options, r=jyn514
Matthias Krüger [Mon, 11 Jul 2022 20:39:04 +0000 (22:39 +0200)]
Rollup merge of #99055 - GuillaumeGomez:rustdoc-help-options, r=jyn514

Fix rustdoc help options

Fixes #98976.

Since you're the one who found out about the problem and also provided the solution (thanks for both!):

r? ```@jyn514```

2 years agoRollup merge of #97210 - Milo123459:clippy-args, r=jyn514
Matthias Krüger [Mon, 11 Jul 2022 20:39:03 +0000 (22:39 +0200)]
Rollup merge of #97210 - Milo123459:clippy-args, r=jyn514

Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`

Resolves #97059

This PR adds support for `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`.

2 years agoAuto merge of #96978 - lqd:win_pgo2, r=Mark-Simulacrum
bors [Mon, 11 Jul 2022 20:32:06 +0000 (20:32 +0000)]
Auto merge of #96978 - lqd:win_pgo2, r=Mark-Simulacrum

Utilize PGO for windows x64 rustc dist builds

This PR adds PGO support for the CI x64 windows dist builds.

These are the results from running the rustc-perf benchmarks:
![image](https://user-images.githubusercontent.com/247183/177662869-683a8034-7c95-42bf-9900-9ffd66677fcf.png)

Thanks to `@Kobzol,` `@michaelwoerister,` `@wesleywiser,` `@Mark-Simulacrum` for their precious help.

2 years agorustc_target: Flip the default for `TargetOptions::executables` to true
Vadim Petrochenkov [Tue, 28 Jun 2022 13:34:07 +0000 (16:34 +0300)]
rustc_target: Flip the default for `TargetOptions::executables` to true

Also change `executables` to true for linux-kernel and windows-uwp-gnu targets

2 years agoFix sized check ICE in intrisicck
Michael Goulet [Sun, 10 Jul 2022 18:55:38 +0000 (18:55 +0000)]
Fix sized check ICE in intrisicck

2 years agoAuto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkov
bors [Mon, 11 Jul 2022 17:09:37 +0000 (17:09 +0000)]
Auto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkov

Create fresh lifetime parameters for bare fn trait too

The current code fails to account for the equivalence between `dyn FnMut(&mut u8)` and bare `FnMut(&mut u8)`, and treated them differently.

This PR introduces a special case for `Fn` traits, which are always fully resolved.

Fixes #98616
Fixes #98726
This will require a beta-backport, as beta contains that bug.

r? `@petrochenkov`

2 years agocompiletest: trim edition before passing as flag
Deadbeef [Mon, 11 Jul 2022 16:41:32 +0000 (16:41 +0000)]
compiletest: trim edition before passing as flag

This makes `edition: 2021` work instead of the ugly
`edition:2021` one has to write.

2 years agointroduce PGO on the `dist-x86_64-msvc` builder
Rémy Rakic [Tue, 14 Jun 2022 19:02:26 +0000 (21:02 +0200)]
introduce PGO on the `dist-x86_64-msvc` builder

This adds windows-specific behavior into the PGO script, and enables it
on CI.

2 years agomake linux PGO script more generic
Rémy Rakic [Tue, 14 Jun 2022 20:19:07 +0000 (22:19 +0200)]
make linux PGO script more generic

This extracts the linux-isms into variables, so that the script can be
extended to do PGO on windows. These variables will be overriden in a
few spots, in windows-specific blocks.

2 years agoplaceholders -> inference vars in comment
Jack Huey [Mon, 11 Jul 2022 13:52:25 +0000 (09:52 -0400)]
placeholders -> inference vars in comment

2 years agoextend bootstrap for PGO on windows
Rémy Rakic [Mon, 16 May 2022 01:40:52 +0000 (03:40 +0200)]
extend bootstrap for PGO on windows

When building LLVM/LLD as part of a build that asks LLVM to generate profiles, e.g. when
doing PGO, cmake or clang-cl don't automatically link clang's profiler runtime in,
causing undefined reference errors at link-time.

We do that manually, by adding clang's resource library folder to the library search path:
- for LLVM itself, by extending the linker args that `rustc_llvm`'s build script
  uses, to avoid the linker errors when linking `rustc_driver`.
- for LLD, by extending cmake's linker flags during the LLD build step.

2 years agouse PlaceRef::iter_projections to fix old FIXME
Rose Hudson [Mon, 11 Jul 2022 13:42:49 +0000 (14:42 +0100)]
use PlaceRef::iter_projections to fix old FIXME

I added this function in 53481a5a8fde83ed1a5d7e8302be028a4c7d8da5

2 years agobump CI LLVM to 14.0.5
Rémy Rakic [Fri, 13 May 2022 07:22:36 +0000 (09:22 +0200)]
bump CI LLVM to 14.0.5

The version 14.0.2 we currently use is busted on windows at the very
least.

2 years agoContinue themes CSS migration over CSS variables
Guillaume Gomez [Mon, 11 Jul 2022 12:51:39 +0000 (14:51 +0200)]
Continue themes CSS migration over CSS variables

2 years agoRemove unused CSS rules
Guillaume Gomez [Mon, 11 Jul 2022 13:01:03 +0000 (15:01 +0200)]
Remove unused CSS rules

2 years agoAuto merge of #99151 - Dylan-DPC:rollup-40aqkxy, r=Dylan-DPC
bors [Mon, 11 Jul 2022 12:16:20 +0000 (12:16 +0000)]
Auto merge of #99151 - Dylan-DPC:rollup-40aqkxy, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #98882 (explain doc comments in macros a bit)
 - #98907 (Deny float const params even when `adt_const_params` is enabled)
 - #99091 (Do not mention private types from other crates as impl candidates)
 - #99140 (Implement `SourceMap::is_span_accessible`)
 - #99147 (Mention similarly named associated type even if it's not clearly in supertrait)

Failed merges:

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

2 years agoRollup merge of #99147 - compiler-errors:issue-55673, r=lcnr
Dylan DPC [Mon, 11 Jul 2022 09:49:33 +0000 (15:19 +0530)]
Rollup merge of #99147 - compiler-errors:issue-55673, r=lcnr

Mention similarly named associated type even if it's not clearly in supertrait

Due to query cycle avoidance, we sometimes restrict the candidates in `complain_about_assoc_type_not_found` too much so that we can't detect typo replacements from just supertraits.

This creates a more general note of the existence of a similarly named associated type from _all_ visible traits when possible.

Fixes #55673

2 years agoRollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-dead
Dylan DPC [Mon, 11 Jul 2022 09:49:32 +0000 (15:19 +0530)]
Rollup merge of #99140 - TaKO8Ki:implement-is-accessible-span, r=fee1-dead

Implement `SourceMap::is_span_accessible`

This patch adds `SourceMap::is_span_accessible` and replaces `span_to_snippet(span).is_ok()` and `span_to_snippet(span).is_err()` with it. This removes a `&str` to `String` conversion.

2 years agoRollup merge of #99091 - compiler-errors:private-types-should-stay-private, r=lcnr
Dylan DPC [Mon, 11 Jul 2022 09:49:31 +0000 (15:19 +0530)]
Rollup merge of #99091 - compiler-errors:private-types-should-stay-private, r=lcnr

Do not mention private types from other crates as impl candidates

Fixes #99080

2 years agoRollup merge of #98907 - compiler-errors:plz-no-float, r=oli-obk
Dylan DPC [Mon, 11 Jul 2022 09:49:30 +0000 (15:19 +0530)]
Rollup merge of #98907 - compiler-errors:plz-no-float, r=oli-obk

Deny float const params even when `adt_const_params` is enabled

Supersedes #98825
Fixes #98813

r? ``@oli-obk``

2 years agoRollup merge of #98882 - compiler-errors:explain-doc-comments-in-macros, r=davidtwco
Dylan DPC [Mon, 11 Jul 2022 09:49:29 +0000 (15:19 +0530)]
Rollup merge of #98882 - compiler-errors:explain-doc-comments-in-macros, r=davidtwco

explain doc comments in macros a bit

Open to suggestions on improving this... macro parsing is very foreign to me.

Should we have a structured suggestion to turn them into their regular non-doc comments?

Fixes #92846
Fixes #97850

2 years agoAuto merge of #97841 - nvzqz:inline-encode-wide, r=thomcc
bors [Mon, 11 Jul 2022 09:30:54 +0000 (09:30 +0000)]
Auto merge of #97841 - nvzqz:inline-encode-wide, r=thomcc

Inline Windows `OsStrExt::encode_wide`

User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.

2 years agoAdd tests for -Chelp and -Zhelp
Guillaume Gomez [Fri, 8 Jul 2022 13:38:09 +0000 (15:38 +0200)]
Add tests for -Chelp and -Zhelp

2 years agoFix rustdoc -Zhelp and -Chelp options
Guillaume Gomez [Fri, 8 Jul 2022 13:37:44 +0000 (15:37 +0200)]
Fix rustdoc -Zhelp and -Chelp options

2 years ago configure nightly branch name in stage0.json
Pietro Albini [Mon, 11 Jul 2022 08:15:13 +0000 (10:15 +0200)]
 configure nightly branch name in stage0.json

2 years agoremove the need to update bump-stage0 with new stage0 config fields
Pietro Albini [Thu, 30 Jun 2022 07:54:51 +0000 (09:54 +0200)]
remove the need to update bump-stage0 with new stage0 config fields

2 years agorename a method
Takayuki Maeda [Mon, 11 Jul 2022 07:51:19 +0000 (16:51 +0900)]
rename a method

2 years agoclippy argument support
Milo [Mon, 11 Jul 2022 07:42:10 +0000 (07:42 +0000)]
clippy argument support

2 years agoClarify that [iu]size bounds were only defined for the target arch
SOFe [Mon, 11 Jul 2022 07:05:00 +0000 (15:05 +0800)]
Clarify that [iu]size bounds were only defined for the target arch

2 years agoUse Visibility::is_accessible_from to make suggestion more specific
Michael Goulet [Mon, 11 Jul 2022 07:06:18 +0000 (07:06 +0000)]
Use Visibility::is_accessible_from to make suggestion more specific

2 years agoDo not mention private Self types from other crates
Michael Goulet [Sat, 9 Jul 2022 18:39:51 +0000 (18:39 +0000)]
Do not mention private Self types from other crates

2 years agoMention similarly named associated type even if it's not clearly in supertrait
Michael Goulet [Mon, 11 Jul 2022 06:53:01 +0000 (06:53 +0000)]
Mention similarly named associated type even if it's not clearly in supertrait

2 years agoAuto merge of #98369 - jyn514:configure.py, r=Mark-Simulacrum
bors [Mon, 11 Jul 2022 06:37:20 +0000 (06:37 +0000)]
Auto merge of #98369 - jyn514:configure.py, r=Mark-Simulacrum

Remove unsupported options in configure.py

I've seen people using `optimize = false` and `full-bootstrap = true` in the past, without knowing
that they're not recommended. Remove `optimize` and a few other options that are always a bad idea,
and document that full-bootstrap is only for testing reproducible builds.

2 years agoDo not suggest same trait over again
Michael Goulet [Mon, 11 Jul 2022 05:21:41 +0000 (05:21 +0000)]
Do not suggest same trait over again

2 years agoUse fake substs to check for `Self: Sized` predicates on method receivers
Michael Goulet [Mon, 11 Jul 2022 05:20:37 +0000 (05:20 +0000)]
Use fake substs to check for `Self: Sized` predicates on method receivers

2 years agoDon't rerun the build script for the compiler each time on linux
Joshua Nelson [Mon, 11 Jul 2022 04:57:25 +0000 (23:57 -0500)]
Don't rerun the build script for the compiler each time on linux

In practice, this doesn't matter very much because the script takes ~no time to run.
But this makes `CARGO_LOG=info` easier to read, and theoretically saves a few milliseconds.

2 years agofix(doctest): treat fatal parse errors as incomplete attributes
Michael Howell [Mon, 11 Jul 2022 03:58:54 +0000 (20:58 -0700)]
fix(doctest): treat fatal parse errors as incomplete attributes

Fixes #99089

2 years agoAuto merge of #99130 - jyn514:std-cache-invalidation, r=Mark-Simulacrum
bors [Mon, 11 Jul 2022 03:56:37 +0000 (03:56 +0000)]
Auto merge of #99130 - jyn514:std-cache-invalidation, r=Mark-Simulacrum

Fix `x build library/std compiler/rustc`

Previously, this was broken because of improper caching:
1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro`
1. `Std` calls `builder.ensure(StdLink)`
1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro`
1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing.  <-- bug is here
1. Cargo gives an error that `proc_macro` doesn't exist.

This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are built change.

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

2 years agoimplement `is_accessible_span`
Takayuki Maeda [Mon, 11 Jul 2022 02:36:15 +0000 (11:36 +0900)]
implement `is_accessible_span`

2 years agoAuto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrum
bors [Mon, 11 Jul 2022 01:15:47 +0000 (01:15 +0000)]
Auto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrum

Allow using `download-ci-llvm = true` outside the git checkout

`@bjorn3` noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled:
```
$ ./rust2/x.py build
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version"
expected success, got: exit status: 128', src/bootstrap/native.rs:134:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Support it too for consistency. It's unclear to me when anyone would need to use this, but `@bjorn3`
feels we should support it, and it's not much additional effort to get it working.

2 years agoDeny floats even when adt_const_params is enabled
Michael Goulet [Mon, 4 Jul 2022 23:44:41 +0000 (23:44 +0000)]
Deny floats even when adt_const_params is enabled

2 years agouse subdiagnostic for message
Michael Goulet [Fri, 8 Jul 2022 03:21:49 +0000 (03:21 +0000)]
use subdiagnostic for message

2 years agoexplain doc comments in macros a bit
Michael Goulet [Mon, 4 Jul 2022 08:42:40 +0000 (08:42 +0000)]
explain doc comments in macros a bit

2 years agoFix `x build library/std compiler/rustc`
Joshua Nelson [Sun, 10 Jul 2022 22:24:43 +0000 (17:24 -0500)]
Fix `x build library/std compiler/rustc`

Previously, this was broken because of improper caching:
1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro`
1. `Std` calls `builder.ensure(StdLink)`
1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro`
1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing.  <-- bug is here
1. Cargo gives an error that `proc_macro` doesn't exist.

This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are
built change.  This also does the same for `RustcLink`; it doesn't matter in practice currently
because nothing uses it except `impl Step for Rustc`, but it will avoid bugs if we start using it in
the future (e.g. to build individual crates for rustfmt).

2 years agoAuto merge of #99133 - matthiaskrgr:rollup-eignphd, r=matthiaskrgr
bors [Sun, 10 Jul 2022 22:34:50 +0000 (22:34 +0000)]
Auto merge of #99133 - matthiaskrgr:rollup-eignphd, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #98713 (promote placeholder bounds to 'static obligations)
 - #99094 (Remove extra space in AtomicPtr::new docs)
 - #99095 (Remove duplicate notes from error on inter-crate ambiguous impl of traits)
 - #99114 (Group .test-arrow CSS rules and fix rgb/rgba property)
 - #99128 (Fix `download-ci-llvm` NixOS patching for binaries)

Failed merges:

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

2 years agoRemove box syntax from doctest.rs
est31 [Sun, 10 Jul 2022 22:05:19 +0000 (00:05 +0200)]
Remove box syntax from doctest.rs

Doctests are fairly cold code, so even if there
is a regression, which i doubt, it won't matter.

2 years agoRemove box syntax from Box<function pointer> construction
est31 [Sun, 10 Jul 2022 22:25:25 +0000 (00:25 +0200)]
Remove box syntax from Box<function pointer> construction

The function pointer should be extremely small, close to pointer size.

2 years agoRollup merge of #99128 - oxalica:fix/ci-llvm-patchelf, r=jyn514
Matthias Krüger [Sun, 10 Jul 2022 22:33:51 +0000 (00:33 +0200)]
Rollup merge of #99128 - oxalica:fix/ci-llvm-patchelf, r=jyn514

Fix `download-ci-llvm` NixOS patching for binaries

LLVM tools should also be patched, since they are used in some tests, specially,
- src/test/run-make-fulldeps/cross-lang-lto (llvm-ar)
- src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs (llvm-ar)
- src/test/run-make-fulldeps/issue-64153 (llvm-objdump)

To be more future proof, we should patch all binaries in `bin`, which is done in this PR.

2 years agoRollup merge of #99114 - GuillaumeGomez:css-cleanup, r=Dylan-DPC
Matthias Krüger [Sun, 10 Jul 2022 22:33:50 +0000 (00:33 +0200)]
Rollup merge of #99114 - GuillaumeGomez:css-cleanup, r=Dylan-DPC

Group .test-arrow CSS rules and fix rgb/rgba property

Surprisingly, the web browsers were handling the `rgb`/`rgba` typo correctly. At least it now is as expected.

For the rest, it's simply grouping `.test-arrow` rules.

r? ``@Dylan-DPC``

2 years agoRollup merge of #99095 - rhysd:issue-99092, r=compiler-errors
Matthias Krüger [Sun, 10 Jul 2022 22:33:49 +0000 (00:33 +0200)]
Rollup merge of #99095 - rhysd:issue-99092, r=compiler-errors

Remove duplicate notes from error on inter-crate ambiguous impl of traits

Fixes #99092

2 years agoRollup merge of #99094 - AldaronLau:atomic-ptr-extra-space, r=Dylan-DPC
Matthias Krüger [Sun, 10 Jul 2022 22:33:48 +0000 (00:33 +0200)]
Rollup merge of #99094 - AldaronLau:atomic-ptr-extra-space, r=Dylan-DPC

Remove extra space in AtomicPtr::new docs

2 years agoRollup merge of #98713 - nikomatsakis:issue-98693, r=jackh726
Matthias Krüger [Sun, 10 Jul 2022 22:33:47 +0000 (00:33 +0200)]
Rollup merge of #98713 - nikomatsakis:issue-98693, r=jackh726

promote placeholder bounds to 'static obligations

In NLL, when we are promoting a bound out from a closure, if we have a requirement that `T: 'a` where `'a` is in a higher universe, we were previously ignoring that, which is totally wrong. We should be promoting those constraints to `'static`, since universes are not expressible across closure boundaries.

Fixes #98693

~~(Marking as WIP because I'm still running tests, haven't add the new test, etc)~~

r? ``@jackh726``