Skip to content

Commit 9c611e9

Browse files
garethgareth
authored andcommitted
---
yaml --- r: 34355 b: refs/heads/snap-stage3 c: b6aafe9 h: refs/heads/master i: 34353: 5a51a80 34351: 38981a1 v: v3
1 parent f218451 commit 9c611e9

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 6e7cf87101e79efb8eed683ab5261878b63c3070
4+
refs/heads/snap-stage3: b6aafe928dbae9e610486105c2a3ec1d2fe2070e
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)