Skip to content

Commit 4043d90

Browse files
committed
Update pointee tests
1 parent d05c2fc commit 4043d90

4 files changed

+47
-50
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
#![feature(derive_smart_pointer)]
22

33
#[pointee]
4-
//~^ ERROR: attribute should be applied to generic type parameters
4+
//~^ ERROR: cannot find attribute `pointee` in this scope
55
struct AStruct<
66
#[pointee]
7-
//~^ ERROR: attribute should be applied to generic type parameters
7+
//~^ ERROR: cannot find attribute `pointee` in this scope
88
'lifetime,
99
#[pointee]
10-
//~^ ERROR: attribute should be applied to generic type parameters
10+
//~^ ERROR: cannot find attribute `pointee` in this scope
1111
const CONST: usize
1212
> {
1313
#[pointee]
14-
//~^ ERROR: attribute should be applied to generic type parameters
14+
//~^ ERROR: cannot find attribute `pointee` in this scope
1515
val: &'lifetime ()
1616
}
1717

1818
#[pointee]
19-
//~^ ERROR: attribute should be applied to generic type parameters
19+
//~^ ERROR: cannot find attribute `pointee` in this scope
2020
enum AnEnum {
2121
#[pointee]
22-
//~^ ERROR: attribute should be applied to generic type parameters
22+
//~^ ERROR: cannot find attribute `pointee` in this scope
2323
AVariant
2424
}
2525

2626
#[pointee]
27-
//~^ ERROR: attribute should be applied to generic type parameters
28-
mod AModule {}
27+
//~^ ERROR: cannot find attribute `pointee` in this scope
28+
mod a_module {}
2929

3030
#[pointee]
31-
//~^ ERROR: attribute should be applied to generic type parameters
31+
//~^ ERROR: cannot find attribute `pointee` in this scope
3232
fn a_function(
3333
) {}
3434

35+
type AType<#[pointee] T> = T; //~ ERROR: cannot find attribute `pointee` in this scope
36+
3537
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
1-
error: attribute should be applied to generic type parameters
2-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:3:1
1+
error: cannot find attribute `pointee` in this scope
2+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:35:14
3+
|
4+
LL | type AType<#[pointee] T> = T;
5+
| ^^^^^^^
6+
7+
error: cannot find attribute `pointee` in this scope
8+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:30:3
39
|
410
LL | #[pointee]
5-
| ^^^^^^^^^^
11+
| ^^^^^^^
612

7-
error: attribute should be applied to generic type parameters
8-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:6:5
13+
error: cannot find attribute `pointee` in this scope
14+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:26:3
915
|
10-
LL | #[pointee]
11-
| ^^^^^^^^^^
16+
LL | #[pointee]
17+
| ^^^^^^^
1218

13-
error: attribute should be applied to generic type parameters
14-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:9:5
19+
error: cannot find attribute `pointee` in this scope
20+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:18:3
1521
|
16-
LL | #[pointee]
17-
| ^^^^^^^^^^
22+
LL | #[pointee]
23+
| ^^^^^^^
1824

19-
error: attribute should be applied to generic type parameters
20-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:13:5
25+
error: cannot find attribute `pointee` in this scope
26+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:21:7
2127
|
2228
LL | #[pointee]
23-
| ^^^^^^^^^^
29+
| ^^^^^^^
2430

25-
error: attribute should be applied to generic type parameters
26-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:18:1
31+
error: cannot find attribute `pointee` in this scope
32+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:3:3
2733
|
2834
LL | #[pointee]
29-
| ^^^^^^^^^^
35+
| ^^^^^^^
3036

31-
error: attribute should be applied to generic type parameters
32-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:21:5
37+
error: cannot find attribute `pointee` in this scope
38+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:6:7
3339
|
3440
LL | #[pointee]
35-
| ^^^^^^^^^^
41+
| ^^^^^^^
3642

37-
error: attribute should be applied to generic type parameters
38-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:26:1
43+
error: cannot find attribute `pointee` in this scope
44+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:9:7
3945
|
40-
LL | #[pointee]
41-
| ^^^^^^^^^^
46+
LL | #[pointee]
47+
| ^^^^^^^
4248

43-
error: attribute should be applied to generic type parameters
44-
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:30:1
49+
error: cannot find attribute `pointee` in this scope
50+
--> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:13:7
4551
|
46-
LL | #[pointee]
47-
| ^^^^^^^^^^
52+
LL | #[pointee]
53+
| ^^^^^^^
4854

49-
error: aborting due to 8 previous errors
55+
error: aborting due to 9 previous errors
5056

tests/ui/feature-gates/feature-gate-derive-smart-pointer.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::marker::SmartPointer; //~ ERROR use of unstable library feature 'derive
33
#[derive(SmartPointer)] //~ ERROR use of unstable library feature 'derive_smart_pointer'
44
#[repr(transparent)]
55
struct MyPointer<'a, #[pointee] T: ?Sized> {
6-
//~^ ERROR the `#[pointee]` attribute is an experimental feature
76
ptr: &'a T,
87
}
98

tests/ui/feature-gates/feature-gate-derive-smart-pointer.stderr

+1-11
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ LL | #[derive(SmartPointer)]
88
= help: add `#![feature(derive_smart_pointer)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

11-
error[E0658]: the `#[pointee]` attribute is an experimental feature
12-
--> $DIR/feature-gate-derive-smart-pointer.rs:5:22
13-
|
14-
LL | struct MyPointer<'a, #[pointee] T: ?Sized> {
15-
| ^^^^^^^^^^
16-
|
17-
= note: see issue #123430 <https://github.com/rust-lang/rust/issues/123430> for more information
18-
= help: add `#![feature(derive_smart_pointer)]` to the crate attributes to enable
19-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20-
2111
error[E0658]: use of unstable library feature 'derive_smart_pointer'
2212
--> $DIR/feature-gate-derive-smart-pointer.rs:1:5
2313
|
@@ -28,6 +18,6 @@ LL | use std::marker::SmartPointer;
2818
= help: add `#![feature(derive_smart_pointer)]` to the crate attributes to enable
2919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3020

31-
error: aborting due to 3 previous errors
21+
error: aborting due to 2 previous errors
3222

3323
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)