about summary refs log tree commit diff
path: root/src/test/ui/resolve/privacy-enum-ctor.stderr
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-395/+0
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-60/+30
2022-10-19instantiate -> constructMichael Goulet-3/+3
2022-08-31Rollup merge of #101161 - ldm0:ldm_fix_diagnostic, r=cjgillotMatthias Krüger-5/+5
Fix uintended diagnostic caused by `drain(..)` Calling `drain(..)` makes later `suggestable_variants.is_empty()` always true, which makes the diagnostics unintended.
2022-08-31Fix uintended diagnostic caused by `drain(..)`Donough Liu-5/+5
2022-08-28More descriptive argument placeholdersMichael Goulet-6/+6
2022-07-16Be more precise when suggesting removal of parens on unit adt ctorMichael Goulet-6/+6
2022-07-06use `named_span` in case of tuple variantTakayuki Maeda-3/+3
2022-06-16diagnostics: fix trailing spaceklensy-4/+4
2022-05-03Tweak wordingEsteban Kuber-2/+2
2022-05-03When suggesting to import an item, also suggest changing the path if appropriateEsteban Küber-1/+6
When we don't find an item we search all of them for an appropriate import and suggest `use`ing it. This is sometimes done for expressions that have paths with more than one segment. We now also suggest changing that path to work with the `use`. Fix #95413
2021-11-16Suggest removal of arguments for unit variant, not replacementEsteban Kuber-6/+9
2021-10-17Some "parenthesis" and "parentheses" fixesr00ster91-3/+3
2021-09-26Improve diagnostics for inaccessible itemsFabian Wolff-8/+20
2021-09-26Do not suggest importing inaccessible itemsFabian Wolff-36/+12
2021-08-11Modify structured suggestion outputEsteban Küber-26/+26
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2020-10-15resolve: suggest variants with placeholdersDavid Wood-10/+102
This commit improves the diagnostic modified in rust-lang/rust#77341 to suggest not only those variants which do not have fields, but those with fields (by suggesting with placeholders). Signed-off-by: David Wood <david@davidtw.co>
2020-09-29resolve: improve "try using the enum's variant"David Wood-35/+8
This commit improves the "try using the enum's variant" suggestion: - Variants in suggestions would not result in more errors (e.g. use of a struct variant is only suggested if the suggestion can trivially construct that variant). Therefore, suggestions are only emitted for variants that have no fields (since the suggestion can't know what value fields would have). - Suggestions include the syntax for constructing the variant. If a struct or tuple variant is suggested, then it is constructed in the suggestion - unless in pattern-matching or when arguments are already provided. - A help message is added which mentions the variants which are no longer suggested. Signed-off-by: David Wood <david@davidtw.co>
2020-09-02pretty: trim paths of unique symbolsDan Aloni-12/+12
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-10Do not suggest similarly named enclosing itemEsteban Küber-7/+0
2020-08-10Tweak ordering of suggestionsEsteban Küber-8/+8
Modify logic to make it easier to follow and recover labels that would otherwise be lost.
2020-07-14Suggest struct pat on incorrect unit or tuple patEsteban Küber-4/+4
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.
2020-06-23Add re-exports to use suggestionsDan Aloni-4/+4
In the following example, an inaccessible path is suggested via `use foo::bar::X;` whereas an accessible public exported path can be suggested instead. ``` mod foo { mod bar { pub struct X; } pub use self::bar::X; } fn main() { X; } ``` This fixes the issue.
2020-05-07reword "possible candidate" import suggestionAndy Russell-6/+6
2020-03-23Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasperMazdak Farrokhzad-16/+22
Increase verbosity when suggesting subtle code changes Do not suggest changes that are actually quite small inline, to minimize the likelihood of confusion. Fix #69243.
2020-03-22Normalize wording of privacy access labelsEsteban Küber-4/+4
2020-03-22Increase verbosity when suggesting subtle code changesEsteban Küber-12/+18
2020-03-21Bless testsLeSeulArtichaut-59/+25
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-4/+28
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-12/+15
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-6/+6
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-12/+64
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+12
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-09-22Point at definition when misusing ADTEsteban Küber-8/+28
When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-08-09review comments: typo and rewordingEsteban Küber-3/+3
2019-08-09Differentiate between tuple structs and tuple variantsEsteban Küber-3/+3
2019-08-09When suggesting fn call use an appropriate number of placeholder argumentsEsteban Küber-3/+3
2019-08-09Suggest calling function on type error when finding bare fnEsteban Küber-3/+21
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-1/+1
2019-03-21use suggestions for "enum instead of variant" errorAndy Russell-23/+42
2019-01-09clarify resolve typo suggestionAndy Russell-8/+26
Include the kind of the binding that we're suggesting, and use a structured suggestion.
2018-12-25Remove licensesMark Rousskov-23/+23
2018-11-10in which the E0618 "expected function" diagnostic gets a makeoverZack M. Davis-3/+9
Now the main span focuses on the erroneous not-a-function callee, while showing the entire call expression is relegated to a secondary span. In the case where the erroneous callee is itself a call, we point out the definition, and, if the call expression spans multiple lines, tentatively suggest a semicolon (because we suspect that the "outer" call is actually supposed to be a tuple). The new `bug!` assertion is, in fact, safe (`confirm_builtin_call` is only called by `check_call`, which is only called with a first arg of kind `ExprKind::Call` in `check_expr_kind`). Resolves #51055.
2018-10-28resolve: More precise spans for privacy errorsVadim Petrochenkov-8/+8
2018-03-14update testsGuillaume Gomez-2/+2
2018-02-26Update UI testsVadim Petrochenkov-11/+11
2018-02-26Update UI testsVadim Petrochenkov-26/+26
2018-02-25Update ui testsGuillaume Gomez-0/+2
2018-01-15Further tweaks to the outputEsteban Küber-0/+225
- Properly address Variant Ctors - Show signature if span of trait method without `self` is not available