Skip to content

Commit f722742

Browse files
AatchJames Miller
authored andcommitted
---
yaml --- r: 142472 b: refs/heads/try2 c: cd1b6c8 h: refs/heads/master v: v3
1 parent 9eba010 commit f722742

33 files changed

+207
-199
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: a69eb952336bb3d483dd046373daa8e3948390a7
8+
refs/heads/try2: cd1b6c897911c91167c5a3c5e3c2fa0d9334ad45
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn inject_libstd_ref(sess: Session, crate: &ast::crate) -> @ast::crate {
7575
fold_mod: |module, fld| {
7676
let n2 = sess.next_node_id();
7777

78-
let prelude_path = @ast::Path {
78+
let prelude_path = ast::Path {
7979
span: dummy_sp(),
8080
global: false,
8181
idents: ~[

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,16 @@ fn nospan<T:Copy>(t: T) -> codemap::spanned<T> {
342342
codemap::spanned { node: t, span: dummy_sp() }
343343
}
344344

345-
fn path_node(ids: ~[ast::ident]) -> @ast::Path {
346-
@ast::Path { span: dummy_sp(),
345+
fn path_node(ids: ~[ast::ident]) -> ast::Path {
346+
ast::Path { span: dummy_sp(),
347347
global: false,
348348
idents: ids,
349349
rp: None,
350350
types: ~[] }
351351
}
352352

353-
fn path_node_global(ids: ~[ast::ident]) -> @ast::Path {
354-
@ast::Path { span: dummy_sp(),
353+
fn path_node_global(ids: ~[ast::ident]) -> ast::Path {
354+
ast::Path { span: dummy_sp(),
355355
global: true,
356356
idents: ids,
357357
rp: None,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
10141014
encode_name(ecx, ebml_w, item.ident);
10151015
encode_attributes(ebml_w, item.attrs);
10161016
match ty.node {
1017-
ast::ty_path(path, bounds, _) if path.idents.len() == 1 => {
1017+
ast::ty_path(ref path, bounds, _) if path.idents.len() == 1 => {
10181018
assert!(bounds.is_none());
10191019
encode_impl_type_basename(ecx, ebml_w,
10201020
ast_util::path_to_ident(path));

branches/try2/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub fn check_expr(sess: Session,
112112
"` in a constant expression");
113113
}
114114
}
115-
expr_path(pth) => {
115+
expr_path(ref pth) => {
116116
// NB: In the future you might wish to relax this slightly
117117
// to handle on-demand instantiation of functions via
118118
// foo::<bar> in a const. Currently that is only done on

branches/try2/src/librustc/middle/pat_util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: @pat) -> bool {
7171
}
7272

7373
pub fn pat_bindings(dm: resolve::DefMap, pat: @pat,
74-
it: &fn(binding_mode, node_id, span, @Path)) {
74+
it: &fn(binding_mode, node_id, span, &Path)) {
7575
for walk_pat(pat) |p| {
7676
match p.node {
77-
pat_ident(binding_mode, pth, _) if pat_is_binding(dm, p) => {
77+
pat_ident(binding_mode, ref pth, _) if pat_is_binding(dm, p) => {
7878
it(binding_mode, p.id, p.span, pth);
7979
}
8080
_ => {}

branches/try2/src/librustc/middle/privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pub fn check_crate<'mm>(tcx: ty::ctxt,
276276
};
277277

278278
// Checks that a private path is in scope.
279-
let check_path: @fn(span: span, def: def, path: @Path) =
279+
let check_path: @fn(span: span, def: def, path: &Path) =
280280
|span, def, path| {
281281
debug!("checking path");
282282
match def {
@@ -449,7 +449,7 @@ pub fn check_crate<'mm>(tcx: ty::ctxt,
449449
_ => {}
450450
}
451451
}
452-
expr_path(path) => {
452+
expr_path(ref path) => {
453453
check_path(expr.span, tcx.def_map.get_copy(&expr.id), path);
454454
}
455455
expr_struct(_, ref fields, _) => {

branches/try2/src/librustc/middle/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ fn determine_rp_in_ty(ty: @ast::Ty,
784784
// then check whether it is region-parameterized and consider
785785
// that as a direct dependency.
786786
match ty.node {
787-
ast::ty_path(path, _bounds, id) => {
787+
ast::ty_path(ref path, _bounds, id) => {
788788
match cx.def_map.find(&id) {
789789
Some(&ast::def_ty(did)) |
790790
Some(&ast::def_trait(did)) |
@@ -820,7 +820,7 @@ fn determine_rp_in_ty(ty: @ast::Ty,
820820
visit_mt(mt, (cx, visitor));
821821
}
822822

823-
ast::ty_path(path, _bounds, _) => {
823+
ast::ty_path(ref path, _bounds, _) => {
824824
// type parameters are---for now, anyway---always invariant
825825
do cx.with_ambient_variance(rv_invariant) {
826826
for path.types.iter().advance |tp| {

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ impl Resolver {
12451245
// Create the module and add all methods.
12461246
match *ty {
12471247
Ty {
1248-
node: ty_path(path, _, _),
1248+
node: ty_path(ref path, _, _),
12491249
_
12501250
} if path.idents.len() == 1 => {
12511251
let name = path_to_ident(path);
@@ -1446,7 +1446,7 @@ impl Resolver {
14461446

14471447
let mut module_path = ~[];
14481448
match view_path.node {
1449-
view_path_simple(_, full_path, _) => {
1449+
view_path_simple(_, ref full_path, _) => {
14501450
let path_len = full_path.idents.len();
14511451
assert!(path_len != 0);
14521452

@@ -1457,8 +1457,8 @@ impl Resolver {
14571457
}
14581458
}
14591459

1460-
view_path_glob(module_ident_path, _) |
1461-
view_path_list(module_ident_path, _, _) => {
1460+
view_path_glob(ref module_ident_path, _) |
1461+
view_path_list(ref module_ident_path, _, _) => {
14621462
for module_ident_path.idents.iter().advance |ident| {
14631463
module_path.push(*ident);
14641464
}
@@ -1468,7 +1468,7 @@ impl Resolver {
14681468
// Build up the import directives.
14691469
let module_ = self.get_module_from_parent(parent);
14701470
match view_path.node {
1471-
view_path_simple(binding, full_path, id) => {
1471+
view_path_simple(binding, ref full_path, id) => {
14721472
let source_ident = *full_path.idents.last();
14731473
let subclass = @SingleImport(binding,
14741474
source_ident);
@@ -3561,7 +3561,7 @@ impl Resolver {
35613561

35623562
// Resolve derived traits.
35633563
for traits.iter().advance |trt| {
3564-
self.resolve_trait_reference(*trt, visitor, TraitDerivation);
3564+
self.resolve_trait_reference(trt, visitor, TraitDerivation);
35653565
}
35663566

35673567
for (*methods).iter().advance |method| {
@@ -4117,7 +4117,7 @@ impl Resolver {
41174117
// Like path expressions, the interpretation of path types depends
41184118
// on whether the path has multiple elements in it or not.
41194119

4120-
ty_path(path, bounds, path_id) => {
4120+
ty_path(ref path, bounds, path_id) => {
41214121
// This is a path in the type namespace. Walk through scopes
41224122
// scopes looking for it.
41234123
let mut result_def = None;
@@ -4211,7 +4211,7 @@ impl Resolver {
42114211
let pat_id = pattern.id;
42124212
for walk_pat(pattern) |pattern| {
42134213
match pattern.node {
4214-
pat_ident(binding_mode, path, _)
4214+
pat_ident(binding_mode, ref path, _)
42154215
if !path.global && path.idents.len() == 1 => {
42164216

42174217
// The meaning of pat_ident with no type parameters
@@ -4338,7 +4338,7 @@ impl Resolver {
43384338
}
43394339
}
43404340

4341-
pat_ident(binding_mode, path, _) => {
4341+
pat_ident(binding_mode, ref path, _) => {
43424342
// This must be an enum variant, struct, or constant.
43434343
match self.resolve_path(path, ValueNS, false, visitor) {
43444344
Some(def @ def_variant(*)) |
@@ -4371,7 +4371,7 @@ impl Resolver {
43714371
}
43724372
}
43734373

4374-
pat_enum(path, _) => {
4374+
pat_enum(ref path, _) => {
43754375
// This must be an enum variant, struct or const.
43764376
match self.resolve_path(path, ValueNS, false, visitor) {
43774377
Some(def @ def_fn(*)) |
@@ -4409,7 +4409,7 @@ impl Resolver {
44094409
self.resolve_expr(last_expr, visitor);
44104410
}
44114411

4412-
pat_struct(path, _, _) => {
4412+
pat_struct(ref path, _, _) => {
44134413
match self.resolve_path(path, TypeNS, false, visitor) {
44144414
Some(def_ty(class_id))
44154415
if self.structs.contains(&class_id) => {
@@ -4484,7 +4484,7 @@ impl Resolver {
44844484
/// If `check_ribs` is true, checks the local definitions first; i.e.
44854485
/// doesn't skip straight to the containing module.
44864486
pub fn resolve_path(@mut self,
4487-
path: @Path,
4487+
path: &Path,
44884488
namespace: Namespace,
44894489
check_ribs: bool,
44904490
visitor: ResolveVisitor)
@@ -4610,7 +4610,7 @@ impl Resolver {
46104610
return NoNameDefinition;
46114611
}
46124612

4613-
pub fn intern_module_part_of_path(@mut self, path: @Path) -> ~[ident] {
4613+
pub fn intern_module_part_of_path(@mut self, path: &Path) -> ~[ident] {
46144614
let mut module_path_idents = ~[];
46154615
for path.idents.iter().enumerate().advance |(index, ident)| {
46164616
if index == path.idents.len() - 1 {
@@ -4624,7 +4624,7 @@ impl Resolver {
46244624
}
46254625

46264626
pub fn resolve_module_relative_path(@mut self,
4627-
path: @Path,
4627+
path: &Path,
46284628
xray: XrayFlag,
46294629
namespace: Namespace)
46304630
-> Option<def> {
@@ -4690,7 +4690,7 @@ impl Resolver {
46904690
/// Invariant: This must be called only during main resolution, not during
46914691
/// import resolution.
46924692
pub fn resolve_crate_relative_path(@mut self,
4693-
path: @Path,
4693+
path: &Path,
46944694
xray: XrayFlag,
46954695
namespace: Namespace)
46964696
-> Option<def> {
@@ -4916,7 +4916,7 @@ impl Resolver {
49164916
// The interpretation of paths depends on whether the path has
49174917
// multiple elements in it or not.
49184918

4919-
expr_path(path) => {
4919+
expr_path(ref path) => {
49204920
// This is a local path in the value namespace. Walk through
49214921
// scopes looking for it.
49224922

@@ -4985,7 +4985,7 @@ impl Resolver {
49854985
visitor);
49864986
}
49874987

4988-
expr_struct(path, _, _) => {
4988+
expr_struct(ref path, _, _) => {
49894989
// Resolve the path to the structure it goes to.
49904990
match self.resolve_path(path, TypeNS, false, visitor) {
49914991
Some(def_ty(class_id)) | Some(def_struct(class_id))

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ pub fn expand_nested_bindings<'r>(bcx: block,
385385

386386
do m.map |br| {
387387
match br.pats[col].node {
388-
ast::pat_ident(_, path, Some(inner)) => {
388+
ast::pat_ident(_, ref path, Some(inner)) => {
389389
let pats = vec::append(
390390
br.pats.slice(0u, col).to_owned(),
391391
vec::append(~[inner],
@@ -441,7 +441,7 @@ pub fn enter_match<'r>(bcx: block,
441441

442442
let this = br.pats[col];
443443
match this.node {
444-
ast::pat_ident(_, path, None) => {
444+
ast::pat_ident(_, ref path, None) => {
445445
if pat_is_binding(dm, this) {
446446
let binding_info =
447447
br.data.bindings_map.get(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ pub fn alloc_local(cx: block, local: &ast::local) -> block {
13991399
let _icx = push_ctxt("alloc_local");
14001400
let t = node_id_type(cx, local.node.id);
14011401
let simple_name = match local.node.pat.node {
1402-
ast::pat_ident(_, pth, None) => Some(path_to_ident(pth)),
1402+
ast::pat_ident(_, ref pth, None) => Some(path_to_ident(pth)),
14031403
_ => None
14041404
};
14051405
let val = alloc_ty(cx, t);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ fn const_expr_unadjusted(cx: @mut CrateContext, e: &ast::expr) -> ValueRef {
525525
_ => cx.sess.span_bug(e.span, "bad const-slice expr")
526526
}
527527
}
528-
ast::expr_path(pth) => {
528+
ast::expr_path(ref pth) => {
529529
assert_eq!(pth.types.len(), 0);
530530
let tcx = cx.tcx;
531531
match tcx.def_map.find(&e.id) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn create_local_var(bcx: block, local: @ast::local) -> DIVariable {
133133
let cx = bcx.ccx();
134134

135135
let ident = match local.node.pat.node {
136-
ast::pat_ident(_, pth, _) => ast_util::path_to_ident(pth),
136+
ast::pat_ident(_, ref pth, _) => ast_util::path_to_ident(pth),
137137
// FIXME this should be handled (#2533)
138138
_ => {
139139
bcx.sess().span_note(local.span, "debuginfo for pattern bindings NYI");
@@ -204,7 +204,7 @@ pub fn create_arg(bcx: block, arg: ast::arg, span: span) -> Option<DIVariable> {
204204
let context = create_function(fcx);
205205

206206
match arg.pat.node {
207-
ast::pat_ident(_, path, _) => {
207+
ast::pat_ident(_, ref path, _) => {
208208
// XXX: This is wrong; it should work for multiple bindings.
209209
let ident = path.idents.last();
210210
let name: &str = cx.sess.str_of(*ident);

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ fn ast_path_substs<AC:AstConv,RS:region_scope + Copy + 'static>(
136136
def_id: ast::def_id,
137137
decl_generics: &ty::Generics,
138138
self_ty: Option<ty::t>,
139-
path: @ast::Path) -> ty::substs
139+
path: &ast::Path) -> ty::substs
140140
{
141141
/*!
142142
*
@@ -188,7 +188,7 @@ pub fn ast_path_to_substs_and_ty<AC:AstConv,RS:region_scope + Copy + 'static>(
188188
this: &AC,
189189
rscope: &RS,
190190
did: ast::def_id,
191-
path: @ast::Path) -> ty_param_substs_and_ty
191+
path: &ast::Path) -> ty_param_substs_and_ty
192192
{
193193
let tcx = this.tcx();
194194
let ty::ty_param_bounds_and_ty {
@@ -206,7 +206,7 @@ pub fn ast_path_to_trait_ref<AC:AstConv,RS:region_scope + Copy + 'static>(
206206
rscope: &RS,
207207
trait_def_id: ast::def_id,
208208
self_ty: Option<ty::t>,
209-
path: @ast::Path) -> @ty::TraitRef
209+
path: &ast::Path) -> @ty::TraitRef
210210
{
211211
let trait_def =
212212
this.get_trait_def(trait_def_id);
@@ -228,7 +228,7 @@ pub fn ast_path_to_ty<AC:AstConv,RS:region_scope + Copy + 'static>(
228228
this: &AC,
229229
rscope: &RS,
230230
did: ast::def_id,
231-
path: @ast::Path)
231+
path: &ast::Path)
232232
-> ty_param_substs_and_ty
233233
{
234234
// Look up the polytype of the item and then substitute the provided types
@@ -276,7 +276,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
276276
}
277277
return ty::mk_evec(tcx, mt, vst);
278278
}
279-
ast::ty_path(path, bounds, id) => {
279+
ast::ty_path(ref path, bounds, id) => {
280280
// Note that the "bounds must be empty if path is not a trait"
281281
// restriction is enforced in the below case for ty_path, which
282282
// will run after this as long as the path isn't a trait.
@@ -321,7 +321,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
321321
}
322322

323323
fn check_path_args(tcx: ty::ctxt,
324-
path: @ast::Path,
324+
path: &ast::Path,
325325
flags: uint) {
326326
if (flags & NO_TPS) != 0u {
327327
if path.types.len() > 0u {
@@ -405,7 +405,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + 'static>(
405405
ast_ty.span);
406406
ty::mk_closure(tcx, fn_decl)
407407
}
408-
ast::ty_path(path, bounds, id) => {
408+
ast::ty_path(ref path, bounds, id) => {
409409
let a_def = match tcx.def_map.find(&id) {
410410
None => tcx.sess.span_fatal(
411411
ast_ty.span, fmt!("unbound path %s",

0 commit comments

Comments
 (0)