diff options
Diffstat (limited to 'src/test/compile-fail/borrowck-uniq-via-box.rs')
| -rw-r--r-- | src/test/compile-fail/borrowck-uniq-via-box.rs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/test/compile-fail/borrowck-uniq-via-box.rs b/src/test/compile-fail/borrowck-uniq-via-box.rs index cf0f5439afc..6fcdf369aba 100644 --- a/src/test/compile-fail/borrowck-uniq-via-box.rs +++ b/src/test/compile-fail/borrowck-uniq-via-box.rs @@ -1,23 +1,23 @@ fn borrow(_v: &int) {} fn box_mut(v: @mut ~int) { - borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_rec_mut(v: @{mut f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_mut_rec(v: @mut {f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_mut_recs(v: @mut {f: {g: {h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_imm(v: @~int) { @@ -33,28 +33,28 @@ fn box_imm_recs(v: @{f: {g: {h: ~int}}}) { } fn box_const(v: @const ~int) { - borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_rec_const(v: @{const f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_recs_const(v: @{f: {g: {const h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_const_rec(v: @const {f: ~int}) { - borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn box_const_recs(v: @const {f: {g: {h: ~int}}}) { - borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location - //!^ NOTE impure due to access to impure function + borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location + //~^ NOTE impure due to access to impure function } fn main() { |
