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

Unsoundness due to multidispatch #15

Closed
Ryman opened this issue Nov 21, 2014 · 1 comment · Fixed by #17
Closed

Unsoundness due to multidispatch #15

Ryman opened this issue Nov 21, 2014 · 1 comment · Fixed by #17

Comments

@Ryman
Copy link
Contributor

Ryman commented Nov 21, 2014

The test below panics when added to the test suite, I think associated types are required.

I tried patching it up, but I couldn't figure out the syntax to add a static bound for the associated type (can't find any tests for it in rustc either).

#[test] fn test_entry_multi() {
    impl Assoc<u32> for Key {}

    let mut map = TypeMap::new();
    map.insert::<Key, Value>(Value);
    if let Occupied(_) = map.entry::<Key, u32>() {
        panic!("Unsound")
    }
}
@reem
Copy link
Owner

reem commented Nov 21, 2014

Ya I've known this would be an issue for a while, but there's no way to add the 'static bound to an associated type yet, which is pretty frustrating.

Thanks for filing.

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

Successfully merging a pull request may close this issue.

2 participants