Commit Graph

172488 Commits

Author SHA1 Message Date
Yuki Okushi
084ad59622
Stabilize future_poll_fn
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-07-16 10:04:14 +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
Jane Losare-Lusby
a9d2ed2ab1 add tracking issue to generic member access APIs 2022-07-15 22:13:43 +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
Esteban Küber
3ee4e5f704 Fix rebase 2022-07-15 11:14:06 -07:00
Esteban Küber
3e5809d94f Move tests to fit in limit 2022-07-15 11:04:45 -07:00
Esteban Küber
635c38187b Avoid incorrect suggestion
We check that there's a single level of block nesting to ensure always
correct suggestions. If we don't, then we only provide a free-form
message to avoid misleading users in cases like
`src/test/ui/nll/borrowed-temporary-error.rs`.

We could expand the analysis to suggest hoising all of the relevant
parts of the users' code to make the code compile, but that could be
too much.
2022-07-15 11:04:45 -07:00
Esteban Küber
20b5aaf111 Provide structured suggestion for dropped temp value 2022-07-15 11:04:45 -07:00
Michael Goulet
2902b92769 Only suggest if span is not erroneous 2022-07-15 17:32:34 +00:00
Michael Goulet
b71a09fda0 Fix ICE in named_arguments_used_positionally lint 2022-07-15 17:32:34 +00:00
Michael Goulet
1c8f87e907 Revert "Highlight conflicting param-env candidates"
This reverts commit 08135254dc.
2022-07-15 17:21:55 +00: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
Oli Scherer
57e9f7a556 Infer wildcard type from other patterns at every pattern level 2022-07-15 15:56:17 +00:00
Oli Scherer
92e470a1de Move constructor into the branch that actually uses it 2022-07-15 15:56:17 +00:00
Oli Scherer
ea68ce7fac Revert a hack that only ever worked on level deep 2022-07-15 15:56:17 +00:00
Oli Scherer
6b33d5bfa9 Make destructuring a defining use 2022-07-15 15:56:17 +00:00
Oli Scherer
728c7e8bda Allow destructuring opaque types, since the patterns constrain the opaque types 2022-07-15 15:56:17 +00:00
Oli Scherer
12457f814c Some tracing helpers 2022-07-15 15:56:16 +00:00
Oli Scherer
0c6918fe21 Reuse a helper method instead of manually rolling it 2022-07-15 15:56:16 +00:00
Oli Scherer
7a8a048b58 Remove early return that would likely have caused miscompilations if it ever happened 2022-07-15 15:56:16 +00:00
Oli Scherer
eeb10335ce Pass one argument instead of fetching two fields of it at every call site 2022-07-15 15:56:16 +00:00
Oli Scherer
a034446fae Add some tracing instrumentation 2022-07-15 15:56:16 +00:00
Ralf Jung
c4cb043f06 interpret/visitor: support visiting with a PlaceTy 2022-07-15 11:54:20 -04:00
Oli Scherer
84a444a1f4 Introduce opaque type to hidden type projection 2022-07-15 15:49:22 +00:00
David Wood
78b19a90b7 passes: migrate half of check_attr
Migrate half of the `rustc_passes::check_attr` diagnostics to using
diagnostic derives and being translatable.
2022-07-15 16:13:49 +01:00
David Wood
81cf2294b4 macros: support adding warnings to diags
Both diagnostic and subdiagnostic derives were missing the ability to
add warnings to diagnostics - this is made more difficult by the `warn`
attribute already existing, so this name being unavailable for the
derives to use. `#[warn_]` is used instead, which requires
special-casing so that `{span_,}warn` is called instead of
`{span_,}warn_`.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:13:49 +01:00
David Wood
88c11c5bff macros: support MultiSpan in diag derives
Add support for `MultiSpan` with any of the attributes that work on a
`Span` - requires that diagnostic logic generated for these attributes
are emitted in the by-move block rather than the by-ref block that they
would normally have been generated in.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:13:49 +01:00
David Wood
c3fdf74885 errors: lint on LintDiagnosticBuilder::build
Apply the `#[rustc_lint_diagnostics]` attribute to
`LintDiagnosticBuilder::build` so that diagnostic migration lints will
trigger for it.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:13:47 +01:00
David Wood
06f480661f errors: impl IntoDiagnosticArg for char
Implements `IntoDiagnosticArg` for `char` using its `Debug`
implementation and introduces a macro for those types which just
delegate the implementation to `ToString`.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15 16:12:46 +01: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
Josh Triplett
d6b7480c2a Stabilize core::ffi::CStr, alloc::ffi::CString, and friends
Stabilize the `core_c_str` and `alloc_c_string` feature gates.

Change `std::ffi` to re-export these types rather than creating type
aliases, since they now have matching stability.
2022-07-15 03:10:35 -07:00
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
rhysd
fa3156ec42 add #[must_use] to Box::from_raw 2022-07-15 17:05:50 +09: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