-
Notifications
You must be signed in to change notification settings - Fork 17
function register
is private
#54
Comments
try replacing this: let mut registry = syntex::Registry::new(); with this in your build.rs build script: serde_codegen::expand(&src, &dst).unwrap(); |
@andete i already do this. |
This is the lib file from quasi_macros 0.15 in question: #![feature(plugin_registrar, unboxed_closures, rustc_private)]
#![cfg_attr(feature = "unstable-testing", feature(plugin))]
#![cfg_attr(feature = "unstable-testing", plugin(clippy))]
extern crate quasi_codegen;
extern crate rustc_plugin;
#[plugin_registrar]
#[doc(hidden)]
pub fn plugin_registrar(reg: &mut rustc_plugin::Registry) {
quasi_codegen::register(reg);
} |
I think it ends up calling the wrong "register" function in quasi_codegen, I wonder if there is a typo in some of the feature stuff that seems to be used for conditional compilation. |
I wonder if this happens if you have different libraries that all want to use quasi and some use codegen and some do not. |
That could very well be it. |
I bet it's this. You can try using |
Does this mean mixing of different quasi modes is not supported? |
AFAIK Cargo does not support multiple dependencies on the same version with different features. |
So it seems to be caused by different settings. If I force all crates to use codegen it works. I wonder why this was not an issue before though :-/ |
I have a main library, A, that uses serde_json. A uses B, which also uses serde_json.
[features]
b = { git = "...", default-features = false }
|
The problem is that this requires all libraries to agree on how to use serde some of which might be out of my control. |
Yes, it would be nicer if it could somehow play nice together. |
Is there any resolution for this issue? |
serde-rs/serde#543 is tracking a resolution of this issue across the ecosystem. |
Using
|
For my problem, that's weird because the compiler tells me that is the This is a list of my dependencies:
A quick search in my
I tried a lot of time to clean and build again my project but I still got this problem... |
@k0pernicus serde_macros is not supported any more, which is why the last release (6 weeks old at this point) is pulling in an old quasi. Can you see whether the problem goes away when using serde_derive instead of serde_macros? See this forum topic for the relevant announcement. |
Ok, it's seems ok now, but I used |
Update: I found a solution using Thanks a lot @dtolnay |
Yes, serde_derive is that plugin. Look at the forum topic I linked to or serde docs for how to set it up. You shouldn't need |
Hey currently I tried to fix this issue by removing serde_derive from my Cargo.toml, and I now have this - [dependencies]
serde = "0.8.*"
serde_xml = "0.8.*"
serde_derive = "0.8.*"
futures = "0.1"
tokio-core = "0.1"
env_logger = "0.3" Which fails to compile with this - (When compiling serde_derive) I've been tearing my hair our trying to figure this out :s. |
@colindjk you need to run |
@dtolnay Welp actually just fixed it earlier by removing my Cargo.lock... it's been a long week XD. I suppose I'll leave it there in case someone makes a simple mistake like that. Thanks. |
This happened after a recent upgrade:
The text was updated successfully, but these errors were encountered: