Skip to content

Commit 3eecc91

Browse files
committed
---
yaml --- r: 48115 b: refs/heads/incoming c: 5f0a123 h: refs/heads/master i: 48113: 7b564cb 48111: d5d5138 v: v3
1 parent 03cb84f commit 3eecc91

File tree

13 files changed

+306
-360
lines changed

13 files changed

+306
-360
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: d30a4f4e677aa133b1a5ca50e69e4a241c58ab55
9+
refs/heads/incoming: 5f0a123f0d1c8718b015c973b3780bc9353e9159
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/etc/x86.supp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,6 @@
429429
...
430430
}
431431

432-
{
433-
enum-instruction-scheduling-10
434-
Memcheck:Cond
435-
fun:*config_from_opts*
436-
...
437-
}
438-
439432
{
440433
llvm-user-new-leak
441434
Memcheck:Leak

branches/incoming/src/librustc/middle/trans/consts.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,22 @@ pub fn const_expr(cx: @CrateContext, e: @ast::expr) -> ValueRef {
394394
ast::expr_path(pth) => {
395395
assert pth.types.len() == 0;
396396
match cx.tcx.def_map.find(&e.id) {
397-
Some(ast::def_fn(def_id, purity)) => {
397+
Some(ast::def_fn(def_id, _purity)) => {
398398
assert ast_util::is_local(def_id);
399399
let f = base::get_item_val(cx, def_id.node);
400-
match purity {
401-
ast::extern_fn =>
402-
llvm::LLVMConstPointerCast(f, T_ptr(T_i8())),
403-
_ => C_struct(~[f, C_null(T_opaque_box_ptr(cx))])
400+
let ety = ty::expr_ty_adjusted(cx.tcx, e);
401+
match ty::get(ety).sty {
402+
ty::ty_bare_fn(*) | ty::ty_ptr(*) => {
403+
llvm::LLVMConstPointerCast(f, T_ptr(T_i8()))
404+
}
405+
ty::ty_closure(*) => {
406+
C_struct(~[f, C_null(T_opaque_box_ptr(cx))])
407+
}
408+
_ => {
409+
cx.sess.span_bug(e.span, fmt!(
410+
"unexpected const fn type: %s",
411+
ty_to_str(cx.tcx, ety)))
412+
}
404413
}
405414
}
406415
Some(ast::def_const(def_id)) => {

branches/incoming/src/libsyntax/codemap.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,12 @@ pub impl CodeMap {
295295
}
296296

297297
/// Add a new FileMap to the CodeMap and return it
298-
fn new_filemap(&self, +filename: FileName, src: @~str) -> @FileMap {
298+
fn new_filemap(+filename: FileName, src: @~str) -> @FileMap {
299299
return self.new_filemap_w_substr(filename, FssNone, src);
300300
}
301301

302-
fn new_filemap_w_substr(
303-
&self,
304-
+filename: FileName,
305-
+substr: FileSubstr,
306-
src: @~str
307-
) -> @FileMap {
302+
fn new_filemap_w_substr(+filename: FileName, +substr: FileSubstr,
303+
src: @~str) -> @FileMap {
308304
let start_pos = if self.files.len() == 0 {
309305
0
310306
} else {

branches/incoming/src/libsyntax/ext/auto_encode.rs

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ pub fn expand_auto_decode(
223223

224224
priv impl ext_ctxt {
225225
fn bind_path(
226-
&self,
227226
span: span,
228227
ident: ast::ident,
229228
path: @ast::path,
@@ -242,7 +241,7 @@ priv impl ext_ctxt {
242241
}
243242
}
244243

245-
fn expr(&self, span: span, +node: ast::expr_) -> @ast::expr {
244+
fn expr(span: span, +node: ast::expr_) -> @ast::expr {
246245
@ast::expr {
247246
id: self.next_id(),
248247
callee_id: self.next_id(),
@@ -251,7 +250,7 @@ priv impl ext_ctxt {
251250
}
252251
}
253252

254-
fn path(&self, span: span, +strs: ~[ast::ident]) -> @ast::path {
253+
fn path(span: span, +strs: ~[ast::ident]) -> @ast::path {
255254
@ast::path {
256255
span: span,
257256
global: false,
@@ -261,7 +260,7 @@ priv impl ext_ctxt {
261260
}
262261
}
263262

264-
fn path_global(&self, span: span, +strs: ~[ast::ident]) -> @ast::path {
263+
fn path_global(span: span, +strs: ~[ast::ident]) -> @ast::path {
265264
@ast::path {
266265
span: span,
267266
global: true,
@@ -272,7 +271,6 @@ priv impl ext_ctxt {
272271
}
273272

274273
fn path_tps(
275-
&self,
276274
span: span,
277275
+strs: ~[ast::ident],
278276
+tps: ~[@ast::Ty]
@@ -287,7 +285,6 @@ priv impl ext_ctxt {
287285
}
288286

289287
fn path_tps_global(
290-
&self,
291288
span: span,
292289
+strs: ~[ast::ident],
293290
+tps: ~[@ast::Ty]
@@ -302,7 +299,6 @@ priv impl ext_ctxt {
302299
}
303300

304301
fn ty_path(
305-
&self,
306302
span: span,
307303
+strs: ~[ast::ident],
308304
+tps: ~[@ast::Ty]
@@ -316,7 +312,7 @@ priv impl ext_ctxt {
316312
}
317313
}
318314

319-
fn binder_pat(&self, span: span, nm: ast::ident) -> @ast::pat {
315+
fn binder_pat(span: span, nm: ast::ident) -> @ast::pat {
320316
@ast::pat {
321317
id: self.next_id(),
322318
node: ast::pat_ident(
@@ -327,12 +323,12 @@ priv impl ext_ctxt {
327323
}
328324
}
329325

330-
fn stmt(&self, expr: @ast::expr) -> @ast::stmt {
326+
fn stmt(expr: @ast::expr) -> @ast::stmt {
331327
@codemap::spanned { node: ast::stmt_semi(expr, self.next_id()),
332328
span: expr.span }
333329
}
334330

335-
fn lit_str(&self, span: span, s: @~str) -> @ast::expr {
331+
fn lit_str(span: span, s: @~str) -> @ast::expr {
336332
self.expr(
337333
span,
338334
ast::expr_vstore(
@@ -344,21 +340,21 @@ priv impl ext_ctxt {
344340
ast::expr_vstore_uniq))
345341
}
346342

347-
fn lit_uint(&self, span: span, i: uint) -> @ast::expr {
343+
fn lit_uint(span: span, i: uint) -> @ast::expr {
348344
self.expr(
349345
span,
350346
ast::expr_lit(
351347
@codemap::spanned { node: ast::lit_uint(i as u64, ast::ty_u),
352348
span: span}))
353349
}
354350

355-
fn lambda(&self, +blk: ast::blk) -> @ast::expr {
356-
let ext_cx = *self;
351+
fn lambda(+blk: ast::blk) -> @ast::expr {
352+
let ext_cx = self;
357353
let blk_e = self.expr(copy blk.span, ast::expr_block(copy blk));
358354
quote_expr!( || $blk_e )
359355
}
360356

361-
fn blk(&self, span: span, +stmts: ~[@ast::stmt]) -> ast::blk {
357+
fn blk(span: span, +stmts: ~[@ast::stmt]) -> ast::blk {
362358
codemap::spanned {
363359
node: ast::blk_ {
364360
view_items: ~[],
@@ -371,7 +367,7 @@ priv impl ext_ctxt {
371367
}
372368
}
373369

374-
fn expr_blk(&self, expr: @ast::expr) -> ast::blk {
370+
fn expr_blk(expr: @ast::expr) -> ast::blk {
375371
codemap::spanned {
376372
node: ast::blk_ {
377373
view_items: ~[],
@@ -384,24 +380,19 @@ priv impl ext_ctxt {
384380
}
385381
}
386382

387-
fn expr_path(&self, span: span, +strs: ~[ast::ident]) -> @ast::expr {
383+
fn expr_path(span: span, +strs: ~[ast::ident]) -> @ast::expr {
388384
self.expr(span, ast::expr_path(self.path(span, strs)))
389385
}
390386

391-
fn expr_path_global(
392-
&self,
393-
span: span,
394-
+strs: ~[ast::ident]
395-
) -> @ast::expr {
387+
fn expr_path_global(span: span, +strs: ~[ast::ident]) -> @ast::expr {
396388
self.expr(span, ast::expr_path(self.path_global(span, strs)))
397389
}
398390

399-
fn expr_var(&self, span: span, +var: ~str) -> @ast::expr {
391+
fn expr_var(span: span, +var: ~str) -> @ast::expr {
400392
self.expr_path(span, ~[self.ident_of(var)])
401393
}
402394

403395
fn expr_field(
404-
&self,
405396
span: span,
406397
expr: @ast::expr,
407398
ident: ast::ident
@@ -410,19 +401,18 @@ priv impl ext_ctxt {
410401
}
411402

412403
fn expr_call(
413-
&self,
414404
span: span,
415405
expr: @ast::expr,
416406
+args: ~[@ast::expr]
417407
) -> @ast::expr {
418408
self.expr(span, ast::expr_call(expr, args, ast::NoSugar))
419409
}
420410

421-
fn lambda_expr(&self, expr: @ast::expr) -> @ast::expr {
411+
fn lambda_expr(expr: @ast::expr) -> @ast::expr {
422412
self.lambda(self.expr_blk(expr))
423413
}
424414

425-
fn lambda_stmts(&self, span: span, +stmts: ~[@ast::stmt]) -> @ast::expr {
415+
fn lambda_stmts(span: span, +stmts: ~[@ast::stmt]) -> @ast::expr {
426416
self.lambda(self.blk(span, stmts))
427417
}
428418
}

branches/incoming/src/libsyntax/ext/quote.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ pub mod rt {
167167
}
168168
169169
pub trait ExtParseUtils {
170-
fn parse_item(&self, s: ~str) -> @ast::item;
171-
fn parse_expr(&self, s: ~str) -> @ast::expr;
172-
fn parse_stmt(&self, s: ~str) -> @ast::stmt;
173-
fn parse_tts(&self, s: ~str) -> ~[ast::token_tree];
170+
fn parse_item(s: ~str) -> @ast::item;
171+
fn parse_expr(s: ~str) -> @ast::expr;
172+
fn parse_stmt(s: ~str) -> @ast::stmt;
173+
fn parse_tts(s: ~str) -> ~[ast::token_tree];
174174
}
175175
176176
impl ExtParseUtils for ext_ctxt {
177177
178-
fn parse_item(&self, s: ~str) -> @ast::item {
178+
fn parse_item(s: ~str) -> @ast::item {
179179
let res = parse::parse_item_from_source_str(
180180
~"<quote expansion>",
181181
@(copy s),
@@ -191,7 +191,7 @@ pub mod rt {
191191
}
192192
}
193193

194-
fn parse_stmt(&self, s: ~str) -> @ast::stmt {
194+
fn parse_stmt(s: ~str) -> @ast::stmt {
195195
parse::parse_stmt_from_source_str(
196196
~"<quote expansion>",
197197
@(copy s),
@@ -200,15 +200,15 @@ pub mod rt {
200200
self.parse_sess())
201201
}
202202
203-
fn parse_expr(&self, s: ~str) -> @ast::expr {
203+
fn parse_expr(s: ~str) -> @ast::expr {
204204
parse::parse_expr_from_source_str(
205205
~"<quote expansion>",
206206
@(copy s),
207207
self.cfg(),
208208
self.parse_sess())
209209
}
210210
211-
fn parse_tts(&self, s: ~str) -> ~[ast::token_tree] {
211+
fn parse_tts(s: ~str) -> ~[ast::token_tree] {
212212
parse::parse_tts_from_source_str(
213213
~"<quote expansion>",
214214
@(copy s),

branches/incoming/src/libsyntax/fold.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,8 @@ impl ast_fold for AstFoldFns {
900900
}
901901

902902
pub impl ast_fold {
903-
fn fold_attributes(&self, attrs: ~[attribute]) -> ~[attribute] {
904-
attrs.map(|x| fold_attribute_(*x, *self))
903+
fn fold_attributes(attrs: ~[attribute]) -> ~[attribute] {
904+
attrs.map(|x| fold_attribute_(*x, self))
905905
}
906906
}
907907

branches/incoming/src/libsyntax/parse/attr.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,21 @@ use core::either::{Either, Left, Right};
2121

2222
// a parser that can parse attributes.
2323
pub trait parser_attr {
24-
fn parse_outer_attributes(&self) -> ~[ast::attribute];
25-
fn parse_attribute(&self, style: ast::attr_style) -> ast::attribute;
26-
fn parse_attribute_naked(
27-
&self,
28-
style: ast::attr_style,
29-
lo: BytePos
30-
) -> ast::attribute;
31-
fn parse_inner_attrs_and_next(&self) ->
24+
fn parse_outer_attributes() -> ~[ast::attribute];
25+
fn parse_attribute(style: ast::attr_style) -> ast::attribute;
26+
fn parse_attribute_naked(style: ast::attr_style, lo: BytePos) ->
27+
ast::attribute;
28+
fn parse_inner_attrs_and_next() ->
3229
(~[ast::attribute], ~[ast::attribute]);
33-
fn parse_meta_item(&self) -> @ast::meta_item;
34-
fn parse_meta_seq(&self) -> ~[@ast::meta_item];
35-
fn parse_optional_meta(&self) -> ~[@ast::meta_item];
30+
fn parse_meta_item() -> @ast::meta_item;
31+
fn parse_meta_seq() -> ~[@ast::meta_item];
32+
fn parse_optional_meta() -> ~[@ast::meta_item];
3633
}
3734

3835
impl parser_attr for Parser {
3936

4037
// Parse attributes that appear before an item
41-
fn parse_outer_attributes(&self) -> ~[ast::attribute] {
38+
fn parse_outer_attributes() -> ~[ast::attribute] {
4239
let mut attrs: ~[ast::attribute] = ~[];
4340
loop {
4441
match *self.token {
@@ -66,13 +63,13 @@ impl parser_attr for Parser {
6663
return attrs;
6764
}
6865

69-
fn parse_attribute(&self, style: ast::attr_style) -> ast::attribute {
66+
fn parse_attribute(style: ast::attr_style) -> ast::attribute {
7067
let lo = self.span.lo;
7168
self.expect(&token::POUND);
7269
return self.parse_attribute_naked(style, lo);
7370
}
7471

75-
fn parse_attribute_naked(&self, style: ast::attr_style, lo: BytePos) ->
72+
fn parse_attribute_naked(style: ast::attr_style, lo: BytePos) ->
7673
ast::attribute {
7774
self.expect(&token::LBRACKET);
7875
let meta_item = self.parse_meta_item();
@@ -92,7 +89,7 @@ impl parser_attr for Parser {
9289

9390
// you can make the 'next' field an Option, but the result is going to be
9491
// more useful as a vector.
95-
fn parse_inner_attrs_and_next(&self) ->
92+
fn parse_inner_attrs_and_next() ->
9693
(~[ast::attribute], ~[ast::attribute]) {
9794
let mut inner_attrs: ~[ast::attribute] = ~[];
9895
let mut next_outer_attrs: ~[ast::attribute] = ~[];
@@ -138,7 +135,7 @@ impl parser_attr for Parser {
138135
(inner_attrs, next_outer_attrs)
139136
}
140137

141-
fn parse_meta_item(&self) -> @ast::meta_item {
138+
fn parse_meta_item() -> @ast::meta_item {
142139
let lo = self.span.lo;
143140
let name = self.id_to_str(self.parse_ident());
144141
match *self.token {
@@ -160,7 +157,7 @@ impl parser_attr for Parser {
160157
}
161158
}
162159

163-
fn parse_meta_seq(&self) -> ~[@ast::meta_item] {
160+
fn parse_meta_seq() -> ~[@ast::meta_item] {
164161
copy self.parse_seq(
165162
&token::LPAREN,
166163
&token::RPAREN,
@@ -169,7 +166,7 @@ impl parser_attr for Parser {
169166
).node
170167
}
171168

172-
fn parse_optional_meta(&self) -> ~[@ast::meta_item] {
169+
fn parse_optional_meta() -> ~[@ast::meta_item] {
173170
match *self.token {
174171
token::LPAREN => self.parse_meta_seq(),
175172
_ => ~[]

0 commit comments

Comments
 (0)