Rollup merge of #37117 - pnkfelix:may-dangle-attr, r=nikomatsakis

`#[may_dangle]` attribute

`#[may_dangle]` attribute

Second step of #34761. Last big hurdle before we can work in earnest towards Allocator integration (#32838)

Note: I am not clear if this is *also* a syntax-breaking change that needs to be part of a breaking-batch.
This commit is contained in:
Eduard-Mihai Burtescu
2016-10-19 07:59:59 +03:00
committed by GitHub
27 changed files with 1098 additions and 36 deletions

View File

@@ -1361,6 +1361,7 @@ impl<'a> State<'a> {
if comma {
try!(self.word_space(","))
}
try!(self.print_outer_attributes_inline(&lifetime_def.attrs));
try!(self.print_lifetime_bounds(&lifetime_def.lifetime, &lifetime_def.bounds));
comma = true;
}
@@ -2803,6 +2804,7 @@ impl<'a> State<'a> {
try!(self.commasep(Inconsistent, &ints[..], |s, &idx| {
if idx < generics.lifetimes.len() {
let lifetime_def = &generics.lifetimes[idx];
try!(s.print_outer_attributes_inline(&lifetime_def.attrs));
s.print_lifetime_bounds(&lifetime_def.lifetime, &lifetime_def.bounds)
} else {
let idx = idx - generics.lifetimes.len();
@@ -2816,6 +2818,7 @@ impl<'a> State<'a> {
}
pub fn print_ty_param(&mut self, param: &ast::TyParam) -> io::Result<()> {
try!(self.print_outer_attributes_inline(&param.attrs));
try!(self.print_ident(param.ident));
try!(self.print_bounds(":", &param.bounds));
match param.default {