Commit Graph

194750 Commits

Author SHA1 Message Date
Hamish Knight
f2b0b92dc1 [Sema] Avoid member attribute cycle in ResolveMacroRequest
If we have a custom attribute on a type that does a qualified lookup
into the same type, we need to be able to expand member attribute
macros for that type. As such, the check to see if we already have
a nominal for the attribute would hit a cycle. Limit this check such
that it only applies to local vars, which is the only case where it
actually matters.

rdar://163961797
2025-11-06 19:33:09 +00:00
Hamish Knight
9981dc8126 [AST] NFC: Move shouldPreferPropertyWrapperOverMacro onto CustomAttr 2025-11-06 14:39:52 +00:00
Hamish Knight
3e0ea3ac68 Merge pull request #85342 from hamishknight/absolute-cinema 2025-11-06 08:25:05 +00:00
Kavon Farvardin
f956b26411 Merge pull request #85352 from kavon/test-moveonly-rdar162749287
Test: ~Copyable passed inout within closure
2025-11-05 21:25:10 -08:00
Henrik G. Olsson
27a7334a15 Merge pull request #85351 from hnrklssn/update-verify-tests
[utils] add update-verify-tests.py
2025-11-06 05:23:06 +00:00
Alex Hoppen
d5b8dc6686 Merge pull request #85344 from ahoppen/basename
[update-checkout] Use `basename` to get repo name for Git failures
2025-11-06 04:05:37 +01:00
John Hui
eedefc5d57 [NFC] Delete unused feature SuppressCXXForeignReferenceTypeInitializers (#85301) 2025-11-05 17:12:09 -08:00
Mishal Shah
60d09fff62 Merge pull request #85315 from swiftlang/count-mixup
Make sure we don't compare too many bytes if a non-native string being compared to a native one has the same utf16 count but a different utf8 count
2025-11-05 16:35:28 -08:00
Arnold Schwaighofer
05a32161de Merge pull request #85220 from nate-chandler/test/20251030/1
[Test] Fix these arm64e check lines.
2025-11-05 16:28:13 -08:00
Kavon Farvardin
3e3e93bb28 Test: ~Copyable passed inout within closure
Add test coverage for a code pattern that briefly broke on main.

rdar://162749287
2025-11-05 16:08:04 -08:00
Henrik G. Olsson
0979d340d1 [utils] update documentation for update-verify-tests
This updates the documentation to reflect the Swift port of this script,
rather than the original clang version.
2025-11-05 16:02:09 -08:00
Henrik G. Olsson
8bff12a580 [utils] port update-verify-tests to Swift's -verify
This ports clang's test suite for update-verify-tests from C to Swift,
and adjusts update-verify-tests as needed. The main differences are the
Swift -verify output format being quite different, as well as Swift's
'-verify-additional-prefix foo' working differently than clang's
'-verify=foo'.
2025-11-05 16:02:06 -08:00
Henrik G. Olsson
d629a0089a [utils] add update-verify-tests.py from clang
This script is used to automatically update test cases using -verify in
clang's test suite. Swift also has a similar -verify test functionality,
and while it can automatically fix some of them using -verify-apply-all,
this functionality only updates existing checks - it doesn't add or
remove any, and it doesn't handle newer and more complex things like
expected-expansion. Handling that type of complexity feels out of scope
to embed in the compiler, so let's copy clang's approach.

This commit adds this script as is from clang. It doesn't work at all
for Swift in its current form, as the output from Swift's -verify is
formatted differently than in clang. This will be fixed in subsequent
commits.

This could have been done by adapting the script as-is in the
llvm-project repository (since it only exists in the Swift fork, not
upstream), but tests using swift-frontend would have to reside in the
swift repo, and modifying a script in one repo with tests in a different
repo sounds like a recipe for endless CI issues.
2025-11-05 16:02:03 -08:00
Alexis Laferrière
579a228d3f Merge pull request #85179 from xymus/exportability-nle-structs
Sema: Opt-in check for structs references to hidden dependencies in non-library-evolution mode
2025-11-05 15:32:05 -08:00
Alex Hoppen
2dac60c94a [update-checkout] Use basename to get repo name for Git failures
`os.path.dirname` removes the last path component of a path. If there was a git failure in `~/src/swift`, this means that we show `~/src` as the repo name, which isn’t very helpful. Use `os.path.basename`, which returns the last path component, ie. `swift`.
2025-11-05 22:40:12 +01:00
Hamish Knight
f205f469a9 [CS] Replace error type with hole for projected value
Missed this in my previous patch, make sure we replace an error with
a hole if necessary.
2025-11-05 20:29:15 +00:00
Hamish Knight
dad263728f Merge pull request #85193 from hamishknight/wrapping-paper
[CS] A couple of property wrapper fixes
2025-11-05 19:51:51 +00:00
John McCall
13937fdb4e Merge pull request #84528 from rjmccall/async-let-runtime-realism
Model async let begin/finish as builtins in SIL
2025-11-05 10:24:46 -08:00
Charles Zablit
4de7e8ce6e Merge pull request #85075 from charles-zablit/charles-zablit/windows/lldb-only-run-swift-test-subset
[windows] only test the Swift subset of LLDB tests in CI
2025-11-05 17:24:30 +00:00
Mishal Shah
a8c6c9628e Merge pull request #85078 from owenv/owenv/tools-protocols-windows
build.ps1: add swift-tools-protocols
2025-11-05 09:01:41 -08:00
Susana Monteiro
0287d65364 Merge pull request #85331 from susmonteiro/susmonteiro/revert-implicit-constructors
[cxx-interop] Revert changes to copy/move constructors definition
2025-11-05 16:29:24 +00:00
susmonteiro
2c9bb7a6eb Revert "[cxx-interop] Implicitly defined copy constructors"
This reverts commit 1c5bbe0290.
2025-11-05 10:42:05 +00:00
susmonteiro
dd921adc05 Revert "[cxx-interop] Implicitly defined move constructors"
This reverts commit c3cd9939c1.
2025-11-05 10:41:38 +00:00
John Hui
1e446b467e [cxx-interop] Suppress inaccessible-base warning from test (#85302)
Clang is helpfully telling us that one of the base types is
inaccessible, except we don't really care about that because we are only
using this type for testing other diagnostics. That warning is getting
caught by the newly comprehensive swiftc diagnostic verifier, so we
suppress it with a Clang pragma.

rdar://163875420
2025-11-04 22:48:24 -08:00
Kavon Farvardin
98560e52f7 Merge pull request #85311 from kavon/fix-fragile-werror 2025-11-04 22:14:59 -08:00
Slava Pestov
114402d2eb Merge pull request #85322 from slavapestov/type-checker-docs-tweak
docs: Remove obsolete example from TypeChecker.md
2025-11-04 23:55:12 -05:00
David Smith
a23ed0dd7a Most ridiculous possible test mistake 2025-11-04 20:31:42 -08:00
Kavon Farvardin
758e67f82d Merge pull request #85296 from j-hui/revert-template-arg-import
[cxx-interop] Revert changes to template argument import/safety check
2025-11-04 18:25:56 -08:00
Slava Pestov
a81a3d37b0 docs: Remove obsolete example from TypeChecker.md
Swift has not had user-defined conversions since before Swift 1.0.

Remove the running example from the discussion of locators. This
probably makes the explanation too opaque, but the old explanation
was useless because it was out of date.

I'll add a proper example later.
2025-11-04 18:31:37 -05:00
Doug Gregor
b1c2bc1731 Merge pull request #85305 from DougGregor/custom-conformance-availability
[Custom availability] Fix conformance availability diagnostic
2025-11-04 15:25:43 -08:00
Aidan Hall
de38bb4bea Merge pull request #85279 from aidan-hall/pack-opt-32-bit-tests
PackSpecialization: Use Int<=32 in tests to support 32-bit platforms
2025-11-04 23:13:10 +00:00
Alexis Laferrière
bf443413b7 Sema: Fix superfluous error about private decls in internal memory layouts
Don't consider implicitly exposed memory layouts when checking for
usable from inline correctness. That check applies only to memory
layouts marked as exposed explicitly. Consider the implict state only at
the general availability checking.
2025-11-04 14:37:10 -08:00
Alex Martini
27a3941cbe Merge pull request #85298 from amartini51/checked_continuation_162971611
Fixes: rdar://162971611
2025-11-04 14:13:30 -08:00
Alexis Laferrière
488321256e Sema: Consider non-LE structs to be of a restricted type by default
In non-library-evolution mode, gated behind the CheckImplementationOnly
feature flag, report references to structs marked with
`@_implementationOnly` from a fragile context. Preventing references
from inlinable functions and structs not marked `@_implementationOnly`.
2025-11-04 13:50:37 -08:00
Alexis Laferrière
1383fcda80 Sema: Report non-LE structs as fragile use sites in CheckImplementationOnly
In non-library-evolution mode, gated behind the CheckImplementationOnly
feature flag, consider structs to be a fragile use site by default,
unless marked `@_implementationOnly`. This prevents them to refer to
restricted imports like implementation-only.
2025-11-04 13:50:37 -08:00
Alexis Laferrière
71035a51de Sema: Accept @_implementationOnly on non-public structs
Gate it behind CheckImplementationOnly.
2025-11-04 13:50:36 -08:00
Alexis Laferrière
62ee4486d7 Features: Intro CheckImplementationOnly 2025-11-04 13:50:25 -08:00
Hiroshi Yamauchi
2d891117c4 Merge pull request #84970 from hjyamauchi/buildps1cas
Add CAS support
2025-11-04 13:16:25 -08:00
David Smith
b4118a2b40 Fix test oversight 2025-11-04 13:00:28 -08:00
Kavon Farvardin
5eb4ab260c Merge pull request #85318 from kavon/workaround-rdar164027738
[cxx-interop] mark test as unsupported on Linux
2025-11-04 12:46:25 -08:00
Kavon Farvardin
9ac7a73520 [cxx-interop] mark test as unsupported on Linux 2025-11-04 12:45:20 -08:00
David Smith
f03c1fe16b Clarify an explanation 2025-11-04 12:43:42 -08:00
David Smith
70f4d7e6d7 Review comment 2025-11-04 12:43:23 -08:00
David Smith
e7ba16381c Make sure we don't compare too many bytes if a non-native string being compared to a native one has the same utf16 count but a different utf8 count 2025-11-04 11:43:43 -08:00
Zixu Wang
18a9d7002f [APIGen] Handle SPI availability for nested decls (#85048)
- Add SPI availability information to `APIAvailability` from attribute
`@_spi_available`.
- Correctly obtain effective availability for nested declarations
without immediate availability attributes.

Resolves rdar://159702280

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-11-04 11:34:05 -08:00
Kuba (Brecka) Mracek
b6c29f1ce6 Merge pull request #85136 from kubamracek/section-top-level
SE-0492: Handle top-level `@section`-annotated globals
2025-11-04 11:15:50 -08:00
Kavon Farvardin
e55d18a66b Merge pull request #85313 from mikeash/rr-preservemost-no-embedded
[Runtime] Don't use custom retain/release calling convention in embedded Swift.
2025-11-04 11:06:48 -08:00
Mike Ash
7036784480 [Runtime] Don't use custom retain/release calling convention in embedded Swift.
In embedded mode, some things call retain/release using the C++ declarations, but the implementations are in Swift. The Swift implementations don't use preservemost, so the C++ declarations must not declare preservemost in that context.

rdar://163940783
2025-11-04 13:30:11 -05:00
Saleem Abdulrasool
a134e44138 Merge pull request #71422 from compnerd/docc
build: setup a CMake based build for DocC
2025-11-04 10:12:09 -08:00
Doug Gregor
ba3d8e0c2b Remove unused variable 2025-11-04 10:07:40 -08:00