Commit Graph

172168 Commits

Author SHA1 Message Date
Duarte Nunes
9cd66be235 docs: be less harsh in wording for Vec::from_raw_parts
In particular, be clear that it is sound to specify memory not
originating from a previous `Vec` allocation. That is already suggested
in other parts of the documentation about zero-alloc conversions to Box<[T]>.

Incorporate a constraint from `slice::from_raw_parts` that was missing
but needs to be fulfilled, since a `Vec` can be converted into a slice.
2022-07-13 14:29:35 -03: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
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
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
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
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
Dylan DPC
9997c51496
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
2022-07-12 17:06:33 +05:30
Dylan DPC
76153661dc
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.
2022-07-12 17:06:32 +05:30
ouz-a
cb0017f2f8 add new rval, pull deref early 2022-07-12 14:26:41 +03:00
Laurențiu Nicola
697dfb56c6 ⬆️ rust-analyzer 2022-07-12 14:18:31 +03:00
Deadbeef
e65214785d add more tests 2022-07-12 10:20:55 +00:00
Deadbeef
944c0e23b8 check non_exhaustive attr and private fields for transparent types 2022-07-12 10:20:55 +00:00
Guillaume Gomez
349a3fc6a3 Update -zhelp and -chelp rustdoc-ui tests to use regex-error-pattern 2022-07-12 11:20:36 +02:00
Guillaume Gomez
f515af7e3b Add regex-error-pattern flag in compiletest 2022-07-12 11:19:52 +02:00
Takayuki Maeda
3de6d6bb13 add regression test for #74713 2022-07-12 14:21:09 +09:00
Takayuki Maeda
e03cb7fb9a implement a suggestion for a floating point number with a type suffix 2022-07-12 13:59:51 +09:00
Ralf Jung
04b3cd9f7c use a loop rather than try_fold 2022-07-11 22:51:33 -04:00
Ralf Jung
ab225ade1e 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.
2022-07-11 22:50:46 -04:00
bors
b3f4c31199 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
2022-07-12 00:25:45 +00:00
est31
3d2494dbf2 Remove box syntax from Box<BareFunctionDecl> construction
The type has 144 bytes according to compiler internal rustdoc.
2022-07-11 22:59:50 +02:00
est31
3fa637dacb Remove box syntax for Box<rustdoc::clean::types::Type> construction
The type has 80 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
88d72a97fc Remove box syntax for Box<ImplItem> construction
ImplItem only has 80 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
ccf1bdbca6 Remove box syntax for Box<Attributes> construction
Attributes only has 48 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
1ac17fcddb Remove box syntax from Box<dyn Iterator> construction
The iterators created should be pretty light weight.
2022-07-11 22:58:57 +02:00
Matthias Krüger
c05e277764
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.
2022-07-11 22:39:10 +02:00
Matthias Krüger
5e223dc7b9
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.
2022-07-11 22:39:09 +02:00
Matthias Krüger
1679d1c622
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.
2022-07-11 22:39:08 +02:00
Matthias Krüger
24d241a884
Rollup merge of #99142 - notriddle:notriddle/doctest-multiline-crate-attributes, r=GuillaumeGomez
fix(doctest): treat fatal parse errors as incomplete attributes

Fixes #99089
2022-07-11 22:39:07 +02:00
Matthias Krüger
7151aaf940
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.
2022-07-11 22:39:06 +02:00
Matthias Krüger
d89c183554
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 .
2022-07-11 22:39:05 +02:00
Matthias Krüger
c431e6f15a
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```
2022-07-11 22:39:04 +02:00