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

librustc: Have the kind checker check sub-bounds in trait casts. #15352

Closed

Commits on Jul 3, 2014

  1. librustc: Have the kind checker check sub-bounds in trait casts.

    This can break code that looked like:
    
        struct S<T> {
            val: T,
        }
        trait Gettable<T> {
            ...
        }
        impl<T: Copy> Gettable<T> for S<T> {
            ...
        }
        let t: Box<S<String>> = box S {
            val: "one".to_string(),
        };
        let a = t as Box<Gettable<String>>;
        //                        ^ note no `Copy` bound
    
    Change this code to:
    
        impl<T> Gettable<T> for S<T> {
        //   ^ remove `Copy` bound
            ...
        }
    
    Closes rust-lang#14061.
    
    [breaking-change]
    pcwalton committed Jul 3, 2014
    Configuration menu
    Copy the full SHA
    a8c59a4 View commit details
    Browse the repository at this point in the history