Skip to content

Commit f1e1257

Browse files
committed
---
yaml --- r: 93791 b: refs/heads/try c: 248cb90 h: refs/heads/master i: 93789: 18af3ca 93787: 81f060b 93783: 1646d1d 93775: 5230750 93759: 7b39f12 v: v3
1 parent 769b008 commit f1e1257

File tree

16 files changed

+50
-48
lines changed

16 files changed

+50
-48
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 97aaf42462ff35ad2bf097c8c1351e876d8d72b8
5+
refs/heads/try: 248cb90dfa00a7efdd51eb457afd9b59246b2d24
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,20 +520,14 @@ then
520520
fi
521521
fi
522522

523-
BIN_SUF=
524-
if [ $CFG_OSTYPE = "pc-mingw32" ]
525-
then
526-
BIN_SUF=.exe
527-
fi
528-
529523
if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
530524
then
531-
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
525+
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc ]
532526
then
533527
err "no local rust to use"
534528
else
535-
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
536-
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
529+
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc --version`
530+
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: " $LRV
537531
fi
538532
fi
539533

branches/try/doc/rust.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,9 @@ block.
11311131
let fptr: extern "C" fn() -> ~[int] = new_vec;
11321132
~~~~
11331133

1134-
Extern functions may be called directly from Rust code as Rust uses large,
1135-
contiguous stack segments like C.
1134+
Extern functions may be called from Rust code, but
1135+
caution must be taken with respect to the size of the stack
1136+
segment, just as when calling an extern function normally.
11361137

11371138
### Type definitions
11381139

@@ -3161,7 +3162,7 @@ Borrowed pointers (`&`)
31613162
Borrowed pointers arise by (automatic) conversion from owning pointers, managed pointers,
31623163
or by applying the borrowing operator `&` to some other value,
31633164
including [lvalues, rvalues or temporaries](#lvalues-rvalues-and-temporaries).
3164-
Borrowed pointers are written `&content`, or in some cases `&'f content` for some lifetime-variable `f`,
3165+
Borrowed pointers are written `&content`, or in some cases `&f/content` for some lifetime-variable `f`,
31653166
for example `&int` means a borrowed pointer to an integer.
31663167
Copying a borrowed pointer is a "shallow" operation:
31673168
it involves only copying the pointer itself.
@@ -3596,9 +3597,9 @@ and releases them back to its environment when they are no longer needed.
35963597
The default implementation of the service-provider interface
35973598
consists of the C runtime functions `malloc` and `free`.
35983599

3599-
The runtime memory-management system, in turn, supplies Rust tasks with
3600-
facilities for allocating releasing stacks, as well as allocating and freeing
3601-
heap data.
3600+
The runtime memory-management system, in turn, supplies Rust tasks
3601+
with facilities for allocating, extending and releasing stacks,
3602+
as well as allocating and freeing heap data.
36023603

36033604
### Built in types
36043605

@@ -3761,6 +3762,7 @@ have come and gone during the course of Rust's development:
37613762

37623763
Additional specific influences can be seen from the following languages:
37633764

3765+
* The stack-growth implementation of Go.
37643766
* The structural algebraic types and compilation manager of SML.
37653767
* The attribute and assembly systems of C#.
37663768
* The references and deterministic destructor system of C++.

branches/try/src/etc/local_stage0.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
TARG_DIR=$1
44
PREFIX=$2
55

6-
LIB_DIR=lib
7-
LIB_PREFIX=lib
6+
BINDIR=bin
7+
LIBDIR=lib
88

99
OS=`uname -s`
1010
case $OS in
@@ -21,8 +21,7 @@ case $OS in
2121
(*)
2222
BIN_SUF=.exe
2323
LIB_SUF=.dll
24-
LIB_DIR=bin
25-
LIB_PREFIX=
24+
LIBDIR=bin
2625
break
2726
;;
2827
esac
@@ -32,7 +31,7 @@ if [ -z $PREFIX ]; then
3231
exit 1
3332
fi
3433

35-
if [ ! -e ${PREFIX}/bin/rustc${BIN_SUF} ]; then
34+
if [ ! -e ${PREFIX}/bin/rustc ]; then
3635
echo "No local rust installed at ${PREFIX}"
3736
exit 1
3837
fi
@@ -42,9 +41,9 @@ if [ -z $TARG_DIR ]; then
4241
exit 1
4342
fi
4443

45-
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
46-
cp ${PREFIX}/${LIB_DIR}/rustc/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
47-
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
48-
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
49-
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
50-
cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
44+
cp ${PREFIX}/bin/rustc ${TARG_DIR}/stage0/bin/
45+
cp ${PREFIX}/lib/rustc/${TARG_DIR}/${LIBDIR}/* ${TARG_DIR}/stage0/${LIBDIR}/
46+
cp ${PREFIX}/lib/libextra*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
47+
cp ${PREFIX}/lib/librust*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
48+
cp ${PREFIX}/lib/libstd*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
49+
cp ${PREFIX}/lib/libsyntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::parse::token;
2929
use syntax::parse::token::{ident_interner, interner_get};
3030
use syntax::parse::token::special_idents;
3131
use syntax::print::pprust::path_to_str;
32-
use syntax::codemap::{Span, dummy_sp, Pos};
32+
use syntax::codemap::{Span, dummy_sp, BytePos};
3333
use syntax::opt_vec::OptVec;
3434
use syntax::visit;
3535
use syntax::visit::Visitor;
@@ -2624,7 +2624,7 @@ impl Resolver {
26242624
if "???" == module_name {
26252625
let span = Span {
26262626
lo: span.lo,
2627-
hi: span.lo + Pos::from_uint(segment_name.len()),
2627+
hi: span.lo + BytePos(segment_name.len()),
26282628
expn_info: span.expn_info,
26292629
};
26302630
self.resolve_error(span,

branches/try/src/librustc/middle/typeck/astconv.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,10 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
560560
ast_ty.span,
561561
"found `ty_infer` in unexpected place");
562562
}
563+
ast::ty_mac(_) => {
564+
tcx.sess.span_bug(ast_ty.span,
565+
"found `ty_mac` in unexpected place");
566+
}
563567
};
564568

565569
tcx.ast_ty_to_ty_cache.insert(ast_ty.id, ty::atttce_resolved(typ));

branches/try/src/libstd/ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub unsafe fn replace_ptr<T>(dest: *mut T, mut src: T) -> T {
155155
* Reads the value from `*src` and returns it. Does not copy `*src`.
156156
*/
157157
#[inline(always)]
158-
pub unsafe fn read_ptr<T>(src: *mut T) -> T {
158+
pub unsafe fn read_ptr<T>(src: *T) -> T {
159159
let mut tmp: T = intrinsics::uninit();
160160
copy_nonoverlapping_memory(&mut tmp, src, 1);
161161
tmp
@@ -168,7 +168,7 @@ pub unsafe fn read_ptr<T>(src: *mut T) -> T {
168168
#[inline(always)]
169169
pub unsafe fn read_and_zero_ptr<T>(dest: *mut T) -> T {
170170
// Copy the data out from `dest`:
171-
let tmp = read_ptr(dest);
171+
let tmp = read_ptr(&*dest);
172172

173173
// Now zero out `dest`:
174174
zero_memory(dest, 1);

branches/try/src/libstd/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ impl<T> OwnedVector<T> for ~[T] {
15271527
let valptr = ptr::to_mut_unsafe_ptr(&mut self[ln - 1u]);
15281528
unsafe {
15291529
raw::set_len(self, ln - 1u);
1530-
Some(ptr::read_ptr(valptr))
1530+
Some(ptr::read_ptr(&*valptr))
15311531
}
15321532
}
15331533
}

branches/try/src/libsyntax/ast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ pub enum ty_ {
861861
ty_bare_fn(@TyBareFn),
862862
ty_tup(~[Ty]),
863863
ty_path(Path, Option<OptVec<TyParamBound>>, NodeId), // for #7264; see above
864+
ty_mac(mac),
864865
ty_typeof(@Expr),
865866
// ty_infer means the type should be inferred instead of it having been
866867
// specified. This should only appear at the "top level" of a type and not

branches/try/src/libsyntax/codemap.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ pub trait Pos {
2929
fn to_uint(&self) -> uint;
3030
}
3131

32-
/// A byte offset. Keep this small (currently 32-bits), as AST contains
33-
/// a lot of them.
32+
/// A byte offset
3433
#[deriving(Clone, Eq, IterBytes, Ord)]
35-
pub struct BytePos(u32);
36-
34+
pub struct BytePos(uint);
3735
/// A character offset. Because of multibyte utf8 characters, a byte offset
3836
/// is not equivalent to a character offset. The CodeMap will convert BytePos
3937
/// values to CharPos values as necessary.
@@ -44,8 +42,8 @@ pub struct CharPos(uint);
4442
// have been unsuccessful
4543

4644
impl Pos for BytePos {
47-
fn from_uint(n: uint) -> BytePos { BytePos(n as u32) }
48-
fn to_uint(&self) -> uint { **self as uint }
45+
fn from_uint(n: uint) -> BytePos { BytePos(n) }
46+
fn to_uint(&self) -> uint { **self }
4947
}
5048

5149
impl Add<BytePos, BytePos> for BytePos {
@@ -280,7 +278,7 @@ impl CodeMap {
280278

281279
let filemap = @FileMap {
282280
name: filename, substr: substr, src: src,
283-
start_pos: Pos::from_uint(start_pos),
281+
start_pos: BytePos(start_pos),
284282
lines: @mut ~[],
285283
multibyte_chars: @mut ~[],
286284
};

branches/try/src/libsyntax/fold.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ pub trait ast_fold {
277277
ty_fixed_length_vec(ref mt, e) => {
278278
ty_fixed_length_vec(fold_mt(mt, self), self.fold_expr(e))
279279
}
280+
ty_mac(ref mac) => ty_mac(self.fold_mac(mac)),
280281
ty_typeof(expr) => ty_typeof(self.fold_expr(expr)),
281282
};
282283
Ty {

branches/try/src/libsyntax/parse/lexer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ pub fn bump(rdr: &mut StringReader) {
247247
let last_char = rdr.curr;
248248
let next = rdr.src.char_range_at(current_byte_offset);
249249
let byte_offset_diff = next.next - current_byte_offset;
250-
rdr.pos = rdr.pos + Pos::from_uint(byte_offset_diff);
250+
rdr.pos = rdr.pos + BytePos(byte_offset_diff);
251251
rdr.curr = next.ch;
252252
rdr.col = rdr.col + CharPos(1u);
253253
if last_char == '\n' {
@@ -257,7 +257,7 @@ pub fn bump(rdr: &mut StringReader) {
257257

258258
if byte_offset_diff > 1 {
259259
rdr.filemap.record_multibyte_char(
260-
Pos::from_uint(current_byte_offset), byte_offset_diff);
260+
BytePos(current_byte_offset), byte_offset_diff);
261261
}
262262
} else {
263263
rdr.curr = unsafe { transmute(-1u32) }; // FIXME: #8971: unsound
@@ -333,7 +333,7 @@ fn consume_any_line_comment(rdr: @mut StringReader)
333333
bump(rdr);
334334
// line comments starting with "///" or "//!" are doc-comments
335335
if rdr.curr == '/' || rdr.curr == '!' {
336-
let start_bpos = rdr.pos - BytePos(3);
336+
let start_bpos = rdr.pos - BytePos(3u);
337337
while rdr.curr != '\n' && !is_eof(rdr) {
338338
bump(rdr);
339339
}
@@ -387,7 +387,7 @@ fn consume_block_comment(rdr: @mut StringReader)
387387
-> Option<TokenAndSpan> {
388388
// block comments starting with "/**" or "/*!" are doc-comments
389389
let is_doc_comment = rdr.curr == '*' || rdr.curr == '!';
390-
let start_bpos = rdr.pos - BytePos(if is_doc_comment {3} else {2});
390+
let start_bpos = rdr.pos - BytePos(if is_doc_comment {3u} else {2u});
391391

392392
let mut level: int = 1;
393393
while level > 0 {
@@ -815,7 +815,7 @@ fn next_token_inner(rdr: @mut StringReader) -> token::Token {
815815
// Byte offsetting here is okay because the
816816
// character before position `start` is an
817817
// ascii single quote.
818-
start - BytePos(1),
818+
start - BytePos(1u),
819819
rdr.last_pos,
820820
~"unterminated character constant");
821821
}

branches/try/src/libsyntax/parse/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ mod test {
349349
}
350350

351351
// produce a codemap::span
352-
fn sp(a: u32, b: u32) -> Span {
352+
fn sp (a: uint, b: uint) -> Span {
353353
Span{lo:BytePos(a),hi:BytePos(b),expn_info:None}
354354
}
355355

branches/try/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ impl Parser {
606606
token::GT => self.bump(),
607607
token::BINOP(token::SHR) => self.replace_token(
608608
token::GT,
609-
self.span.lo + BytePos(1),
609+
self.span.lo + BytePos(1u),
610610
self.span.hi
611611
),
612612
_ => self.fatal(format!("expected `{}`, found `{}`",

branches/try/src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ pub fn print_type(s: @ps, ty: &ast::Ty) {
459459
print_expr(s, e);
460460
word(s.s, ")");
461461
}
462+
ast::ty_mac(_) => {
463+
fail!("print_type doesn't know how to print a ty_mac");
464+
}
462465
ast::ty_infer => {
463466
fail!("print_type shouldn't see a ty_infer");
464467
}
@@ -2116,7 +2119,7 @@ pub fn maybe_print_trailing_comment(s: @ps, span: codemap::Span,
21162119
if (*cmnt).style != comments::trailing { return; }
21172120
let span_line = cm.lookup_char_pos(span.hi);
21182121
let comment_line = cm.lookup_char_pos((*cmnt).pos);
2119-
let mut next = (*cmnt).pos + BytePos(1);
2122+
let mut next = (*cmnt).pos + BytePos(1u);
21202123
match next_pos { None => (), Some(p) => next = p }
21212124
if span.hi < (*cmnt).pos && (*cmnt).pos < next &&
21222125
span_line.line == comment_line.line {

branches/try/src/libsyntax/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ pub fn walk_ty<E:Clone, V:Visitor<E>>(visitor: &mut V, typ: &Ty, env: E) {
314314
ty_typeof(expression) => {
315315
visitor.visit_expr(expression, env)
316316
}
317-
ty_nil | ty_bot | ty_infer => ()
317+
ty_nil | ty_bot | ty_mac(_) | ty_infer => ()
318318
}
319319
}
320320

0 commit comments

Comments
 (0)