upsuper / delegate-attr Goto Github PK
View Code? Open in Web Editor NEWAttribute proc-macro to delegate method to a field
License: MIT License
Attribute proc-macro to delegate method to a field
License: MIT License
... which should use the given method
name instead for the generated code.
build error:
error[E0432]: unresolved import `proc_macro`
--> /tmp/portage/dev-lang/crulz-0.0.5/work/cargo_home/gentoo/delegate-attr-0.2.6/src/lib.rs:116:5
|
116 | use proc_macro::TokenStream as RawTokenStream;
| ^^^^^^^^^^ help: a similar path exists: `syn::proc_macro`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.
error: could not compile `delegate-attr`.
Caused by:
process didn't exit successfully: `rustc --edition=2018 --crate-name delegate_attr /tmp/portage/dev-lang/crulz-0.0.5/work/cargo_home/gentoo/delegate-attr-0.2.6/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C metadata=7b1e9c1e249b7558 -C extra-filename=-7b1e9c1e249b7558 --out-dir /tmp/portage/dev-lang/crulz-0.0.5/work/crulz-0.0.5/target/release/deps -L dependency=/tmp/portage/dev-lang/crulz-0.0.5/work/crulz-0.0.5/target/release/deps --extern proc_macro2=/tmp/portage/dev-lang/crulz-0.0.5/work/crulz-0.0.5/target/release/deps/libproc_macro2-2e08b6645d18456d.rlib --extern quote=/tmp/portage/dev-lang/crulz-0.0.5/work/crulz-0.0.5/target/release/deps/libquote-e2b461bbf4d433e3.rlib --extern syn=/tmp/portage/dev-lang/crulz-0.0.5/work/crulz-0.0.5/target/release/deps/libsyn-b19198c7b97e7587.rlib --cap-lints allow` (exit code: 1)
This may be fixed with (at the top of lib.rs
):
extern crate proc_macro;
This crate doesn't seem to work for implementing traits with methods returning Self, because of mistmatched types, expecting the same type for the self parameter and for the output.
Do you think a fix is possible so that it can return the inner type in that case?
... which should add an .into()
to the generated code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.