When the number of type parameters in the associated function of an impl
and its trait differ, we now *always* point at the trait one, even if it
comes from a foreign crate. When it is local, we point at the specific
params, when it is foreign, we point at the whole associated item.
Fix#69944.
rename Generator to Coroutine
implements https://github.com/rust-lang/compiler-team/issues/682
While I did an automated replacement, I went through all changes manually to avoid renaming things like "id generators", "code generator", ...
I renamed files where that was necessary due to the contents referring to the crate name itself (mir opt, codegen or debuginfo tests), or required by tidy (feature gate docs)
* [x] rename various remaining abbreviated references to generators.
* [x] rename files
* [x] rename folders
* [x] add renamed feature: `generators`, ...
r? `@ghost`
Restructure `rustc_type_ir` a bit
1. Split `sty` into new `ty_kind`/`region_kind`/`const_kind` modules, so that when we uplift more kinds (e.g. `PredicateKind`, `ClauseKind`, and `ExistentialPredicate`), they can live in their own simple-to-understand files.
2. Split up the `structural_impls` module, which is a kitchen sink of random impls -- move `TypeFoldable` and `TypeVisitable` impls into existing `fold` and `visit` modules, respectively.
3. Move the `DebugWithInfcx` trait and blanket impls into a new `debug` module, and `TypeFlags` definition into a new `flags` module.
5. Move `Interner` trait into a new `interner` module. I expect this file to get a lot larger as we make the interner more powerful for the trait solver refactor.
r? `@ghost` for now, will assign once #116946 lands
Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
Fix#10537
changelog: Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
GDB 14 has a "gdb.ValuePrinter" tag class that was introduced to let
GDB evolve the pretty-printer API. Users of this tag are required to
hide any local attributes or methods. This patch makes this change to
the Rust pretty-printers. At present this is just a cleanup,
providing the basis for any future changes.
Currently, the Rust pretty-printers are registered in gdb using the
uninformative name "lookup":
(gdb) info pretty-printer
global pretty-printers:
[...]
objfile /home/tromey/[...]
lookup
It's nicer for users if the top-level registration is given a clear
name. Additionally, gdb lets users individually enable and disable
specific printers, provided they are registered correctly.
This patch implements both these ideas. Now the output looks like:
(gdb) info pretty-printer
global pretty-printers:
[...]
objfile /home/tromey/[...]
rust
StdArc
StdBTreeMap
StdBTreeSet
StdCell
StdHashMap
StdHashSet
StdNonZeroNumber
StdOsString
StdRc
StdRef
StdRefCell
StdRefMut
StdSlice
StdStr
StdString
StdVec
StdVecDeque
When encountering a binding that isn't found but has a typo suggestion
for a binding with a leading underscore, suggest changing the binding
definition instead of the use place.
Fix#60164.
[`map_identity`]: allow closure with type annotations
Fixes#9122
`.map(|a: u32| a)` can help type inference, so we should probably allow this and not warn about "unnecessary map of the identity function"
changelog: [`map_identity`]: allow closure with type annotations
Move where doc comment meant as comment check
The new place makes more sense and covers more cases beyond individual statements.
```
error: expected one of `.`, `;`, `?`, `else`, or an operator, found doc comment `//!foo
--> $DIR/doc-comment-in-stmt.rs:25:22
|
LL | let y = x.max(1) //!foo
| ^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator
|
help: add a space before `!` to write a regular comment
|
LL | let y = x.max(1) // !foo
| +
```
Fix#65329.