1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-07 11:49:40 +00:00

net-p2p/openethereum: Unbreak with Rust 1.53.0

error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> cargo-crates/logos-derive-0.7.7/src/lib.rs:55:20
    |
55  |             extras.insert(util::ident(&ext), |_| panic!("Only one #[extras] attribute can be declared."));
    |                    ^^^^^^ -----------------  ----------------------------------------------------------- supplied 2 arguments
    |                    |
    |                    expected 1 argument
    |

http://package23.nyi.freebsd.org/data/114i386-default-foo/2021-06-18_08h49m22s/logs/errors/openethereum-3.2.6.log

PR:		256653
This commit is contained in:
Tobias Kortkamp 2021-06-19 21:34:01 +02:00
parent db3e8fbceb
commit d6a24d4f9c
No known key found for this signature in database
GPG Key ID: A4F09FB73CC51F61
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,34 @@
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> cargo-crates/logos-derive-0.7.7/src/lib.rs:55:20
|
55 | extras.insert(util::ident(&ext), |_| panic!("Only one #[extras] attribute can be declared."));
| ^^^^^^ ----------------- ----------------------------------------------------------- supplied 2 arguments
| |
| expected 1 argument
|
--- cargo-crates/logos-derive-0.7.7/src/lib.rs.orig 2021-06-19 19:31:53 UTC
+++ cargo-crates/logos-derive-0.7.7/src/lib.rs
@@ -52,7 +52,7 @@ pub fn logos(input: TokenStream) -> TokenStream {
for attr in &item.attrs {
if let Some(ext) = value_from_attr("extras", attr) {
- extras.insert(util::ident(&ext), |_| panic!("Only one #[extras] attribute can be declared."));
+ extras.insert_or(util::ident(&ext), |_| panic!("Only one #[extras] attribute can be declared."));
}
}
@@ -86,11 +86,11 @@ pub fn logos(input: TokenStream) -> TokenStream {
let variant = &variant.ident;
if ident == "error" {
- error.insert(variant, |_| panic!("Only one #[error] variant can be declared."));
+ error.insert_or(variant, |_| panic!("Only one #[error] variant can be declared."));
}
if ident == "end" {
- end.insert(variant, |_| panic!("Only one #[end] variant can be declared."));
+ end.insert_or(variant, |_| panic!("Only one #[end] variant can be declared."));
}
if let Some(path) = value_from_attr("token", attr) {

View File

@ -0,0 +1,16 @@
--- cargo-crates/logos-derive-0.7.7/src/util.rs.orig 2021-06-19 20:26:00 UTC
+++ cargo-crates/logos-derive-0.7.7/src/util.rs
@@ -3,11 +3,11 @@ pub use proc_macro2::{Span, TokenTree};
use quote::quote;
pub trait OptionExt<T> {
- fn insert(&mut self, val: T, f: impl FnOnce(&T));
+ fn insert_or(&mut self, val: T, f: impl FnOnce(&T));
}
impl<T> OptionExt<T> for Option<T> {
- fn insert(&mut self, val: T, f: impl FnOnce(&T)) {
+ fn insert_or(&mut self, val: T, f: impl FnOnce(&T)) {
match self {
Some(t) => f(t),
slot => *slot = Some(val),