Skip to content

Commit 9eba4d7

Browse files
garethgareth
authored andcommitted
---
yaml --- r: 38247 b: refs/heads/try c: b6aafe9 h: refs/heads/master i: 38245: f96124e 38243: 578bb45 38239: be50382 v: v3
1 parent b4de566 commit 9eba4d7

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 6e7cf87101e79efb8eed683ab5261878b63c3070
5+
refs/heads/try: b6aafe928dbae9e610486105c2a3ec1d2fe2070e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/doc/tutorial-macros.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ macro_rules! early_return(
4343
_ => {}
4444
}
4545
);
46-
)
46+
);
4747
// ...
4848
early_return!(input_1 special_a);
4949
// ...
@@ -160,7 +160,7 @@ macro_rules! early_return(
160160
_ => {}
161161
}
162162
);
163-
)
163+
);
164164
// ...
165165
early_return!(input_1, [special_a|special_c|special_d]);
166166
// ...

branches/try/src/librustc/middle/resolve.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,8 +2086,11 @@ impl Resolver {
20862086
match self.resolve_import_for_module(module_, import_directive) {
20872087
Failed => {
20882088
// We presumably emitted an error. Continue.
2089-
self.session.span_err(import_directive.span,
2090-
~"failed to resolve import");
2089+
let idents = import_directive.module_path.get();
2090+
let msg = fmt!("failed to resolve import: %s",
2091+
self.import_path_to_str(idents,
2092+
*import_directive.subclass));
2093+
self.session.span_err(import_directive.span, msg);
20912094
}
20922095
Indeterminate => {
20932096
// Bail out. We'll come around next time.
@@ -2117,6 +2120,26 @@ impl Resolver {
21172120
// XXX: Shouldn't copy here. We need string builder functionality.
21182121
return result;
21192122
}
2123+
2124+
fn import_directive_subclass_to_str(subclass: ImportDirectiveSubclass)
2125+
-> ~str {
2126+
match subclass {
2127+
SingleImport(_target, source, _ns) => self.session.str_of(source),
2128+
GlobImport => ~"*"
2129+
}
2130+
}
2131+
2132+
fn import_path_to_str(idents: ~[ident], subclass: ImportDirectiveSubclass)
2133+
-> ~str {
2134+
if idents.is_empty() {
2135+
self.import_directive_subclass_to_str(subclass)
2136+
} else {
2137+
fmt!("%s::%s",
2138+
self.idents_to_str(idents),
2139+
self.import_directive_subclass_to_str(subclass))
2140+
}
2141+
}
2142+
21202143
/**
21212144
* Attempts to resolve the given import. The return value indicates
21222145
* failure if we're certain the name does not exist, indeterminate if we

0 commit comments

Comments
 (0)