Commit Graph

103491 Commits

Author SHA1 Message Date
Konrad 'ktoso' Malawski
fb6453c64c [Distributed] IRGen mangler must mangle distributed thunk 2025-06-02 13:34:09 +09:00
Konrad 'ktoso' Malawski
9b3662e526 [Distributed] print distributed(_thunk) in SILPrinter 2025-06-02 13:34:07 +09:00
Allan Shortlidge
d5ef256b40 Merge pull request #81751 from tshortli/migratable-member-import-visibility 2025-06-01 08:49:01 -07:00
Saleem Abdulrasool
ee41fa5199 Merge pull request #81889 from compnerd/nothrows 2025-06-01 08:39:25 -07:00
Meghana Gupta
cbe253326b Fix diagnostic messages for some cases of invalid lifetime dependencies 2025-06-01 07:55:07 -07:00
Hamish Knight
82e6d7bbee Merge pull request #81887 from hamishknight/warning-downgrade
[Sema] Downgrade multi-param default inference diag for methods
2025-06-01 02:58:59 +01:00
Saleem Abdulrasool
7bece65fbd AST: honour throws in AccessorDecl::createImplicit
We would previously unconditionally create the accessor as a throwing
accessor irrespective of the parameter. This seems like an oversight and
results in an incorrect accessor being formed. This was caught while
trying to improve the ClangImporter's handling of aliasing macros.
2025-05-31 12:35:40 -07:00
Pavel Yaskevich
bc61bfb442 [Serialization] Prevent using declarations from being serialized 2025-05-31 11:10:39 -07:00
Pavel Yaskevich
83ac0f5042 [TypeChecker] Disable use of using in macro extensions 2025-05-31 10:49:50 -07:00
Pavel Yaskevich
21ec5924f7 [AST] NFC: Capitalize UsingSpecifier::nonisolated for consistency 2025-05-31 10:49:50 -07:00
Pavel Yaskevich
ec9132cb5a [Diagnostics] Tailor using diagnostic to current use-case - default isolation 2025-05-31 10:49:50 -07:00
Pavel Yaskevich
595c3b3a62 [Concurrency] Start using default isolation set in a file scope
Infer default actor isolation from `using` declaration in the
file scope and use it to override one that is set by `-default-isolation`
flag.
2025-05-31 10:49:50 -07:00
Pavel Yaskevich
c246a7a372 [AST/Sema] Hide using declaration behind DefaultIsolationPerFile experimental feature 2025-05-31 10:49:50 -07:00
Pavel Yaskevich
ad71e07cae [AST] Don't print using declarations in swift interfaces
These declarations are effectively `fileprivate` at the moment
and should appear in swift interfaces.
2025-05-31 10:49:50 -07:00
Pavel Yaskevich
36b77116bd [Concurrency] Add a request to retrieve default isolation of a file
The default isolation is computed based on `using` declaration
found in the file, if any.
2025-05-31 10:49:50 -07:00
Pavel Yaskevich
4ad27ba61e [Parse] Implement parsing for using declarations 2025-05-31 10:49:45 -07:00
Hamish Knight
2790ccce89 [Sema] Downgrade multi-param default inference diag for methods
We recently started enforcing this rule for methods, downgrade to a
warning until the next language mode to avoid source compatibility
breakage.
2025-05-31 17:33:58 +01:00
Slava Pestov
f6f0d75263 Merge pull request #81843 from slavapestov/hamish-fuzzer-fixes
Hamish fuzzer fixes
2025-05-31 12:28:56 -04:00
Hamish Knight
dde37c0f01 Merge pull request #81868 from hamishknight/x-of-hearts
Change InlineArray sugar separator `x` -> `of`
2025-05-31 10:05:26 +01:00
Doug Gregor
5c3faaaf92 Merge pull request #81884 from DougGregor/unsafe-for-loop-uses
[Strict memory safety] Show issues with unsafe constructs in the for..in loop
2025-05-30 23:28:53 -07:00
Henrik G. Olsson
ac068c2a6b [ClangImporter] Look through __ended_by and __null_terminated (#81630)
Previously we would not import decls containing these types. This was
not an issue, because they can only occur when -fbounds-safety or
-fexperimental-bounds-safety-attributes is passed to clang. When
SafeInteropWrappers is enabled we pass
-fexperimental-bound-safety-attributes to clang however, so these types
can now occur without the user specifying any -Xcc flags.

rdar://151611718
2025-05-30 22:53:15 -07:00
Doug Gregor
1d903b2e6e Merge pull request #81882 from DougGregor/unsafe-implied-conformance
[Strict memory safety] Improve Fix-Its for implied conformances
2025-05-30 22:18:35 -07:00
Daniil Kovalev
bcc7ed94a6 [AutoDiff] Define derivative for concrete SIMD.init(repeating:) (#81864)
The PR #81766 introduced some concrete SIMD operations, but
`init(repeating:)` was temporarily disabled due to differentiation
testing break. See:


7a00619065

This PR contains two changes:

1. Define custom derivatives for concrete `init(repeating:)` so we do
not fall into non-differentiability error diagnostic.

2. Add a fix to SIL linker so differentiability witness lookup is done
when the original function has both `@_alwaysEmitIntoClient` and
`@_transparent`. Similar changes were introduced previously in #78908,
but they only handled `@_alwaysEmitIntoClient` without `@_transparent`.

<!--
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-05-30 20:10:29 -07:00
Doug Gregor
efacceeacd [Strict memory safety] Show issues with unsafe constructs in the for..in loop
We weren't showing the unsafe uses when we determine that a for..in
loop is unsafe. Do so, which generally means complaining about `next()`
being unsafe. Fixes rdar://151237127
2025-05-30 18:44:11 -07:00
Pavel Yaskevich
dad81fb4bc Merge pull request #81779 from xedin/diagnostic-fixes
[Diagnostics] A collection of diagnostic fixes/improvements
2025-05-30 18:37:16 -07:00
Artem Chikin
bb6967bcb9 Merge pull request #81850 from artemcm/BridgeHeaderScanDiagnostics
[Dependency Scanning] Bridge diagnostics emitted during bridging header scanning
2025-05-30 18:36:16 -07:00
Doug Gregor
9af5884555 [Strict memory safety] Improve Fix-Its for implied conformances
The Fix-It was adding @unsafe prior to the extension, which is
incorrect. Make sure we apply @unsafe at the right location for the
explicit conformance.

Fixes rdar://151800162
2025-05-30 17:41:10 -07:00
Holly Borla
214b8d8497 Merge pull request #81860 from hborla/isolated-capture-fixes
[Concurrency] Fix a false-positive metatype capture diagnostic.
2025-05-30 16:05:28 -07:00
Pavel Yaskevich
4b5105df5e [ASTGen] Implement bridging for using declaration 2025-05-30 15:52:09 -07:00
Allan Shortlidge
aca604660f AST/Sema: Make MemberImportVisibility a migratable feature.
The migration to `MemberImportVisibility` can be performed mechanically by
adding missing import declarations, so offer automatic migration for the
feature.

Resolves rdar://151931597.
2025-05-30 15:34:08 -07:00
Allan Shortlidge
522fee4a14 Basic: Fix a bug in LangOptions::hasFeature().
Don't skip checking if a feature is enabled for migration when the feature also
has an associated language version.
2025-05-30 15:34:08 -07:00
Allan Shortlidge
d258fa783b AST: Simplify the interface of DiagnosticEngine::getBestAddImportFixItLoc().
For clarity, it should just take a `SourceFile`.
2025-05-30 15:34:08 -07:00
Allan Shortlidge
6ea2dd8fac AST/Sema: Remove code adding @_spi to suggested import fix-its.
The was never invoked because inaccessibility due to SPI protection level is
always diagnosed before missing imports are diagnosed. The functionality could
therefore not be tested and should be removed.
2025-05-30 15:34:08 -07:00
Doug Gregor
31fe75bc6b Merge pull request #81853 from DougGregor/objc-selector-effects
Effects: Treat #selector as covering throws/async effects in its operand
2025-05-30 15:28:27 -07:00
Egor Zhdan
284c3716c2 Merge pull request #81844 from swiftlang/egorzhdan/zero-sized-no-unique-address
[cxx-interop] Do not crash when emitting layout of `std::string`
2025-05-30 22:14:37 +01:00
Joe Groff
9904d6c318 SILGen: Establish an addressability scope for closure captures.
This allows a captured variable to serve as the root of an addressable dependency.
Fixes the compiler crash in rdar://150479326.
2025-05-30 14:03:27 -07:00
Artem Chikin
8ec341eac4 [Dependency Scanning] Bridge diagnostics emitted during bridging header scanning
Instead of simply dumping them to stderr.

Resolves rdar://151993075
2025-05-30 13:50:37 -07:00
Slava Pestov
a0e7cce51d ASTDemangler: Use associated type declarations instead of identifiers as keys 2025-05-30 16:27:01 -04:00
Slava Pestov
4e6352d5d9 Sema: Handle bogus DeclNameRefs in translateExprToDeclRefTypeRepr() 2025-05-30 16:27:01 -04:00
Slava Pestov
a3444a0c87 Sema: Handle invalid conformance in ApplyClassifier::classifyApply() 2025-05-30 16:27:01 -04:00
Slava Pestov
d3cf1a42b9 Sema: getBaseIdentifier() => isSimpleName() in synthesizeCodingKeysIfNeededForUnqualifiedLookup() 2025-05-30 16:27:01 -04:00
Slava Pestov
401f527bbb Sema: Don't construct TupleType with InOutType inside 2025-05-30 16:27:01 -04:00
Slava Pestov
6d0c73935b Parse: An empty escaped identifier is entirely whitespace 2025-05-30 16:27:00 -04:00
Hamish Knight
6d3455f52b Merge pull request #81849 from hamishknight/message-in-an-error
[Basic] Always dump message to stderr in `_abortWithMessage`
2025-05-30 20:53:37 +01:00
Slava Pestov
ff941bc4f3 Sema: Fix crash when any is followed by something that doesn't parse as a type 2025-05-30 14:44:58 -04:00
Slava Pestov
0a0019ba76 Sema: Fix null pointer dereference with invalid ParamDecl 2025-05-30 14:44:24 -04:00
Slava Pestov
0e1561f05a Sema: Change a couple of Identifier usages to DeclName instead 2025-05-30 14:43:48 -04:00
nate-chandler
dd75d2ed82 Merge pull request #81854 from nate-chandler/rdar152195094
[DestroyAddrHoisting] Don't destructure NE aggs.
2025-05-30 11:32:12 -07:00
Pavel Yaskevich
f31cdb3fec Merge pull request #81852 from xedin/rdar-151943924
[TypeCheckEffects] Fix `AbstractFunction::getType` to look through al…
2025-05-30 11:03:40 -07:00
Holly Borla
f0e77c7814 [Concurrency] Don't diagnose metatype captures in closures that are
isolated to the same actor as the enclosing context.
2025-05-30 10:58:38 -07:00