]> git.lizzy.rs Git - rust.git/commit
Improve eager type resolution error message
authorleonardo.yvens <leoyvens@gmail.com>
Sun, 13 May 2018 15:52:50 +0000 (12:52 -0300)
committerleonardo.yvens <leoyvens@gmail.com>
Sun, 13 May 2018 16:02:34 +0000 (13:02 -0300)
commit87890561f3d09c86b2d99a2115930622b0899d50
treed66b7f7962342d790fcef8c6cd102a5c22c0372d
parente6db79f2ca07e4e533f4e940462a42f1093e52f3
Improve eager type resolution error message

This PR improves the span of eager resolution type errors referring to indexing and field access to use the base span rather than the whole expression.

Also a note "Type must be known at this point." is added to where we at some point in the past emitted the "type must be known at this context" error, so that early failures can be differentiated and will hopefully be less surprising.

Fixes #50692 (or at least does the best we can for the moment)

r? @estebank
src/librustc/infer/error_reporting/need_type_info.rs
src/librustc/traits/error_reporting.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/writeback.rs
src/test/ui/span/issue-42234-unknown-receiver-type.stderr
src/test/ui/span/method-and-field-eager-resolution.rs [new file with mode: 0644]
src/test/ui/span/method-and-field-eager-resolution.stderr [new file with mode: 0644]