-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1177
- Loading branch information
Showing
6 changed files
with
30 additions
and
73 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
resource r(i: int) { | ||
} | ||
resource r(i: @mutable int) { *i += 1; } | ||
|
||
fn main() { | ||
// Even though this looks like a copy, it's guaranteed not to be | ||
let a = r(0); | ||
} | ||
let i = @mutable 0; | ||
// Even though these look like copies, they are guaranteed not to be | ||
{ | ||
let a = r(i); | ||
let b = (a, 10); | ||
let (c, _d) = b; | ||
log c; | ||
} | ||
assert *i == 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This rule is very subtle.