diff --git a/src/test/ui/issues/issue-54348.rs b/src/test/ui/issues/issue-54348.rs new file mode 100644 index 0000000000000..b980290391d3a --- /dev/null +++ b/src/test/ui/issues/issue-54348.rs @@ -0,0 +1,5 @@ +fn main() { + [1][0u64 as usize]; + [1][1.5 as usize]; // ERROR index out of bounds + [1][1u64 as usize]; // ERROR index out of bounds +} diff --git a/src/test/ui/issues/issue-54348.stderr b/src/test/ui/issues/issue-54348.stderr new file mode 100644 index 0000000000000..a9f1b4942584d --- /dev/null +++ b/src/test/ui/issues/issue-54348.stderr @@ -0,0 +1,16 @@ +error: index out of bounds: the len is 1 but the index is 1 + --> $DIR/issue-54348.rs:3:5 + | +LL | [1][1.5 as usize]; // ERROR index out of bounds + | ^^^^^^^^^^^^^^^^^ + | + = note: #[deny(const_err)] on by default + +error: index out of bounds: the len is 1 but the index is 1 + --> $DIR/issue-54348.rs:4:5 + | +LL | [1][1u64 as usize]; // ERROR index out of bounds + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/issues/issue-55587.rs b/src/test/ui/issues/issue-55587.rs new file mode 100644 index 0000000000000..8b78749f6529a --- /dev/null +++ b/src/test/ui/issues/issue-55587.rs @@ -0,0 +1,5 @@ +use std::path::Path; + +fn main() { + let Path::new(); //~ ERROR expected tuple struct/variant +} diff --git a/src/test/ui/issues/issue-55587.stderr b/src/test/ui/issues/issue-55587.stderr new file mode 100644 index 0000000000000..876fb4391b1bc --- /dev/null +++ b/src/test/ui/issues/issue-55587.stderr @@ -0,0 +1,9 @@ +error[E0164]: expected tuple struct/variant, found method `::new` + --> $DIR/issue-55587.rs:4:9 + | +LL | let Path::new(); //~ ERROR expected tuple struct/variant + | ^^^^^^^^^^^ not a tuple variant or struct + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0164`.