debuginfo: Variables in generic functions should have generic type. #8641

michaelwoerister opened this Issue Aug 20, 2013 · 3 comments


None yet

3 participants


As per 3.3.7 Function Template Instantiations of the DWARF 4 specification, the template type parameter DIE (debug information entry) should be referenced where it has been used in the source code, as opposed to the DIE for the type that has been substituted for the parameter.

In the context of Rust this would mean that the variable x in the following function should be described as having type T=int instead of just type int:

fn generic_fun<T>(x: T) -> T {

fn main() {
    let s_have = Some(generic_fun(11111));

As of PR #8554 generic functions are supported but arguments, return value, locals, etc are described as having their type concrete type instead of "their generic type substituted by their concrete type". That means that debug info loses some information.

This should not pose a big problem to the regular debugging workflow---but I wanted to record somewhere that this issue exists.


Visiting for triage. It still seems relevant.


Triage: nothing to add.


Triage: same as last year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment