diff options
| author | bors <bors@rust-lang.org> | 2023-05-29 03:04:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-29 03:04:06 +0000 |
| commit | dc0943d2eebf139e7e509882b803f77bfd25656d (patch) | |
| tree | f676e20f47d2b60f37c2828f39b2cfbcb29d0fc2 /tests/ui | |
| parent | f8447b963893b410f1dbce2cd752a898dc3ed8d4 (diff) | |
| parent | e71b3b3cfac1ea515bc3cf2a6495f9261f265f43 (diff) | |
| download | rust-dc0943d2eebf139e7e509882b803f77bfd25656d.tar.gz rust-dc0943d2eebf139e7e509882b803f77bfd25656d.zip | |
Auto merge of #112055 - matthiaskrgr:rollup-y3exx8c, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #112029 (Recover upon mistyped error on typo'd `const` in const param def) - #112037 (Add details about `unsafe_op_in_unsafe_fn` to E0133) - #112039 (compiler: update solaris/illumos to enable tsan support.) - #112042 (Migrate GUI colors test to original CSS color format) - #112045 (Followup to #111973) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/parser/typod-const-in-const-param-def.rs | 16 | ||||
| -rw-r--r-- | tests/ui/parser/typod-const-in-const-param-def.stderr | 46 |
2 files changed, 62 insertions, 0 deletions
diff --git a/tests/ui/parser/typod-const-in-const-param-def.rs b/tests/ui/parser/typod-const-in-const-param-def.rs new file mode 100644 index 00000000000..85d3ebba57a --- /dev/null +++ b/tests/ui/parser/typod-const-in-const-param-def.rs @@ -0,0 +1,16 @@ +pub fn foo<Const N: u8>() {} +//~^ ERROR `const` keyword was mistyped as `Const` + +pub fn bar<Const>() {} +// OK + +pub fn baz<Const N: u8, T>() {} +//~^ ERROR `const` keyword was mistyped as `Const` + +pub fn qux<T, Const N: u8>() {} +//~^ ERROR `const` keyword was mistyped as `Const` + +pub fn quux<T, Const N: u8, U>() {} +//~^ ERROR `const` keyword was mistyped as `Const` + +fn main() {} diff --git a/tests/ui/parser/typod-const-in-const-param-def.stderr b/tests/ui/parser/typod-const-in-const-param-def.stderr new file mode 100644 index 00000000000..75d73c6ea87 --- /dev/null +++ b/tests/ui/parser/typod-const-in-const-param-def.stderr @@ -0,0 +1,46 @@ +error: `const` keyword was mistyped as `Const` + --> $DIR/typod-const-in-const-param-def.rs:1:12 + | +LL | pub fn foo<Const N: u8>() {} + | ^^^^^ + | +help: use the `const` keyword + | +LL | pub fn foo<const N: u8>() {} + | ~~~~~ + +error: `const` keyword was mistyped as `Const` + --> $DIR/typod-const-in-const-param-def.rs:7:12 + | +LL | pub fn baz<Const N: u8, T>() {} + | ^^^^^ + | +help: use the `const` keyword + | +LL | pub fn baz<const N: u8, T>() {} + | ~~~~~ + +error: `const` keyword was mistyped as `Const` + --> $DIR/typod-const-in-const-param-def.rs:10:15 + | +LL | pub fn qux<T, Const N: u8>() {} + | ^^^^^ + | +help: use the `const` keyword + | +LL | pub fn qux<T, const N: u8>() {} + | ~~~~~ + +error: `const` keyword was mistyped as `Const` + --> $DIR/typod-const-in-const-param-def.rs:13:16 + | +LL | pub fn quux<T, Const N: u8, U>() {} + | ^^^^^ + | +help: use the `const` keyword + | +LL | pub fn quux<T, const N: u8, U>() {} + | ~~~~~ + +error: aborting due to 4 previous errors + |
