Skip to content

cmd/compile: var _ = f prevents f from being dead-code eliminated #60464

Open
@neild

Description

@neild

Context: https://go.dev/cl/498595

This statement prevents Config.EncryptTicket from being dead-code eliminated:

var _ = &Config{WrapSession: (&Config{}).EncryptTicket}

Seems like the compiler (linker?) could notice that the reference is dead and eliminate it.

Metadata

Metadata

Assignees

Labels

FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.binary-sizecompiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions