]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoRollup merge of #99270 - rhysd:issue-99269, r=Mark-Simulacrum
Yuki Okushi [Sat, 16 Jul 2022 08:53:03 +0000 (17:53 +0900)]
Rollup merge of #99270 - rhysd:issue-99269, r=Mark-Simulacrum

Add `#[must_use]` to `Box::from_raw`

Fixes #99269

23 months agoRollup merge of #99264 - eltociear:patch-14, r=compiler-errors
Yuki Okushi [Sat, 16 Jul 2022 08:53:02 +0000 (17:53 +0900)]
Rollup merge of #99264 - eltociear:patch-14, r=compiler-errors

Fix typo in mod.rs

constuct -> construct

23 months agoRollup merge of #99253 - pierwill:pierwill/rm-storage-fixme, r=oli-obk
Yuki Okushi [Sat, 16 Jul 2022 08:53:01 +0000 (17:53 +0900)]
Rollup merge of #99253 - pierwill:pierwill/rm-storage-fixme, r=oli-obk

Remove FIXME from MIR `always_storage_live_locals`

See discussion in https://github.com/rust-lang/rust/pull/99025#issuecomment-1183347428.

23 months agoRollup merge of #98662 - LucasDumont:document_fs_write, r=thomcc
Yuki Okushi [Sat, 16 Jul 2022 08:53:00 +0000 (17:53 +0900)]
Rollup merge of #98662 - LucasDumont:document_fs_write, r=thomcc

Add std::fs::write documentation precision

Fixes #97947.

As mentioned in #97947, the documentation is updated

23 months agoRollup merge of #98387 - NobodyXu:feature/std_io_Error_try_downgrade_inner, r=yaahc
Yuki Okushi [Sat, 16 Jul 2022 08:52:59 +0000 (17:52 +0900)]
Rollup merge of #98387 - NobodyXu:feature/std_io_Error_try_downgrade_inner, r=yaahc

Add new unstable API `downcast` to `std::io::Error`

https://github.com/rust-lang/libs-team/issues/57

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
23 months agoAuto merge of #95685 - oxidecomputer:restore-static-dwarf, r=pnkfelix
bors [Sat, 16 Jul 2022 00:18:54 +0000 (00:18 +0000)]
Auto merge of #95685 - oxidecomputer:restore-static-dwarf, r=pnkfelix

Revert "Work around invalid DWARF bugs for fat LTO"

Since September, the toolchain has not been generating reliable DWARF
information for static variables when LTO is on. This has affected
projects in the embedded space where the use of LTO is typical. In our
case, it has kept us from bumping past the 2021-09-22 nightly toolchain
lest our debugger break. This has been a pretty dramatic regression for
people using debuggers and static variables. See #90357 for more info
and a repro case.

This commit is a mechanical revert of
d5de680e20def848751cb3c11e1182408112b1d3 from PR #89041, which caused
the issue. (Note on that PR that the commit's author has requested it be
reverted.)

I have locally verified that this fixes #90357 by restoring the
functionality of both the repro case I posted on that bug, and debugger
behavior on real programs. There do not appear to be test cases for this
in the toolchain; if I've missed them, point me at 'em and I'll update
them.

23 months agoAuto merge of #99288 - Aaron1011:stable-intrinsics, r=yaahc
bors [Fri, 15 Jul 2022 21:38:02 +0000 (21:38 +0000)]
Auto merge of #99288 - Aaron1011:stable-intrinsics, r=yaahc

Mark stabilized intrinsics with `rustc_allowed_through_unstable_modules`

Fixes #99286

PR #95956 accidentally made these intrinsics unstable when
accessed through the unstable path segment 'std::intrinsics'

23 months agoSet minimum GDB version needed for basic-types-globals* tests.
Luqman Aden [Fri, 15 Jul 2022 20:46:14 +0000 (13:46 -0700)]
Set minimum GDB version needed for basic-types-globals* tests.

23 months agoApply suggestions from code review
Jane Losare-Lusby [Fri, 15 Jul 2022 20:17:44 +0000 (13:17 -0700)]
Apply suggestions from code review

23 months agoAuto merge of #99015 - lcnr:fn-ctxt-no-more, r=compiler-errors
bors [Fri, 15 Jul 2022 17:11:07 +0000 (17:11 +0000)]
Auto merge of #99015 - lcnr:fn-ctxt-no-more, r=compiler-errors

stop using `FnCtxt` outside of hir typeck

the requirements between **hir typeck**™, and **not hir typeck**™ are different enough to warrant a full split. with this PR `FnCtxt` is now only used for hir typeck (and for one clippy lint which seems to be emulating hir typeck).

Once this PR has landed I intend to move `FnCtxt` into a new crate. This should also allow some further general improvements here.

r? rust-lang/types

