Skip to content

Commit cd87210

Browse files
committed
---
yaml --- r: 83917 b: refs/heads/dist-snap c: 0c6fc46 h: refs/heads/master i: 83915: 99f1fc6 v: v3
1 parent d7aae34 commit cd87210

File tree

10 files changed

+16
-13
lines changed

10 files changed

+16
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: cdea73cf5b94784fdc910ab23d5d3455c868d247
9+
refs/heads/dist-snap: 0c6fc46c030ab0515a052fa99c9e10c75cfc8184
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/kind.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ fn with_appropriate_checker(cx: Context, id: node_id,
198198
fn check_for_bare(cx: Context, fv: @freevar_entry) {
199199
cx.tcx.sess.span_err(
200200
fv.span,
201-
"attempted dynamic environment capture");
202-
}
201+
"can't capture dynamic environment in a fn item; \
202+
use the || { ... } closure form instead");
203+
} // same check is done in resolve.rs, but shouldn't be done
203204

204205
let fty = ty::node_id_to_type(cx.tcx, id);
205206
match ty::get(fty).sty {

branches/dist-snap/src/librustc/middle/resolve.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3381,7 +3381,8 @@ impl Resolver {
33813381

33823382
self.session.span_err(
33833383
span,
3384-
"attempted dynamic environment-capture");
3384+
"can't capture dynamic environment in a fn item; \
3385+
use the || { ... } closure form instead");
33853386
} else {
33863387
// This was an attempt to use a type parameter outside
33873388
// its scope.
@@ -3403,7 +3404,8 @@ impl Resolver {
34033404

34043405
self.session.span_err(
34053406
span,
3406-
"attempted dynamic environment-capture");
3407+
"can't capture dynamic environment in a fn item; \
3408+
use the || { ... } closure form instead");
34073409
} else {
34083410
// This was an attempt to use a type parameter outside
34093411
// its scope.

branches/dist-snap/src/test/compile-fail/bad-env-capture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: attempted dynamic environment-capture
11+
// error-pattern: can't capture dynamic environment in a fn item;
1212
fn foo() {
1313
let x: int;
1414
fn bar() { log(debug, x); }

branches/dist-snap/src/test/compile-fail/bad-env-capture2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: attempted dynamic environment-capture
11+
// error-pattern: can't capture dynamic environment in a fn item;
1212
fn foo(x: int) {
1313
fn bar() { log(debug, x); }
1414
}

branches/dist-snap/src/test/compile-fail/bad-env-capture3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: attempted dynamic environment-capture
11+
// error-pattern: can't capture dynamic environment in a fn item;
1212
fn foo(x: int) {
1313
fn mth() {
1414
fn bar() { log(debug, x); }

branches/dist-snap/src/test/compile-fail/capture1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// except according to those terms.
1111

1212

13-
// error-pattern: attempted dynamic environment-capture
13+
// error-pattern: can't capture dynamic environment in a fn item;
1414

1515
fn main() {
1616
let bar: int = 5;

branches/dist-snap/src/test/compile-fail/issue-3021-b.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn siphash(k0 : u64) {
1818

1919
impl siphash {
2020
pub fn reset(&mut self) {
21-
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture
21+
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
2222
//~^ ERROR unresolved name `k0`.
2323
}
2424
}

branches/dist-snap/src/test/compile-fail/issue-3021-d.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ fn siphash(k0 : u64, k1 : u64) -> siphash {
3030

3131
impl siphash for SipState {
3232
fn reset(&self) {
33-
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture
33+
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
3434
//~^ ERROR unresolved name `k0`.
35-
self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR attempted dynamic environment-capture
35+
self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment
3636
//~^ ERROR unresolved name `k1`.
3737
}
3838
fn result(&self) -> u64 { return mk_result(self); }

branches/dist-snap/src/test/compile-fail/issue-3021.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn siphash(k0 : u64) -> SipHash {
2121

2222
impl SipHash for SipState {
2323
fn reset(&self) {
24-
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR attempted dynamic environment-capture
24+
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
2525
//~^ ERROR unresolved name `k0`.
2626
}
2727
}

0 commit comments

Comments
 (0)