rust/src/test/ui/span
David Wood 2537a8aa7a
syntax: improve parameter without type suggestions
This commit improves the suggestions provided when function parameters
do not have types:

- A new suggestion is added for arbitrary self types, which suggests
adding `self: ` before the type.

- Existing suggestions are now provided when a `<` is found where a `:`
was expected (previously only `,` and `)` or trait items), this gives
suggestions in the case where the unnamed parameter type is generic
in a free function.

- The suggestion that a type name be provided (e.g. `fn foo(HashMap<u32>)`
-> `fn foo(HashMap: TypeName<u32>)`) will no longer occur when a `<` was
found instead of `:`.

- The ident will not be used for recovery when a `<` was found instead
of `:`.

Signed-off-by: David Wood <david@davidtw.co>
2019-10-02 09:51:27 +01:00
..
borrowck-borrow-overloaded-auto-deref-mut.rs
borrowck-borrow-overloaded-auto-deref-mut.stderr
borrowck-borrow-overloaded-deref-mut.rs
borrowck-borrow-overloaded-deref-mut.stderr
borrowck-call-is-borrow-issue-12224.rs
borrowck-call-is-borrow-issue-12224.stderr
borrowck-call-method-from-mut-aliasable.rs
borrowck-call-method-from-mut-aliasable.stderr
borrowck-fn-in-const-b.rs
borrowck-fn-in-const-b.stderr
borrowck-let-suggestion-suffixes.rs
borrowck-let-suggestion-suffixes.stderr
borrowck-object-mutability.rs
borrowck-object-mutability.stderr
borrowck-ref-into-rvalue.rs
borrowck-ref-into-rvalue.stderr
coerce-suggestions.rs
coerce-suggestions.stderr Change to use exprPrecedence instead of exprKind. 2019-10-01 05:00:22 -04:00
destructor-restrictions.rs
destructor-restrictions.stderr
dropck_arr_cycle_checked.rs
dropck_arr_cycle_checked.stderr
dropck_direct_cycle_with_drop.rs
dropck_direct_cycle_with_drop.stderr
dropck_misc_variants.rs
dropck_misc_variants.stderr
dropck_vec_cycle_checked.rs
dropck_vec_cycle_checked.stderr
dropck-object-cycle.rs
dropck-object-cycle.stderr
E0046.rs
E0046.stderr
E0057.rs
E0057.stderr
E0072.rs
E0072.stderr
E0204.rs
E0204.stderr
E0493.rs
E0493.stderr update tests 2019-09-30 13:47:12 +02:00
E0535.rs
E0535.stderr
E0536.rs
E0536.stderr
E0537.rs
E0537.stderr
gated-features-attr-spans.rs
gated-features-attr-spans.stderr
impl-wrong-item-for-trait.rs
impl-wrong-item-for-trait.stderr
import-ty-params.rs
import-ty-params.stderr
issue28498-reject-ex1.rs
issue28498-reject-ex1.stderr
issue28498-reject-lifetime-param.rs
issue28498-reject-lifetime-param.stderr
issue28498-reject-passed-to-fn.rs
issue28498-reject-passed-to-fn.stderr
issue28498-reject-trait-bound.rs
issue28498-reject-trait-bound.stderr
issue-7575.rs
issue-7575.stderr
issue-11925.rs
issue-11925.stderr
issue-15480.rs
issue-15480.stderr
issue-23338-locals-die-before-temps-of-body.rs
issue-23338-locals-die-before-temps-of-body.stderr
issue-23729.rs
issue-23729.stderr
issue-23827.rs
issue-23827.stderr
issue-24356.rs
issue-24356.stderr
issue-24690.rs
issue-24690.stderr
issue-24805-dropck-child-has-items-via-parent.rs
issue-24805-dropck-child-has-items-via-parent.stderr
issue-24805-dropck-trait-has-items.rs
issue-24805-dropck-trait-has-items.stderr
issue-24895-copy-clone-dropck.rs
issue-24895-copy-clone-dropck.stderr
issue-25199.rs
issue-25199.stderr
issue-26656.rs
issue-26656.stderr
issue-27522.rs Refer to "self type" instead of "receiver type" 2019-09-02 19:07:04 -07:00
issue-27522.stderr Refer to "self type" instead of "receiver type" 2019-09-02 19:07:04 -07:00
issue-29106.rs
issue-29106.stderr
issue-29595.rs
issue-29595.stderr Use span label instead of note for cause in E0631 2019-08-31 00:14:23 -07:00
issue-33884.rs
issue-33884.stderr
issue-34264.rs
issue-34264.stderr syntax: improve parameter without type suggestions 2019-10-02 09:51:27 +01:00
issue-35987.rs
issue-35987.stderr
issue-36530.rs
issue-36530.stderr
issue-36537.rs
issue-36537.stderr
issue-37767.rs
issue-37767.stderr
issue-39018.rs
issue-39018.stderr
issue-39698.rs
issue-39698.stderr
issue-40157.rs
issue-40157.stderr
issue-42234-unknown-receiver-type.rs
issue-42234-unknown-receiver-type.stderr Point at method call on missing annotation error 2019-08-25 13:39:11 -07:00
issue-43927-non-ADT-derive.rs Move special treatment of derive(Copy, PartialEq, Eq) from expansion infrastructure to elsewhere 2019-08-03 23:57:35 +03:00
issue-43927-non-ADT-derive.stderr Move special treatment of derive(Copy, PartialEq, Eq) from expansion infrastructure to elsewhere 2019-08-03 23:57:35 +03:00
lint-unused-unsafe.rs
lint-unused-unsafe.stderr
macro-span-replacement.rs
macro-span-replacement.stderr
macro-ty-params.rs
macro-ty-params.stderr
method-and-field-eager-resolution.rs
method-and-field-eager-resolution.stderr
missing-unit-argument.rs
missing-unit-argument.stderr
move-closure.rs
move-closure.stderr
multiline-span-E0072.rs
multiline-span-E0072.stderr
multiline-span-simple.rs
multiline-span-simple.stderr
multispan-import-lint.rs
multispan-import-lint.stderr
mut-arg-hint.rs
mut-arg-hint.stderr
mut-ptr-cant-outlive-ref.rs
mut-ptr-cant-outlive-ref.stderr
non-existing-module-import.rs
non-existing-module-import.stderr
pub-struct-field.rs
pub-struct-field.stderr
range-2.rs
range-2.stderr
recursive-type-field.rs
recursive-type-field.stderr
regionck-unboxed-closure-lifetimes.rs
regionck-unboxed-closure-lifetimes.stderr
regions-close-over-borrowed-ref-in-obj.rs
regions-close-over-borrowed-ref-in-obj.stderr
regions-close-over-type-parameter-2.rs
regions-close-over-type-parameter-2.stderr
regions-escape-loop-via-variable.rs
regions-escape-loop-via-variable.stderr
regions-escape-loop-via-vec.rs
regions-escape-loop-via-vec.stderr
regions-infer-borrow-scope-within-loop.rs
regions-infer-borrow-scope-within-loop.stderr
send-is-not-static-ensures-scoping.rs
send-is-not-static-ensures-scoping.stderr
send-is-not-static-std-sync-2.rs
send-is-not-static-std-sync-2.stderr
send-is-not-static-std-sync.rs
send-is-not-static-std-sync.stderr
slice-borrow.rs
slice-borrow.stderr
suggestion-non-ascii.rs
suggestion-non-ascii.stderr
type-annotations-needed-expr.rs Point at method call on missing annotation error 2019-08-25 13:39:11 -07:00
type-annotations-needed-expr.stderr Point at method call on missing annotation error 2019-08-25 13:39:11 -07:00
type-binding.rs
type-binding.stderr
typo-suggestion.rs
typo-suggestion.stderr
unused-warning-point-at-signature.rs
unused-warning-point-at-signature.stderr
vec_refs_data_with_early_death.rs
vec_refs_data_with_early_death.stderr
vec-must-not-hide-type-from-dropck.rs
vec-must-not-hide-type-from-dropck.stderr
visibility-ty-params.rs
visibility-ty-params.stderr resolve: Move late resolution into a separate visitor 2019-08-10 13:15:15 +03:00
wf-method-late-bound-regions.rs
wf-method-late-bound-regions.stderr