23 months agoMark stabilized intrinsics with `rustc_allowed_through_unstable_modules`
Aaron Hill [Fri, 15 Jul 2022 16:17:17 +0000 (11:17 -0500)]
Mark stabilized intrinsics with `rustc_allowed_through_unstable_modules`

Fixes #99286

PR #95956 accidentally made these intrinsics unstable when
accessed through the unstable path segment 'std::intrinsics'

23 months agohir typeck: `fulfillment_cx` ignore regions
lcnr [Fri, 8 Jul 2022 09:17:12 +0000 (11:17 +0200)]
hir typeck: `fulfillment_cx` ignore regions

23 months agoprovide `generic_param_scope` for region errors
lcnr [Fri, 8 Jul 2022 08:59:35 +0000 (10:59 +0200)]
provide `generic_param_scope` for region errors

23 months agodon't require `FnCtxt` to check global asm
lcnr [Thu, 7 Jul 2022 14:14:27 +0000 (16:14 +0200)]
don't require `FnCtxt` to check global asm

23 months agotry to avoid `FnCtxt` during wf
lcnr [Thu, 7 Jul 2022 13:12:32 +0000 (15:12 +0200)]
try to avoid `FnCtxt` during wf

23 months agoremove unnecessary `select_obligations_where_possible`
lcnr [Thu, 7 Jul 2022 11:43:01 +0000 (13:43 +0200)]
remove unnecessary `select_obligations_where_possible`

this was previously used for opaque types but became unnecessary
after #89024

23 months agoremove `impl_implied_bounds` from `FnCtxt`
lcnr [Thu, 7 Jul 2022 09:05:02 +0000 (11:05 +0200)]
remove `impl_implied_bounds` from `FnCtxt`

23 months ago`QueryNormalizer` bug on ambiguity
lcnr [Thu, 7 Jul 2022 09:04:36 +0000 (11:04 +0200)]
`QueryNormalizer` bug on ambiguity

23 months agoAuto merge of #99046 - nnethercote:final-derive-output-improvements, r=Mark-Simulacrum
bors [Fri, 15 Jul 2022 14:30:14 +0000 (14:30 +0000)]
Auto merge of #99046 - nnethercote:final-derive-output-improvements, r=Mark-Simulacrum

Final derive output improvements

With all these changes, the derive output in `deriving-all-codegen.stdout` is pretty close to optimal, i.e. very similar to what you'd write by hand.

r? `@ghost`

23 months agoAuto merge of #99278 - Dylan-DPC:rollup-fcln6st, r=Dylan-DPC
bors [Fri, 15 Jul 2022 11:44:20 +0000 (11:44 +0000)]
Auto merge of #99278 - Dylan-DPC:rollup-fcln6st, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #88991 (Add Nintendo Switch as tier 3 target)
 - #98869 (Remove some usages of `guess_head_span`)
 - #99119 (Refactor: remove a string matching about methods)
 - #99209 (Correctly handle crate level page on docs.rs as well)
 - #99246 (Update RLS)

Failed merges:

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

23 months agoRollup merge of #99246 - Xanewok:update-rls, r=jyn514
Dylan DPC [Fri, 15 Jul 2022 10:23:40 +0000 (15:53 +0530)]
Rollup merge of #99246 - Xanewok:update-rls, r=jyn514

Update RLS

Fixes #99234

r? `@jyn514`
cc `@Mark-Simulacrum`

23 months agoRollup merge of #99209 - GuillaumeGomez:crate-level-sidebar, r=jsha
Dylan DPC [Fri, 15 Jul 2022 10:23:39 +0000 (15:53 +0530)]
Rollup merge of #99209 - GuillaumeGomez:crate-level-sidebar, r=jsha

Correctly handle crate level page on docs.rs as well

Fixes #99121.

On docs.rs, they move the `class` attribute into a child which still has `rustdoc`. So instead of using the `<body>`, we can simply use this one directly.

r? `@jsha`

23 months agoRollup merge of #99119 - TaKO8Ki:remove-string-matching-about-methods, r=cjgillot
Dylan DPC [Fri, 15 Jul 2022 10:23:38 +0000 (15:53 +0530)]
Rollup merge of #99119 - TaKO8Ki:remove-string-matching-about-methods, r=cjgillot

Refactor: remove a string matching about methods

This patch remove a string matching about methods and adds some rustfix tests.

23 months agoRollup merge of #98869 - compiler-errors:stop_guessing_head_span, r=cjgillot
Dylan DPC [Fri, 15 Jul 2022 10:23:37 +0000 (15:53 +0530)]
Rollup merge of #98869 - compiler-errors:stop_guessing_head_span, r=cjgillot

Remove some usages of `guess_head_span`

No need to pass things through `guess_head_span` if they already point to the head span.

Only major change is that we point to the head span of `enum`s on some errors now, which I prefer.

r? `@cjgillot`

