| Age | Commit message (Collapse) | Author | Lines |
|
more case""
This reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2.
It retains the test added in that commit as a check-pass test, intended to
prevent future (unintentional) regressions.
|
|
Revert "resolve: Avoid "self-confirming" import resolutions in one more case"
And remove the assert that https://github.com/rust-lang/rust/pull/70236 tried to avoid instead.
Closes https://github.com/rust-lang/rust/issues/74556.
|
|
This commit modifies name resolution to emit an error when non-static
lifetimes are used in anonymous constants when the `min_const_generics`
feature is enabled.
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
I think it reads better this way.
|
|
|
|
|
|
use if let instead of single match arm expressions
use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match)
|
|
use matches!() macro for simple if let conditions
|
|
reduce nesting (clippy::single_match)
|
|
|
|
(clippy::manual_strip)
|
|
fix a couple of stylistic clippy warnings
namely:
clippy::redundant_pattern_matching
clippy::redundant_pattern
clippy::search_is_some
clippy::filter_next
clippy::into_iter_on_ref
clippy::clone_on_copy
clippy::needless_return
|
|
namely:
clippy::redundant_pattern_matching
clippy::redundant_pattern
clippy::search_is_some
clippy::filter_next
clippy::into_iter_on_ref
clippy::clone_on_copy
clippy::needless_return
|
|
Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>
|
|
* Change error message for type param in a const expression when using
min_const_generics
* Change ParamInNonTrivialAnonConst to contain an extra bool used for
distinguishing whether the passed-in symbol is a type or a value.
|
|
|
|
|
|
Give better diagnostic when using a private tuple struct constructor
Fixes #75907
Some notes:
1. This required some deep changes, including removing a Copy impl for PatKind. If some tests fail, I would still appreciate review on the overall approach
2. this only works with basic patterns (no wildcards for example), and fails if there is any problems getting the visibility of the fields (i am not sure what the failure that can happen in resolve_visibility_speculative, but we check the length of our fields in both cases against each other, so if anything goes wrong, we fall back to the worse error. This could be extended to more patterns
3. this does not yet deal with #75906, but I believe it will be similar
4. let me know if you want more tests
5. doesn't yet at the suggestion that `@yoshuawuyts` suggested at the end of their issue, but that could be added relatively easily (i believe)
|
|
|
|
A `Visibility` does not have outer attributes, so we only capture tokens
when parsing a `macro_rules!` matcher
|
|
|
|
remove redundant clones
(clippy::redundant_clone)
|
|
Improve unresolved use error message
"use of undeclared type or module `foo`" doesn't mention that it could be a crate.
This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate.
I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case.
|
|
(clippy::redundant_clone)
|
|
Give a better error message for duplicate built-in macros
Minor follow-up to https://github.com/rust-lang/rust/pull/75176 giving a better error message for duplicate builtin macros. This would have made it a little easier to debug.
r? @petrochenkov
|
|
|
|
Previously, this would say no such macro existed, but this was
misleading, since the macro _did_ exist, it was just already seen.
- Say where the macro was previously defined
- Add long-form error message
|
|
Detect potential cases where `if let` was meant but `let` was left out.
Fix #44990.
|
|
|