5 files changed +10
-88
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
2
- --> $DIR/coerce-issue-49593-box-never.rs:19 :5
2
+ --> $DIR/coerce-issue-49593-box-never.rs:18 :5
3
3
|
4
4
LL | Box::<_ /* ! */>::new(x)
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
Original file line number Diff line number Diff line change 1
1
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
2
- --> $DIR/coerce-issue-49593-box-never.rs:19 :5
2
+ --> $DIR/coerce-issue-49593-box-never.rs:18 :5
3
3
|
4
4
LL | Box::<_ /* ! */>::new(x)
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
6
6
|
7
7
= note: required for the cast from `Box<()>` to `Box<(dyn std::error::Error + 'static)>`
8
8
9
9
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
10
- --> $DIR/coerce-issue-49593-box-never.rs:24:49
10
+ --> $DIR/coerce-issue-49593-box-never.rs:24:5
11
11
|
12
- LL | /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x)
13
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
12
+ LL | raw_ptr_box::<_ /* ! */>(x)
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
14
14
|
15
15
= note: required for the cast from `*mut ()` to `*mut (dyn std::error::Error + 'static)`
16
16
Original file line number Diff line number Diff line change 1
1
//@ revisions: nofallback fallback
2
- //@ ignore-windows - the number of `Error` impls is platform-dependent
3
2
//@check-fail
4
3
5
4
#![ feature( never_type) ]
@@ -21,13 +20,14 @@ fn foo(x: !) -> Box<dyn Error> {
21
20
}
22
21
23
22
fn foo_raw_ptr ( x : !) -> * mut dyn Error {
24
- /* *mut $0 is coerced to *mut Error here */ raw_ptr_box :: < _ /* ! */ > ( x)
23
+ /* *mut $0 is coerced to *mut Error here */
24
+ raw_ptr_box :: < _ /* ! */ > ( x)
25
25
//[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied
26
26
}
27
27
28
28
fn no_coercion ( d : * mut dyn Error ) -> * mut dyn Error {
29
29
/* an unsize coercion won't compile here, and it is indeed not used
30
- because there is nothing requiring the _ to be Sized */
30
+ because there is nothing requiring the _ to be Sized */
31
31
d as * mut _
32
32
}
33
33
@@ -50,10 +50,9 @@ fn foo_no_never() {
50
50
first_iter = true ;
51
51
}
52
52
53
- let mut y : Option < S > = None ;
53
+ let mut y: Option < S > = None ;
54
54
// assert types are equal
55
55
mem:: swap ( & mut x, & mut y) ;
56
56
}
57
57
58
- fn main ( ) {
59
- }
58
+ fn main ( ) { }
0 commit comments