]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agointerpret/visitor: support visiting with a PlaceTy
Ralf Jung [Fri, 15 Jul 2022 00:32:45 +0000 (20:32 -0400)]
interpret/visitor: support visiting with a PlaceTy

2 years agointerpret/validity: improve some comments
Ralf Jung [Thu, 14 Jul 2022 23:19:15 +0000 (19:19 -0400)]
interpret/validity: improve some comments

2 years agoAuto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC
bors [Thu, 14 Jul 2022 11:00:30 +0000 (11:00 +0000)]
Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #97720 (Always create elided lifetime parameters for functions)
 - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`)
 - #98705 (Implement `for<>` lifetime binder for closures)
 - #99126 (remove allow(rustc::potential_query_instability) in rustc_span)
 - #99139 (Give a better error when `x dist` fails for an optional tool)

Failed merges:

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

2 years agoRollup merge of #99139 - jyn514:dist-tool-help, r=Mark-Simulacrum
Dylan DPC [Thu, 14 Jul 2022 08:44:23 +0000 (14:14 +0530)]
Rollup merge of #99139 - jyn514:dist-tool-help, r=Mark-Simulacrum

Give a better error when `x dist` fails for an optional tool

Before:
```
thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9
```

After:
```
thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure)
note: not all tools are available on all nightlies
help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9
```

Closes https://github.com/rust-lang/rust/issues/85683 by explaining better why the error is expected.

2 years agoRollup merge of #99126 - NiklasJonsson:84447/rustc_span, r=petrochenkov
Dylan DPC [Thu, 14 Jul 2022 08:44:22 +0000 (14:14 +0530)]
Rollup merge of #99126 - NiklasJonsson:84447/rustc_span, r=petrochenkov

remove allow(rustc::potential_query_instability) in rustc_span

Also, avoid sorting before debug output as iteration order can now be
relied upon.

Related #84447

2 years agoRollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillot
Dylan DPC [Thu, 14 Jul 2022 08:44:21 +0000 (14:14 +0530)]
Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillot

Implement `for<>` lifetime binder for closures

This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following:

```rust
let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) };
//       ^^^^^^^^^^^--- new!
```

cc ``@Aaron1011`` ``@cjgillot``

2 years agoRollup merge of #98315 - joshtriplett:stabilize-core-ffi-c, r=Mark-Simulacrum
Dylan DPC [Thu, 14 Jul 2022 08:44:20 +0000 (14:14 +0530)]
Rollup merge of #98315 - joshtriplett:stabilize-core-ffi-c, r=Mark-Simulacrum

Stabilize `core::ffi:c_*` and rexport in `std::ffi`

This only stabilizes the base types, not the non-zero variants, since
those have their own separate tracking issue and have not gone through
FCP to stabilize.

2 years agoRollup merge of #97720 - cjgillot:all-fresh, r=petrochenkov
Dylan DPC [Thu, 14 Jul 2022 08:44:19 +0000 (14:14 +0530)]
Rollup merge of #97720 - cjgillot:all-fresh, r=petrochenkov

Always create elided lifetime parameters for functions

Anonymous and elided lifetimes in functions are sometimes (async fns) --and sometimes not (regular fns)-- desugared to implicit generic parameters.

This difference of treatment makes it some downstream analyses more complicated to handle.  This step is a pre-requisite to perform lifetime elision resolution on AST.

There is currently an inconsistency in the treatment of argument-position impl-trait for functions and async fns:
```rust
trait Foo<'a> {}
fn foo(t: impl Foo<'_>) {} //~ ERROR missing lifetime specifier
async fn async_foo(t: impl Foo<'_>) {} //~ OK
fn bar(t: impl Iterator<Item = &'_ u8>) {} //~ ERROR missing lifetime specifier
async fn async_bar(t: impl Iterator<Item = &'_ u8>) {} //~ OK
```

The current implementation reports "missing lifetime specifier" on `foo`, but **accepts it** in `async_foo`.
This PR **proposes to accept** the anonymous lifetime in both cases as an extra generic lifetime parameter.
This change would be insta-stable, so let's ping t-lang.
Anonymous lifetimes in GAT bindings keep being forbidden:
```rust
fn foo(t: impl Foo<Assoc<'_> = Bar<'_>>) {}
                         ^^        ^^
                       forbidden   ok
```
I started a discussion here: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Anonymous.20lifetimes.20in.20universal.20impl-trait/near/284968606

r? ``@petrochenkov``

2 years agoAuto merge of #98975 - jyn514:unstable_opts, r=wesleywiser
bors [Thu, 14 Jul 2022 08:14:31 +0000 (08:14 +0000)]
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`

2 years agoAuto merge of #99225 - ehuss:update-cargo, r=ehuss
bors [Thu, 14 Jul 2022 05:07:22 +0000 (05:07 +0000)]
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)

2 years agoUpdate cargo
Eric Huss [Thu, 14 Jul 2022 04:25:48 +0000 (21:25 -0700)]
Update cargo

2 years agoStabilize `core::ffi:c_*` and rexport in `std::ffi`
Josh Triplett [Mon, 20 Jun 2022 20:59:58 +0000 (13:59 -0700)]
Stabilize `core::ffi:c_*` and rexport in `std::ffi`

This only stabilizes the base types, not the non-zero variants, since
those have their own separate tracking issue and have not gone through
FCP to stabilize.

2 years agoAuto merge of #98754 - jyn514:non-trivial-drop, r=compiler-errors
bors [Thu, 14 Jul 2022 02:22:48 +0000 (02:22 +0000)]
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`

2 years agoAuto merge of #97995 - RalfJung:union-more-nodrop, r=Mark-Simulacrum
bors [Wed, 13 Jul 2022 23:42:05 +0000 (23:42 +0000)]
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

2 years agoRename `debugging_opts` to `unstable_opts`
Joshua Nelson [Wed, 6 Jul 2022 12:44:47 +0000 (07:44 -0500)]
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.

2 years agoadd array tests, cleanup, tidy, and bless
Ralf Jung [Thu, 30 Jun 2022 14:17:49 +0000 (10:17 -0400)]
add array tests, cleanup, tidy, and bless

2 years agoassigning to a union field can never drop now
Ralf Jung [Thu, 30 Jun 2022 12:40:06 +0000 (08:40 -0400)]
assigning to a union field can never drop now

2 years agoremove untagged_union feature gate
Ralf Jung [Thu, 30 Jun 2022 02:33:18 +0000 (22:33 -0400)]
remove untagged_union feature gate

2 years agoalso allow arrays of allowed types
Ralf Jung [Sun, 19 Jun 2022 16:57:07 +0000 (09:57 -0700)]
also allow arrays of allowed types

2 years agoallow unions with mutable references and tuples of allowed types
Ralf Jung [Sat, 11 Jun 2022 05:12:57 +0000 (22:12 -0700)]
allow unions with mutable references and tuples of allowed types

2 years agofactor 'is this type allowed as union field on stable' into separate function
Ralf Jung [Sat, 11 Jun 2022 04:44:57 +0000 (21:44 -0700)]
factor 'is this type allowed as union field on stable' into separate function

2 years agoAuto merge of #99136 - CAD97:layout-faster, r=scottmcm
bors [Wed, 13 Jul 2022 21:01:20 +0000 (21:01 +0000)]
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

2 years agoreduce scope of allow(rustc::potential_query_instability) in rustc_span
Niklas Jonsson [Sun, 10 Jul 2022 20:59:06 +0000 (22:59 +0200)]
reduce scope of allow(rustc::potential_query_instability) in rustc_span

2 years agoAuto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPC
bors [Wed, 13 Jul 2022 17:13:27 +0000 (17:13 +0000)]
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

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 agoRollup merge of #99199 - TaKO8Ki:remove-unnecessary-span-to-snippet, r=cjgillot
Dylan DPC [Wed, 13 Jul 2022 14:02:37 +0000 (19:32 +0530)]
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.

2 years agoRollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwco
Dylan DPC [Wed, 13 Jul 2022 14:02:36 +0000 (19:32 +0530)]
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

2 years agoRollup merge of #99030 - rust-lang:notriddle/field-recovery, r=petrochenkov
Dylan DPC [Wed, 13 Jul 2022 14:02:35 +0000 (19:32 +0530)]
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

2 years agoRollup merge of #99011 - oli-obk:UnsoundCell, r=eddyb
Dylan DPC [Wed, 13 Jul 2022 14:02:34 +0000 (19:32 +0530)]
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

2 years agoRollup merge of #98574 - dingxiangfei2009:let-else-thir, r=oli-obk
Dylan DPC [Wed, 13 Jul 2022 14:02:33 +0000 (19:32 +0530)]
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

2 years agoAdd feature gate.
Camille GILLOT [Wed, 22 Jun 2022 20:19:02 +0000 (22:19 +0200)]
Add feature gate.

2 years agoBless ui-fulldeps tests.
Camille GILLOT [Sat, 4 Jun 2022 20:50:19 +0000 (22:50 +0200)]
Bless ui-fulldeps tests.

2 years agoClippy fallout.
Camille GILLOT [Sat, 4 Jun 2022 12:17:00 +0000 (14:17 +0200)]
Clippy fallout.

2 years agoAlways use CreateParameter mode for function definitions.
Camille GILLOT [Sun, 19 Jun 2022 20:57:05 +0000 (22:57 +0200)]
Always use CreateParameter mode for function definitions.

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 agoLimit test to x86 targets for reproducability
Oli Scherer [Wed, 13 Jul 2022 10:11:35 +0000 (10:11 +0000)]
Limit test to x86 targets for reproducability

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 agoavoid `&str` to `String` conversions
Takayuki Maeda [Wed, 13 Jul 2022 04:24:38 +0000 (13:24 +0900)]
avoid `&str` to `String` conversions

2 years agoremove an unnecessary `span_to_snippet`
Takayuki Maeda [Wed, 13 Jul 2022 04:24:06 +0000 (13:24 +0900)]
remove an unnecessary `span_to_snippet`

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 agoFix clippy build
Maybe Waffle [Thu, 30 Jun 2022 10:18:51 +0000 (14:18 +0400)]
Fix clippy build

2 years agoAdd rustfmt test for formatting `for<>` before closures
Maybe Waffle [Sun, 3 Jul 2022 12:11:46 +0000 (16:11 +0400)]
Add rustfmt test for formatting `for<>` before closures

2 years agoimplement rustfmt formatting for `for<>` closure binders
Maybe Waffle [Thu, 30 Jun 2022 13:40:38 +0000 (17:40 +0400)]
implement rustfmt formatting for `for<>` closure binders

2 years agoAdd back expr size checks
Maybe Waffle [Mon, 11 Jul 2022 19:40:35 +0000 (23:40 +0400)]
Add back expr size checks

2 years agoAdd an indirection for closures in `hir::ExprKind`
Maybe Waffle [Mon, 11 Jul 2022 19:39:53 +0000 (23:39 +0400)]
Add an indirection for closures in `hir::ExprKind`

This helps bring `hir::Expr` size down, `Closure` was the biggest
variant, especially after `for<>` additions.

2 years agoAdd `LifetimeBinderKind::Closure`
Maybe Waffle [Sun, 3 Jul 2022 15:15:39 +0000 (19:15 +0400)]
Add `LifetimeBinderKind::Closure`

2 years agoadd test for implicit stuff in signatures of closures with `for<>`
Maybe Waffle [Fri, 24 Jun 2022 15:57:01 +0000 (19:57 +0400)]
add test for implicit stuff in signatures of closures with `for<>`

2 years agomake for<> in closures a possible place to suggest adding named lifetime
Maybe Waffle [Thu, 30 Jun 2022 09:06:19 +0000 (13:06 +0400)]
make for<> in closures a possible place to suggest adding named lifetime

2 years agoLower closure binders to hir & properly check them
Maybe Waffle [Tue, 12 Jul 2022 09:34:24 +0000 (13:34 +0400)]
Lower closure binders to hir & properly check them

2 years agoUpdate compiler/rustc_parse/src/parser/expr.rs
Michael Howell [Tue, 12 Jul 2022 14:34:49 +0000 (07:34 -0700)]
Update compiler/rustc_parse/src/parser/expr.rs

Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
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 agoComment out expr size check
Maybe Waffle [Tue, 12 Jul 2022 09:33:25 +0000 (13:33 +0400)]
Comment out expr size check

2 years ago--bless tests
Maybe Waffle [Thu, 2 Jun 2022 16:15:41 +0000 (20:15 +0400)]
--bless tests

2 years agoParse closure binders
Maybe Waffle [Thu, 2 Jun 2022 16:15:05 +0000 (20:15 +0400)]
Parse closure binders

This is first step in implementing RFC 3216.
- Parse `for<'a>` before closures in ast
  - Error in lowering
- Add `closure_lifetime_binder` feature

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 agofix the typo
Ding Xiang Fei [Tue, 12 Jul 2022 11:24:08 +0000 (13:24 +0200)]
fix the typo

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 agoAlways check Cell alongside with `UnsafeCell`
Oli Scherer [Tue, 12 Jul 2022 07:29:36 +0000 (07:29 +0000)]
Always check Cell alongside with `UnsafeCell`

2 years agoUse some more visible sigils than `,`
Oli Scherer [Tue, 12 Jul 2022 07:22:52 +0000 (07:22 +0000)]
Use some more visible sigils than `,`

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 duplication of layout size check
Christopher Durham [Mon, 11 Jul 2022 20:20:00 +0000 (16:20 -0400)]
Remove duplication of layout size check

2 years agoadd tests for async await
Ding Xiang Fei [Mon, 11 Jul 2022 21:20:27 +0000 (23:20 +0200)]
add tests for async await

2 years agoextract method to read scrutinee conditionally
Ding Xiang Fei [Mon, 11 Jul 2022 19:11:03 +0000 (21:11 +0200)]
extract method to read scrutinee conditionally

2 years agomove else block into the `Local` struct
Ding Xiang Fei [Tue, 5 Jul 2022 21:31:18 +0000 (23:31 +0200)]
move else block into the `Local` struct

2 years agolower let-else in MIR instead
Ding Xiang Fei [Thu, 2 Jun 2022 14:39:47 +0000 (22:39 +0800)]
lower let-else in MIR instead

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.