-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Unsafe[Mutable]Pointer<Pointee: ~Copyable & ~Escapable> #84233
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
base: main
Are you sure you want to change the base?
Conversation
7bc91c5
to
9d0a464
Compare
@lorentey I'm using this PR to test compiler fixes. I think it's almost there and will land the few small compiler commits ASAP. The hard problem: safely migrating all the signatures and symbols remains. In particular: Backward compatibility with deprecated APIs:test/Generics/slice_test.swift
Problem: Mangled namestest/SILGen/borrow_from_load_expr.swift
Documenting Escapable requirementstest/SourceKit/DocSupport/doc_clang_module.swift Need to add
API signature changestest/api-digester/stability-stdlib-source.swift Accessor UnsafeMutablePointer.hashValue.Get() has generic signature change from to <Pointee where Pointee : ~Copyable, Pointee : ~Escapable> |
@swift-ci test |
1 similar comment
@swift-ci test |
@swift-ci benchmark |
@swift-ci Please Build Toolchain macOS Platform |
loadUnaligned only supports loading non-BitwiseCopyable values. The generic loadUnaligned should also be supported but it depends on UnsafePointer<T: ~Escapable>.
Only supports non-BitwiseCopyable values. The generic storeBytes should also be supported but it depends on UnsafePointer<T: ~Escapable>.
Handle storing to a mutable property implemented as unsafeMutableAddress. In SIL, the stored address comes from pointer_to_address. Recognize the addressor pattern and handle the store as if it writes to a regular property of 'self'. Required for UnsafePointer<~Escapable>.pointee.
New declaration: Unsafe[Mutable]Pointer<Pointee: ~Copyable & ~Escapable>
9d0a464
to
78c608b
Compare
78c608b
to
813fe4c
Compare
Allow unsafe pointer to access a ~Escapable Pointee.
This is a placeholder for review and to drive implementation of compiler Builtins. I suspect @lorentey will ultimately have a PR with the standard library additions.