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: Make references to functions not have static lifetime. #15961

Merged
merged 1 commit into from
Jul 25, 2014

Commits on Jul 24, 2014

  1. librustc: Make references to functions not have static lifetime.

    This breaks code like:
    
        struct A<'a> {
            func: &'a fn() -> Option<int>
        }
    
        fn foo() -> Option<int> { ... }
    
        fn create() -> A<'static> {
            A {
                func: &foo
            }
        }
    
    Change this code to not take functions by reference. For example:
    
        struct A {
            func: extern "Rust" fn() -> Option<int>
        }
    
        fn foo() -> Option<int> { ... }
    
        fn create() -> A {
            A {
                func: foo
            }
        }
    
    Closes rust-lang#13595.
    
    [breaking-change]
    pcwalton committed Jul 24, 2014
    5 Configuration menu
    Copy the full SHA
    d1dcd19 View commit details
    Browse the repository at this point in the history