about summary refs log tree commit diff
path: root/src/test/ui/thinlto
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-04-17 10:24:50 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-04-18 19:18:26 -0700
commit6aa4c992bc8ee003be01bfc59d2d7b54d01bc131 (patch)
tree4313d42306b5b29b60ab686db1880e4b8f1ba69b /src/test/ui/thinlto
parente928e9441157f63a776ba1f8773818838e0912ea (diff)
downloadrust-6aa4c992bc8ee003be01bfc59d2d7b54d01bc131.tar.gz
rust-6aa4c992bc8ee003be01bfc59d2d7b54d01bc131.zip
Suggest appropriate path when calling associated item on bare types
When looking at the documentation for `std::f32` or `std::str`, for
example, it is easy to get confused and assume `std::f32` and `f32`
are the same thing. Because of this, it is not uncommon to attempt
writing `f32::consts::PI` instead of the correct
`std::f32::consts::PI`. When encountering the former, which results
in an access error due to it being an inexistent path, try to access
the same path under `std`. If this succeeds, this information is
stored for later tweaking of the final E0599 to provide an
appropriate suggestion.

This suggestion applies to both E0233 and E0599 and is only checked
when the first ident of a path corresponds to a primitive type.
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions