Commit Graph

172223 Commits

Author SHA1 Message Date
Guillaume Gomez
b95b1389c5 Add tests for JSON non-inlining 2022-07-16 13:39:38 +02:00
Guillaume Gomez
3c55a26cb4 Correctly handle usage of private items in public API for JSON output format 2022-07-16 13:39:38 +02:00
Guillaume Gomez
1a15c7147f Fix rustdoc JSON inline 2022-07-16 13:39:38 +02:00
bors
0ed9c64c3e Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiser
Rename `debugging_opts` to `unstable_opts`

This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.

cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options

r? `@Amanieu` cc `@nikic` `@joshtriplett`
2022-07-14 08:14:31 +00:00
bors
431c6f8499 Auto merge of #99225 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in b1dd22e668af5279e13a071ad4b17435bd6bfa4c..8827baaa781b37872134c1ba692a6f0aeb37890e
2022-07-09 14:48:50 +0000 to 2022-07-14 02:56:51 +0000
- Add a test for regressions in selecting the correct workspace root (rust-lang/cargo#10862)
- clarify profile used for 'cargo install --debug' (rust-lang/cargo#10861)
- servers should use 404 (rust-lang/cargo#10860)
- test(add): Ensure comments are preserved (rust-lang/cargo#10849)
- Fix nested workspace resolution (rust-lang/cargo#10846)
- Small tweaks to the future-incompat docs. (rust-lang/cargo#10856)
- Fixed extra period typo (rust-lang/cargo#10847)
2022-07-14 05:07:22 +00:00
Eric Huss
8d06175b7c Update cargo 2022-07-13 21:25:48 -07:00
bors
8a392a5992 Auto merge of #98754 - jyn514:non-trivial-drop, r=compiler-errors
Fix drop-tracking ICE when a struct containing a field with a significant drop is used across an await

Previously, drop-tracking would incorrectly assume the struct would be dropped immediately, which was not true.

Fixes #98476. Also fixes https://github.com/rust-lang/rust/issues/98477, I think because the parent HIR node for type variables is the whole function instead of the expression where the variable is used.

r? `@eholk`
2022-07-14 02:22:48 +00:00
bors
cbb07c27a4 Auto merge of #97995 - RalfJung:union-more-nodrop, r=Mark-Simulacrum
allow unions with mutable references and tuples of allowed types

We currently allow shared references in unions, but not mutable references. That seems somewhat inconsistent. So let's allow all references, and while we are at it, let's make sure the set of allowed types is closed under tuples.

This will need T-lang FCP (at least).

Then remove the `tagged_unions` feature, since we do not plan to stabilize any more of it.
Closes https://github.com/rust-lang/rust/issues/55149
2022-07-13 23:42:05 +00:00
Joshua Nelson
3c9765cff1 Rename debugging_opts to unstable_opts
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
2022-07-13 17:47:06 -05:00
Ralf Jung
07fe9882cc add array tests, cleanup, tidy, and bless 2022-07-13 18:31:29 -04:00
Ralf Jung
e4593ef0f2 assigning to a union field can never drop now 2022-07-13 18:27:28 -04:00
Ralf Jung
5bf6017b87 remove untagged_union feature gate 2022-07-13 18:27:28 -04:00
Ralf Jung
6dfede3b9d also allow arrays of allowed types 2022-07-13 18:27:28 -04:00
Ralf Jung
ec7152cdf6 allow unions with mutable references and tuples of allowed types 2022-07-13 18:27:28 -04:00
Ralf Jung
848d23b57b factor 'is this type allowed as union field on stable' into separate function 2022-07-13 18:27:28 -04:00
bors
87588a2afd Auto merge of #99136 - CAD97:layout-faster, r=scottmcm
Take advantage of known-valid-align in layout.rs

An attempt to improve perf by `@nnethercote's` approach suggested in #99117
2022-07-13 21:01:20 +00:00
bors
c80dde43f9 Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #98574 (Lower let-else in MIR)
 - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside)
 - #99030 (diagnostics: error messages when struct literals fail to parse)
 - #99155 (Keep unstable target features for asm feature checking)
 - #99199 (Refactor: remove an unnecessary `span_to_snippet`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-13 17:13:27 +00:00
bors
42bd138126 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`
2022-07-13 14:32:33 +00:00
Dylan DPC
3933b2b310
Rollup merge of #99199 - TaKO8Ki:remove-unnecessary-span-to-snippet, r=cjgillot
Refactor: remove an unnecessary `span_to_snippet`

`span_suggestion_hidden` does not show the suggested code and the suggestion is used just for rustfix, so `span_to_snippet` is unnecessary here.
2022-07-13 19:32:37 +05:30
Dylan DPC
68cfdbb5c1
Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwco
Keep unstable target features for asm feature checking

Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-13 19:32:36 +05:30
Dylan DPC
980579a5e9
Rollup merge of #99030 - rust-lang:notriddle/field-recovery, r=petrochenkov
diagnostics: error messages when struct literals fail to parse

If an expression is supplied where a field is expected, the parser can become convinced that it's a shorthand field syntax when it's not.

This PR addresses it by explicitly recording the permitted `:` token immediately after the identifier, and also adds a suggestion to insert the name of the field if it looks like a complex expression.

Fixes #98917
2022-07-13 19:32:35 +05:30
Dylan DPC
1e7d04b23b
Rollup merge of #99011 - oli-obk:UnsoundCell, r=eddyb
`UnsafeCell` blocks niches inside its nested type from being available outside

fixes #87341

This implements the plan by `@eddyb` in https://github.com/rust-lang/rust/issues/87341#issuecomment-886083646

Somewhat related PR (not strictly necessary, but that cleanup made this PR simpler): #94527
2022-07-13 19:32:34 +05:30
Dylan DPC
0083cd2fd4
Rollup merge of #98574 - dingxiangfei2009:let-else-thir, r=oli-obk
Lower let-else in MIR

This MR will switch to lower let-else statements in MIR building instead.

To lower let-else in MIR, we build a mini-switch two branches. One branch leads to the matching case, and the other leads to the `else` block. This arrangement will allow temporary lifetime analysis running as-is so that the temporaries are properly extended according to the same rule applied to regular `let` statements.

cc https://github.com/rust-lang/rust/issues/87335

Fix #98672
2022-07-13 19:32:33 +05:30
bors
ca4e39400e 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 (⬆️ 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
2022-07-13 11:10:51 +00:00
Oli Scherer
519c07b3ce Limit test to x86 targets for reproducability 2022-07-13 10:11:35 +00:00
Guillaume Gomez
f290811aaf
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 00797b88e0.
2022-07-13 10:38:50 +02:00
Guillaume Gomez
3eb8198cf8
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```
2022-07-13 10:38:49 +02:00
Guillaume Gomez
660fcaab6b
Rollup merge of #99176 - lnicola:rust-analyzer-2022-07-12, r=lnicola
⬆️ rust-analyzer

r? ``@ghost``
2022-07-13 10:38:48 +02:00
Guillaume Gomez
75d03d6e92
Rollup merge of #99168 - TaKO8Ki:add-regression-test-for-74713, r=Dylan-DPC
Add regression test for #74713

closes #74713
2022-07-13 10:38:47 +02:00
Guillaume Gomez
3b30cce56a
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`
2022-07-13 10:38:46 +02:00
Guillaume Gomez
41eb8ddbf9
Rollup merge of #99148 - SOF3:clarify-xsize-bound, r=scottmcm
Clarify that [iu]size bounds were only defined for the target arch
2022-07-13 10:38:45 +02:00
Guillaume Gomez
876d59999a
Rollup merge of #99132 - jyn514:autolabel, r=Mark-Simulacrum
Add some autolabels for A-bootstrap and T-infra
2022-07-13 10:38:44 +02:00
Guillaume Gomez
8a48557261
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.
2022-07-13 10:38:43 +02:00
Guillaume Gomez
0b3644e1f3
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.
2022-07-13 10:38:42 +02:00
Guillaume Gomez
3dfb224897
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
2022-07-13 10:38:41 +02:00
bors
a639f89d04 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.
2022-07-13 08:29:57 +00:00
bors
95e8b86c8c 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`.
2022-07-13 05:24:18 +00:00
Deadbeef
1d260067f1 fix documentation 2022-07-13 04:49:32 +00:00
Takayuki Maeda
f65bf0b2bb avoid &str to String conversions 2022-07-13 13:24:38 +09:00
Takayuki Maeda
5188bdbccd remove an unnecessary span_to_snippet 2022-07-13 13:24:06 +09:00
bors
7b5715289f 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`
2022-07-13 02:43:25 +00:00
Michael Howell
9fcb9c6648 Update compiler/rustc_parse/src/parser/expr.rs
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2022-07-12 09:51:20 -07:00
Krasimir Georgiev
a89d014a21 llvm-wrapper: adapt for LLVM API change 2022-07-12 16:00:52 +00:00
Jonas Schievink
2f0172f589 Mention rust-analyzer maintainers when proc_macro bridge is changed 2022-07-12 17:34:07 +02:00
ouz-a
b4c3a2af7b ignore wasm=32 & bless 2022-07-12 16:02:17 +03:00
bors
1c7b36d4db 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
2022-07-12 11:36:58 +00:00
Dylan DPC
87e25e4fd0
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`
2022-07-12 17:06:36 +05:30
Dylan DPC
01c24213cb
Rollup merge of #99154 - rosehuds:master, r=cjgillot
use PlaceRef::iter_projections to fix old FIXME

I added this function in 53481a5a8f
2022-07-12 17:06:35 +05:30
Dylan DPC
c0bcbe8a6e
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
2022-07-12 17:06:34 +05:30
Dylan DPC
99fc65bc49
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
2022-07-12 17:06:33 +05:30