-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Creating a raw reference/pointer to an extern never value claims following code is unreachable #74840
Copy link
Copy link
Closed
Labels
A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullC-bugCategory: This is a bug.Category: This is a bug.F-never_type`#![feature(never_type)]``#![feature(never_type)]`F-raw_ref_op`#![feature(raw_ref_op)]``#![feature(raw_ref_op)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullC-bugCategory: This is a bug.Category: This is a bug.F-never_type`#![feature(never_type)]``#![feature(never_type)]`F-raw_ref_op`#![feature(raw_ref_op)]``#![feature(raw_ref_op)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code (playground):
I expected to see this happen: just a linker failure because
FOOdoesn't exist.Instead, this happened: before the linker failure,
rustccomplained that code was unreachable.(The code should also build without the
unsafe; that is caused by the same problem.)Meta
cc @rust-lang/wg-unsafe-code-guidelines