Rename `Ty::is_ty_infer` -> `Ty::is_ty_or_numeric_infer`
Makes sure people are aware that they may have a type variable *or* an int/float variable.
r? `@oli-obk` https://github.com/rust-lang/rust/pull/106322#issuecomment-1376913539 but I could instead implement your solution, let me know.
(This will conflict with #106322 for now, ignore that 😄)
Render missing generics suggestion verbosely
It's a bit easier to read like this, especially ones that are appending new generics onto an existing list, like ": `, T`" which render somewhat poorly inline.
Also don't suggest `dyn` as a type parameter to add, even if technically that's valid in edition 2015.
Migrate `rustc_lint` lint diagnostics
Part 2 of [Migrate `rustc_lint` errors to `SessionDiagnostic`](https://github.com/rust-lang/rust/pull/100776)
r? `@davidtwco`
# TODO
- [x] Refactor some lints manually implementing `DecorateLint` to use `Option<Subdiagnostic>`.
- [x] Add `#[rustc_lint_diagnostics]` to lint functions in `context.rs`.
- [x] Migrate `hidden_unicode_codepoints.rs`.
- [x] Migrate `UnsafeCode` in `builtin.rs`.
- [x] Migrate the rest of `builtin.rs`.
Revert "Make nested RPITIT inherit the parent opaque's generics."
This reverts commit e2d41f4c97, and adjusts the `tests/ui/async-await/in-trait/nested-rpit.rs` test.
r? `@cjgillot`
fixes#106332, manually verified because it had no minimization :/
reopens#105197
cc #106729
Mark ZST as FFI-safe if all its fields are PhantomData
This presents one possible solution to issue: #106629.
This is my first (tentative) contribution to the compiler itself.
I'm looking forward for comments and feedback
Closes: #106629
remove unreachable error code `E0490`
AFAIK, the untested and undocumented error code `E0490` is now unreachable, it was from the days of the original borrow checker.
cc ``@GuillaumeGomez`` #61137
Handle inference variables in `CollectAllMismatches` correctly
1. Fix#106240
2. Treat int/float type variables correctly (see `src/test/ui/iterators/invalid-iterator-chain-with-int-infer.rs`), so we can point out things like "`Iterator::Item` changed to `{integer}` here"
Harden the pre-tyctxt query system against accidental recomputation
While the current compiler has no issues where we `take` and then compute the query again, in https://github.com/rust-lang/rust/pull/105462 I accidentally introduced such a case.
I also took the opportunity to remove `peek_mut`, which is only ever used for `global_tcx` to then invoke `enter`. I added an `enter` method directly on the query.
Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`
This removes the need for <>><><><<>> dances and makes the code a bit nicer.
Not sure if `astconv` is the best name though, maybe someone has a better idea?
Move autoderef to `rustc_hir_analysis`
Not sure if this is a change we actually want, but autoderef really is only (functionally) used by `rustc_hir_analysis` and `rustc_hir_typeck`, so it probably should live there.
Instead, implement a separate autoderef helper in `TypeErrCtxt` for the one use-case that goes against the ordering of the crate graph..
Migrate mir_build diagnostics 2 of 3
The first three commits are fairly boring, however I've made some changes to the output of the match checking diagnostics.
Clean up `OnUnimplementedFormatString::verify`
Lift the always-allowed symbols to a static array and replace a `match iter().find(...)` with `iter().any(...)`
Allow codegen to unsize `dyn*` to `dyn`
`dyn* Trait` is just another type that implements `Trait`, so we should be able to unsize `&dyn* Trait` into `&dyn Trait` perfectly fine, same for `Box` and other unsizeable types.
Fixes#106488