Skip to content

Commit fb5a21f

Browse files
committed
---
yaml --- r: 146342 b: refs/heads/try2 c: f27272d h: refs/heads/master v: v3
1 parent f1daff7 commit fb5a21f

File tree

22 files changed

+334
-186
lines changed

22 files changed

+334
-186
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: 1bbd4afb4ae5503bc04a7f500bc8ade6e1db0854
8+
refs/heads/try2: f27272d60f193c6d27cc283f48c5be0e41562814
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
401401
valopt libdir "${CFG_PREFIX}/lib" "install libraries"
402402

403403
#Deprecated opts to keep compatibility
404-
valopt build-triple "${CFG_BUILD}" "LLVM build triple"
405-
valopt host-triples "${CFG_HOST}" "LLVM host triples"
406-
valopt target-triples "${CFG_TARGET}" "LLVM target triples"
404+
valopt build-triple "${DEFAULT_BUILD}" "LLVM build triple"
405+
valopt host-triples "${CFG_BUILD}" "LLVM host triples"
406+
valopt target-triples "${CFG_HOST}" "LLVM target triples"
407407

408408
# Validate Options
409409
step_msg "validating $CFG_SELF args"

branches/try2/doc/rust.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,6 @@ This requirement most often affects name-designator pairs when they occur at the
568568
* `log_syntax!` : print out the arguments at compile time
569569
* `trace_macros!` : supply `true` or `false` to enable or disable macro expansion logging
570570
* `stringify!` : turn the identifier argument into a string literal
571-
* `concat!` : concatenates a comma-separated list of literals
572571
* `concat_idents!` : create a new identifier by concatenating the arguments
573572

574573
# Crates and source files

