Skip to content

Commit b1c6c63

Browse files
committed
Revert "add and update tests for Copyable types not having ownership modifiers"
This reverts commit 87f190b. (cherry picked from commit 07677c2)
1 parent 2471323 commit b1c6c63

12 files changed

+22
-23
lines changed

test/Parse/ownership_modifiers.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
struct borrowing {}
44
struct consuming {}
55

6-
struct Foo: ~Copyable {}
6+
struct Foo {}
77

88
func foo(x: borrowing Foo) {}
99
func bar(x: consuming Foo) {}
@@ -18,13 +18,13 @@ func worst(x: (borrowing consuming Foo) -> ()) {} // expected-error{{at most one
1818

1919
func zim(x: borrowing) {}
2020
func zang(x: consuming) {}
21-
func zung(x: borrowing consuming) {} // expected-error{{copyable types cannot be 'consuming' or 'borrowing' yet}}
22-
func zip(x: consuming borrowing) {} // expected-error{{copyable types cannot be 'consuming' or 'borrowing' yet}}
21+
func zung(x: borrowing consuming) {}
22+
func zip(x: consuming borrowing) {}
2323
func zap(x: (borrowing, consuming) -> ()) {}
24-
func zoop(x: (borrowing consuming, consuming borrowing) -> ()) {} // expected-error 2{{copyable types cannot be 'consuming' or 'borrowing' yet}}
24+
func zoop(x: (borrowing consuming, consuming borrowing) -> ()) {}
2525

26-
func worster(x: borrowing borrowing borrowing) {} // expected-error{{at most one}} // expected-error{{copyable types cannot be 'consuming' or 'borrowing' yet}}
27-
func worstest(x: (borrowing borrowing borrowing) -> ()) {} // expected-error{{at most one}} // expected-error{{copyable types cannot be 'consuming' or 'borrowing' yet}}
26+
func worster(x: borrowing borrowing borrowing) {} // expected-error{{at most one}}
27+
func worstest(x: (borrowing borrowing borrowing) -> ()) {} // expected-error{{at most one}}
2828

2929
// Parameter specifier names are regular identifiers in other positions,
3030
// including argument labels.
@@ -47,7 +47,7 @@ func argumentLabel(anonConsumingInClosure: (_ consuming: Int) -> ()) {}
4747
func argumentLabel(anonSharedInClosure: (_ __shared: Int) -> ()) {}
4848
func argumentLabel(anonOwnedInClosure: (_ __owned: Int) -> ()) {}
4949

50-
struct MethodModifiers: ~Copyable {
50+
struct MethodModifiers {
5151
mutating func mutating() {}
5252
borrowing func borrowing() {}
5353
consuming func consuming() {}
@@ -60,7 +60,6 @@ struct MethodModifiers: ~Copyable {
6060
borrowing mutating consuming func tooManyD() {} // expected-error 2 {{method must not be declared both }}
6161
}
6262

63-
6463
func chalk(_ a: consuming String, // expected-error{{copyable types cannot be 'consuming' or 'borrowing' yet}}
6564
_ b: borrowing [Int], // expected-error{{copyable types cannot be 'consuming' or 'borrowing' yet}}
6665
_ c: __shared [String],
@@ -107,3 +106,4 @@ func consumingClosure2(_ f: consuming @escaping () -> ()) { } // expected-error
107106

108107
func borrowingClosure1(_ f: borrowing () -> ()) { } // expected-error {{copyable types cannot be 'consuming' or 'borrowing' yet}}
109108
func borrowingClosure2(_ f: borrowing @escaping () -> ()) { } // expected-error {{copyable types cannot be 'consuming' or 'borrowing' yet}}
109+

test/Parse/ownership_modifiers_no_errors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -enable-experimental-feature NoImplicitCopy
1+
// RUN: %target-typecheck-verify-swift
22

33
// This is a variation of `ownership_modifiers.swift` with the expected error
44
// lines removed, so that the file is parsed by the SwiftSyntax parser

test/SILGen/consuming_parameter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-feature NoImplicitCopy %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
22

33
func bar(_: String) {}
44

test/SILGen/moveonly.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-feature NoImplicitCopy %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
22

33
//////////////////
44
// Declarations //

test/SILGen/moveonly_escaping_closure.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-feature NoImplicitCopy -module-name moveonly_closure %s | %FileCheck %s
2-
// RUN: %target-swift-emit-sil -enable-experimental-feature NoImplicitCopy -module-name moveonly_closure -verify %s
1+
// RUN: %target-swift-emit-silgen -module-name moveonly_closure %s | %FileCheck %s
2+
// RUN: %target-swift-emit-sil -module-name moveonly_closure -verify %s
33

44
@_moveOnly
55
struct Empty {}

test/SILGen/ownership_specifier_mangling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-feature NoImplicitCopy %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
22

33
// The internal `__shared` and `__owned` modifiers would always affect
44
// symbol mangling, even if they don't have a concrete impact on ABI. The

test/SILOptimizer/consuming_parameter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -c -enable-experimental-feature NoImplicitCopy -disable-availability-checking -Xllvm --sil-print-final-ossa-module -O -module-name=main -o /dev/null %s 2>&1 | %FileCheck %s
1+
// RUN: %target-swift-frontend -c -disable-availability-checking -Xllvm --sil-print-final-ossa-module -O -module-name=main -o /dev/null %s 2>&1 | %FileCheck %s
22

33
// REQUIRES: concurrency
44

test/SILOptimizer/moveonly_addresschecker_destructure_through_deinit_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-sil -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses -enable-experimental-feature MoveOnlyTuples %s
1+
// RUN: %target-swift-emit-sil -sil-verify-all -verify -enable-experimental-feature MoveOnlyClasses -enable-experimental-feature MoveOnlyTuples %s
22

33
// This test validates that we properly emit errors if we partially invalidate
44
// through a type with a deinit.

test/SILOptimizer/moveonly_objectchecker_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-sil -sil-verify-all -verify -enable-experimental-feature NoImplicitCopy -enable-experimental-feature MoveOnlyClasses %s
1+
// RUN: %target-swift-emit-sil -sil-verify-all -verify -enable-experimental-feature MoveOnlyClasses %s
22

33
//////////////////
44
// Declarations //

test/SILOptimizer/moveonly_trivial_addresschecker_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-sil -enable-experimental-feature NoImplicitCopy -sil-verify-all -verify %s
1+
// RUN: %target-swift-emit-sil -sil-verify-all -verify %s
22

33
//////////////////
44
// Declarations //

0 commit comments

Comments
 (0)