File tree 12 files changed +43
-9
lines changed
12 files changed +43
-9
lines changed Original file line number Diff line number Diff line change 1
1
error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/E0435.rs:3:17
3
3
|
4
+ LL | let foo = 42u32;
5
+ | --- help: consider using `const` instead of `let`
4
6
LL | let _: [u8; foo];
5
7
| ^^^ non-constant value
6
8
Original file line number Diff line number Diff line change @@ -2,25 +2,33 @@ error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/bindings.rs:5:29
3
3
|
4
4
LL | const foo: impl Clone = x;
5
- | ^ non-constant value
5
+ | --- ^ non-constant value
6
+ | |
7
+ | help: consider using `let` instead of `const`
6
8
7
9
error[E0435]: attempt to use a non-constant value in a constant
8
10
--> $DIR/bindings.rs:11:33
9
11
|
10
12
LL | const foo: impl Clone = x;
11
- | ^ non-constant value
13
+ | --- ^ non-constant value
14
+ | |
15
+ | help: consider using `let` instead of `const`
12
16
13
17
error[E0435]: attempt to use a non-constant value in a constant
14
18
--> $DIR/bindings.rs:18:33
15
19
|
16
20
LL | const foo: impl Clone = x;
17
- | ^ non-constant value
21
+ | --- ^ non-constant value
22
+ | |
23
+ | help: consider using `let` instead of `const`
18
24
19
25
error[E0435]: attempt to use a non-constant value in a constant
20
26
--> $DIR/bindings.rs:25:33
21
27
|
22
28
LL | const foo: impl Clone = x;
23
- | ^ non-constant value
29
+ | --- ^ non-constant value
30
+ | |
31
+ | help: consider using `let` instead of `const`
24
32
25
33
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
26
34
--> $DIR/bindings.rs:1:12
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-27433.rs:3:23
3
3
|
4
4
LL | const FOO : u32 = foo;
5
- | ^^^ non-constant value
5
+ | --- ^^^ non-constant value
6
+ | |
7
+ | help: consider using `let` instead of `const`
6
8
7
9
error: aborting due to previous error
8
10
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-3521-2.rs:4:23
3
3
|
4
4
LL | static y: isize = foo + 1;
5
- | ^^^ non-constant value
5
+ | - ^^^ non-constant value
6
+ | |
7
+ | help: consider using `let` instead of `static`
6
8
7
9
error: aborting due to previous error
8
10
Original file line number Diff line number Diff line change 1
1
error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-3521.rs:6:15
3
3
|
4
+ LL | let foo = 100;
5
+ | --- help: consider using `const` instead of `let`
6
+ ...
4
7
LL | Bar = foo
5
8
| ^^^ non-constant value
6
9
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-3668-2.rs:2:27
3
3
|
4
4
LL | static child: isize = x + 1;
5
- | ^ non-constant value
5
+ | ----- ^ non-constant value
6
+ | |
7
+ | help: consider using `let` instead of `static`
6
8
7
9
error: aborting due to previous error
8
10
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-3668.rs:8:34
3
3
|
4
4
LL | static childVal: Box<P> = self.child.get();
5
- | ^^^^ non-constant value
5
+ | -------- ^^^^ non-constant value
6
+ | |
7
+ | help: consider using `let` instead of `static`
6
8
7
9
error: aborting due to previous error
8
10
Original file line number Diff line number Diff line change 1
1
error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-42060.rs:3:23
3
3
|
4
+ LL | let thing = ();
5
+ | ----- help: consider using `const` instead of `let`
4
6
LL | let other: typeof(thing) = thing;
5
7
| ^^^^^ non-constant value
6
8
7
9
error[E0435]: attempt to use a non-constant value in a constant
8
10
--> $DIR/issue-42060.rs:9:13
9
11
|
12
+ LL | let q = 1;
13
+ | - help: consider using `const` instead of `let`
10
14
LL | <typeof(q)>::N
11
15
| ^ non-constant value
12
16
Original file line number Diff line number Diff line change 1
1
error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/issue-44239.rs:6:26
3
3
|
4
+ LL | let n = 0;
5
+ | - help: consider using `const` instead of `let`
6
+ ...
4
7
LL | const N: usize = n;
5
8
| ^ non-constant value
6
9
Original file line number Diff line number Diff line change 1
1
error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/non-constant-expr-for-arr-len.rs:5:22
3
3
|
4
+ LL | fn bar(n: usize) {
5
+ | - help: consider using `const` instead of `let`
4
6
LL | let _x = [0; n];
5
7
| ^ non-constant value
6
8
Original file line number Diff line number Diff line change 1
1
error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/repeat_count.rs:5:17
3
3
|
4
+ LL | let n = 1;
5
+ | - help: consider using `const` instead of `let`
4
6
LL | let a = [0; n];
5
7
| ^ non-constant value
6
8
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ error[E0435]: attempt to use a non-constant value in a constant
2
2
--> $DIR/type-dependent-def-issue-49241.rs:3:22
3
3
|
4
4
LL | const l: usize = v.count();
5
- | ^ non-constant value
5
+ | - ^ non-constant value
6
+ | |
7
+ | help: consider using `let` instead of `const`
6
8
7
9
error: aborting due to previous error
8
10
You can’t perform that action at this time.
0 commit comments