Skip to content

Commit 5d82f9d

Browse files
committed
---
yaml --- r: 3547 b: refs/heads/master c: d39c59a h: refs/heads/master i: 3545: a7ff478 3543: 9511681 v: v3
1 parent affa0d6 commit 5d82f9d

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4e59b0be544bfda5c533c2024c981861ce012709
2+
refs/heads/master: d39c59ae4172b18ea022893a09164dcb6debb1c0

trunk/src/comp/front/ast.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,19 @@ fn ternary_to_if(&@expr e) -> @ast::expr {
598598
}
599599
}
600600

601+
// Path stringification
602+
fn path_to_str(&ast::path pth) -> str {
603+
auto result = str::connect(pth.node.idents, "::");
604+
if (vec::len[@ast::ty](pth.node.types) > 0u) {
605+
fn f(&@ast::ty t) -> str { ret pretty::pprust::ty_to_str(*t); }
606+
result += "[";
607+
result += str::connect(vec::map(f, pth.node.types), ",");
608+
result += "]";
609+
}
610+
ret result;
611+
}
612+
613+
601614
//
602615
// Local Variables:
603616
// mode: rust

trunk/src/comp/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fn enc_ty_fn(&io::writer w, &@ctxt cx, &ty::arg[] args, &ty::t out,
232232

233233
}
234234
fn enc_constr(&io::writer w, &@ctxt cx, &@ty::constr_def c) {
235-
w.write_str(ty::path_to_str(c.node.path));
235+
w.write_str(path_to_str(c.node.path));
236236
w.write_char('(');
237237
w.write_str(cx.ds(c.node.id));
238238
w.write_char('|');

trunk/src/comp/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ fn resolve_constr(@env e, node_id id, &@ast::constr c, &scopes sc,
423423
case (_) {
424424
e.sess.span_err(c.span,
425425
"Non-predicate in constraint: " +
426-
ty::path_to_str(c.node.path));
426+
ast::path_to_str(c.node.path));
427427
}
428428
}
429429
}

trunk/src/comp/middle/ty.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import front::ast::def_id;
1818
import front::ast::constr_arg_general;
1919
import front::ast::mutability;
2020
import front::ast::controlflow;
21+
import front::ast::path_to_str;
2122
import metadata::creader;
2223
import metadata::decoder;
2324
import util::common::*;
@@ -101,7 +102,6 @@ export node_type_table;
101102
export pat_node_id;
102103
export pat_ty;
103104
export cname;
104-
export path_to_str;
105105
export rename;
106106
export ret_ty_of_fn;
107107
export ret_ty_of_fn_ty;
@@ -632,19 +632,6 @@ fn cname(&ctxt cx, &t typ) -> option::t[str] {
632632
}
633633

634634

635-
// Stringification
636-
fn path_to_str(&ast::path pth) -> str {
637-
auto result = str::connect(pth.node.idents, "::");
638-
if (vec::len[@ast::ty](pth.node.types) > 0u) {
639-
fn f(&@ast::ty t) -> str { ret pretty::pprust::ty_to_str(*t); }
640-
result += "[";
641-
result += str::connect(vec::map(f, pth.node.types), ",");
642-
result += "]";
643-
}
644-
ret result;
645-
}
646-
647-
648635
// Type folds
649636
type ty_walk = fn(t) ;
650637

trunk/src/comp/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import front::ast;
33
import front::ast::mutability;
44
import front::ast::local_def;
5+
import front::ast::path_to_str;
56
import metadata::decoder;
67
import driver::session;
78
import util::common;
@@ -22,7 +23,6 @@ import middle::ty::mo_val;
2223
import middle::ty::mo_alias;
2324
import middle::ty::node_type_table;
2425
import middle::ty::pat_ty;
25-
import middle::ty::path_to_str;
2626
import middle::ty::ty_param_substs_opt_and_ty;
2727
import pretty::ppaux::ty_to_str;
2828
import middle::ty::ty_param_count_and_ty;

trunk/src/comp/pretty/ppaux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,12 @@ const uint default_columns = 78u;
379379
fn uint_to_str(&uint i) -> str { ret uistr(i); }
380380

381381
fn constr_to_str(&@constr_def c) -> str {
382-
ret path_to_str(c.node.path) +
382+
ret ast::path_to_str(c.node.path) +
383383
constr_args_to_str(uint_to_str, c.node.args);
384384
}
385385

386386
fn ast_constr_to_str(&@front::ast::constr c) -> str {
387-
ret path_to_str(c.node.path) +
387+
ret ast::path_to_str(c.node.path) +
388388
constr_args_to_str(uint_to_str, c.node.args);
389389
}
390390

0 commit comments

Comments
 (0)