@@ -10,7 +10,7 @@ LL | foo::<{ BAR + 3 }>();
10
10
| ^ ^
11
11
12
12
error: expressions must be enclosed in braces to be used as const generic arguments
13
- --> $DIR/const-expression-suggest-missing-braces.rs:18 :11
13
+ --> $DIR/const-expression-suggest-missing-braces.rs:19 :11
14
14
|
15
15
LL | foo::<3 + 3>();
16
16
| ^^^^^
@@ -21,7 +21,7 @@ LL | foo::<{ 3 + 3 }>();
21
21
| ^ ^
22
22
23
23
error: expected one of `,` or `>`, found `-`
24
- --> $DIR/const-expression-suggest-missing-braces.rs:21 :15
24
+ --> $DIR/const-expression-suggest-missing-braces.rs:22 :15
25
25
|
26
26
LL | foo::<BAR - 3>();
27
27
| ^ expected one of `,` or `>`
@@ -32,7 +32,7 @@ LL | foo::<{ BAR - 3 }>();
32
32
| ^ ^
33
33
34
34
error: expected one of `,` or `>`, found `-`
35
- --> $DIR/const-expression-suggest-missing-braces.rs:24 :15
35
+ --> $DIR/const-expression-suggest-missing-braces.rs:25 :15
36
36
|
37
37
LL | foo::<BAR - BAR>();
38
38
| ^ expected one of `,` or `>`
@@ -43,7 +43,7 @@ LL | foo::<{ BAR - BAR }>();
43
43
| ^ ^
44
44
45
45
error: expressions must be enclosed in braces to be used as const generic arguments
46
- --> $DIR/const-expression-suggest-missing-braces.rs:27 :11
46
+ --> $DIR/const-expression-suggest-missing-braces.rs:28 :11
47
47
|
48
48
LL | foo::<100 - BAR>();
49
49
| ^^^^^^^^^
@@ -54,7 +54,7 @@ LL | foo::<{ 100 - BAR }>();
54
54
| ^ ^
55
55
56
56
error: expected one of `,` or `>`, found `(`
57
- --> $DIR/const-expression-suggest-missing-braces.rs:30 :19
57
+ --> $DIR/const-expression-suggest-missing-braces.rs:31 :19
58
58
|
59
59
LL | foo::<bar<i32>()>();
60
60
| ^ expected one of `,` or `>`
@@ -65,7 +65,7 @@ LL | foo::<{ bar<i32>() }>();
65
65
| ^ ^
66
66
67
67
error: expected one of `,` or `>`, found `(`
68
- --> $DIR/const-expression-suggest-missing-braces.rs:33 :21
68
+ --> $DIR/const-expression-suggest-missing-braces.rs:34 :21
69
69
|
70
70
LL | foo::<bar::<i32>()>();
71
71
| ^ expected one of `,` or `>`
@@ -76,7 +76,7 @@ LL | foo::<{ bar::<i32>() }>();
76
76
| ^ ^
77
77
78
78
error: expected one of `,` or `>`, found `(`
79
- --> $DIR/const-expression-suggest-missing-braces.rs:36 :21
79
+ --> $DIR/const-expression-suggest-missing-braces.rs:37 :21
80
80
|
81
81
LL | foo::<bar::<i32>() + BAR>();
82
82
| ^ expected one of `,` or `>`
@@ -87,7 +87,7 @@ LL | foo::<{ bar::<i32>() + BAR }>();
87
87
| ^ ^
88
88
89
89
error: expected one of `,` or `>`, found `(`
90
- --> $DIR/const-expression-suggest-missing-braces.rs:39 :21
90
+ --> $DIR/const-expression-suggest-missing-braces.rs:40 :21
91
91
|
92
92
LL | foo::<bar::<i32>() - BAR>();
93
93
| ^ expected one of `,` or `>`
@@ -98,7 +98,7 @@ LL | foo::<{ bar::<i32>() - BAR }>();
98
98
| ^ ^
99
99
100
100
error: expected one of `,` or `>`, found `-`
101
- --> $DIR/const-expression-suggest-missing-braces.rs:42 :15
101
+ --> $DIR/const-expression-suggest-missing-braces.rs:43 :15
102
102
|
103
103
LL | foo::<BAR - bar::<i32>()>();
104
104
| ^ expected one of `,` or `>`
@@ -109,7 +109,7 @@ LL | foo::<{ BAR - bar::<i32>() }>();
109
109
| ^ ^
110
110
111
111
error: expected one of `,` or `>`, found `-`
112
- --> $DIR/const-expression-suggest-missing-braces.rs:45 :15
112
+ --> $DIR/const-expression-suggest-missing-braces.rs:46 :15
113
113
|
114
114
LL | foo::<BAR - bar::<i32>()>();
115
115
| ^ expected one of `,` or `>`
@@ -138,6 +138,8 @@ LL | foo::<BAR + BAR>();
138
138
| ^^^^^^^^^ help: use `dyn`: `dyn BAR + BAR`
139
139
|
140
140
= note: `#[warn(bare_trait_objects)]` on by default
141
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
142
+ = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
141
143
142
144
error[E0747]: type provided when a constant was expected
143
145
--> $DIR/const-expression-suggest-missing-braces.rs:11:11
0 commit comments