Specify types where the manual vtable relies on them

This commit is contained in:
David Tolnay 2019-10-27 16:07:30 -07:00
parent a2846fd345
commit b261a64e48
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -44,7 +44,7 @@ impl Error {
where
M: Display + Debug + Send + Sync + 'static,
{
let error = MessageError(message);
let error: MessageError<M> = MessageError(message);
let vtable = &ErrorVTable {
object_drop: object_drop::<MessageError<M>>,
object_drop_front: object_drop_front::<MessageError<M>>,
@ -63,7 +63,7 @@ impl Error {
where
M: Display + Send + Sync + 'static,
{
let error = DisplayError(message);
let error: DisplayError<M> = DisplayError(message);
let vtable = &ErrorVTable {
object_drop: object_drop::<DisplayError<M>>,
object_drop_front: object_drop_front::<DisplayError<M>>,
@ -167,7 +167,7 @@ impl Error {
where
C: Display + Send + Sync + 'static,
{
let error = ContextError {
let error: ContextError<C, Error> = ContextError {
context,
error: self,
};