Skip to content

Commit 8f0247d

Browse files
committed
---
yaml --- r: 117629 b: refs/heads/auto c: cc28ae5 h: refs/heads/master i: 117627: 292ef3e v: v3
1 parent bc420ba commit 8f0247d

File tree

6 files changed

+97
-135
lines changed

6 files changed

+97
-135
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: ddd09df1377456de0f8376414d27828ba104df5b
16+
refs/heads/auto: cc28ae5201b0927683b253dbe893a62a188aa5a5
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustdoc/html/static/playpen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
a.attr('target', '_blank');
2323
$(this).append(a);
2424
}, function() {
25-
$(this).find('a.test-arrow').remove();
25+
$(this).find('a').remove();
2626
});
2727
}
2828
}());

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ pub mod rt {
135135
}
136136
}
137137

138+
impl ToSource for ast::Arg {
139+
fn to_source(&self) -> String {
140+
pprust::arg_to_str(self)
141+
}
142+
}
143+
138144
impl<'a> ToSource for &'a str {
139145
fn to_source(&self) -> String {
140146
let lit = dummy_spanned(ast::LitStr(
@@ -264,6 +270,7 @@ pub mod rt {
264270
impl_to_tokens!(Generics)
265271
impl_to_tokens!(@ast::Expr)
266272
impl_to_tokens!(ast::Block)
273+
impl_to_tokens!(ast::Arg)
267274
impl_to_tokens_self!(&'a str)
268275
impl_to_tokens!(())
269276
impl_to_tokens!(char)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ pub fn variant_to_str(var: &ast::Variant) -> String {
242242
to_str(|s| s.print_variant(var))
243243
}
244244

245+
pub fn arg_to_str(arg: &ast::Arg) -> String {
246+
to_str(|s| s.print_arg(arg))
247+
}
248+
245249
pub fn visibility_qualified(vis: ast::Visibility, s: &str) -> String {
246250
match vis {
247251
ast::Public => format!("pub {}", s).to_string(),

branches/auto/src/test/compile-fail/borrowck-field-sensitivity.rs

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010

1111
struct A { a: int, b: Box<int> }
1212

13-
fn deref_after_move() {
13+
fn borrow<T>(_: &T) { }
14+
15+
fn use_after_move() {
1416
let x = A { a: 1, b: box 2 };
1517
drop(x.b);
1618
drop(*x.b); //~ ERROR use of partially moved value: `*x.b`
1719
}
1820

19-
fn deref_after_fu_move() {
21+
fn use_after_fu_move() {
2022
let x = A { a: 1, b: box 2 };
2123
let y = A { a: 3, .. x };
2224
drop(*x.b); //~ ERROR use of partially moved value: `*x.b`
@@ -25,37 +27,35 @@ fn deref_after_fu_move() {
2527
fn borrow_after_move() {
2628
let x = A { a: 1, b: box 2 };
2729
drop(x.b);
28-
let p = &x.b; //~ ERROR use of moved value: `x.b`
29-
drop(**p);
30+
borrow(&x.b); //~ ERROR use of moved value: `x.b`
3031
}
3132

3233
fn borrow_after_fu_move() {
3334
let x = A { a: 1, b: box 2 };
3435
let _y = A { a: 3, .. x };
35-
let p = &x.b; //~ ERROR use of moved value: `x.b`
36-
drop(**p);
36+
borrow(&x.b); //~ ERROR use of moved value: `x.b`
3737
}
3838

3939
fn move_after_borrow() {
4040
let x = A { a: 1, b: box 2 };
41-
let p = &x.b;
41+
let y = &x.b;
4242
drop(x.b); //~ ERROR cannot move out of `x.b` because it is borrowed
43-
drop(**p);
43+
borrow(&*y);
4444
}
4545

4646
fn fu_move_after_borrow() {
4747
let x = A { a: 1, b: box 2 };
48-
let p = &x.b;
49-
let _y = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed
50-
drop(**p);
48+
let y = &x.b;
49+
let _z = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed
50+
borrow(&*y);
5151
}
5252

5353
fn mut_borrow_after_mut_borrow() {
5454
let mut x = A { a: 1, b: box 2 };
55-
let p = &mut x.a;
56-
let q = &mut x.a; //~ ERROR cannot borrow `x.a` as mutable more than once at a time
57-
drop(*p);
58-
drop(*q);
55+
let y = &mut x.a;
56+
let z = &mut x.a; //~ ERROR cannot borrow `x.a` as mutable more than once at a time
57+
drop(*y);
58+
drop(*z);
5959
}
6060

6161
fn move_after_move() {
@@ -84,21 +84,7 @@ fn fu_move_after_fu_move() {
8484

8585
// The following functions aren't yet accepted, but they should be.
8686

87-
fn move_after_borrow_correct() {
88-
let x = A { a: 1, b: box 2 };
89-
let p = &x.a;
90-
drop(x.b); //~ ERROR cannot move out of `x.b` because it is borrowed
91-
drop(*p);
92-
}
93-
94-
fn fu_move_after_borrow_correct() {
95-
let x = A { a: 1, b: box 2 };
96-
let p = &x.a;
97-
let _y = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed
98-
drop(*p);
99-
}
100-
101-
fn copy_after_field_assign_after_uninit() {
87+
fn use_after_field_assign_after_uninit() {
10288
let mut x: A;
10389
x.a = 1;
10490
drop(x.a); //~ ERROR use of possibly uninitialized variable: `x.a`
@@ -107,8 +93,7 @@ fn copy_after_field_assign_after_uninit() {
10793
fn borrow_after_field_assign_after_uninit() {
10894
let mut x: A;
10995
x.a = 1;
110-
let p = &x.a; //~ ERROR use of possibly uninitialized variable: `x.a`
111-
drop(*p);
96+
borrow(&x.a); //~ ERROR use of possibly uninitialized variable: `x.a`
11297
}
11398

11499
fn move_after_field_assign_after_uninit() {
@@ -118,8 +103,8 @@ fn move_after_field_assign_after_uninit() {
118103
}
119104

120105
fn main() {
121-
deref_after_move();
122-
deref_after_fu_move();
106+
use_after_move();
107+
use_after_fu_move();
123108

124109
borrow_after_move();
125110
borrow_after_fu_move();
@@ -132,10 +117,7 @@ fn main() {
132117
fu_move_after_move();
133118
fu_move_after_fu_move();
134119

135-
move_after_borrow_correct();
136-
fu_move_after_borrow_correct();
137-
138-
copy_after_field_assign_after_uninit();
120+
use_after_field_assign_after_uninit();
139121
borrow_after_field_assign_after_uninit();
140122
move_after_field_assign_after_uninit();
141123
}

0 commit comments

Comments
 (0)