mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Since these types depend on lexical borrow scopes (a SIL option), we're now making that the requirement whenever such types appear.
10 lines
322 B
Swift
10 lines
322 B
Swift
// RUN: %target-swift-frontend -typecheck %s
|
|
// RUN: %target-typecheck-verify-swift -enable-lexical-borrow-scopes=false
|
|
|
|
@_moveOnly
|
|
public struct MO { // expected-error 2{{noncopyable types require lexical borrow scopes (add -enable-lexical-borrow-scopes=true)}}
|
|
let x = 0
|
|
}
|
|
|
|
public func whatever(_ mo: borrowing MO) {}
|