cleaned up some tests

This commit is contained in:
Kivooeo 2025-06-07 16:17:21 +05:00
parent c57119b9a1
commit 85ce9ee481
10 changed files with 18 additions and 19 deletions

View file

@ -1,3 +1,5 @@
//! Checks error handling for undefined custom attributes.
#![feature(stmt_expr_attributes)]
#[foo] //~ ERROR cannot find attribute `foo` in this scope

View file

@ -1,17 +1,17 @@
error: cannot find attribute `foo` in this scope
--> $DIR/custom_attribute.rs:3:3
--> $DIR/attr_unknown_custom_attr.rs:5:3
|
LL | #[foo]
| ^^^
error: cannot find attribute `foo` in this scope
--> $DIR/custom_attribute.rs:5:7
--> $DIR/attr_unknown_custom_attr.rs:7:7
|
LL | #[foo]
| ^^^
error: cannot find attribute `foo` in this scope
--> $DIR/custom_attribute.rs:7:7
--> $DIR/attr_unknown_custom_attr.rs:9:7
|
LL | #[foo]
| ^^^

View file

@ -1,3 +1,5 @@
//! Checks error handling for mismatched `--crate-name` and `#![crate_name]` values.
//@ compile-flags: --crate-name foo
#![crate_name = "bar"]

View file

@ -1,5 +1,5 @@
error: `--crate-name` and `#[crate_name]` are required to match, but `foo` != `bar`
--> $DIR/crate-name-mismatch.rs:3:1
--> $DIR/crate-name-mismatch.rs:5:1
|
LL | #![crate_name = "bar"]
| ^^^^^^^^^^^^^^^^^^^^^^

View file

@ -1,4 +1,4 @@
// Unresolved multi-segment attributes are not treated as custom.
//! Unresolved multi-segment attributes are not treated as custom.
mod existent {}

View file

@ -1,5 +1,5 @@
error[E0433]: failed to resolve: could not find `nonexistent` in `existent`
--> $DIR/custom-attribute-multisegment.rs:5:13
--> $DIR/custom_attr_multisegment_error.rs:5:13
|
LL | #[existent::nonexistent]
| ^^^^^^^^^^^ could not find `nonexistent` in `existent`

View file

@ -1,7 +0,0 @@
//@ check-pass
trait Foo {
fn m(&self, _:isize) { }
}
pub fn main() { }

View file

@ -1,3 +1,5 @@
//! Checks deep recursion behavior.
//@ run-pass
//@ ignore-emscripten apparently blows the stack

View file

@ -1,3 +1,5 @@
//! Checks run with a custom test framework and indexed test functions.
//@ compile-flags: --test
//@ run-pass

View file

@ -1,6 +1,6 @@
//@ run-pass
//! Checks basic default method functionality.
#![allow(dead_code)]
//@ run-pass
trait Foo {
fn f(&self) {
@ -10,9 +10,7 @@ trait Foo {
fn g(&self);
}
struct A {
x: isize
}
struct A;
impl Foo for A {
fn g(&self) {
@ -21,6 +19,6 @@ impl Foo for A {
}
pub fn main() {
let a = A { x: 1 };
let a = A;
a.f();
}