Closed
Description
Spawned off of #5446. (This is a significantly narrowed down version of the test case described there; the problem with conditions appears to arise from its use of 'self
region parameters for borrowed function pointers.)
(This top version is newer and thus labelled as a variant. The "original narrowing" is at the bottom of the report.)
iss.rc (variant 3):
#[link(name="iss6919_3", vers="0.1")];
struct C<'self> {
pub k: &'self fn(), // <-- necessary; bug seems to require &'self functions.
}
fn no_op() { }
pub static D : C<'static> = C {
k: no_op
};
main.rs (variant 3):
extern mod iss ( name = "iss6919_3" );
fn main() {
iss::D.k; // <-- this is just a deref. (An invocation fails too, but its uglier to write and would distract.)
}
Transcript:
% rustc --lib iss.rc
warning: no debug symbols in executable (-arch x86_64)
% RUST_LOG=rustc=1,::rt::backtrace rustc -L . main.rs
rust: task failed at 'lookup_item: id not found: 11', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/metadata/decoder.rs:92
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/rustc.rc:400
rust: domain main @0x7fa35b808410 root task failed
% rustc --version
/Users/fklock/opt/rust-dbg-nopt/bin/rustc 0.6 (4f6285f 2013-06-02 22:31:36 -0700)
host: x86_64-apple-darwin
%
Original narrowed version below (but one above is smaller).
iss.rc:
#[link(name="iss", vers="0.1")];
struct C<'self> {
k: &'self fn(), // <-- necessary; bug seems to require &'self functions.
}
impl<'self> C<'self> {
pub fn r(&self) { }
}
fn no_op() { }
pub static D : C<'static> = C {
k: no_op
};
main.rs:
extern mod iss;
fn main() { iss::D.r(); }
Transcript:
% rustc --lib iss.rc
warning: no debug symbols in executable (-arch x86_64)
% RUST_LOG=rustc=1,::rt::backtrace rustc -L . main.rs
rust: task failed at 'lookup_item: id not found: 20', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/metadata/decoder.rs:92
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/fklock/Dev/Mozilla/rust.git/src/librustc/rustc.rc:400
rust: domain main @0x7fe851808410 root task failed
% rustc --version
/Users/fklock/opt/rust-dbg-nopt/bin/rustc 0.6 (4f6285f 2013-06-02 22:31:36 -0700)
host: x86_64-apple-darwin
%