mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
warning → error, lowercase
This commit is contained in:
parent
41d1cd7196
commit
e0eea8b7c1
@ -243,9 +243,9 @@ impl<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> RegionScope for StaticRscope<'a, 'gcx, 'tcx>
|
|||||||
if !self.tcx.sess.features.borrow().static_in_const {
|
if !self.tcx.sess.features.borrow().static_in_const {
|
||||||
self.tcx
|
self.tcx
|
||||||
.sess
|
.sess
|
||||||
.struct_span_warn(span,
|
.struct_span_err(span,
|
||||||
"This needs a `'static` lifetime or the \
|
"this needs a `'static` lifetime or the \
|
||||||
`static_in_const` feature, see #35897")
|
`static_in_const` feature, see #35897")
|
||||||
.emit();
|
.emit();
|
||||||
}
|
}
|
||||||
ty::ReStatic
|
ty::ReStatic
|
||||||
|
@ -15,7 +15,7 @@ const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync));
|
|||||||
//~| NOTE `std::fmt::Debug + Sync + 'static: std::marker::Sized` 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 does not have a constant size known at compile-time
|
||||||
//~| NOTE constant expressions must have a statically known size
|
//~| NOTE constant expressions must have a statically known size
|
||||||
//~| WARNING This needs a `'static` lifetime or the `static_in_const` feature
|
//~| ERROR this needs a `'static` lifetime or the `static_in_const` feature
|
||||||
|
|
||||||
const CONST_FOO: str = *"foo";
|
const CONST_FOO: str = *"foo";
|
||||||
//~^ ERROR `str: std::marker::Sized` is not satisfied
|
//~^ ERROR `str: std::marker::Sized` is not satisfied
|
||||||
@ -28,7 +28,7 @@ static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
|
|||||||
//~| NOTE `std::fmt::Debug + Sync + 'static: std::marker::Sized` 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 does not have a constant size known at compile-time
|
||||||
//~| NOTE constant expressions must have a statically known size
|
//~| NOTE constant expressions must have a statically known size
|
||||||
//~| WARNING This needs a `'static` lifetime or the `static_in_const` feature
|
//~| ERROR this needs a `'static` lifetime or the `static_in_const` feature
|
||||||
|
|
||||||
static STATIC_BAR: str = *"bar";
|
static STATIC_BAR: str = *"bar";
|
||||||
//~^ ERROR `str: std::marker::Sized` is not satisfied
|
//~^ ERROR `str: std::marker::Sized` is not satisfied
|
||||||
|
@ -12,7 +12,7 @@ fn main() {
|
|||||||
static foo: Fn() -> u32 = || -> u32 {
|
static foo: Fn() -> u32 = || -> u32 {
|
||||||
//~^ ERROR: mismatched types
|
//~^ ERROR: mismatched types
|
||||||
//~| ERROR: `std::ops::Fn() -> u32 + 'static: std::marker::Sized` is not satisfied
|
//~| ERROR: `std::ops::Fn() -> u32 + 'static: std::marker::Sized` is not satisfied
|
||||||
//~| WARNING: This needs a `'static` lifetime or the `static_in_const` feature
|
//~| ERROR: this needs a `'static` lifetime or the `static_in_const` feature
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user