Skip to content

Commit af75871

Browse files
committed
update ui test since the new frontend is a bit more lenient
1 parent 2a4b0b7 commit af75871

File tree

2 files changed

+5
-57
lines changed

2 files changed

+5
-57
lines changed

tests/ui/autodiff/autodiff_illegal.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ fn f14(x: f32) -> Foo {
110110

111111
type MyFloat = f32;
112112

113-
// We would like to support type alias to f32/f64 in argument type in the future,
114-
// but that requires us to implement our checks at a later stage
115-
// like THIR which has type information available.
116-
#[autodiff_reverse(df15, Active, Active)]
117-
fn f15(x: MyFloat) -> f32 {
118-
//~^^ ERROR failed to resolve: use of undeclared type `MyFloat` [E0433]
119-
unimplemented!()
120-
}
121-
122113
// We would like to support type alias to f32/f64 in return type in the future
123114
#[autodiff_reverse(df16, Active, Active)]
124115
fn f16(x: f32) -> MyFloat {
@@ -136,13 +127,6 @@ fn f17(x: f64) -> F64Trans {
136127
unimplemented!()
137128
}
138129

139-
// We would like to support `#[repr(transparent)]` f32/f64 wrapper in argument type in the future
140-
#[autodiff_reverse(df18, Active, Active)]
141-
fn f18(x: F64Trans) -> f64 {
142-
//~^^ ERROR failed to resolve: use of undeclared type `F64Trans` [E0433]
143-
unimplemented!()
144-
}
145-
146130
// Invalid return activity
147131
#[autodiff_forward(df19, Dual, Active)]
148132
fn f19(x: f32) -> f32 {
@@ -163,11 +147,4 @@ fn f21(x: f32) -> f32 {
163147
unimplemented!()
164148
}
165149

166-
struct DoesNotImplDefault;
167-
#[autodiff_forward(df22, Dual)]
168-
pub fn f22() -> DoesNotImplDefault {
169-
//~^^ ERROR the function or associated item `default` exists for tuple `(DoesNotImplDefault, DoesNotImplDefault)`, but its trait bounds were not satisfied
170-
unimplemented!()
171-
}
172-
173150
fn main() {}

tests/ui/autodiff/autodiff_illegal.stderr

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -107,53 +107,24 @@ LL | #[autodiff_reverse(df13, Reverse)]
107107
| ^^^^^^^
108108

109109
error: invalid return activity Active in Forward Mode
110-
--> $DIR/autodiff_illegal.rs:147:1
110+
--> $DIR/autodiff_illegal.rs:131:1
111111
|
112112
LL | #[autodiff_forward(df19, Dual, Active)]
113113
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114114

115115
error: invalid return activity Dual in Reverse Mode
116-
--> $DIR/autodiff_illegal.rs:153:1
116+
--> $DIR/autodiff_illegal.rs:137:1
117117
|
118118
LL | #[autodiff_reverse(df20, Active, Dual)]
119119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120120

121121
error: invalid return activity Duplicated in Reverse Mode
122-
--> $DIR/autodiff_illegal.rs:160:1
122+
--> $DIR/autodiff_illegal.rs:144:1
123123
|
124124
LL | #[autodiff_reverse(df21, Active, Duplicated)]
125125
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126126

127-
error[E0433]: failed to resolve: use of undeclared type `MyFloat`
128-
--> $DIR/autodiff_illegal.rs:116:1
129-
|
130-
LL | #[autodiff_reverse(df15, Active, Active)]
131-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `MyFloat`
132-
133-
error[E0433]: failed to resolve: use of undeclared type `F64Trans`
134-
--> $DIR/autodiff_illegal.rs:140:1
135-
|
136-
LL | #[autodiff_reverse(df18, Active, Active)]
137-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `F64Trans`
138-
139-
error[E0599]: the function or associated item `default` exists for tuple `(DoesNotImplDefault, DoesNotImplDefault)`, but its trait bounds were not satisfied
140-
--> $DIR/autodiff_illegal.rs:167:1
141-
|
142-
LL | struct DoesNotImplDefault;
143-
| ------------------------- doesn't satisfy `DoesNotImplDefault: Default`
144-
LL | #[autodiff_forward(df22, Dual)]
145-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item cannot be called on `(DoesNotImplDefault, DoesNotImplDefault)` due to unsatisfied trait bounds
146-
|
147-
= note: the following trait bounds were not satisfied:
148-
`DoesNotImplDefault: Default`
149-
which is required by `(DoesNotImplDefault, DoesNotImplDefault): Default`
150-
help: consider annotating `DoesNotImplDefault` with `#[derive(Default)]`
151-
|
152-
LL + #[derive(Default)]
153-
LL | struct DoesNotImplDefault;
154-
|
155-
156-
error: aborting due to 21 previous errors
127+
error: aborting due to 18 previous errors
157128

158-
Some errors have detailed explanations: E0428, E0433, E0599, E0658.
129+
Some errors have detailed explanations: E0428, E0658.
159130
For more information about an error, try `rustc --explain E0428`.

0 commit comments

Comments
 (0)