about summary refs log tree commit diff
path: root/src/test/ui/resolve/resolve-inconsistent-names.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-36/+0
2022-07-28suggest adding/removing `ref` for binding patternsTakayuki Maeda-0/+1
2022-04-30When encountering a binding that could be a const or unit variant, suggest ↵Esteban Kuber-5/+4
the right path
2020-03-04resolve, inconsistent binding mode: tweak wording.Mazdak Farrokhzad-1/+1
2019-08-10Suggest using a qualified path in patterns with inconsistent bindingsJakub Adam Wieczorek-1/+30
A program like the following one: ```rust enum E { A, B, C } fn f(x: E) -> bool { match x { A | B => false, C => true } } ``` is rejected by the compiler due to `E` variant paths not being in scope. In this case `A`, `B` are resolved as pattern bindings and consequently the pattern is considered invalid as the inner or-patterns do not bind to the same set of identifiers. This is expected but the compiler errors that follow could be surprising or confusing to some users. This commit adds a help note explaining that if the user desired to match against variants or consts, they should use a qualified path. The note is restricted to cases where the identifier starts with an upper-case sequence so as to reduce the false negatives. Since this happens during resolution, there's no clean way to check what the patterns match against. The syntactic criterium, however, is in line with the convention that's assumed by the `non-camel-case-types` lint.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+17