Skip to content

Commit 8c78e97

Browse files
committed
Use Cell instead of Vec in const-generics test
As `Cell` won't receive an allocator parameter, it is used. Otherwise a `#![feature(allocator_api)]` could have been added, but for the purpose of this test, changing the type is more clear.
1 parent 8725e4c commit 8c78e97

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
use std::cell::Cell;
2+
13
fn main() {
2-
let _: Vec<&str, "a"> = Vec::new();
4+
let _: Cell<&str, "a"> = Cell::new("");
35
//~^ ERROR wrong number of generic arguments
46
}

src/test/ui/const-generics/invalid-constant-in-args.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0107]: wrong number of generic arguments: expected 1, found 2
2-
--> $DIR/invalid-constant-in-args.rs:2:22
2+
--> $DIR/invalid-constant-in-args.rs:4:23
33
|
4-
LL | let _: Vec<&str, "a"> = Vec::new();
5-
| ^^^ unexpected const argument
4+
LL | let _: Cell<&str, "a"> = Cell::new("");
5+
| ^^^ unexpected const argument
66

77
error: aborting due to previous error
88

0 commit comments

Comments
 (0)