impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> RegionScope for StaticRscope<'a, 'gcx, 'tcx> {
fn anon_regions(&self,
- _span: Span,
+ span: Span,
count: usize)
-> Result<Vec<ty::Region>, Option<Vec<ElisionFailureInfo>>> {
- Ok(vec![ty::ReStatic; count])
- }
-
- fn object_lifetime_default(&self, span: Span) -> Option<ty::Region> {
- Some(self.base_object_lifetime_default(span))
- }
-
- fn base_object_lifetime_default(&self, span: Span) -> ty::Region {
if !self.tcx.sess.features.borrow().static_in_const {
self.tcx
.sess
`static_in_const` feature, see #35897")
.emit();
}
+ Ok(vec![ty::ReStatic; count])
+ }
+
+ fn object_lifetime_default(&self, span: Span) -> Option<ty::Region> {
+ Some(self.base_object_lifetime_default(span))
+ }
+
+ fn base_object_lifetime_default(&self, _span: Span) -> ty::Region {
ty::ReStatic
}
}
//~| NOTE `std::fmt::Debug + Sync + 'static: std::marker::Sized` not satisfied
//~| NOTE does not have a constant size known at compile-time
//~| NOTE constant expressions must have a statically known size
-//~| ERROR this needs a `'static` lifetime or the `static_in_const` feature
const CONST_FOO: str = *"foo";
//~^ ERROR `str: std::marker::Sized` is not satisfied
//~| NOTE `std::fmt::Debug + Sync + 'static: std::marker::Sized` not satisfied
//~| NOTE does not have a constant size known at compile-time
//~| NOTE constant expressions must have a statically known size
-//~| ERROR this needs a `'static` lifetime or the `static_in_const` feature
static STATIC_BAR: str = *"bar";
//~^ ERROR `str: std::marker::Sized` is not satisfied
static foo: Fn() -> u32 = || -> u32 {
//~^ ERROR: mismatched types
//~| ERROR: `std::ops::Fn() -> u32 + 'static: std::marker::Sized` is not satisfied
- //~| ERROR: this needs a `'static` lifetime or the `static_in_const` feature
0
};
}