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

Mismatched types with class self region #2502

Closed
brson opened this issue Jun 4, 2012 · 0 comments
Closed

Mismatched types with class self region #2502

brson opened this issue Jun 4, 2012 · 0 comments
Labels
A-lifetimes Area: lifetime related
Milestone

Comments

@brson
Copy link
Contributor

brson commented Jun 4, 2012

class font/& {
    let fontbuf: &self.[u8];

    new(fontbuf: &self.[u8]) {
        self.fontbuf = fontbuf;
    }

    fn buf() -> &self.[u8] {
        self.fontbuf
    }
}

fn main() { }
/home/banderson/Dev/rust/src/test/run-pass/test.rs:5:23: 5:30 error: mismatched types: expected `&self.[u8]` but found `&self.[u8]` (references with lifetime &self do not necessarily outlive references with lifetime &self)
/home/banderson/Dev/rust/src/test/run-pass/test.rs:5         self.fontbuf = fontbuf;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: lifetime related
Projects
None yet
Development

No branches or pull requests

2 participants