Skip to content

Commit

Permalink
fix tests for diag change
Browse files Browse the repository at this point in the history
  • Loading branch information
pitaj committed Apr 17, 2024
1 parent 66b0c23 commit a0c614d
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/ui/borrowck/issue-64453.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LL | static settings_dir: String = format!("");
| ^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of static item `settings_dir`
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/check-static-values-constraints.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
| ^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
Expand All @@ -37,7 +37,7 @@ LL | field2: SafeEnum::Variant4("str".to_string()),
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:96:5
Expand All @@ -54,7 +54,7 @@ LL | vec![MyOwned],
| ^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0010]: allocations are not allowed in statics
Expand All @@ -72,7 +72,7 @@ LL | vec![MyOwned],
| ^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0010]: allocations are not allowed in statics
Expand All @@ -90,7 +90,7 @@ LL | &vec![MyOwned],
| ^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0010]: allocations are not allowed in statics
Expand All @@ -108,7 +108,7 @@ LL | &vec![MyOwned],
| ^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0010]: allocations are not allowed in statics
Expand All @@ -126,7 +126,7 @@ LL | static STATIC19: Vec<isize> = vec![3];
| ^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0010]: allocations are not allowed in statics
Expand All @@ -144,7 +144,7 @@ LL | static x: Vec<isize> = vec![3];
| ^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0507]: cannot move out of static item `x`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/issue-16538.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
--> $DIR/issue-16538.rs:11:22
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/consts/issue-32829-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LL | invalid();
| ^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error[E0015]: cannot call non-const fn `invalid` in statics
--> $DIR/issue-32829-2.rs:54:9
Expand All @@ -22,7 +22,7 @@ LL | invalid();
| ^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 3 previous errors

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/mir_check_nonconst.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | static foo: Foo = bar();
| ^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 1 previous error

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-25901.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LL | impl Deref for A {
| ^^^^^^^^^^^^^^^^
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 1 previous error

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-7364.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 2 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 40 previous errors

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/static/static-mut-not-constant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | static mut a: Box<isize> = Box::new(3);
| ^^^^^^^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 1 previous error

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/static/static-vec-repeat-not-constant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | static a: [isize; 2] = [foo(); 2];
| ^^^^^
|
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
= note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
= note: consider wrapping this expression in `std::sync::LazyLock::new(|| ...)`

error: aborting due to 1 previous error

Expand Down

0 comments on commit a0c614d

Please sign in to comment.