Fix rustc_parse_format precision & width spans
When a `precision`/`width` was `CountIsName - {:name$}` or `CountIs - {:10}` the `precision_span`/`width_span` was set to `None`
For `width` the name span in `CountIsName(_, name_span)` had its `.start` off by one
r? ``@fee1-dead`` / cc ``@PrestonFrom`` since this is similar to #99987
Migrate `rustc_plugin_impl` to `SessionDiagnostic`
Migration of the `rustc_plugin_impl` crate.
~Draft PR because it is blocked on #100694 for `#[fatal(...)]` support~ (this has been merged, and I've changed over to `#[diag(...)]` now too), but I would also like to know if what I did with `LoadPluginError` is okay, because all it does is display the error message from `libloading` ([See conversation on zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.23100717.20diagnostic.20translation/near/294327843)). This crate is apparently for a deprecated feature which is used by servo, so I don't know how much this matters anyway.
InferCtxt tainted_by_errors_flag should be Option<ErrorGuaranteed>
Fixes#100321.
Use Cell<Option<ErrorGuaranteed>> to guarantee that we emit an error when that flag is set.
Do not re-parse function signatures to suggest generics
This PR uses the existing resolution rib infrastructure to channel the correct span information to suggest generic parameters. This allows to avoid re-parsing a function's source code.
Drive-by cleanup: this removes useless `FnItemRibKind` from late resolution ribs. All the use cases are already covered by `ItemRibKind` and `AssocItemRibKind` which have more precise semantics.
Cranelift 0.87 now supports lowering `fma` as a libcall on x86 [0].
With 0.88 enabling the native x86 instruction under the `has_fma` flag.
aarch64 and s390x already support this as a native instruction, so it's
nice that we emit it for those.
We can't lower the SIMD version using the `fma` instruction since the
lowering can fail if the x86 `has_fma` flag is not enabled. Cranelift
doesn't yet know how to fallback for these cases
[0]: 709716bb8e
Align android `sigaddset` impl with the reference impl from Bionic
In https://github.com/rust-lang/rust/pull/100737 I noticed we were treating the sigset_t as an array of bytes, while referencing code from android (ad8dcd6023/libc/include/android/legacy_signal_inlines.h) which treats it as an array of unsigned long.
That said, the behavior difference is so subtle here that it's not hard to see why nobody noticed. This fixes the implementation to be equivalent to the one in bionic.
Rollup of 9 pull requests
Successful merges:
- #100382 (Make the GATS self outlives error take into GATs in the inputs)
- #100565 (Suggest adding a missing semicolon before an item)
- #100641 (Add the armv4t-none-eabi target to the supported_targets)
- #100789 (Use separate infcx to solve obligations during negative coherence)
- #100832 (Some small bootstrap cleanup)
- #100861 (fix ICE with extra-const-ub-checks)
- #100862 (tidy: remove crossbeam-utils)
- #100887 (Refactor part of codegen_call_terminator)
- #100893 (Remove out-of-context comment in `mem::MaybeUninit` documentation)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Remove out-of-context comment in `mem::MaybeUninit` documentation
Reverted the comment to an earlier version to avoid confusion: neither raw pointer assignment nor `ptr::write` is used inside the for loop.
Refactor part of codegen_call_terminator
I was reading through this code and found the chain of `if let` and a nested match on the same value that was matched in the `if let` to be kind of hard to follow. This PR cleans it up by flattening the `if let` chain and nested match into a single `match` expression.
Some small bootstrap cleanup
This is a collection of a few small cleanups. See commits for more details.
* Remove some unused fields from the tool_extended macro.
* Remove rustfmt from publish_toolstate.
* Remove Steve from toolstate failure notices.
* Don't allow rustfmt to fail on dist.
Use separate infcx to solve obligations during negative coherence
I feel like I fixed this already but I may have fixed it then forgot to push the branch...
Also fixes up some redundant param-envs being passed around (since they're already passed around in the `Obligation`)
Fixes#99662
r? ``@spastorino``
Add the armv4t-none-eabi target to the supported_targets
This target was added in #100244 but forgot to add it to the macro in the `mod.rs` file.
``@Lokathor``
Make the GATS self outlives error take into GATs in the inputs
Before, the reasoning was that outlives should factor in to the outlives error, because that value is produced and inputs aren't. However, this is potentially confusing, and we can just require this for now and relax it later if we need. GATs in where clauses still don't count for the self outlives error, and I've added a test for that.
This now errors:
```rust
trait Input {
type Item<'a>;
//~^ missing required
fn takes_item<'a>(&'a self, item: Self::Item<'a>);
}
```
I've also added a test that this does not:
```rust
trait WhereClause {
type Item<'a>;
fn takes_item<'a>(&'a self) where Self::Item<'a>: ;
}
```
r? ``@compiler-errors``