1
Fork 0

librustc: Remove the &LIFETIME EXPR production from the language.

This was parsed by the parser but completely ignored; not even stored in
the AST!

This breaks code that looks like:

    static X: &'static [u8] = &'static [1, 2, 3];

Change this code to the shorter:

    static X: &'static [u8] = &[1, 2, 3];

Closes #15312.

[breaking-change]
This commit is contained in:
Patrick Walton 2014-07-04 00:56:57 -07:00
parent 1bff1ff810
commit 29ec2506ab
13 changed files with 23 additions and 27 deletions

View file

@ -113,12 +113,12 @@ static mut STATIC14: SafeStruct = SafeStruct {
field2: Variant4("str".to_string())
};
static STATIC15: &'static [Box<MyOwned>] = &'static [box MyOwned, box MyOwned];
static STATIC15: &'static [Box<MyOwned>] = &[box MyOwned, box MyOwned];
//~^ ERROR static items are not allowed to have custom pointers
//~^^ ERROR static items are not allowed to have custom pointers
static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) =
(&'static box MyOwned, &'static box MyOwned);
(&box MyOwned, &box MyOwned);
//~^ ERROR static items are not allowed to have custom pointers
//~^^ ERROR static items are not allowed to have custom pointers