branches/try2/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ For a more in-depth explanation of borrowed pointers, read the
11421142
11431143
## Freezing
11441144
1145-
Lending an immutable pointer to an object freezes it and prevents mutation.
1145+
Borrowing an immutable pointer to an object freezes it and prevents mutation.
11461146
`Owned` objects have freezing enforced statically at compile-time.
11471147
11481148
~~~~

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ impl Visitor<()> for Context {
140140

141141
},
142142
ast::ty_box(_) => {
143-
self.gate_feature("managed_boxes", t.span,
144-
"The managed box syntax will be replaced \
145-
by a library type, and a garbage \
146-
collector is not yet implemented. \
147-
Consider using the `std::rc::Rc` type \
148-
for reference counted pointers.");
143+
self.gate_feature("managed_boxes", t.span, "The managed box syntax may be replaced \
144+
by a library type, and a garbage \
145+
collector is not yet implemented. \
146+
Consider using the `std::rc` module \
147+
as it performs much better as a \
148+
reference counting implementation.");
149149
}
150150
_ => {}
151151
}

branches/try2/src/librustc/util/ppaux.rs

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,11 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
308308
ident: Option<ast::Ident>,
309309
sig: &ty::FnSig)
310310
-> ~str {
311-
let mut s = ~"extern ";
312-
313-
s.push_str(abis.to_str());
314-
s.push_char(' ');
311+
let mut s = if abis.is_rust() {
312+
~""
313+
} else {
314+
format!("extern {} ", abis.to_str())
315+
};
315316

316317
match purity {
317318
ast::impure_fn => {}
@@ -331,16 +332,16 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
331332
_ => { }
332333
}
333334

334-
push_sig_to_str(cx, &mut s, sig);
335+
push_sig_to_str(cx, &mut s, '(', ')', sig);
335336

336337
return s;
337338
}
338-
fn closure_to_str(cx: ctxt, cty: &ty::ClosureTy) -> ~str
339-
{
339+
fn closure_to_str(cx: ctxt, cty: &ty::ClosureTy) -> ~str {
340340
let is_proc =
341341
(cty.sigil, cty.onceness) == (ast::OwnedSigil, ast::Once);
342+
let is_borrowed_closure = cty.sigil == ast::BorrowedSigil;
342343

343-
let mut s = if is_proc {
344+
let mut s = if is_proc || is_borrowed_closure {
344345
~""
345346
} else {
346347
cty.sigil.to_str()
@@ -374,23 +375,42 @@ pub fn ty_to_str(cx: ctxt, typ: t) -> ~str {
374375
}
375376
};
376377

377-
s.push_str("fn");
378+
if !is_borrowed_closure {
379+
s.push_str("fn");
380+
}
378381
}
379382

380-
if !cty.bounds.is_empty() {
381-
s.push_str(":");
382-
}
383-
s.push_str(cty.bounds.repr(cx));
383+
if !is_borrowed_closure {
384+
// Print bounds before `fn` if this is not a borrowed closure.
385+
if !cty.bounds.is_empty() {
386+
s.push_str(":");
387+
s.push_str(cty.bounds.repr(cx));
388+
}
389+
390+
push_sig_to_str(cx, &mut s, '(', ')', &cty.sig);
391+
} else {
392+
// Print bounds after the signature if this is a borrowed closure.
393+
push_sig_to_str(cx, &mut s, '|', '|', &cty.sig);
384394

385-
push_sig_to_str(cx, &mut s, &cty.sig);
395+
if is_borrowed_closure {
396+
if !cty.bounds.is_empty() {
397+
s.push_str(":");
398+
s.push_str(cty.bounds.repr(cx));
399+
}
400+
}
401+
}
386402

387403
return s;
388404
}
389-
fn push_sig_to_str(cx: ctxt, s: &mut ~str, sig: &ty::FnSig) {
390-
s.push_char('(');
405+
fn push_sig_to_str(cx: ctxt,
406+
s: &mut ~str,
407+
bra: char,
408+
ket: char,
409+
sig: &ty::FnSig) {
410+
s.push_char(bra);
391411
let strs = sig.inputs.map(|a| fn_input_to_str(cx, *a));
392412
s.push_str(strs.connect(", "));
393-
s.push_char(')');
413+
s.push_char(ket);
394414
if ty::get(sig.output).sty != ty_nil {
395415
s.push_str(" -> ");
396416
if ty::type_is_bot(sig.output) {

branches/try2/src/libsyntax/ext/base.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use codemap;
1414
use codemap::{CodeMap, Span, ExpnInfo};
1515
use diagnostic::span_handler;
1616
use ext;
17-
use ext::expand;
1817
use parse;
1918
use parse::token;
2019
use parse::token::{ident_to_str, intern, str_to_ident};
@@ -247,9 +246,6 @@ pub fn syntax_expander_table() -> SyntaxEnv {
247246
syntax_expanders.insert(intern("concat_idents"),
248247
builtin_normal_tt_no_ctxt(
249248
ext::concat_idents::expand_syntax_ext));
250-
syntax_expanders.insert(intern("concat"),
251-
builtin_normal_tt_no_ctxt(
252-
ext::concat::expand_syntax_ext));
253249
syntax_expanders.insert(intern(&"log_syntax"),
254250
builtin_normal_tt_no_ctxt(
255251
ext::log_syntax::expand_syntax_ext));
@@ -342,22 +338,6 @@ impl ExtCtxt {
342338
}
343339
}
344340

345-
pub fn expand_expr(@self, mut e: @ast::Expr) -> @ast::Expr {
346-
loop {
347-
match e.node {
348-
ast::ExprMac(*) => {
349-
let extsbox = @mut syntax_expander_table();
350-
let expander = expand::MacroExpander {
351-
extsbox: extsbox,
352-
cx: self,
353-
};
354-
e = expand::expand_expr(extsbox, self, e, &expander);
355-
}
356-
_ => return e
357-
}
358-
}
359-
}
360-
361341
pub fn codemap(&self) -> @CodeMap { self.parse_sess.cm }
362342
pub fn parse_sess(&self) -> @mut parse::ParseSess { self.parse_sess }
363343
pub fn cfg(&self) -> ast::CrateConfig { self.cfg.clone() }

branches/try2/src/libsyntax/ext/concat.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

branches/try2/src/libsyntax/ext/expand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ struct NoOpFolder {
10831083

10841084
impl ast_fold for NoOpFolder {}
10851085

1086-
pub struct MacroExpander {
1086+
struct MacroExpander {
10871087
extsbox: @mut SyntaxEnv,
10881088
cx: @ExtCtxt,
10891089
}

branches/try2/src/libsyntax/ext/format.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,8 @@ pub fn expand_args(ecx: @ExtCtxt, sp: Span,
735735
(_, None) => { return MRExpr(ecx.expr_uint(sp, 2)); }
736736
};
737737
cx.fmtsp = efmt.span;
738-
// Be sure to recursively expand macros just in case the format string uses
739-
// a macro to build the format expression.
740-
let (fmt, _) = expr_to_str(ecx, ecx.expand_expr(efmt),
741-
"format argument must be a string literal.");
738+
let (fmt, _fmt_str_style) = expr_to_str(ecx, efmt,
739+
"format argument must be a string literal.");
742740

743741
let mut err = false;
744742
do parse::parse_error::cond.trap(|m| {

0 commit comments

Comments
 (0)