Skip to content

Commit 8692f40

Browse files
committed
---
yaml --- r: 149693 b: refs/heads/try2 c: baf7908 h: refs/heads/master i: 149691: 1bc75be v: v3
1 parent 9989b76 commit 8692f40

File tree

9 files changed

+58
-65
lines changed

9 files changed

+58
-65
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c602c814ff7220b9afb228270a53f8dcf16c910a
8+
refs/heads/try2: baf79083aedb8ae64efddbcf28b358841cfd1157
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
163163
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
164164
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError
165165

166-
syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc
167-
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
168-
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
169-
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend
170-
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend
166+
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
167+
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
168+
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
169+
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell
170+
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
171+
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
171172
" FIXME: this is a really ugly and not fully correct implementation. Most
172173
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
173174
" a comment, but in practice at present it leaves comments open two levels

branches/try2/src/librustc/metadata/decoder.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,26 @@ fn list_crate_deps(data: &[u8], out: &mut io::Writer) -> io::IoResult<()> {
11451145
Ok(())
11461146
}
11471147

1148+
pub fn maybe_get_crate_hash(data: &[u8]) -> Option<Svh> {
1149+
let cratedoc = reader::Doc(data);
1150+
reader::maybe_get_doc(cratedoc, tag_crate_hash).map(|doc| {
1151+
Svh::new(doc.as_str_slice())
1152+
})
1153+
}
1154+
11481155
pub fn get_crate_hash(data: &[u8]) -> Svh {
11491156
let cratedoc = reader::Doc(data);
11501157
let hashdoc = reader::get_doc(cratedoc, tag_crate_hash);
11511158
Svh::new(hashdoc.as_str_slice())
11521159
}
11531160

1161+
pub fn maybe_get_crate_id(data: &[u8]) -> Option<CrateId> {
1162+
let cratedoc = reader::Doc(data);
1163+
reader::maybe_get_doc(cratedoc, tag_crate_crateid).map(|doc| {
1164+
from_str(doc.as_str_slice()).unwrap()
1165+
})
1166+
}
1167+
11541168
pub fn get_crate_id(data: &[u8]) -> CrateId {
11551169
let cratedoc = reader::Doc(data);
11561170
let hashdoc = reader::get_doc(cratedoc, tag_crate_crateid);

branches/try2/src/librustc/metadata/loader.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,17 @@ impl<'a> Context<'a> {
318318
}
319319

320320
fn crate_matches(&mut self, crate_data: &[u8]) -> bool {
321-
let other_id = decoder::get_crate_id(crate_data);
322-
if !self.crate_id.matches(&other_id) { return false }
321+
match decoder::maybe_get_crate_id(crate_data) {
322+
Some(ref id) if self.crate_id.matches(id) => {}
323+
_ => return false
324+
}
325+
let hash = match decoder::maybe_get_crate_hash(crate_data) {
326+
Some(hash) => hash, None => return false
327+
};
323328
match self.hash {
324329
None => true,
325-
Some(hash) => {
326-
if *hash != decoder::get_crate_hash(crate_data) {
330+
Some(myhash) => {
331+
if *myhash != hash {
327332
self.rejected_via_hash = true;
328333
false
329334
} else {

branches/try2/src/librustc/middle/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ impl<'a> DynamicFailureHandler<'a> {
11881188

11891189
let fcx = self.bcx.fcx;
11901190
let fail_cx = fcx.new_block(false, "case_fallthrough", None);
1191-
controlflow::trans_fail(fail_cx, Some(self.sp), self.msg.clone());
1191+
controlflow::trans_fail(fail_cx, self.sp, self.msg.clone());
11921192
self.finished.set(Some(fail_cx.llbb));
11931193
fail_cx.llbb
11941194
}

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ pub fn fail_if_zero<'a>(
864864
}
865865
};
866866
with_cond(cx, is_zero, |bcx| {
867-
controlflow::trans_fail(bcx, Some(span), InternedString::new(text))
867+
controlflow::trans_fail(bcx, span, InternedString::new(text))
868868
})
869869
}
870870

branches/try2/src/librustc/middle/trans/controlflow.rs

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ use middle::trans::debuginfo;
1818
use middle::trans::cleanup;
1919
use middle::trans::cleanup::CleanupMethods;
2020
use middle::trans::expr;
21-
use middle::ty;
22-
use util::ppaux;
2321
use util::ppaux::Repr;
2422

2523
use middle::trans::type_::Type;
@@ -327,67 +325,23 @@ pub fn trans_ret<'a>(bcx: &'a Block<'a>,
327325
return bcx;
328326
}
329327

330-
pub fn trans_fail_expr<'a>(
331-
bcx: &'a Block<'a>,
332-
sp_opt: Option<Span>,
333-
fail_expr: Option<@ast::Expr>)
334-
-> &'a Block<'a> {
335-
let _icx = push_ctxt("trans_fail_expr");
336-
let mut bcx = bcx;
337-
match fail_expr {
338-
Some(arg_expr) => {
339-
let ccx = bcx.ccx();
340-
let tcx = ccx.tcx;
341-
let arg_datum =
342-
unpack_datum!(bcx, expr::trans_to_lvalue(bcx, arg_expr, "fail"));
343-
344-
if ty::type_is_str(arg_datum.ty) {
345-
let (lldata, _) = arg_datum.get_vec_base_and_len(bcx);
346-
return trans_fail_value(bcx, sp_opt, lldata);
347-
} else if bcx.unreachable.get() || ty::type_is_bot(arg_datum.ty) {
348-
return bcx;
349-
} else {
350-
bcx.sess().span_bug(
351-
arg_expr.span, ~"fail called with unsupported type " +
352-
ppaux::ty_to_str(tcx, arg_datum.ty));
353-
}
354-
}
355-
_ => trans_fail(bcx, sp_opt, InternedString::new("explicit failure"))
356-
}
357-
}
358-
359328
pub fn trans_fail<'a>(
360329
bcx: &'a Block<'a>,
361-
sp_opt: Option<Span>,
330+
sp: Span,
362331
fail_str: InternedString)
363332
-> &'a Block<'a> {
364-
let _icx = push_ctxt("trans_fail");
365333
let V_fail_str = C_cstr(bcx.ccx(), fail_str);
366-
return trans_fail_value(bcx, sp_opt, V_fail_str);
367-
}
368-
369-
fn trans_fail_value<'a>(
370-
bcx: &'a Block<'a>,
371-
sp_opt: Option<Span>,
372-
V_fail_str: ValueRef)
373-
-> &'a Block<'a> {
374334
let _icx = push_ctxt("trans_fail_value");
375335
let ccx = bcx.ccx();
376-
let (V_filename, V_line) = match sp_opt {
377-
Some(sp) => {
378-
let sess = bcx.sess();
379-
let loc = sess.parse_sess.cm.lookup_char_pos(sp.lo);
380-
(C_cstr(bcx.ccx(), token::intern_and_get_ident(loc.file.name)),
381-
loc.line as int)
382-
}
383-
None => {
384-
(C_cstr(bcx.ccx(), InternedString::new("<runtime>")), 0)
385-
}
386-
};
336+
let sess = bcx.sess();
337+
let loc = sess.parse_sess.cm.lookup_char_pos(sp.lo);
338+
let V_filename = C_cstr(bcx.ccx(),
339+
token::intern_and_get_ident(loc.file.name));
340+
let V_line = loc.line as int;
387341
let V_str = PointerCast(bcx, V_fail_str, Type::i8p());
388342
let V_filename = PointerCast(bcx, V_filename, Type::i8p());
389343
let args = ~[V_str, V_filename, C_int(ccx, V_line)];
390-
let did = langcall(bcx, sp_opt, "", FailFnLangItem);
344+
let did = langcall(bcx, Some(sp), "", FailFnLangItem);
391345
let bcx = callee::trans_lang_call(bcx, did, args, Some(expr::Ignore)).bcx;
392346
Unreachable(bcx);
393347
return bcx;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-include ../tools.mk
2+
3+
all:
4+
touch $(TMPDIR)/rust.metadata.bin
5+
ar crus $(TMPDIR)/libfoo-ffffffff-1.0.rlib $(TMPDIR)/rust.metadata.bin
6+
$(RUSTC) foo.rs 2>&1 | grep "can't find crate for"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2014 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 crate foo;
12+
13+
fn main() {}

0 commit comments

Comments
 (0)