mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 08:37:14 +00:00
Update some more tests for 1a68a9882
This commit is contained in:
parent
4ce6472c02
commit
5945667b99
|
@ -1,21 +0,0 @@
|
|||
// error-pattern: cannot copy pinned type r
|
||||
|
||||
resource r(i: @mutable int) {
|
||||
*i = *i + 1;
|
||||
}
|
||||
|
||||
fn movearg(i: r) {
|
||||
// Implicit copy to mutate reference i
|
||||
let j <- i;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let i = @mutable 0;
|
||||
{
|
||||
let j <- r(i);
|
||||
movearg(j);
|
||||
}
|
||||
log_err *i;
|
||||
// nooooooo. destructor ran twice
|
||||
assert *i == 2;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// error-pattern: cannot copy pinned type 'a
|
||||
|
||||
resource r(i: @mutable int) {
|
||||
*i = *i + 1;
|
||||
}
|
||||
|
||||
fn movearg<pin T>(i: T) {
|
||||
// Implicit copy to mutate reference i
|
||||
let j <- i;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let i = @mutable 0;
|
||||
{
|
||||
let j <- r(i);
|
||||
movearg(j);
|
||||
}
|
||||
log_err *i;
|
||||
// nooooooo. destructor ran twice
|
||||
assert *i == 2;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// error-pattern:quux
|
||||
fn test00_start(ch: chan_t<int>, message: int) { send(ch, message); }
|
||||
fn test00_start(ch: chan_t<int>, message: int) { send(ch, copy message); }
|
||||
|
||||
type task_id = int;
|
||||
type port_id = int;
|
||||
|
|
Loading…
Reference in a new issue