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

"unconstrained type" in ccross with templates #42

Open
mrwright opened this issue Jan 5, 2015 · 1 comment
Open

"unconstrained type" in ccross with templates #42

mrwright opened this issue Jan 5, 2015 · 1 comment
Labels

Comments

@mrwright
Copy link
Member

mrwright commented Jan 5, 2015

The following code:

enum X<T> {
    Some(*T)
}

fn f<T>() -> *T {
    match *(null as *X<T>) {
        Some(x) => null as *T,
    }
}

fails with:

task '<main>' failed at 'Type is not fully constrained: <unconstrained>', src/target/ccross.rs:436

If the cast of null to *T is removed, it works.

@mrwright mrwright added the bug label Jan 5, 2015
@mrwright mrwright changed the title "unconstrained type" in ccross with casts in match statements "unconstrained type" in ccross with templates Jan 5, 2015
@mrwright
Copy link
Member Author

mrwright commented Jan 5, 2015

Another way to trigger what I assume is the same bug:

fn f<T>() -> *T {
    null
}

fn g<T>() -> *T {
    f()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant