Skip to content

Commit 610b7a3

Browse files
committed
cleaned up some tests
1 parent c57119b commit 610b7a3

12 files changed

+45
-79
lines changed

tests/ui/crate-name-attr-used.rs renamed to tests/ui/attributes/crate-name-attr-validation.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Checks proper validation of the `#![crate_name]` attribute.
2+
13
//@ run-pass
24
//@ compile-flags:--crate-name crate_name_attr_used -F unused-attributes
35

tests/ui/complex.rs

Lines changed: 0 additions & 38 deletions
This file was deleted.

tests/ui/constructor-lifetime-args.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/ui/auxiliary/crate-method-reexport-grrrrrrr2.rs renamed to tests/ui/cross-crate/auxiliary/method_reexport_aux.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#![crate_name="crate_method_reexport_grrrrrrr2"]
1+
//! Used by `tests/ui/cross-crate/cross-crate-method-reexport.rs`
2+
3+
#![crate_name="method_reexport_aux"]
24

35
pub use name_pool::add;
46

tests/ui/crate-method-reexport-grrrrrrr.rs renamed to tests/ui/cross-crate/cross-crate-method-reexport.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
// name_pool::methods impl in the other crate is reachable from this
55
// crate.
66

7-
//@ aux-build:crate-method-reexport-grrrrrrr2.rs
7+
//@ aux-build:method_reexport_aux.rs
88

9-
extern crate crate_method_reexport_grrrrrrr2;
9+
extern crate method_reexport_aux;
1010

1111
pub fn main() {
12-
use crate_method_reexport_grrrrrrr2::rust::add;
13-
use crate_method_reexport_grrrrrrr2::rust::cx;
12+
use method_reexport_aux::rust::add;
13+
use method_reexport_aux::rust::cx;
1414
let x: Box<_> = Box::new(());
1515
x.cx();
1616
let y = ();

tests/ui/conservative_impl_trait.rs renamed to tests/ui/diagnostic-width/impl-trait-invalid-iterator-error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// #39872, #39553
1+
//! Test for #39872 and #39553
22
33
fn will_ice(something: &u32) -> impl Iterator<Item = &u32> {
44
//~^ ERROR `()` is not an iterator

tests/ui/conservative_impl_trait.stderr renamed to tests/ui/diagnostic-width/impl-trait-invalid-iterator-error.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `()` is not an iterator
2-
--> $DIR/conservative_impl_trait.rs:3:33
2+
--> $DIR/impl-trait-invalid-iterator-error.rs:3:33
33
|
44
LL | fn will_ice(something: &u32) -> impl Iterator<Item = &u32> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator

tests/ui/crate-leading-sep.rs renamed to tests/ui/imports/global-path-resolution-drop.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Checks global path resolution of `mem::drop` using a leading `::`.
2+
13
//@ run-pass
24

35
#![allow(dropping_copy_types)]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//! Tests that all lifetime parameters in struct (`S`) and enum (`E`) constructors are
2+
//! treated as early bound, similar to associated items, rather than late bound as in manual
3+
//! constructors.
4+
5+
struct S<'a, 'b>(&'a u8, &'b u8);
6+
enum E<'a, 'b> {
7+
V(&'a u8),
8+
U(&'b u8),
9+
}
10+
11+
fn main() {
12+
S(&0, &0); // OK
13+
S::<'static>(&0, &0);
14+
//~^ ERROR struct takes 2 lifetime arguments
15+
S::<'static, 'static, 'static>(&0, &0);
16+
//~^ ERROR struct takes 2 lifetime arguments
17+
E::V(&0); // OK
18+
E::V::<'static>(&0);
19+
//~^ ERROR enum takes 2 lifetime arguments
20+
E::V::<'static, 'static, 'static>(&0);
21+
//~^ ERROR enum takes 2 lifetime arguments
22+
}

tests/ui/constructor-lifetime-args.stderr renamed to tests/ui/lifetimes/constructor-lifetime-early-binding-error.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0107]: struct takes 2 lifetime arguments but 1 lifetime argument was supplied
2-
--> $DIR/constructor-lifetime-args.rs:17:5
2+
--> $DIR/constructor-lifetime-early-binding-error.rs:15:5
33
|
44
LL | S::<'static>(&0, &0);
55
| ^ ------- supplied 1 lifetime argument
66
| |
77
| expected 2 lifetime arguments
88
|
99
note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
10-
--> $DIR/constructor-lifetime-args.rs:9:8
10+
--> $DIR/constructor-lifetime-early-binding-error.rs:7:8
1111
|
1212
LL | struct S<'a, 'b>(&'a u8, &'b u8);
1313
| ^ -- --
@@ -17,29 +17,29 @@ LL | S::<'static, 'static>(&0, &0);
1717
| +++++++++
1818

1919
error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
20-
--> $DIR/constructor-lifetime-args.rs:19:5
20+
--> $DIR/constructor-lifetime-early-binding-error.rs:17:5
2121
|
2222
LL | S::<'static, 'static, 'static>(&0, &0);
2323
| ^ --------- help: remove the lifetime argument
2424
| |
2525
| expected 2 lifetime arguments
2626
|
2727
note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
28-
--> $DIR/constructor-lifetime-args.rs:9:8
28+
--> $DIR/constructor-lifetime-early-binding-error.rs:7:8
2929
|
3030
LL | struct S<'a, 'b>(&'a u8, &'b u8);
3131
| ^ -- --
3232

3333
error[E0107]: enum takes 2 lifetime arguments but 1 lifetime argument was supplied
34-
--> $DIR/constructor-lifetime-args.rs:22:8
34+
--> $DIR/constructor-lifetime-early-binding-error.rs:20:8
3535
|
3636
LL | E::V::<'static>(&0);
3737
| ^ ------- supplied 1 lifetime argument
3838
| |
3939
| expected 2 lifetime arguments
4040
|
4141
note: enum defined here, with 2 lifetime parameters: `'a`, `'b`
42-
--> $DIR/constructor-lifetime-args.rs:10:6
42+
--> $DIR/constructor-lifetime-early-binding-error.rs:8:6
4343
|
4444
LL | enum E<'a, 'b> {
4545
| ^ -- --
@@ -49,15 +49,15 @@ LL | E::V::<'static, 'static>(&0);
4949
| +++++++++
5050

5151
error[E0107]: enum takes 2 lifetime arguments but 3 lifetime arguments were supplied
52-
--> $DIR/constructor-lifetime-args.rs:24:8
52+
--> $DIR/constructor-lifetime-early-binding-error.rs:22:8
5353
|
5454
LL | E::V::<'static, 'static, 'static>(&0);
5555
| ^ --------- help: remove the lifetime argument
5656
| |
5757
| expected 2 lifetime arguments
5858
|
5959
note: enum defined here, with 2 lifetime parameters: `'a`, `'b`
60-
--> $DIR/constructor-lifetime-args.rs:10:6
60+
--> $DIR/constructor-lifetime-early-binding-error.rs:8:6
6161
|
6262
LL | enum E<'a, 'b> {
6363
| ^ -- --

tests/ui/crate_type_flag.rs renamed to tests/ui/linking/crate-type-invalid-flag-error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Test for #70183 that --crate-type flag display valid value.
2+
13
//@ compile-flags: --crate-type dynlib
24

35
fn main() {}

0 commit comments

Comments
 (0)