mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-05 22:07:37 +03:00
Merge pull request #371 from dtolnay/coreprovider
Drop Provider API support in pre-1.81 nightlies
This commit is contained in:
commit
d14adfbb60
2 changed files with 3 additions and 3 deletions
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#![feature(error_generic_member_access)]
|
#![feature(error_generic_member_access)]
|
||||||
|
|
||||||
|
use core::error::{Error, Request};
|
||||||
use core::fmt::{self, Debug, Display};
|
use core::fmt::{self, Debug, Display};
|
||||||
use std::error::{Error, Request};
|
|
||||||
|
|
||||||
struct MyError(Thing);
|
struct MyError(Thing);
|
||||||
struct Thing;
|
struct Thing;
|
||||||
|
|
|
@ -143,7 +143,7 @@ fn impl_struct(input: Struct) -> TokenStream {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
quote! {
|
quote! {
|
||||||
fn provide<'_request>(&'_request self, #request: &mut ::std::error::Request<'_request>) {
|
fn provide<'_request>(&'_request self, #request: &mut ::core::error::Request<'_request>) {
|
||||||
#body
|
#body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ fn impl_enum(input: Enum) -> TokenStream {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Some(quote! {
|
Some(quote! {
|
||||||
fn provide<'_request>(&'_request self, #request: &mut ::std::error::Request<'_request>) {
|
fn provide<'_request>(&'_request self, #request: &mut ::core::error::Request<'_request>) {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
match self {
|
match self {
|
||||||
#(#arms)*
|
#(#arms)*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue