submodules: update clippy from fc24fce7 to 721f688e
Fixes clippy toolstate.
Changes:
````
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````
r? @oli-obk
Fixes clippy toolstate
Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````
Resolve `$crate`s for pretty-printing at more appropriate time
Doing it in `BuildReducedGraphVisitor` wasn't a good idea, identifiers wasn't actually visited half of the time.
As a result some `$crate`s weren't resolved and were therefore pretty-printed as `$crate` literally, which turns into two tokens during re-parsing of the pretty-printed text.
Now we are visiting and resolving `$crate` identifiers in an item right before sending that item to a proc macro attribute or derive.
Fixes https://github.com/rust-lang/rust/issues/57089
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end
This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
Implement the new-style trait solver
Final PR of what I believe to be a minimally working implementation of the new-style trait solver.
The new trait solver can be used by providing the `-Z chalk` command line flag. It is currently used everywhere in `rustc_typeck`, and for everything relying on `rustc::infer::canonical::query_response::enter_canonical_trait_query`.
The trait solver is invoked in rustc by using the `evaluate_goal` canonical query. This is not optimal because each call to `evaluate_goal` creates a new `chalk_engine::Forest`, hence rustc cannot use answers to intermediate goals produced by the root goal. We'll need to change that but I guess that's ok for now.
Some next steps, I think, are:
* handle region constraints: region constraints are computed but are completely ignored for now, I think we may need additional support from `chalk_engine` (as a side effect, types or trait references with outlive requirements cannot be proved well-formed)
* deactivate eager normalization in the presence of `-Z chalk` in order to leverage the lazy normalization strategy of the new-style trait solver
* add the remaining built-in impls (only `Sized` is supported currently)
* transition the compiler to using generic goals instead of predicates that still refer to named type parameters etc
I added a few very simple tests to check that the new solver has the right behavior, they won't be needed anymore once it is mature enough. Additionally it shows off that we get [implied bounds](https://github.com/rust-lang/rust/issues/44491) for free.
r? @nikomatsakis
Call poly_project_and_unify_type on types that contain inference types
Commit f57247c48c (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type *contains* an
inference variable (e.g. '&_', 'MyType<_>'), it required the type to
*be* an inference variable (i.e. only '_' would match).
This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.
Fixes#56822
Add `io` and `arch` modules to `std::os::fortanix_sgx`
This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target.
### io
`io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`.
### arch
`arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.
When a format string has escaped whitespace characters format
arguments were shifted by one per each escaped character. Account
for these escaped characters when synthesizing the spans.
Fix#55155.
Various changes to string format diagnostics
- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests
```
error: invalid format string: expected `'}'`, found `'t'`
--> $DIR/ifmt-bad-arg.rs:85:1
|
LL | ninth number: {
| - because of this opening brace
LL | tenth number: {}",
| ^ expected `}` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
```
Fix#53837.