Skip to content

Commit 8a05972

Browse files
committed
---
yaml --- r: 3401 b: refs/heads/master c: fb14afd h: refs/heads/master i: 3399: 65b84f6 v: v3
1 parent f7511b6 commit 8a05972

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
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: 07125aa38b0fd14ada84da43c874b798a2767840
2+
refs/heads/master: fb14afd5eb8ab19f08e37e295fb207f0a1bb8e23

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3137,7 +3137,7 @@ fn copy_val(&@block_ctxt cx, copy_action action, ValueRef dst, ValueRef src,
31373137
// FIXME this is just a clunky stopgap. we should do proper checking in an
31383138
// earlier pass.
31393139
if (!ty::type_is_copyable(ccx.tcx, t)) {
3140-
ccx.sess.span_err(cx.sp, "Copying a non-copyable type.");
3140+
ccx.sess.span_fatal(cx.sp, "Copying a non-copyable type.");
31413141
}
31423142

31433143
if (ty::type_is_scalar(ccx.tcx, t) ||
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// error-pattern:Copying a non-copyable type
2+
3+
res foo(int i) {}
4+
5+
fn main() {
6+
auto x <- foo(10);
7+
auto y = x;
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
res shrinky_pointer(@mutable int i) {
2+
*i -= 1;
3+
}
4+
5+
fn look_at(&shrinky_pointer pt) -> int {
6+
ret **pt;
7+
}
8+
9+
fn main() {
10+
auto my_total = @mutable 10;
11+
{
12+
auto pt <- shrinky_pointer(my_total);
13+
assert (look_at(pt) == 10);
14+
}
15+
assert (*my_total == 9);
16+
}

0 commit comments

Comments
 (0)