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

ICE with static function pointer to a generic function #13970

Closed
Kimundi opened this issue May 6, 2014 · 1 comment · Fixed by #20295
Closed

ICE with static function pointer to a generic function #13970

Kimundi opened this issue May 6, 2014 · 1 comment · Fixed by #20295
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Kimundi
Copy link
Member

Kimundi commented May 6, 2014

Testcase:

fn foo<T>(a: T) -> T { a }

static BLOCK_FN_INFERRED: fn(uint) -> uint = foo;

fn main() {}

The intend here is to let rustc infer the right instantiation of foo, which would be foo::<uint>.

Output (warnings trimmed):

error: internal compiler error: fictitious type ty_param(middle::ty::param_ty{idx: 0u, def_id: syntax::ast::DefId{krate: 0u32, node: 11u32}}) in sizing_type_of()
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at '~Any', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:155

@Twisol
Copy link

Twisol commented Jan 4, 2015

/cc @eddyb

flip1995 added a commit to flip1995/rust that referenced this issue Jan 9, 2025
r? @ghost

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants