Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stdlib] Remove overly-permissive UnsafePointer init #22288

Merged
merged 4 commits into from Feb 12, 2019

Conversation

airspeedswift
Copy link
Member

Follow-on building on #22275 removing the generic init, leaving only the inits from that PR

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test

@airspeedswift
Copy link
Member Author

Please test with following pull request:
apple/swift-corelibs-foundation#1870

@swift-ci please test linux platform

@airspeedswift
Copy link
Member Author

@swift-ci please test macOS platform

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

Copy link
Member

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve under the assumption that you'll add tests in UnsafePointerDiagnostics.swift something like this:

_ = UnsafePointer<Int>(ps) // expected-error {{error: cannot convert value of type 'UnsafePointer<String>' to expected argument type 'UnsafePointer<_>'}}
_ = UnsafeMutablePointer<Int>(mps) // expected-error {{error: cannot convert value of type 'UnsafeMutablePointer<String>' to expected argument type 'UnsafeMutablePointer<_>'}}
_ = UnsafePointer<String>(pi) // expected-error {{error: cannot convert value of type 'UnsafePointer<Int>' to expected argument type 'UnsafePointer<_>'}}
_ = UnsafeMutablePointer<String>(mpi) // expected-error {{error: cannot convert value of type 'UnsafeMutablePointer<Int>' to expected argument type 'UnsafeMutablePointer<_>'}}

@moiseev
Copy link
Contributor

moiseev commented Feb 1, 2019

@atrick I just added the tests you recommended. Plus the reproducer for SR-9800.

@moiseev
Copy link
Contributor

moiseev commented Feb 1, 2019

apple/swift-corelibs-foundation#1870
@swift-ci please test linux platform

@moiseev
Copy link
Contributor

moiseev commented Feb 1, 2019

@swift-ci Please test macOS platform

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - c3239b9

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 1, 2019

Build failed
Swift Test Linux Platform
Git Sha - c3239b9

@airspeedswift
Copy link
Member Author

@swift-ci please smoke test and merge

@moiseev
Copy link
Contributor

moiseev commented Feb 12, 2019

@swift-ci Please smoke test Linux platform

@airspeedswift airspeedswift merged commit f15892c into apple:master Feb 12, 2019
@airspeedswift airspeedswift deleted the safe-conversion branch February 12, 2019 19:47
akyrtzi added a commit to akyrtzi/swift-syntax that referenced this pull request Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants