Skip to content
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

Intrinsics can be declared and defined #36979

Closed
arielb1 opened this issue Oct 5, 2016 · 2 comments · Fixed by #64406
Closed

Intrinsics can be declared and defined #36979

arielb1 opened this issue Oct 5, 2016 · 2 comments · Fixed by #64406
Labels
A-intrinsics Area: intrinsics C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@arielb1
Copy link
Contributor

arielb1 commented Oct 5, 2016

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.
@arielb1 arielb1 added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-amusing labels Oct 5, 2016
@arielb1
Copy link
Contributor Author

arielb1 commented Oct 5, 2016

cc #34123

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@istankovic
Copy link
Contributor

Still reproducible with rustc 1.26.0-nightly (adf2135ad 2018-03-17).

@jonas-schievink jonas-schievink added A-intrinsics Area: intrinsics T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. requires-nightly This issue requires a nightly compiler in some way. labels Aug 19, 2019
Centril added a commit to Centril/rust that referenced this issue Sep 13, 2019
…nsic, r=Centril

Ban non-extern rust intrinsics

Intrinsics can only be defined by the compiler.

Fixes rust-lang#36979
Centril added a commit to Centril/rust that referenced this issue Sep 13, 2019
…nsic, r=Centril

Ban non-extern rust intrinsics

Intrinsics can only be defined by the compiler.

Fixes rust-lang#36979
Centril added a commit to Centril/rust that referenced this issue Sep 14, 2019
…nsic, r=Centril

Ban non-extern rust intrinsics

Intrinsics can only be defined by the compiler.

Fixes rust-lang#36979
@bors bors closed this as completed in 5f9b9b2 Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intrinsics Area: intrinsics C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants