Skip to content

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

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libregex_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,

#[inline]
fn groups<'r>(&'r mut self, i: uint) -> &'r mut Captures {
&'r mut self.queue[i].groups
&mut self.queue[i].groups
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/driver/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ pub fn get_os(triple: &str) -> Option<abi::Os> {
}
None
}
static os_names : &'static [(&'static str, abi::Os)] = &'static [
static os_names : &'static [(&'static str, abi::Os)] = &[
("mingw32", abi::OsWin32),
("win32", abi::OsWin32),
("darwin", abi::OsMacos),
Expand All @@ -442,7 +442,7 @@ pub fn get_arch(triple: &str) -> Option<abi::Architecture> {
}
None
}
static architecture_abis : &'static [(&'static str, abi::Architecture)] = &'static [
static architecture_abis : &'static [(&'static str, abi::Architecture)] = &[
("i386", abi::X86),
("i486", abi::X86),
("i586", abi::X86),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ impl LintPass for UnusedAttribute {
}

fn check_attribute(&mut self, cx: &Context, attr: &ast::Attribute) {
static ATTRIBUTE_WHITELIST: &'static [&'static str] = &'static [
static ATTRIBUTE_WHITELIST: &'static [&'static str] = &[
// FIXME: #14408 whitelist docs since rustdoc looks at them
"doc",

Expand Down Expand Up @@ -574,7 +574,7 @@ impl LintPass for UnusedAttribute {
"unstable",
];

static CRATE_ATTRS: &'static [&'static str] = &'static [
static CRATE_ATTRS: &'static [&'static str] = &[
"crate_type",
"feature",
"no_start",
Expand Down
2 changes: 1 addition & 1 deletion src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ impl<T: Iterator<char>> Parser<T> {
/// Provides access to the current position in the logical structure of the
/// JSON stream.
pub fn stack<'l>(&'l self) -> &'l Stack {
return &'l self.stack;
return &self.stack;
}

fn eof(&self) -> bool { self.ch.is_none() }
Expand Down
9 changes: 3 additions & 6 deletions src/libstd/collections/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ mod table {

unsafe {
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
(&'a *self.keys.offset(idx),
&'a *self.vals.offset(idx))
(&*self.keys.offset(idx), &*self.vals.offset(idx))
}
}

Expand All @@ -306,8 +305,7 @@ mod table {

unsafe {
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
(&'a *self.keys.offset(idx),
&'a mut *self.vals.offset(idx))
(&*self.keys.offset(idx), &mut *self.vals.offset(idx))
}
}

Expand All @@ -319,8 +317,7 @@ mod table {
unsafe {
debug_assert!(*self.hashes.offset(idx) != EMPTY_BUCKET);
(transmute(self.hashes.offset(idx)),
&'a mut *self.keys.offset(idx),
&'a mut *self.vals.offset(idx))
&mut *self.keys.offset(idx), &mut *self.vals.offset(idx))
}
}

Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,6 @@ impl<'a> Parser<'a> {
}
token::BINOP(token::AND) | token::ANDAND => {
self.expect_and();
let _lt = self.parse_opt_lifetime();
let m = self.parse_mutability();
let e = self.parse_prefix_expr();
hi = e.span.hi;
Expand Down
12 changes: 6 additions & 6 deletions src/libterm/terminfo/parser/compiled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use super::super::TermInfo;

// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.

pub static boolfnames: &'static[&'static str] = &'static["auto_left_margin", "auto_right_margin",
pub static boolfnames: &'static[&'static str] = &["auto_left_margin", "auto_right_margin",
"no_esc_ctlc", "ceol_standout_glitch", "eat_newline_glitch", "erase_overstrike", "generic_type",
"hard_copy", "has_meta_key", "has_status_line", "insert_null_glitch", "memory_above",
"memory_below", "move_insert_mode", "move_standout_mode", "over_strike", "status_line_esc_ok",
Expand All @@ -31,12 +31,12 @@ pub static boolfnames: &'static[&'static str] = &'static["auto_left_margin", "au
"no_correctly_working_cr", "gnu_has_meta_key", "linefeed_is_newline", "has_hardware_tabs",
"return_does_clr_eol"];

pub static boolnames: &'static[&'static str] = &'static["bw", "am", "xsb", "xhp", "xenl", "eo",
pub static boolnames: &'static[&'static str] = &["bw", "am", "xsb", "xhp", "xenl", "eo",
"gn", "hc", "km", "hs", "in", "db", "da", "mir", "msgr", "os", "eslok", "xt", "hz", "ul", "xon",
"nxon", "mc5i", "chts", "nrrmc", "npc", "ndscr", "ccc", "bce", "hls", "xhpa", "crxm", "daisy",
"xvpa", "sam", "cpix", "lpix", "OTbs", "OTns", "OTnc", "OTMT", "OTNL", "OTpt", "OTxr"];

pub static numfnames: &'static[&'static str] = &'static[ "columns", "init_tabs", "lines",
pub static numfnames: &'static[&'static str] = &[ "columns", "init_tabs", "lines",
"lines_of_memory", "magic_cookie_glitch", "padding_baud_rate", "virtual_terminal",
"width_status_line", "num_labels", "label_height", "label_width", "max_attributes",
"maximum_windows", "max_colors", "max_pairs", "no_color_video", "buffer_capacity",
Expand All @@ -46,12 +46,12 @@ pub static numfnames: &'static[&'static str] = &'static[ "columns", "init_tabs",
"bit_image_entwining", "bit_image_type", "magic_cookie_glitch_ul", "carriage_return_delay",
"new_line_delay", "backspace_delay", "horizontal_tab_delay", "number_of_function_keys"];

pub static numnames: &'static[&'static str] = &'static[ "cols", "it", "lines", "lm", "xmc", "pb",
pub static numnames: &'static[&'static str] = &[ "cols", "it", "lines", "lm", "xmc", "pb",
"vt", "wsl", "nlab", "lh", "lw", "ma", "wnum", "colors", "pairs", "ncv", "bufsz", "spinv",
"spinh", "maddr", "mjump", "mcs", "mls", "npins", "orc", "orl", "orhi", "orvi", "cps", "widcs",
"btns", "bitwin", "bitype", "UTug", "OTdC", "OTdN", "OTdB", "OTdT", "OTkn"];

pub static stringfnames: &'static[&'static str] = &'static[ "back_tab", "bell", "carriage_return",
pub static stringfnames: &'static[&'static str] = &[ "back_tab", "bell", "carriage_return",
"change_scroll_region", "clear_all_tabs", "clear_screen", "clr_eol", "clr_eos",
"column_address", "command_character", "cursor_address", "cursor_down", "cursor_home",
"cursor_invisible", "cursor_left", "cursor_mem_address", "cursor_normal", "cursor_right",
Expand Down Expand Up @@ -124,7 +124,7 @@ pub static stringfnames: &'static[&'static str] = &'static[ "back_tab", "bell",
"acs_lrcorner", "acs_ltee", "acs_rtee", "acs_btee", "acs_ttee", "acs_hline", "acs_vline",
"acs_plus", "memory_lock", "memory_unlock", "box_chars_1"];

pub static stringnames: &'static[&'static str] = &'static[ "cbt", "_", "cr", "csr", "tbc", "clear",
pub static stringnames: &'static[&'static str] = &[ "cbt", "_", "cr", "csr", "tbc", "clear",
"_", "_", "hpa", "cmdch", "cup", "cud1", "home", "civis", "cub1", "mrcup", "cnorm", "cuf1",
"ll", "cuu1", "cvvis", "dch1", "dl1", "dsl", "hd", "smacs", "blink", "bold", "smcup", "smdc",
"dim", "smir", "invis", "prot", "rev", "smso", "smul", "ech", "rmacs", "sgr0", "rmcup", "rmdc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static STATIC1: UnsafeEnum<int> = VariantSafe;
static STATIC2: Unsafe<int> = Unsafe{value: 1, marker1: marker::InvariantType};
static STATIC3: MyUnsafe<int> = MyUnsafe{value: STATIC2};

static STATIC4: &'static Unsafe<int> = &'static STATIC2;
static STATIC4: &'static Unsafe<int> = &STATIC2;
//~^ ERROR borrow of immutable static items with unsafe interior is not allowed

struct Wrap<T> {
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/check-static-values-constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5917.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

struct T (&'static [int]);
static t : T = T (&'static [5, 4, 3]);
static t : T = T (&[5, 4, 3]);
pub fn main () {
let T(ref v) = t;
assert_eq!(v[0], 5);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-8578.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl<'a> UninterpretedOption_NamePart {
static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart {
name_part: None,
};
&'static instance
&instance
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/run-pass/trans-tag-static-padding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ fn default_instance() -> &'static Request {
// size of struct may be not equal to size of struct, and
// compiler crashes in internal assertion check.
};
&'static instance
&instance
}

fn non_default_instance() -> &'static Request {
static instance: Request = Request {
foo: TestSome(0x1020304050607080),
bar: 19,
};
&'static instance
&instance
}

pub fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/typeck_type_placeholder_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// This test checks that the `_` type placeholder works
// correctly for enabling type inference.

static CONSTEXPR: *const int = &'static 413 as *const _;
static CONSTEXPR: *const int = &413 as *const _;

pub fn main() {
let x: Vec<_> = range(0u, 5).collect();
Expand Down