You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mod foo {}fnmain(){let v = Vec::new();
v.push(foo);}
produces these diagnostics:
<anon>:5:12: 5:15 error: unresolved name `foo` [E0425]
<anon>:5 v.push(foo);
^~~
<anon>:5:12: 5:15 help: see the detailed explanation for E0425
<anon>:5:12: 5:15 help: To call a function from the `foo` module, use `foo::push(..)`
The suggestion doesn't make sense -- we should instead emit something like "modules are not valid expressions".
The text was updated successfully, but these errors were encountered:
jseyfried
changed the title
resolve: nonsensical diagnostics for an expression the resolves to a module
resolve: nonsensical diagnostics for an expression that resolves to a module
Apr 25, 2016
resolve: improve diagnostics and lay groundwork for resolving before ast->hir
This PR improves diagnostics in `resolve` and lays some groundwork for resolving before ast->hir.
More specifically,
- It removes an API in `resolve` intended for external refactoring tools (see #27493) that appears not to be in active use. The API is incompatible with resolving before ast->hir, but could be rewritten in a more compatible and less intrusive way.
- It improves the diagnostics for pattern bindings that conflict with `const`s.
- It improves the diagnostics for modules used as expressions (fixes#33186).
- It refactors away some uses of the hir map, which is unavavailable before ast->hir lowering.
r? @eddyb
This code:
produces these diagnostics:
The suggestion doesn't make sense -- we should instead emit something like "modules are not valid expressions".
The text was updated successfully, but these errors were encountered: