Skip to content

6.1+ compiler crash (Assertion failed: (!operand->getType().isTrivial(getFunction())) #80573

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

Closed
RandomHashTags opened this issue Apr 7, 2025 · 1 comment · Fixed by #80773
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels

Comments

@RandomHashTags
Copy link

Description

Swift's compiler crashes when compiling Destiny (my upcoming networking library). Compiler crashes using the 6.1-RELEASE and main-snapshot-04-03 toolchains when trying to build.

Successfully compiles using 6.0.3.

Reproduction

  1. clone destiny
  2. run swift build using 6.1 or later toolchain
  3. encounter compiler crash

Stack dump

Assertion failed: (!operand->getType().isTrivial(getFunction()) && "Should not be passing trivial values to this api. Use instead " "emitCopyValueOperation"), function createExplicitCopyValue at SILBuilder.h:1460.
(to display assertion configuration options: -Xllvm -assert-help)
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend -frontend -c /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/Application.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/DestinyDefaults.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/DynamicResponses.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/HTTPRequestHeaders.swift -primary-file /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/HTTPResponseHeaders.swift -primary-file /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/Request.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/Router.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/RouterGroup.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/RouterResponderStorage.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/commands/BootCommands.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/extensions/SwiftCompressionExtensions.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/middleware/DynamicCORSMiddleware.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/middleware/DynamicDateMiddleware.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/middleware/DynamicMiddleware.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/middleware/DynamicRateLimitMiddleware.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/middleware/StaticFileMiddleware.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/middleware/StaticMiddleware.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/ConditionalRouteResponder.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/DynamicResponse.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/DynamicRoute.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/DynamicRouteResponder.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/StaticErrorResponder.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/StaticRedirectionRoute.swift /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/routes/StaticRoute.swift -emit-dependencies-path /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyDefaults-tool.build/HTTPResponseHeaders.d -emit-reference-dependencies-path /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyDefaults-tool.build/HTTPResponseHeaders.swiftdeps -emit-dependencies-path /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyDefaults-tool.build/Request.d -emit-reference-dependencies-path /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyDefaults-tool.build/Request.swiftdeps -target x86_64-unknown-linux-gnu -disable-objc-interop -I /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/Modules-tool -color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -load-plugin-executable /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyUtilityMacros-tool#DestinyUtilityMacros -empty-abi-descriptor -resource-dir /home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /home/paradigm/Desktop/GitProjects/destiny -Xcc -fmodule-map-file=/home/paradigm/Desktop/GitProjects/destiny/.build/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include/module.modulemap -Xcc -I -Xcc /home/paradigm/Desktop/GitProjects/destiny/.build/checkouts/swift-syntax/Sources/_SwiftSyntaxCShims/include -Xcc -fmodule-map-file=/home/paradigm/Desktop/GitProjects/destiny/.build/checkouts/CEpoll/module.modulemap -Xcc -fPIC -Xcc -g -Xcc -fno-omit-frame-pointer -module-name DestinyDefaults -package-name destiny -in-process-plugin-server-path /home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/lib/swift/host/libSwiftInProcPluginServer.so -plugin-path /home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/lib/swift/host/plugins -plugin-path /home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/local/lib/swift/host/plugins -parse-as-library -o /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyDefaults-tool.build/HTTPResponseHeaders.swift.o -o /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/DestinyDefaults-tool.build/Request.swift.o -index-store-path /home/paradigm/Desktop/GitProjects/destiny/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules
1.      Swift version 6.1 (swift-6.1-RELEASE)
2.      Compiling with effective version 5.10
3.      While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/Request.swift")
4.      While silgen emitFunction SIL function "@$s15DestinyDefaults7RequestV5querySDyS2SGvg".
 for getter for query (at /home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/Request.swift:47:21)
5.      While silgen closureexpr SIL function "@$s15DestinyDefaults7RequestV5querySDyS2SGvgAEyXEfU_".
 for expression at [/home/paradigm/Desktop/GitProjects/destiny/Sources/DestinyDefaults/Request.swift:47:47 - line:65:5] RangeText="{
        guard (uri .== .init(repeating: 63)) != .init(repeating: false), // make sure a question mark is present
                let targets:[DestinyRoutePathType] = uri.splitSIMD(separator: 63).get(1)?.splitSIMD(separator: 38) // 63 -> ? | 38 -> &
        else {
            return [:]
        }
        var queries:[String:String] = [:]
        queries.reserveCapacity(targets.count)
        for var key in targets {
            let equalsIndex:Int = key.leadingNonByteCount(byte: 61) // 61 -> =
            var value:DestinyRoutePathType = copy key
            // TODO: shift SIMD right `equalsIndex+1`
            value.keepLeading(value.leadingNonzeroByteCount)

            key.keepLeading(equalsIndex)
            queries[key.leadingString()] = value.stringSIMD()
        }
        return queries
    "
 #0 0x00005f83b3864b18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x7a8eb18)
 #1 0x00005f83b38628fe llvm::sys::RunSignalHandlers() (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x7a8c8fe)
 #2 0x00005f83b38651b8 SignalHandler(int) Signals.cpp:0:0
 #3 0x000078a35384bcd0 (/usr/lib/libc.so.6+0x3dcd0)
 #4 0x000078a3538a5624 __pthread_kill_implementation /usr/src/debug/glibc/glibc/nptl/pthread_kill.c:44:76
 #5 0x000078a35384bba0 raise /usr/src/debug/glibc/glibc/signal/../sysdeps/posix/raise.c:27:6
 #6 0x000078a353833582 abort /usr/src/debug/glibc/glibc/stdlib/abort.c:81:3
 #7 0x00005f83aefc43ab (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x31ee3ab)
 #8 0x00005f83adc2f77b swift::SILBuilder::createExplicitCopyValue(swift::SILLocation, swift::SILValue) LoadableByAddress.cpp:0:0
 #9 0x00005f83adcec08d swift::Lowering::SILGenBuilder::createExplicitCopyValue(swift::SILLocation, swift::Lowering::ManagedValue) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x1f1608d)
#10 0x00005f83add2ef29 (anonymous namespace)::RValueEmitter::visitCopyExpr(swift::CopyExpr*, swift::Lowering::SGFContext) SILGenExpr.cpp:0:0
#11 0x00005f83add2a49b swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) SILGenExpr.cpp:0:0
#12 0x00005f83add1cd4c swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, std::optional<swift::SILLocation>) SILGenExpr.cpp:0:0
#13 0x00005f83add0a538 swift::Lowering::SILGenFunction::emitPatternBinding(swift::PatternBindingDecl*, unsigned int, bool) SILGenDecl.cpp:0:0
#14 0x00005f83add10632 swift::ASTVisitor<swift::Lowering::SILGenFunction, void, void, void, void, void, void>::visit(swift::Decl*) SILGenDecl.cpp:0:0
#15 0x00005f83addb2bd5 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) SILGenStmt.cpp:0:0
#16 0x00005f83addb9a90 std::_Function_handler<void (swift::Lowering::ManagedValue, swift::Lowering::SwitchCaseFullExpr&&), (anonymous namespace)::StmtEmitter::visitForEachStmt(swift::ForEachStmt*)::$_0>::_M_invoke(std::_Any_data const&, swift::Lowering::ManagedValue&&, swift::Lowering::SwitchCaseFullExpr&&) SILGenStmt.cpp:0:0
#17 0x00005f83add073b0 swift::Lowering::SwitchEnumBuilder::emit() && (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x1f313b0)
#18 0x00005f83addb8931 (anonymous namespace)::StmtEmitter::visitForEachStmt(swift::ForEachStmt*) SILGenStmt.cpp:0:0
#19 0x00005f83addb2cfb swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) SILGenStmt.cpp:0:0
#20 0x00005f83addb13ad swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) SILGenStmt.cpp:0:0
#21 0x00005f83add47447 swift::Lowering::SILGenFunction::emitClosure(swift::AbstractClosureExpr*) SILGenFunction.cpp:0:0
#22 0x00005f83adc99828 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) SILGen.cpp:0:0
#23 0x00005f83adca1ac8 void llvm::function_ref<void ()>::callback_fn<swift::Lowering::SILGenModule::emitClosure(swift::AbstractClosureExpr*, swift::Lowering::FunctionTypeInfo const&)::$_4>(long) SILGen.cpp:0:0
#24 0x00005f83ae5b0cf7 swift::Lowering::TypeConverter::withClosureTypeInfo(swift::AbstractClosureExpr*, swift::Lowering::FunctionTypeInfo const&, llvm::function_ref<void ()>) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x27dacf7)
#25 0x00005f83adc9c0b8 swift::Lowering::SILGenModule::emitClosure(swift::AbstractClosureExpr*, swift::Lowering::FunctionTypeInfo const&) SILGen.cpp:0:0
#26 0x00005f83adcceec1 (anonymous namespace)::SILGenApply::visitAbstractClosureExpr(swift::AbstractClosureExpr*) SILGenApply.cpp:0:0
#27 0x00005f83adcb698d swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) SILGenApply.cpp:0:0
#28 0x00005f83add2a5a1 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) SILGenExpr.cpp:0:0
#29 0x00005f83add396e5 (anonymous namespace)::RValueEmitter::visitLazyInitializerExpr(swift::LazyInitializerExpr*, swift::Lowering::SGFContext) SILGenExpr.cpp:0:0
#30 0x00005f83add2a8db swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) SILGenExpr.cpp:0:0
#31 0x00005f83add1cd4c swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, std::optional<swift::SILLocation>) SILGenExpr.cpp:0:0
#32 0x00005f83add0a538 swift::Lowering::SILGenFunction::emitPatternBinding(swift::PatternBindingDecl*, unsigned int, bool) SILGenDecl.cpp:0:0
#33 0x00005f83add10632 swift::ASTVisitor<swift::Lowering::SILGenFunction, void, void, void, void, void, void>::visit(swift::Decl*) SILGenDecl.cpp:0:0
#34 0x00005f83addb2bd5 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) SILGenStmt.cpp:0:0
#35 0x00005f83addb13ad swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) SILGenStmt.cpp:0:0
#36 0x00005f83add47224 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) SILGenFunction.cpp:0:0
#37 0x00005f83adc9a837 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) SILGen.cpp:0:0
#38 0x00005f83adc9b311 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) SILGen.cpp:0:0
#39 0x00005f83adc98e58 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) SILGen.cpp:0:0
#40 0x00005f83addd8682 void llvm::function_ref<void (swift::AccessorDecl*)>::callback_fn<(anonymous namespace)::SILGenType::visitAccessors(swift::AbstractStorageDecl*)::'lambda'(swift::AccessorDecl*)>(long, swift::AccessorDecl*) SILGenType.cpp:0:0
#41 0x00005f83aed4a49f swift::AbstractStorageDecl::visitEmittedAccessors(llvm::function_ref<void (swift::AccessorDecl*)>) const (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x2f7449f)
#42 0x00005f83adc9d5f4 swift::Lowering::SILGenModule::visitEmittedAccessors(swift::AbstractStorageDecl*, llvm::function_ref<void (swift::AccessorDecl*)>) SILGen.cpp:0:0
#43 0x00005f83addd8665 (anonymous namespace)::SILGenType::visitAbstractStorageDecl(swift::AbstractStorageDecl*) SILGenType.cpp:0:0
#44 0x00005f83addd85d9 (anonymous namespace)::SILGenType::visitVarDecl(swift::VarDecl*) SILGenType.cpp:0:0
#45 0x00005f83addd5418 (anonymous namespace)::SILGenType::emitType() SILGenType.cpp:0:0
#46 0x00005f83addd52f8 swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) SILGenType.cpp:0:0
#47 0x00005f83adc9dc93 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) SILGen.cpp:0:0
#48 0x00005f83adc9e3d0 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x1ec83d0)
#49 0x00005f83addb0d14 std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule>> swift::SimpleRequest<swift::ASTLoweringRequest, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)17>::callDerived<0ul>(swift::Evaluator&, std::integer_sequence<unsigned long, 0ul>) const SILGenRequests.cpp:0:0
#50 0x00005f83addb0c39 swift::SimpleRequest<swift::ASTLoweringRequest, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)17>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) SILGenRequests.cpp:0:0
#51 0x00005f83adca2657 swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()) SILGen.cpp:0:0
#52 0x00005f83adc9eb22 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x1ec8b22)
#53 0x00005f83ad5ce88d swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x17f888d)
#54 0x00005f83ad5d11ea performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) FrontendTool.cpp:0:0
#55 0x00005f83ad5d0643 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x17fa643)
#56 0x00005f83ad3ac54a swift::mainEntry(int, char const**) (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x15d654a)
#57 0x000078a353835488 __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#58 0x000078a35383554c call_init /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:128:20
#59 0x000078a35383554c __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:347:5
#60 0x00005f83ad3ab9a5 _start (/home/paradigm/.local/share/swiftly/toolchains/6.1.0/usr/bin/swift-frontend+0x15d59a5)

Expected behavior

Compilation to succeed.

Environment

Swift
Swift version 6.1 (swift-6.1-RELEASE)
Target: x86_64-unknown-linux-gnu

OS
Arch Linux (6.13.8-arch1-1)

IDE
VS Code (1.98.2)

Swift VS Code extension
2.0.2

Swiftly
1.0.0

Additional information

Crash originates from the https://github.com/RandomHashTags/destiny/blob/008e3a3a425f7e9088874e113ff3066e6655947d/Sources/DestinyDefaults/Request.swift file (query variable):

extension Collection {
    /// - Returns: The element at the given index, if the index is within bounds, otherwise `nil`.
    @usableFromInline
    package func get(_ index: Index) -> Element? {
        return index < endIndex && index >= startIndex ? self[index] : nil
    }
}

typealias DestinyRoutePathType = SIMD64<UInt8>

public let uri:DestinyRoutePathType

public lazy var query : [String:String] = {
        guard (uri .== .init(repeating: 63)) != .init(repeating: false), // make sure a question mark is present
                let targets:[DestinyRoutePathType] = uri.splitSIMD(separator: 63).get(1)?.splitSIMD(separator: 38) // 63 -> ? | 38 -> &
        else {
            return [:]
        }
        var queries:[String:String] = [:]
        queries.reserveCapacity(targets.count)
        for var key in targets {
            let equalsIndex:Int = key.leadingNonByteCount(byte: 61) // 61 -> =
            var value:DestinyRoutePathType = copy key
            // TODO: shift SIMD right `equalsIndex+1`
            value.keepLeading(value.leadingNonzeroByteCount)

            key.keepLeading(equalsIndex)
            queries[key.leadingString()] = value.stringSIMD()
        }
        return queries
    }()

referenced SIMD64<UInt8> function extensions can be found at

@RandomHashTags RandomHashTags added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels labels Apr 7, 2025
jckarter added a commit to jckarter/swift that referenced this issue Apr 11, 2025
Avoids an assertion failure emitting an `explicit_copy_value` on the trivial
value, which is unsupported. This allows `copy x` to compile, albeit with
no effect (which is not ideal, but also not a regression, since no-implicit-copy
controls still don't fully work on trivial values). Fixes swiftlang#80573 and rdar://148712387.
@jckarter
Copy link
Contributor

Thanks for the report! #80773 should fix this. You can work around it in the meantime by leaving off the copy on copy key, or if the copy is necessary for explicitly copying a borrowing/consuming parameter binding, maybe you could copy the value by writing let keyCopy = key and then use that copied binding.

jckarter added a commit to jckarter/swift that referenced this issue Apr 11, 2025
Avoids an assertion failure emitting an `explicit_copy_value` on the trivial
value, which is unsupported. This allows `copy x` to compile, albeit with
no effect (which is not ideal, but also not a regression, since no-implicit-copy
controls still don't fully work on trivial values). Fixes swiftlang#80573 and rdar://148712387.
jckarter added a commit to jckarter/swift that referenced this issue Apr 12, 2025
Avoids an assertion failure emitting an `explicit_copy_value` on the trivial
value, which is unsupported. This allows `copy x` to compile, albeit with
no effect (which is not ideal, but also not a regression, since no-implicit-copy
controls still don't fully work on trivial values). Fixes swiftlang#80573 and rdar://148712387.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software triage needed This issue needs more specific labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants