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
fd1a263fc7029b06a8f041feadbcc85c65b0a6e8
rust/tests/ui/const-generics/invalid-constant-in-args.rs

7 lines
165 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("");
diagnostics: remove inconsistent English article "this" from E0107 Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.
2023-02-23 10:27:06 -07:00
//~^ ERROR 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: 2408ms Template: 5ms
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