Skip to content

Intrinsics can be declared and defined #36979

Closed
@arielb1

Description

@arielb1

Meta

$ rustc -V
rustc 1.14.0-nightly (9c31d76e9 2016-10-03)

STR

#![feature(intrinsics)]

trait Foo {
    extern "rust-intrinsic" fn foo(&self);
}

impl Foo for () {
    extern "rust-intrinsic" fn foo(&self) {
        hello();
    }
}

extern "rust-intrinsic" fn hello() {
    println!("Hello, World!");
}

fn main() {
    ().foo();
}

Actual Result

error: internal compiler error: ../src/librustc_trans/intrinsic.rs:558: unknown intrinsic 'hello'

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', ../src/librustc_errors/lib.rs:656
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intrinsicsArea: IntrinsicsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions