Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
58e901b6fd1163172149fd422565523b17eed5f0
rust/tests/ui/const-generics/invalid-constant-in-args.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
170 B
Rust
Raw Normal View History

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.
2020-11-18 19:31:59 +01:00
use std::cell::Cell;
Add a test for invalid const arguments
2019-03-07 23:39:01 +00:00
fn main() {
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.
2020-11-18 19:31:59 +01:00
let _: Cell<&str, "a"> = Cell::new("");
Rework diagnostics for wrong number of generic args
2021-01-02 19:45:11 +01:00
//~^ ERROR this struct takes 1 generic argument but 2 generic arguments were supplied
Add a test for invalid const arguments
2019-03-07 23:39:01 +00:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1596ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API