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.
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'
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.
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
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>
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>
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>
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>
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`
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`
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`
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`
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.
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.
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