Commit Graph

172404 Commits

Author SHA1 Message Date
Yuki Okushi
06eb90ef63
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
2022-07-16 17:53:00 +09:00
Yuki Okushi
bf9ed99496
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>
2022-07-16 17:52:59 +09:00
bors
e6c43cf8b9 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
d5de680e20 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.
2022-07-16 00:18:54 +00:00
bors
8c1cc82a82 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'
2022-07-15 21:38:02 +00:00
Luqman Aden
2085d6ac42 Set minimum GDB version needed for basic-types-globals* tests. 2022-07-15 13:46:14 -07:00
Jane Losare-Lusby
8e8a3be22f
Apply suggestions from code review 2022-07-15 13:17:44 -07:00
bors
23e21bdd25 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
2022-07-15 17:11:07 +00:00
Aaron Hill
ef8e322b14
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'
2022-07-15 11:18:40 -05:00
lcnr
16b2acc7c0 hir typeck: fulfillment_cx ignore regions 2022-07-15 17:01:32 +02:00
lcnr
5bd8c960f5 provide generic_param_scope for region errors 2022-07-15 16:53:20 +02:00
lcnr
b955fa7dd0 don't require FnCtxt to check global asm 2022-07-15 16:53:20 +02:00
lcnr
4b56fd9341 try to avoid FnCtxt during wf 2022-07-15 16:53:18 +02:00
lcnr
29d0390b97 remove unnecessary select_obligations_where_possible
this was previously used for opaque types but became unnecessary
after #89024
2022-07-15 16:40:39 +02:00
lcnr
2b730a3610 remove impl_implied_bounds from FnCtxt 2022-07-15 16:40:39 +02:00
lcnr
7808f69ad7 QueryNormalizer bug on ambiguity 2022-07-15 16:40:39 +02:00
bors
0fe5390a88 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`
2022-07-15 14:30:14 +00:00
bors
116819f54f 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
2022-07-15 11:44:20 +00:00
Dylan DPC
8e3dd62a95
Rollup merge of #99246 - Xanewok:update-rls, r=jyn514
Update RLS

Fixes #99234

r? `@jyn514`
cc `@Mark-Simulacrum`
2022-07-15 15:53:40 +05:30
Dylan DPC
5c8c4dbce9
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`
2022-07-15 15:53:39 +05:30
Dylan DPC
24f0e1499e
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.
2022-07-15 15:53:38 +05:30
Dylan DPC
e0e6f1d1cb
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`
2022-07-15 15:53:37 +05:30
Dylan DPC
a6d3ee3247
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`
2022-07-15 15:53:36 +05:30
bors
6077b7cda4 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.
2022-07-15 08:57:59 +00:00
bors
522abf6d88 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
2022-07-15 06:14:51 +00:00
Takayuki Maeda
45b88aff10 simplify suggest_deref_ref_or_into 2022-07-15 14:29:15 +09:00
Michael Goulet
fcfb3e92a0 Remove some more usages of guess_head_span 2022-07-15 05:23:47 +00:00
Dylan DPC
7976cd6eb0
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?
2022-07-15 10:39:47 +05:30
Dylan DPC
6dae197afa
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`.
2022-07-15 10:39:46 +05:30
Dylan DPC
bc8abdb44c
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.
2022-07-15 10:39:45 +05:30
Dylan DPC
fe6062f829
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`
2022-07-15 10:39:44 +05:30
Dylan DPC
7b63058d13
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
2022-07-15 10:39:43 +05:30
Dylan DPC
99f3132cd7
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`.
2022-07-15 10:39:41 +05:30
bors
b90a0ede02 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`
2022-07-15 03:44:53 +00:00
Michael Goulet
4b890f3474 Remove some span_of_impl+unwrap 2022-07-15 03:17:21 +00:00
Michael Goulet
03bfbe1fb3 Move item_span from check_item_type into each function 2022-07-15 03:17:21 +00:00
Michael Goulet
78efaf43e4 remove tcx from ObligationCauseCode::span 2022-07-15 03:17:20 +00:00
Michael Goulet
27b6ab9129 Remove some more usages of guess_head_span 2022-07-15 03:17:20 +00:00
Michael Goulet
57f7618f62 Remove some usages of guess_head_span from typeck 2022-07-15 03:17:20 +00:00
Michael Goulet
aad2334ecb Make item spans more consistent 2022-07-15 03:17:20 +00:00
Jiahao XU
d8aba1002a
Improve example of downcast
Co-authored-by: Jane Losare-Lusby <jlusby42@gmail.com>
2022-07-15 13:04:06 +10:00
bors
30243dd87e Auto merge of #98203 - kckeiks:gather-body-owners-in-hir-item-queries, r=cjgillot
gather body owners

Issue #96341
2022-07-15 01:03:55 +00:00
Michael Goulet
d25abdc0c5 Point out custom Fn-family trait impl 2022-07-14 23:36:46 +00:00
Michael Goulet
ddb7003b79 Add support for APIT and RPIT callables in label_fn_like 2022-07-14 23:29:03 +00:00
Manish Goregaokar
62edbbecb7 Add regression test for #89436 2022-07-14 15:40:46 -07:00
bors
1ba1fec234 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.
2022-07-14 21:50:14 +00:00
leo60228
62aafb01b1
Rename aarch64-nintendo-switch to aarch64-nintendo-switch-freestanding 2022-07-14 15:58:26 -04:00
leo60228
d04753e19e
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.
2022-07-14 15:58:22 -04:00
leo60228
fd81b99a99
Add docs for Switch target 2022-07-14 15:58:17 -04:00
leo60228
c690db4024
Remove obsolete crt0 references in linker script 2022-07-14 15:58:11 -04:00
jam1garner
7f8804915e
Remove unneeded options from Nintendo Switch target 2022-07-14 15:58:09 -04:00