Skip to content

Commit de2123a

Browse files
committed
bless you
1 parent 75fdc8a commit de2123a

File tree

60 files changed

+199
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+199
-87
lines changed

src/test/ui/borrowck/issue-64453.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ struct Project;
22
struct Value;
33

44
static settings_dir: String = format!("");
5-
//~^ ERROR calls in statics are limited to constant functions
5+
//~^ ERROR cannot call non-const fn
66
//~| ERROR is not yet stable as a const
77

88
fn from_string(_: String) -> Value {

src/test/ui/borrowck/issue-64453.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ LL | static settings_dir: String = format!("");
77
= help: add `#![feature(const_fmt_arguments_new)]` to the crate attributes to enable
88
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
99

10-
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
10+
error[E0015]: cannot call non-const fn `format` in statics
1111
--> $DIR/issue-64453.rs:4:31
1212
|
1313
LL | static settings_dir: String = format!("");
1414
| ^^^^^^^^^^^
1515
|
16+
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
1617
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
1718

1819
error[E0507]: cannot move out of static item `settings_dir`

src/test/ui/check-static-values-constraints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static mut STATIC13: SafeStruct = SafeStruct{field1: SafeEnum::Variant1,
8787
static mut STATIC14: SafeStruct = SafeStruct {
8888
field1: SafeEnum::Variant1,
8989
field2: SafeEnum::Variant4("str".to_string())
90-
//~^ ERROR calls in statics are limited to constant functions
90+
//~^ ERROR cannot call non-const fn
9191
};
9292

9393
static STATIC15: &'static [Box<MyOwned>] = &[

src/test/ui/check-static-values-constraints.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ error[E0010]: allocations are not allowed in statics
1515
LL | static STATIC11: Box<MyOwned> = box MyOwned;
1616
| ^^^^^^^^^^^ allocation not allowed in statics
1717

18-
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
19-
--> $DIR/check-static-values-constraints.rs:89:32
18+
error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
19+
--> $DIR/check-static-values-constraints.rs:89:38
2020
|
2121
LL | field2: SafeEnum::Variant4("str".to_string())
22-
| ^^^^^^^^^^^^^^^^^
22+
| ^^^^^^^^^^^
23+
|
24+
= note: calls in statics are limited to constant functions, tuple structs and tuple variants
2325

2426
error[E0010]: allocations are not allowed in statics
2527
--> $DIR/check-static-values-constraints.rs:94:5

src/test/ui/const-generics/nested-type.full.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
1+
error[E0015]: cannot call non-const fn `Foo::{constant#0}::Foo::<17_usize>::value` in constants
22
--> $DIR/nested-type.rs:15:5
33
|
44
LL | Foo::<17>::value()
55
| ^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
68

79
error: aborting due to previous error
810

src/test/ui/const-generics/nested-type.min.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ LL | | }]>;
1414
= note: the only supported types are integers, `bool` and `char`
1515
= help: more complex types are supported with `#![feature(adt_const_params)]`
1616

17-
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
17+
error[E0015]: cannot call non-const fn `Foo::{constant#0}::Foo::<17_usize>::value` in constants
1818
--> $DIR/nested-type.rs:15:5
1919
|
2020
LL | Foo::<17>::value()
2121
| ^^^^^^^^^^^^^^^^^^
22+
|
23+
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
2224

2325
error: aborting due to 2 previous errors
2426

src/test/ui/const-generics/nested-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
1313
}
1414

1515
Foo::<17>::value()
16-
//~^ ERROR calls in constants are limited to constant functions
16+
//~^ ERROR cannot call non-const fn
1717
}]>;
1818

1919
fn main() {}

src/test/ui/consts/const-call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn f(x: usize) -> usize {
44

55
fn main() {
66
let _ = [0; f(2)];
7-
//~^ ERROR calls in constants are limited to constant functions
7+
//~^ ERROR cannot call non-const fn
88
}

src/test/ui/consts/const-call.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
1+
error[E0015]: cannot call non-const fn `f` in constants
22
--> $DIR/const-call.rs:6:17
33
|
44
LL | let _ = [0; f(2)];
55
| ^^^^
6+
|
7+
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
68

79
error: aborting due to previous error
810

src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern "C" {
77
const extern "C" fn bar() {
88
unsafe {
99
regular_in_block();
10-
//~^ ERROR: calls in constant functions
10+
//~^ ERROR: cannot call non-const fn
1111
}
1212
}
1313

@@ -16,7 +16,7 @@ extern "C" fn regular() {}
1616
const extern "C" fn foo() {
1717
unsafe {
1818
regular();
19-
//~^ ERROR: calls in constant functions
19+
//~^ ERROR: cannot call non-const fn
2020
}
2121
}
2222

0 commit comments

Comments
 (0)