diff options
| author | bors <bors@rust-lang.org> | 2014-07-04 19:01:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-04 19:01:33 +0000 |
| commit | 935da0739e71c5581e5e6abb564e18f894e0ec04 (patch) | |
| tree | febd32b41fc7a597d749fbd231f54b7137bed9a1 /src/test | |
| parent | 25e8b6ed9c9cf60448eb95a0e8a42330ed44f479 (diff) | |
| parent | 29ec2506abb1d382e432cae2519aa7b7695c276a (diff) | |
| download | rust-935da0739e71c5581e5e6abb564e18f894e0ec04.tar.gz rust-935da0739e71c5581e5e6abb564e18f894e0ec04.zip | |
auto merge of #15405 : pcwalton/rust/delifetime, r=nick29581
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]
r? @nick29581
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/borrowck-forbid-static-unsafe-interior.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/check-static-values-constraints.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/issue-5917.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/issue-8578.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/trans-tag-static-padding.rs | 4 | ||||
| -rw-r--r-- | src/test/run-pass/typeck_type_placeholder_1.rs | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/src/test/compile-fail/borrowck-forbid-static-unsafe-interior.rs b/src/test/compile-fail/borrowck-forbid-static-unsafe-interior.rs index 9939fc79190..1c7516ef7e2 100644 --- a/src/test/compile-fail/borrowck-forbid-static-unsafe-interior.rs +++ b/src/test/compile-fail/borrowck-forbid-static-unsafe-interior.rs @@ -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> { diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs index da5f7680d8c..b7344d72a46 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/compile-fail/check-static-values-constraints.rs @@ -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 diff --git a/src/test/run-pass/issue-5917.rs b/src/test/run-pass/issue-5917.rs index 543f4bf027b..5b601267356 100644 --- a/src/test/run-pass/issue-5917.rs +++ b/src/test/run-pass/issue-5917.rs @@ -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); diff --git a/src/test/run-pass/issue-8578.rs b/src/test/run-pass/issue-8578.rs index 6ceb2cf87b9..275fe740db1 100644 --- a/src/test/run-pass/issue-8578.rs +++ b/src/test/run-pass/issue-8578.rs @@ -17,7 +17,7 @@ impl<'a> UninterpretedOption_NamePart { static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart { name_part: None, }; - &'static instance + &instance } } diff --git a/src/test/run-pass/trans-tag-static-padding.rs b/src/test/run-pass/trans-tag-static-padding.rs index c6a3a0b0409..ed4712ff3be 100644 --- a/src/test/run-pass/trans-tag-static-padding.rs +++ b/src/test/run-pass/trans-tag-static-padding.rs @@ -43,7 +43,7 @@ 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 { @@ -51,7 +51,7 @@ fn non_default_instance() -> &'static Request { foo: TestSome(0x1020304050607080), bar: 19, }; - &'static instance + &instance } pub fn main() { diff --git a/src/test/run-pass/typeck_type_placeholder_1.rs b/src/test/run-pass/typeck_type_placeholder_1.rs index 1a79edb30c9..f95e9ad7d83 100644 --- a/src/test/run-pass/typeck_type_placeholder_1.rs +++ b/src/test/run-pass/typeck_type_placeholder_1.rs @@ -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(); |
