]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #88991 - libstd-switch:aarch64-nintendo-switch, r=wesleywiser
Dylan DPC [Fri, 15 Jul 2022 10:23:36 +0000 (15:53 +0530)]
Rollup merge of #88991 - libstd-switch:aarch64-nintendo-switch, r=wesleywiser

Add Nintendo Switch as tier 3 target

[Relevant Zulip Discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Upstreaming.20Nintendo.20Switch.20Support/near/253445503)

This is the first step towards working on incrementally adding support for the Nintendo Switch. After this lands `@leo60228` and I will work on ensuring further work is cleared from a legal perspective before continuing on to work on an allocator and porting libstd.

The plan is to keep these changes small and incremental enough so as to not cause unneeded burden on reviewers by submitting a single large patch, as was felt to be the case last attempt at upstreaming (#74567).

All this specific patch does is add the target itself without and std support, which has been tested on-device and is working as expected.

Designated Target Maintainers:
* `@leo60228`
* `@jam1garner`

2 years agoAuto merge of #99267 - Dylan-DPC:rollup-d8l7y1o, r=Dylan-DPC
bors [Fri, 15 Jul 2022 06:14:51 +0000 (06:14 +0000)]
Auto merge of #99267 - Dylan-DPC:rollup-d8l7y1o, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #99113 (Simplify [a]rc code a little)
 - #99131 (Add label for generic arg (+ APIT) and RPIT callables in `label_fn_like`)
 - #99237 (removed unused CSS and unused HTML IDs)
 - #99239 (Add myself to the set of people notified when MIR changes.)
 - #99241 (Remove comment referring to constness.rs)
 - #99257 (Add regression test for #89436)

Failed merges:

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

2 years agoRollup merge of #99257 - Manishearth:regression, r=jackh726
Dylan DPC [Fri, 15 Jul 2022 05:09:47 +0000 (10:39 +0530)]
Rollup merge of #99257 - Manishearth:regression, r=jackh726

Add regression test for #89436

I never got around to adding such a test.

In general I think the `yoke` crate has a bunch of interesting testcases that exercise various edges of the algorithms here, it would be nice if we could simply depend on the crate and add some tests that exercise it, but I don't think that's possible. Do you or `@eddyb` think there's any use trying to upstream a bunch of common yoke minimal working example code to the testsuite and having a ton of yoke tests?

2 years agoRollup merge of #99241 - danbev:intrinsics-comment, r=fee1-dead
Dylan DPC [Fri, 15 Jul 2022 05:09:46 +0000 (10:39 +0530)]
Rollup merge of #99241 - danbev:intrinsics-comment, r=fee1-dead

Remove comment referring to constness.rs

This commit removes the comment in emulate_intrinsic, which is
currently referring to `src/librustc_middle/ty/constness.rs`.

2 years agoRollup merge of #99239 - vakaras:add-myself-to-mir-followers, r=tmiasko
Dylan DPC [Fri, 15 Jul 2022 05:09:45 +0000 (10:39 +0530)]
Rollup merge of #99239 - vakaras:add-myself-to-mir-followers, r=tmiasko

Add myself to the set of people notified when MIR changes.

I would like to be notified when changes to MIR are made.

2 years agoRollup merge of #99237 - GuillaumeGomez:rustdoc-css-cleanup, r=notriddle
Dylan DPC [Fri, 15 Jul 2022 05:09:44 +0000 (10:39 +0530)]
Rollup merge of #99237 - GuillaumeGomez:rustdoc-css-cleanup, r=notriddle

removed unused CSS and unused HTML IDs

I think that should cover most remaining unused CSS/HTML IDs.

r? `@notriddle`

2 years agoRollup merge of #99131 - compiler-errors:label-fn, r=cjgillot
Dylan DPC [Fri, 15 Jul 2022 05:09:43 +0000 (10:39 +0530)]
Rollup merge of #99131 - compiler-errors:label-fn, r=cjgillot

Add label for generic arg (+ APIT) and RPIT callables in `label_fn_like`

Fixes #98308

2 years agoRollup merge of #99113 - WaffleLapkin:arc_simplify, r=Mark-Simulacrum
Dylan DPC [Fri, 15 Jul 2022 05:09:41 +0000 (10:39 +0530)]
Rollup merge of #99113 - WaffleLapkin:arc_simplify, r=Mark-Simulacrum

Simplify [a]rc code a little

Nothing interesting, just make [a]rc code a little nicer by using `byte_sub` and `let`-`else`.

2 years agoAuto merge of #97406 - aliemjay:verify-bounds-fix-master, r=oli-obk
bors [Fri, 15 Jul 2022 03:44:53 +0000 (03:44 +0000)]
Auto merge of #97406 - aliemjay:verify-bounds-fix-master, r=oli-obk

Make outlives::{components,verify} agree

fixes #97405

cc `@oli-obk` this is should fix https://github.com/rust-lang/rust/pull/95474#discussion_r880660075

r? `@oli-obk`

2 years agoAuto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, r=cjgillot
bors [Fri, 15 Jul 2022 01:03:55 +0000 (01:03 +0000)]
Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, r=cjgillot

gather body owners

Issue #96341

2 years agoPoint out custom Fn-family trait impl
Michael Goulet [Wed, 13 Jul 2022 05:39:01 +0000 (05:39 +0000)]
Point out custom Fn-family trait impl

2 years agoAdd support for APIT and RPIT callables in label_fn_like
Michael Goulet [Sun, 10 Jul 2022 21:59:31 +0000 (21:59 +0000)]
Add support for APIT and RPIT callables in label_fn_like

2 years agoAdd regression test for #89436
Manish Goregaokar [Thu, 14 Jul 2022 22:40:46 +0000 (15:40 -0700)]
Add regression test for #89436

2 years agoAuto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot
bors [Thu, 14 Jul 2022 21:50:14 +0000 (21:50 +0000)]
Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot

Stop keeping metadata in memory before writing it to disk

Fixes #96358

I created this PR according with the instruction given in the issue except for the following points:

- While the issue says "Write metadata into the temporary file in `encode_and_write_metadata` even if `!need_metadata_file`", I could not do that. That is because though I tried to do that and run `x.py test`, I got a lot of test failures as follows.

<details>
<summary>List of failed tests</summary>
<pre>
<code>
failures:
    [ui] src/test/ui/json-multiple.rs
    [ui] src/test/ui/json-options.rs
    [ui] src/test/ui/rmeta/rmeta-rpass.rs
    [ui] src/test/ui/save-analysis/emit-notifications.rs
    [ui] src/test/ui/svh/changing-crates.rs
    [ui] src/test/ui/svh/svh-change-lit.rs
    [ui] src/test/ui/svh/svh-change-significant-cfg.rs
    [ui] src/test/ui/svh/svh-change-trait-bound.rs
    [ui] src/test/ui/svh/svh-change-type-arg.rs
    [ui] src/test/ui/svh/svh-change-type-ret.rs
    [ui] src/test/ui/svh/svh-change-type-static.rs
    [ui] src/test/ui/svh/svh-use-trait.rs

test result: FAILED. 12915 passed; 12 failed; 100 ignored; 0 measured; 0 filtered out; finished in 71.41s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:01:58
</code>
</pre>
</details>

- I could not resolve the extra tasks about `create_rmeta_file` and `create_compressed_metadata_file` for my lack of ability.

2 years agoRename aarch64-nintendo-switch to aarch64-nintendo-switch-freestanding
leo60228 [Fri, 17 Sep 2021 17:29:49 +0000 (13:29 -0400)]
Rename aarch64-nintendo-switch to aarch64-nintendo-switch-freestanding

2 years agoAdd aarch64-nintendo-switch.md to SUMMARY.md
leo60228 [Fri, 17 Sep 2021 14:44:59 +0000 (10:44 -0400)]
Add aarch64-nintendo-switch.md to SUMMARY.md

I can't think of any other reason CI might be failing, and I should've
done this anyway.

2 years agoAdd docs for Switch target
leo60228 [Fri, 17 Sep 2021 14:11:19 +0000 (10:11 -0400)]
Add docs for Switch target

2 years agoRemove obsolete crt0 references in linker script
leo60228 [Wed, 15 Sep 2021 22:21:34 +0000 (18:21 -0400)]
Remove obsolete crt0 references in linker script

2 years agoRemove unneeded options from Nintendo Switch target
jam1garner [Wed, 15 Sep 2021 21:57:43 +0000 (17:57 -0400)]
Remove unneeded options from Nintendo Switch target

2 years agoDon't build std for switch
leo60228 [Wed, 15 Sep 2021 19:30:00 +0000 (15:30 -0400)]
Don't build std for switch

2 years agoAdd linker script for switch
leo60228 [Wed, 15 Sep 2021 19:26:59 +0000 (15:26 -0400)]
Add linker script for switch

2 years agoRemove unnecessary linker args
leo60228 [Wed, 15 Sep 2021 19:19:00 +0000 (15:19 -0400)]
Remove unnecessary linker args

2 years agoDon't use host linker for switch
leo60228 [Wed, 15 Sep 2021 19:17:40 +0000 (15:17 -0400)]
Don't use host linker for switch

2 years agoAdd Nintendo Switch tier 3 target
jam1garner [Wed, 15 Sep 2021 17:56:20 +0000 (13:56 -0400)]
Add Nintendo Switch tier 3 target

2 years agoAuto merge of #99252 - lqd:win-dwarf5, r=eddyb
bors [Thu, 14 Jul 2022 19:03:58 +0000 (19:03 +0000)]
Auto merge of #99252 - lqd:win-dwarf5, r=eddyb

fix dwarf debuginfo being used in addition to CodeView on windows

Tackles the debuginfo size increase regression on windows to [unblock clippy](https://github.com/rust-lang/rust/issues/99143#issuecomment-1184638573) -- introduced by the DWARF5 support in #98350 cc `@pcwalton.`

r? `@eddyb`
Fixes #99143

2 years agofix dwarf debuginfo being used in addition to CodeView on windows
Rémy Rakic [Thu, 14 Jul 2022 18:41:55 +0000 (20:41 +0200)]
fix dwarf debuginfo being used in addition to CodeView on windows

Fixes the debuginfo size increase regression introduced by the DWARF5 support.

2 years agoAuto merge of #99242 - Dylan-DPC:rollup-34bqdh8, r=Dylan-DPC
bors [Thu, 14 Jul 2022 16:23:07 +0000 (16:23 +0000)]
Auto merge of #99242 - Dylan-DPC:rollup-34bqdh8, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #98072 (Add provider API to error trait)
 - #98580 (Emit warning when named arguments are used positionally in format)
 - #99000 (Move abstract const to middle)
 - #99192 (Fix spans for asm diagnostics)
 - #99222 (Better error message for generic_const_exprs inference failure)
 - #99236 (solaris: unbreak build on native platform)

Failed merges:

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

2 years agoRemove comment referring to constness.rs
Daniel Bevenius [Thu, 14 Jul 2022 13:35:19 +0000 (15:35 +0200)]
Remove comment referring to constness.rs

This commit removes the comment in emulate_intrinsic, which is
currently referring to 'src/librustc_middle/ty/constness.rs'.

2 years agoRollup merge of #99236 - psumbera:Issue99208, r=Mark-Simulacrum
Dylan DPC [Thu, 14 Jul 2022 13:54:08 +0000 (19:24 +0530)]
Rollup merge of #99236 - psumbera:Issue99208, r=Mark-Simulacrum

solaris: unbreak build on native platform

Fixes: #99208
2 years agoRollup merge of #99222 - atsuzaki:generic_const_err, r=lcnr
Dylan DPC [Thu, 14 Jul 2022 13:54:06 +0000 (19:24 +0530)]
Rollup merge of #99222 - atsuzaki:generic_const_err, r=lcnr

Better error message for generic_const_exprs inference failure

Fixes #90531

This code:
```rs
#![feature(generic_const_exprs)]

fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {}

fn main() {
  let arr = [5; 5];
  foo(arr);
}
```

Will now emit the following error:
```rs
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> test.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information

error[E0284]: type annotations needed
 --> test.rs:8:7
  |
8 |       foo(arr);
  |       ^^^ cannot infer the value of the const parameter `N` declared on the function `foo`
  |
note: required by a bound in `foo`
 --> test.rs:3:56
  |
3 | fn foo<const N: usize>(_arr: [u64; N + 1]) where [u64; N + 1]: {}
  |                                                        ^^^^^ required by this bound in `foo`
help: consider specifying the generic argument
  |
8 |       foo::<N>(arr);
  |          +++++

error: aborting due to previous error; 1 warning emitted
```

cc: `@lcnr` thanks a lot again for the help on this

2 years agoRollup merge of #99192 - Amanieu:fix-asm-srcloc, r=petrochenkov
Dylan DPC [Thu, 14 Jul 2022 13:54:05 +0000 (19:24 +0530)]
Rollup merge of #99192 - Amanieu:fix-asm-srcloc, r=petrochenkov

Fix spans for asm diagnostics

Line spans were incorrect if the first line of an asm statement was an
empty string.

2 years agoRollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnr
Dylan DPC [Thu, 14 Jul 2022 13:54:04 +0000 (19:24 +0530)]
Rollup merge of #99000 - JulianKnodt:allow_resolve_no_substs, r=lcnr

Move abstract const to middle

Moves AbstractConst (and all associated methods) to rustc middle for use in `rustc_infer`.
This allows for const resolution in infer to use abstract consts to walk consts and check if
they are resolvable.

This attempts to resolve the issue where `Foo<{ concrete const }, generic T>` is incorrectly marked as conflicting, and is independent from the other issue where nested abstract consts must be resolved.

r? `@lcnr`

2 years agoRollup merge of #98580 - PrestonFrom:issue_98466, r=estebank
Dylan DPC [Thu, 14 Jul 2022 13:54:03 +0000 (19:24 +0530)]
Rollup merge of #98580 - PrestonFrom:issue_98466, r=estebank

Emit warning when named arguments are used positionally in format

Addresses Issue 98466 by emitting an error if a named argument
is used like a position argument (i.e. the name is not used in
the string to be formatted).

Fixes rust-lang#98466

2 years agoRollup merge of #98072 - yaahc:generic-member-access, r=thomcc
Dylan DPC [Thu, 14 Jul 2022 13:54:02 +0000 (19:24 +0530)]
Rollup merge of #98072 - yaahc:generic-member-access, r=thomcc

Add provider API to error trait

Implements https://github.com/rust-lang/rfcs/pull/2895

2 years agoAuto merge of #95956 - yaahc:stable-in-unstable, r=cjgillot
bors [Thu, 14 Jul 2022 13:42:09 +0000 (13:42 +0000)]
Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillot

Support unstable moves via stable in unstable items

part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328.

The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge.

This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.

2 years agoRemoved unused HTML IDs
Guillaume Gomez [Thu, 14 Jul 2022 13:03:51 +0000 (15:03 +0200)]
Removed unused HTML IDs

2 years agoRemove unused CSS
Guillaume Gomez [Thu, 14 Jul 2022 12:59:25 +0000 (14:59 +0200)]
Remove unused CSS

2 years agoAdd vakaras to the set of people notified when MIR changes.
Vytautas Astrauskas [Thu, 14 Jul 2022 12:24:36 +0000 (14:24 +0200)]
Add vakaras to the set of people notified when MIR changes.

2 years agosolaris: unbreak build on native platform
Petr Sumbera [Thu, 14 Jul 2022 11:44:40 +0000 (13:44 +0200)]
solaris: unbreak build on native platform

Fixes: #99208
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 agoFix spans for asm diagnostics
Amanieu d'Antras [Tue, 12 Jul 2022 20:54:47 +0000 (22:54 +0200)]
Fix spans for asm diagnostics

Line spans were incorrect if the first line of an asm statement was an
empty string.

2 years agoFix overlapping impls
kadmin [Tue, 12 Jul 2022 07:11:05 +0000 (07:11 +0000)]
Fix overlapping impls

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 agoUpdate tests
Katherine Philip [Thu, 14 Jul 2022 00:28:11 +0000 (17:28 -0700)]
Update tests

2 years agobless tests
Ali MJ Al-Nasrawy [Thu, 14 Jul 2022 00:08:51 +0000 (03:08 +0300)]
bless tests

2 years agoMake outlives::{components,verify} agree
Ali MJ Al-Nasrawy [Wed, 25 May 2022 17:15:49 +0000 (20:15 +0300)]
Make outlives::{components,verify} agree

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 agoRemove predicate note
Katherine Philip [Wed, 13 Jul 2022 17:27:19 +0000 (10:27 -0700)]
Remove predicate note

2 years agoAdd checks & fallback branch
Katherine Philip [Wed, 13 Jul 2022 17:25:58 +0000 (10:25 -0700)]
Add checks & fallback branch

2 years agoUse emit_inference_failure_err for ConstEvaluatable predicates
Katherine Philip [Wed, 13 Jul 2022 16:42:25 +0000 (09:42 -0700)]
Use emit_inference_failure_err for ConstEvaluatable predicates

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 agoEmit warning when named arguments are used positionally in format
Preston From [Sat, 25 Jun 2022 05:52:13 +0000 (23:52 -0600)]
Emit warning when named arguments are used positionally in format

Addresses Issue 98466 by emitting a warning if a named argument
is used like a position argument (i.e. the name is not used in
the string to be formatted).

Fixes rust-lang#98466

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 agocollect module item-likes in visit_items
Miguel Guarniz [Wed, 13 Jul 2022 17:25:53 +0000 (13:25 -0400)]
collect module item-likes in visit_items

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
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 agomerge visitors in queries
Miguel Guarniz [Wed, 6 Jul 2022 23:13:49 +0000 (19:13 -0400)]
merge visitors in queries

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2 years agoinline associated_body
Miguel Guarniz [Wed, 6 Jul 2022 22:23:38 +0000 (18:23 -0400)]
inline associated_body

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2 years agouse gathered body_owners in par_body_owners
Miguel Guarniz [Wed, 22 Jun 2022 23:12:18 +0000 (19:12 -0400)]
use gathered body_owners in par_body_owners

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
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