google / rustcxx Goto Github PK
View Code? Open in Web Editor NEWrustcxx: Using C++ from Rust made easy
License: Apache License 2.0
rustcxx: Using C++ from Rust made easy
License: Apache License 2.0
I cloned your Repository and tried to compile the example but i got this:
[jan@helium example]$ cargo build
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling rustcxx_common v0.1.0 (file:///home/jan/Uni/Bachelorarbeit/Programme/rustcxx/common)
Compiling gcc v0.3.54
error[E0432]: unresolved import `syntax::abi`
--> common/lib.rs:27:13
|
27 | use syntax::abi::Abi;
| ^^^ Could not find `abi` in `syntax`
error[E0432]: unresolved import `syntax::codemap::spanned`
--> common/lib.rs:29:61
|
29 | use syntax::codemap::{Span, Spanned, dummy_spanned, respan, spanned, DUMMY_SP};
| ^^^^^^^ no `spanned` in `codemap`. Did you mean to use `Spanned`?
error[E0432]: unresolved import `syntax::parse::common`
--> common/lib.rs:35:20
|
35 | use syntax::parse::common::SeqSep;
| ^^^^^^ Could not find `common` in `parse`
error[E0412]: cannot find type `SpannedIdent` in module `ast`
--> common/lib.rs:52:40
|
52 | ident: ast::SpannedIdent) -> PResult<'a, Self::ArgValue>;
| ^^^^^^^^^^^^ not found in `ast`
error[E0412]: cannot find type `SpannedIdent` in module `ast`
--> common/lib.rs:68:40
|
68 | ident: ast::SpannedIdent) -> PResult<'a, Self::ArgValue> {
| ^^^^^^^^^^^^ not found in `ast`
error[E0412]: cannot find type `SpannedIdent` in module `ast`
--> common/lib.rs:97:40
|
97 | ident: ast::SpannedIdent) -> PResult<'a, Self::ArgValue> {
| ^^^^^^^^^^^^ not found in `ast`
error[E0412]: cannot find type `SpannedIdent` in module `ast`
--> common/lib.rs:212:21
|
212 | pub ident: ast::SpannedIdent,
| ^^^^^^^^^^^^ not found in `ast`
error[E0425]: cannot find function `intern` in module `token`
--> common/lib.rs:342:57
|
342 | let no_mangle = ecx.meta_word(self.span, token::intern("no_mangle").as_str());
| ^^^^^^ not found in `token`
error[E0425]: cannot find function `intern` in module `token`
--> common/lib.rs:348:20
|
348 | token::intern("deny").as_str(),
| ^^^^^^ not found in `token`
error[E0425]: cannot find function `intern` in module `token`
--> common/lib.rs:349:60
|
349 | vec![ecx.meta_list_item_word(self.span, token::intern("private_no_mangle_fns").as_str())]);
| ^^^^^^ not found in `token`
warning: use of deprecated item 'std::hash::SipHasher': use `std::collections::hash_map::DefaultHasher` instead
--> common/lib.rs:24:17
|
24 | use std::hash::{SipHasher, Hash, Hasher};
| ^^^^^^^^^
|
= note: #[warn(deprecated)] on by default
warning: use of deprecated item 'std::hash::SipHasher': use `std::collections::hash_map::DefaultHasher` instead
--> common/lib.rs:135:30
|
135 | let mut hasher = SipHasher::new();
| ^^^^^^^^^^^^^^
error[E0624]: method `check` is private
--> common/lib.rs:71:27
|
71 | while !parser.check(&token::Comma) &&
| ^^^^^
error[E0624]: method `check` is private
--> common/lib.rs:72:27
|
72 | !parser.check(&token::CloseDelim(token::Paren)) {
| ^^^^^
error[E0624]: method `parse_token_tree` is private
--> common/lib.rs:73:41
|
73 | tokens.push(try!(parser.parse_token_tree()));
| ^^^^^^^^^^^^^^^^
error[E0624]: method `parse_token_tree` is private
--> common/lib.rs:92:29
|
92 | |parser| parser.parse_token_tree())
| ^^^^^^^^^^^^^^^^
error[E0624]: method `check` is private
--> common/lib.rs:120:30
|
120 | let args = if parser.check(&token::OpenDelim(token::Paren)) {
| ^^^^^
error[E0624]: method `check` is private
--> common/lib.rs:126:50
|
126 | let ret_ty = if args.is_some() && parser.check(&token::RArrow) {
| ^^^^^
warning: use of deprecated item 'std::hash::SipHasher::new': use `std::collections::hash_map::DefaultHasher` instead
--> common/lib.rs:135:30
|
135 | let mut hasher = SipHasher::new();
| ^^^^^^^^^^^^^^
error[E0624]: method `parse_unspanned_seq` is private
--> common/lib.rs:153:16
|
153 | parser.parse_unspanned_seq(
| ^^^^^^^^^^^^^^^^^^^
error[E0599]: no associated item named `Inherited` found for type `syntax::codemap::Spanned<syntax::ast::VisibilityKind>` in the current scope
--> common/lib.rs:189:18
|
189 | vis: ast::Visibility::Inherited,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ associated item not found in `syntax::codemap::Spanned<syntax::ast::VisibilityKind>`
error[E0615]: attempted to take value of method `lo` on type `syntax::codemap::Span`
--> common/lib.rs:221:34
|
221 | let lo = parser.span.lo;
| ^^
|
= help: maybe a `()` to call it is missing?
error[E0615]: attempted to take value of method `lo` on type `syntax::codemap::Span`
--> common/lib.rs:223:34
|
223 | let hi = parser.span.lo;
| ^^
|
= help: maybe a `()` to call it is missing?
error[E0061]: this function takes 4 parameters but 6 parameters were supplied
--> common/lib.rs:356:23
|
356 | let fn_item = ast::ItemKind::Fn(
| _______________________^
357 | | decl, ast::Unsafety::Unsafe, dummy_spanned(ast::Constness::NotConst),
358 | | Abi::C, ast::Generics::default(), self.body.clone());
| |________________________________________________________________^ expected 4 parameters
error[E0599]: no associated item named `Public` found for type `syntax::codemap::Spanned<syntax::ast::VisibilityKind>` in the current scope
--> common/lib.rs:365:18
|
365 | vis: ast::Visibility::Public,
| ^^^^^^^^^^^^^^^^^^^^^^^ associated item not found in `syntax::codemap::Spanned<syntax::ast::VisibilityKind>`
error[E0063]: missing field `tokens` in initializer of `syntax::ast::Item`
--> common/lib.rs:360:11
|
360 | P(ast::Item {
| ^^^^^^^^^ missing `tokens`
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
--> common/lib.rs:382:40
|
382 | (Some(&TokenTree::Token(_, token::Ident(ident))),
| ^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 1
error[E0599]: no variant named `Sequence` found for type `syntax::tokenstream::TokenTree` in the current scope
--> common/lib.rs:401:20
|
401 | (Some(&TokenTree::Sequence(..)), _, _) => unimplemented!(),
| ^^^^^^^^^^^^^^^^^^^^^^^ variant not found in `syntax::tokenstream::TokenTree`
error[E0308]: mismatched types
--> common/lib.rs:387:39
|
387 | result.extend(f(span, &contents.tts));
| ^^^^^^^^^^^^^ expected slice, found struct `syntax::tokenstream::ThinTokenStream`
|
= note: expected type `&[syntax::tokenstream::TokenTree]`
found type `&syntax::tokenstream::ThinTokenStream`
error[E0609]: no field `open_span` on type `&syntax::tokenstream::Delimited`
--> common/lib.rs:392:45
|
392 | result.push(respan(contents.open_span, token_to_string(&contents.open_token())));
| ^^^^^^^^^
error[E0308]: mismatched types
--> common/lib.rs:393:48
|
393 | result.extend(parse_rust_macro(&contents.tts, f));
| ^^^^^^^^^^^^^ expected slice, found struct `syntax::tokenstream::ThinTokenStream`
|
= note: expected type `&[syntax::tokenstream::TokenTree]`
found type `&syntax::tokenstream::ThinTokenStream`
error[E0609]: no field `close_span` on type `&syntax::tokenstream::Delimited`
--> common/lib.rs:394:45
|
394 | result.push(respan(contents.close_span, token_to_string(&contents.close_token())));
| ^^^^^^^^^^
error[E0599]: no variant named `Sequence` found for type `syntax::tokenstream::TokenTree` in the current scope
--> common/lib.rs:430:14
|
430 | &TokenTree::Sequence(..) => unimplemented!()
| ^^^^^^^^^^^^^^^^^^^^^^^ variant not found in `syntax::tokenstream::TokenTree`
error[E0609]: no field `open_span` on type `&syntax::tokenstream::Delimited`
--> common/lib.rs:422:45
|
422 | let open = respan(delimited.open_span, token_to_string(&delimited.open_token()));
| ^^^^^^^^^
error[E0609]: no field `close_span` on type `&syntax::tokenstream::Delimited`
--> common/lib.rs:423:46
|
423 | let close = respan(delimited.close_span, token_to_string(&delimited.close_token()));
| ^^^^^^^^^^
error[E0308]: mismatched types
--> common/lib.rs:426:40
|
426 | .chain(flatten_tts(&delimited.tts))
| ^^^^^^^^^^^^^^ expected slice, found struct `syntax::tokenstream::ThinTokenStream`
|
= note: expected type `&[syntax::tokenstream::TokenTree]`
found type `&syntax::tokenstream::ThinTokenStream`
error[E0615]: attempted to take value of method `lo` on type `syntax::codemap::Span`
--> common/lib.rs:440:57
|
440 | let mut last_pos = codemap.lookup_char_pos(DUMMY_SP.lo);
| ^^
|
= help: maybe a `()` to call it is missing?
error[E0615]: attempted to take value of method `lo` on type `syntax::codemap::Span`
--> common/lib.rs:446:58
|
446 | let pos = codemap.lookup_char_pos(token.span.lo);
| ^^
|
= help: maybe a `()` to call it is missing?
error[E0615]: attempted to take value of method `lo` on type `syntax::codemap::Span`
--> common/lib.rs:475:44
|
475 | let pos = codemap.lookup_char_pos(span.lo);
| ^^
|
= help: maybe a `()` to call it is missing?
error[E0618]: expected function, found enum variant `Err`
--> common/types.rs:38:13
|
38 | Err(handler.struct_span_err(ty.span, &msg))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a function
help: `Err` is a unit variant, you need to write it without the parenthesis
|
38 | Err
|
error[E0609]: no field `identifier` on type `&syntax::ast::PathSegment`
--> common/types.rs:63:40
|
63 | let name : &str = &segment.identifier.name.as_str();
| ^^^^^^^^^^
error[E0609]: no field `identifier` on type `&syntax::ast::PathSegment`
--> common/types.rs:79:40
|
79 | Some((module, rest)) if module.identifier.name.as_str() == "libc" && rest.len() == 1 => {
| ^^^^^^^^^^
error[E0609]: no field `identifier` on type `syntax::ast::PathSegment`
--> common/types.rs:80:40
|
80 | let name : &str = &rest[0].identifier.name.as_str();
| ^^^^^^^^^^ unknown field
|
= note: available fields are: `ident`, `args`
error: aborting due to 40 previous errors
Some errors occurred: E0023, E0061, E0063, E0308, E0412, E0425, E0432, E0599, E0609...
For more information about an error, try `rustc --explain E0023`.
error: Could not compile `rustcxx_common`.
To learn more, run the command again with --verbose.
Currently, rustcxx use the statement expression feature (which is gcc feature) to generate the cxx! code.
However, It makes us uneasy to use rustcxx with MSVC.
Do you have a plan to change this?
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.