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

type parameter A/#0 (A/0) out of range when substituting (root type=Some(*const A)) substs=[] #65025

Closed
gz opened this issue Oct 2, 2019 · 4 comments · Fixed by #65133
Closed
Assignees
Labels
A-FFI Area: Foreign function interface (FFI) A-type-system Area: Type system C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@gz
Copy link
Contributor

gz commented Oct 2, 2019

Minimal example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=814876c654b0b3ad162d52ba64064b02

error: internal compiler error: src/librustc/ty/subst.rs:557: type parameter `A/#0` (A/0) out of range when substituting (root type=Some(*const A)) substs=[]

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:579:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


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

note: rustc 1.38.0 (625451e37 2019-09-23) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

I'm on nightly but it also crashes on stable.

@jonas-schievink jonas-schievink added A-FFI Area: Foreign function interface (FFI) A-type-system Area: Type system C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 2, 2019
@Centril
Copy link
Contributor

Centril commented Oct 3, 2019

Reduced:

unsafe fn setup_boostrap_code<A>() {
    extern "C" {
        static xxx:  *const A;
    }

    let arg1_pointer_new: *const u64 = core::mem::transmute(&xxx);
}

@pnkfelix
Copy link
Member

pnkfelix commented Oct 3, 2019

triage: P-medium. removing nomination label.

@pnkfelix pnkfelix added P-medium Medium priority and removed I-nominated labels Oct 3, 2019
@davidtwco
Copy link
Member

Assigning to myself to see if re-working #65133 as per this comment fixes the issue.

@ago-84
Copy link

ago-84 commented Apr 1, 2021

good found!
01111001 01101111 01110101 01110010 00100000 01100001 01100111 01100101 00100000 01110100 01101111 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00111111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) A-type-system Area: Type system C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority 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.

6 participants