about summary refs log tree commit diff
path: root/src/test/ui/ufcs
AgeCommit message (Collapse)AuthorLines
2021-02-22Update test cases0yoyoyo-12/+12
2021-01-10Rework diagnostics for wrong number of generic argsPatryk Wychowaniec-5/+49
2020-10-06Fix tests from rebaseMatthew Jasper-0/+1
2020-09-02pretty: trim paths of unique symbolsDan Aloni-1/+1
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-22Use smaller def span for functionsAaron Hill-4/+4
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-03-21Bless testsLeSeulArtichaut-2/+2
2020-03-12update testsMark Mansi-8/+8
2020-02-21Implement RFC 2532 – Associated Type DefaultsJonas Schievink-7/+7
2020-01-08Unify output of "variant not found" errorsEsteban Küber-4/+4
2019-11-18Surround types with backticks in type errorsEsteban Küber-2/+2
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-12/+12
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-0/+21
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-26Rollup merge of #65773 - estebank:sugg-whitespace, r=CentrilMazdak Farrokhzad-0/+2
Increase spacing for suggestions in diagnostics Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages. r? @Centril
2019-10-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+2
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
2019-10-23Update ui testsGuillaume Gomez-1/+1
2019-10-17Update ui testsGuillaume Gomez-1/+1
2019-10-11Print lifetimes with backticksYuki Okushi-4/+4
2019-09-02Refer to "`self` type" instead of "receiver type"Esteban Küber-18/+19
2019-07-16Update the help message on error for self typeLimira-3/+3
2019-04-29Suggest try_into when possibleEsteban Küber-0/+8
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-4/+3
2019-04-10clarify what the item is in "not a module" errorAndy Russell-6/+6
2019-03-23Tweak spans for E0599Esteban Küber-6/+2
2019-03-11Update testsVadim Petrochenkov-36/+36
2019-01-09clarify resolve typo suggestionAndy Russell-7/+7
Include the kind of the binding that we're suggesting, and use a structured suggestion.
2018-12-26Fixed more tests.Alexander Regueiro-4/+8
2018-12-25Remove licensesMark Rousskov-99/+59
2018-12-20Refactor and add comments to code in receiver_is_validMichael Hewson-9/+9
also updated some error messages removed the code manually checking for `receiver_ty: Deref<Target=self_ty>`, in favour of using autoderef but only doing one iteration. This will cause error messages to be more consistent. Before, a "mismatched method receiver" error would be emitted when `receiver_ty` was valid except for a lifetime parameter, but only when `feature(arbitrary_self_types)` was enabled, and without the feature flag the error would be "uncoercible receiver". Now it emits "mismatched method receiver" in both cases.
2018-11-18resolve: Avoid sentence breaks in diagnosticsVadim Petrochenkov-8/+8
2018-10-11structured suggestion for E0223 ambiguous associated typeZack M. Davis-3/+1
It looks like we tend to use angle-brackets around the placeholder in the few other places we use `Applicability::HasPlaceholders`, but that would be confusing here, so ...
2018-08-24updates tests to use new error codeMatthew Russo-2/+2
2018-08-20Update new ui testsvarkor-2/+2
2018-08-19Fix some remaining testsvarkor-1/+1
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+527