23 months 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`

23 months agoAuto merge of #99013 - RalfJung:dont-poison-my-places, r=oli-obk
bors [Fri, 15 Jul 2022 08:57:59 +0000 (08:57 +0000)]
Auto merge of #99013 - RalfJung:dont-poison-my-places, r=oli-obk

interpret: get rid of MemPlaceMeta::Poison

This is achieved by refactoring the projection code (`{mplace,place,operand}_{downcast,field,index,...}`) so that we no longer need to call `assert_mem_place` in the operand handling.

23 months agoadd `#[must_use]` to `Box::from_raw`
rhysd [Fri, 15 Jul 2022 08:05:50 +0000 (17:05 +0900)]
add `#[must_use]` to `Box::from_raw`

23 months 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

23 months agosimplify `suggest_deref_ref_or_into`
Takayuki Maeda [Fri, 15 Jul 2022 05:29:15 +0000 (14:29 +0900)]
simplify `suggest_deref_ref_or_into`

23 months agoRemove some more usages of guess_head_span
Michael Goulet [Fri, 15 Jul 2022 05:23:47 +0000 (05:23 +0000)]
Remove some more usages of guess_head_span

23 months 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?

23 months 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`.

23 months 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.

23 months 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`

23 months 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

23 months 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`.

23 months agoFix typo in mod.rs
Ikko Ashimine [Fri, 15 Jul 2022 03:57:46 +0000 (12:57 +0900)]
Fix typo in mod.rs

constuct -> construct

23 months 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`

23 months agoRemove some span_of_impl+unwrap
Michael Goulet [Fri, 8 Jul 2022 02:41:41 +0000 (02:41 +0000)]
Remove some span_of_impl+unwrap

23 months agoMove item_span from check_item_type into each function
Michael Goulet [Fri, 8 Jul 2022 02:32:51 +0000 (02:32 +0000)]
Move item_span from check_item_type into each function

23 months agoremove tcx from ObligationCauseCode::span
Michael Goulet [Fri, 8 Jul 2022 02:02:08 +0000 (02:02 +0000)]
remove tcx from ObligationCauseCode::span

23 months agoRemove some more usages of guess_head_span
Michael Goulet [Fri, 8 Jul 2022 02:10:15 +0000 (02:10 +0000)]
Remove some more usages of guess_head_span

23 months agoRemove some usages of guess_head_span from typeck
Michael Goulet [Thu, 7 Jul 2022 06:52:27 +0000 (06:52 +0000)]
Remove some usages of guess_head_span from typeck

23 months agoMake item spans more consistent
Michael Goulet [Fri, 8 Jul 2022 01:50:10 +0000 (01:50 +0000)]
Make item spans more consistent

23 months agoImprove example of `downcast`
Jiahao XU [Fri, 15 Jul 2022 03:04:06 +0000 (13:04 +1000)]
Improve example of `downcast`

Co-authored-by: Jane Losare-Lusby <jlusby42@gmail.com>
23 months 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

23 months 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

23 months 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

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

23 months 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.

23 months agoRemove FIXME from MIR `always_storage_live_locals`
pierwill [Thu, 14 Jul 2022 20:30:36 +0000 (15:30 -0500)]
Remove FIXME from MIR `always_storage_live_locals`

23 months 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

23 months 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.

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

23 months 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

23 months 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

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

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

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

23 months 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

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

23 months 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

23 months 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.

23 months agoCorrectly handle crate level page on docs.rs as well
Guillaume Gomez [Wed, 13 Jul 2022 12:43:52 +0000 (14:43 +0200)]
Correctly handle crate level page on docs.rs as well

23 months 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

23 months agorename MPlaceTy::dangling to fake_alloc_zst
Ralf Jung [Thu, 14 Jul 2022 15:40:47 +0000 (11:40 -0400)]
rename MPlaceTy::dangling to fake_alloc_zst

23 months agoUpdate RLS
Igor Matuszewski [Thu, 14 Jul 2022 15:23:46 +0000 (17:23 +0200)]
Update RLS

23 months 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'.

23 months 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
23 months 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

23 months 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.

23 months 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`

23 months 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

23 months 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

23 months 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.

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

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

23 months 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.

23 months 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
23 months 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

23 months 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.

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

23 months 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.

23 months 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

23 months 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``

23 months 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.

23 months 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``

23 months 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`

23 months 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)

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

23 months 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.

23 months 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`

23 months agoRename `std::io::Error::try_downcast_inner` to `downcast`
Jiahao XU [Thu, 14 Jul 2022 01:24:44 +0000 (11:24 +1000)]
Rename `std::io::Error::try_downcast_inner` to `downcast`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
23 months agoUpdate tests
Katherine Philip [Thu, 14 Jul 2022 00:28:11 +0000 (17:28 -0700)]
Update tests

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

23 months 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

23 months 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

23 months agoRemove predicate note
Katherine Philip [Wed, 13 Jul 2022 17:27:19 +0000 (10:27 -0700)]
Remove predicate note

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

23 months 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