Skip to content

Commit 4f92d3a

Browse files
committed
rustc: adjust span for error message to not trim last letter
1 parent 7272743 commit 4f92d3a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3079,7 +3079,7 @@ pub impl Resolver {
30793079
self.session.span_err(imports[index].span, "unresolved import");
30803080
} else {
30813081
let err = fmt!("unresolved import (maybe you meant `%s::*`?)",
3082-
sn.slice(0, sn.len() - 1)); // -1 to adjust for semicolon
3082+
sn.slice(0, sn.len()));
30833083
self.session.span_err(imports[index].span, err);
30843084
}
30853085
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
extern mod extra;
12+
use extra; //~ ERROR unresolved import (maybe you meant `extra::*`?)
13+
14+
fn main() {}

0 commit comments

Comments
 (0)