| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Rollup of 8 pull requests
Successful merges:
- #121025 (add known-bug tests for derive failure to detect packed repr)
- #121194 (Refactor pre-getopts command line argument handling)
- #121563 (Use `ControlFlow` in visitors.)
- #122173 (Don't ICE in CTFE if raw/fn-ptr types differ)
- #122175 (Bless tidy issues order)
- #122179 (rustc: Fix typo)
- #122181 (Fix crash in internal late lint checking)
- #122183 (interpret: update comment about read_discriminant on uninhabited variants)
Failed merges:
- #122076 (Tweak the way we protect in-place function arguments in interpreters)
- #122132 (Diagnostic renaming 3)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
`#[repr(packed)]` attributes that are not visible before macro expansion
|
|
|
|
|
|
This gives one extra error message on two tests, but is necessary to fix
bigger problems caused by the cancellation of stashed errors.
(Note: why not just avoid stashing altogether? Because that resulted in
additional output changes.)
|
|
|
|
|
|
|
|
Continue compilation after check_mod_type_wf errors
The ICEs fixed here were probably reachable through const eval gymnastics before, but now they are easily reachable without that, too.
The new errors are often bugfixes, where useful errors were missing, because they were reported after the early abort. In other cases sometimes they are just duplication of already emitted errors, which won't be user-visible due to deduplication.
fixes https://github.com/rust-lang/rust/issues/120860
|
|
|
|
|
|
|
|
Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items
Fixes #109596
Fixes #119936
|
|
|
|
|
|
|
|
|
|
|
|
This gets us more accurate suggestions.
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #117981 (Remove deprecated `--check-cfg` syntax)
- #118177 (Suppress warnings in LLVM wrapper when targeting MSVC)
- #118317 (tip for define macro name after `macro_rules!`)
- #118504 (Enforce `must_use` on associated types and RPITITs that have a must-use trait in bounds)
- #118660 (rustc_arena: add `alloc_str`)
- #118681 (Fix is_foreign_item for StableMIR instance )
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
|
|
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
|
|
When we have a resolution error when looking at a fully qualified path
on a type, look for all associated functions on inherent impls that
return `Self` and mention them to the user.
Fix #69512.
|
|
Suggest trait bounds for used associated type on type param
Fix #101351.
When an associated type on a type parameter is used, and the type parameter isn't constrained by the correct trait, suggest the appropriate trait bound:
```
error[E0220]: associated type `Associated` not found for `T`
--> file.rs:6:15
|
6 | field: T::Associated,
| ^^^^^^^^^^ there is a similarly named associated type `Associated` in the trait `Foo`
|
help: consider restricting type parameter `T`
|
5 | struct Generic<T: Foo> {
| +++++
```
When an associated type on a type parameter has a typo, suggest fixing
it:
```
error[E0220]: associated type `Baa` not found for `T`
--> $DIR/issue-55673.rs:9:8
|
LL | T::Baa: std::fmt::Debug,
| ^^^ there is a similarly named associated type `Bar` in the trait `Foo`
|
help: change the associated type name to use `Bar` from `Foo`
|
LL | T::Bar: std::fmt::Debug,
| ~~~
```
|
|
|
|
Fix #101351.
When an associated type on a type parameter is used, and the type
parameter isn't constrained by the correct trait, suggest the
appropriate trait bound:
```
error[E0220]: associated type `Associated` not found for `T`
--> file.rs:6:15
|
6 | field: T::Associated,
| ^^^^^^^^^^ there is a similarly named associated type `Associated` in the trait `Foo`
|
help: consider restricting type parameter `T`
|
5 | struct Generic<T: Foo> {
| +++++
```
When an associated type on a type parameter has a typo, suggest fixing
it:
```
error[E0220]: associated type `Baa` not found for `T`
--> $DIR/issue-55673.rs:9:8
|
LL | T::Baa: std::fmt::Debug,
| ^^^ there is a similarly named associated type `Bar` in the trait `Foo`
|
help: change the associated type name to use `Bar` from `Foo`
|
LL | T::Bar: std::fmt::Debug,
| ~~~
```
|
|
Replace `HashMap` with `IndexMap` in pattern binding resolve
fixes https://github.com/rust-lang/rust/pull/114332#discussion_r1284189179
|
|
It will be iterated over, so we should avoid using `HashMap`.
|
|
resolve: skip underscore character during candidate lookup
Fixes #116164
In use statement, an underscore is merely a placeholder symbol and does not bind to any name. Therefore, it can be safely ignored.
|
|
|
|
|
|
Tweak output.
Fix #115992.
|
|
More accurate suggestion for `self.` and `Self::`
Detect that we can't suggest `self.` in an associated function without `&self` receiver.
Partially address #115992.
r? ``@compiler-errors``
|
|
|
|
|
|
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions.
The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
|
|
Improve diagnostic for generic params from outer items (E0401)
Generalize the wording of E0401 to talk about *outer items* instead of *outer functions* since the current phrasing is outdated. The outer item can be a function, constant, trait, ADT or impl block (see the new UI test for the more exotic examples).
Further, don't suggest introducing generic parameters to constant items unless the feature `generic_const_items` is enabled.
Lastly, make E0401 translatable while we're at it.
Fixes #115720.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chenyukang:yukang-fix-114433-unused-qualifications, r=compiler-errors
Remove invalid lint when there is a generic argument in prefix path
Fixes #114433
|
|
|