| Age | Commit message (Collapse) | Author | Lines |
|
Fix ICEs with `@ ..` binding
This reverts #74557 and introduces an alternative fix while ensuring that #74954 is not broken.
The diagnostics are verbose though, it fixes three related issues.
cc #74954, #74539, and #74702
|
|
Deduplicate `::` -> `:` typo errors
Deduplicate errors caused by the same type ascription typo, including
ones suggested during parsing that would get reported again during
resolve. Fix #70382.
|
|
report kind of deprecated item in message
This is important for fields, which are incorrectly referred to as
"items".
|
|
|
|
* Deduplicate type ascription LHS errors
* Remove duplicated `:` -> `::` suggestion from parse error
* Tweak wording to be more accurate
* Modify `current_type_ascription` to reduce span wrangling
* remove now unnecessary match arm
* Add run-rustfix to appropriate tests
|
|
|
|
This reverts commit f5e5eb6f46ef2cf0dd45dba4f975305509334fc6.
|
|
|
|
|
|
|
|
This is important for fields, which are incorrectly referred to as
"items".
|
|
delay_span_bug instead of silent ignore
This is a follow-up to #74557.
r? @pnkfelix
|
|
correctly deal with unsorted generic parameters
We now stop sorting generic params and instead correctly handle unsorted params in the rest of the compiler.
We still restrict const params to come after type params though, so this PR does not change anything which
is visible to users.
This might slightly influence perf, so let's prevent any unintentional rollups. @bors rollup=never
r? @varkor
|
|
Internally unify rustc_deprecated and deprecated
This PR intentionally tries to be "featureless" in that the behavior is not altered for either attribute, though it more clearly exposes cases where that is the case in the code.
|
|
|
|
|
|
|
|
This should not be a change in behavior.
|
|
Fix an ICE on an invalid `binding @ ...` in a tuple struct pattern
Fixes #74539.
|
|
|
|
This has been put in place to patch over an ICE caused when we encounter
a non-static lifetime in a const generic during borrow checking. This
restriction may be relaxed in the future, but we need more discussion
before then, and in the meantime we should still deal with this ICE.
Fixes issue #60814
|
|
|
|
|
|
- Accept DefId in resolve_str_path_error
This will probably break lots of internal invariants.
|
|
|
|
forbid generic params in the type of const params
implements and closes #74152
fixes #74101, closes #71169, fixes #73491, closes #62878
@eddyb and I talked [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/type.20of.20const.20parameters/near/203405696) about this and we probably want to also forbid generic consts in the default
type of a parameter, e.g. `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`, this is currently still allowed
and I will probably fix that in a followup PR.
r? @varkor @eddyb
|
|
|
|
|
|
This matches the previous behavior of everybody_loops and is also more
consistent than special-casing impls.
|
|
|
|
|
|
Just use a boolean instead.
|
|
- Remove unnecessary `should_loop` variable
- Report errors for trait implementations
These should give resolution errors because they are visible outside the
current scope. Without these errors, rustdoc will give ICEs:
```
thread 'rustc' panicked at 'attempted .def_id() on invalid res: Err', /home/joshua/src/rust/src/libstd/macros.rs:16:9
15: rustc_hir::def::Res<Id>::def_id
at /home/joshua/src/rust/src/librustc_hir/def.rs:382
16: rustdoc::clean::utils::register_res
at src/librustdoc/clean/utils.rs:627
17: rustdoc::clean::utils::resolve_type
at src/librustdoc/clean/utils.rs:587
```
- Add much more extensive tests
+ fn -> impl -> fn
+ fn -> impl -> fn -> macro
+ errors in function parameters
+ errors in trait bounds
+ errors in the type implementing the trait
+ unknown bounds for the type
+ unknown types in function bodies
+ errors generated by macros
- Use explicit state instead of trying to reconstruct it from random info
- Use an enum instead of a boolean
- Add example of ignored error
|
|
Instead, ignore resolution errors that occur in item bodies.
The reason this can't ignore item bodies altogether is because
`const fn` could be used in generic types, for example `[T; f()]`
|
|
More static symbols
These commits add some more static symbols and convert lots of places to use them.
r? @oli-obk
|
|
In various ways, such as changing functions to take a `Symbol` instead
of a `&str`.
|
|
Note that the output of `unpretty-debug.stdout` has changed. In that
test the hash values are normalized from a symbol numbers to small
numbers like "0#0" and "0#1". The increase in the number of static
symbols must have caused the original numbers to contain more digits,
resulting in different pretty-printing prior to normalization.
|
|
Structured suggestion when not using struct pattern
r? @petrochenkov
|
|
When encountering a unit or tuple pattern for a struct-like item, suggest
using the correct pattern.
Use `insert_field_names_local` when evaluating variants and store field
names even when the list is empty in order to produce accurate
structured suggestions.
|
|
Minor refactor for rustc_resolve diagnostics match
Use `matches!` instead of old `if let`
|
|
Reword incorrect `self` token suggestion
|
|
Add a help to use `in_band_lifetimes` in nightly
Fixes #73775
|
|
Other terms are more inclusive and precise.
|
|
Use `matches!` instead of old `if let`
|
|
|
|
|
|
|
|
r=petrochenkov
Tweak `::` -> `:` typo heuristic and reduce verbosity
Do not trigger on correct type ascription expressions with trailing
operators and _do_ trigger on likely path typos where a turbofish is
used.
On likely path typos, remove note explaining type ascription.
Clean up indentation.
r? @petrochenkov
|
|
Avoid "blacklist"
Other terms are more inclusive and precise.
Clippy still has a lint named "blacklisted-name", but renaming it would
be a breaking change, so is left for future work.
The target configuration option "abi-blacklist" has been depreciated and
renamed to "unsupported-abis". The old name continues to work.
|
|
|