File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
trunk/src/librustc/middle Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: aa38867e4e7da648a85985251f542bee12a64095
2
+ refs/heads/master: 9f118865a207cb4a64aa3dac81ae74ba1f7bba69
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5
5
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
Original file line number Diff line number Diff line change @@ -2996,7 +2996,14 @@ pub impl Resolver {
2996
2996
let imports: & mut ~[ @ImportDirective ] = & mut * module_. imports ;
2997
2997
let import_count = imports. len ( ) ;
2998
2998
if index != import_count {
2999
- self . session . span_err ( imports[ index] . span , ~"unresolved import") ;
2999
+ let sn = self . session . codemap . span_to_snippet ( imports[ index] . span ) ;
3000
+ if str:: contains ( sn, "::" ) {
3001
+ self . session . span_err ( imports[ index] . span , ~"unresolved import") ;
3002
+ } else {
3003
+ let err = fmt ! ( "unresolved import (maybe you meant `%s::*`?)" ,
3004
+ sn. slice( 0 , sn. len( ) - 1 ) ) ; // -1 to adjust for semicolon
3005
+ self . session . span_err ( imports[ index] . span , err) ;
3006
+ }
3000
3007
}
3001
3008
3002
3009
// Descend into children and anonymous children.
You can’t perform that action at this time.
0 commit comments