diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:32 +0000 |
commit | 4547b622d8d29df964fa2914213088b148c498fc (patch) | |
tree | 9fc6b25f3c3add6b745be9a2400a6e96140046e9 /src/test/ui/typeof | |
parent | Releasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz rustc-4547b622d8d29df964fa2914213088b148c498fc.zip |
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/typeof')
-rw-r--r-- | src/test/ui/typeof/issue-29184.rs | 3 | ||||
-rw-r--r-- | src/test/ui/typeof/issue-29184.stderr | 14 | ||||
-rw-r--r-- | src/test/ui/typeof/issue-42060.rs | 11 | ||||
-rw-r--r-- | src/test/ui/typeof/issue-42060.stderr | 32 |
4 files changed, 60 insertions, 0 deletions
diff --git a/src/test/ui/typeof/issue-29184.rs b/src/test/ui/typeof/issue-29184.rs new file mode 100644 index 000000000..c77e364c3 --- /dev/null +++ b/src/test/ui/typeof/issue-29184.rs @@ -0,0 +1,3 @@ +fn main() { + let x: typeof(92) = 92; //~ ERROR `typeof` is a reserved keyword +} diff --git a/src/test/ui/typeof/issue-29184.stderr b/src/test/ui/typeof/issue-29184.stderr new file mode 100644 index 000000000..75b6c64f2 --- /dev/null +++ b/src/test/ui/typeof/issue-29184.stderr @@ -0,0 +1,14 @@ +error[E0516]: `typeof` is a reserved keyword but unimplemented + --> $DIR/issue-29184.rs:2:12 + | +LL | let x: typeof(92) = 92; + | ^^^^^^^^^^ reserved keyword + | +help: consider replacing `typeof(...)` with an actual type + | +LL | let x: i32 = 92; + | ~~~ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0516`. diff --git a/src/test/ui/typeof/issue-42060.rs b/src/test/ui/typeof/issue-42060.rs new file mode 100644 index 000000000..1740b2383 --- /dev/null +++ b/src/test/ui/typeof/issue-42060.rs @@ -0,0 +1,11 @@ +fn main() { + let thing = (); + let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant + //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516] +} + +fn f(){ + let q = 1; + <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant + //~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516] +} diff --git a/src/test/ui/typeof/issue-42060.stderr b/src/test/ui/typeof/issue-42060.stderr new file mode 100644 index 000000000..effcbe4d7 --- /dev/null +++ b/src/test/ui/typeof/issue-42060.stderr @@ -0,0 +1,32 @@ +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/issue-42060.rs:3:23 + | +LL | let thing = (); + | --------- help: consider using `const` instead of `let`: `const thing` +LL | let other: typeof(thing) = thing; + | ^^^^^ non-constant value + +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/issue-42060.rs:9:13 + | +LL | let q = 1; + | ----- help: consider using `const` instead of `let`: `const q` +LL | <typeof(q)>::N + | ^ non-constant value + +error[E0516]: `typeof` is a reserved keyword but unimplemented + --> $DIR/issue-42060.rs:3:16 + | +LL | let other: typeof(thing) = thing; + | ^^^^^^^^^^^^^ reserved keyword + +error[E0516]: `typeof` is a reserved keyword but unimplemented + --> $DIR/issue-42060.rs:9:6 + | +LL | <typeof(q)>::N + | ^^^^^^^^^ reserved keyword + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0435, E0516. +For more information about an error, try `rustc --explain E0435`. |