Skip to content

Remove Session::crate_types_opt? #72427

Closed
@ecstatic-morse

Description

@ecstatic-morse

See #72256 (comment) for context.

There's only one place in the compiler that can't call Session::crate_types because that field is sometimes uninitialized.

/// PIE is potentially more effective than PIC, but can only be used in executables.
/// If all our outputs are executables, then we can relax PIC to PIE when producing object code.
/// If the list of crate types is not yet known we conservatively return `false`.
pub fn all_outputs_are_pic_executables(sess: &Session) -> bool {

Perhaps this indicates that we want to force initialization of crate_types somewhere?

Metadata

Metadata

Assignees

Labels

A-codegenArea: Code generationC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions