ptal / oak

A typed parser generator embedded in Rust code for Parsing Expression Grammars
Apache License 2.0
142 stars 14 forks source link

oak will not compile on nightly (rustc 1.32.0-nightly (653da4fd0 2018-11-08)) #107

Closed zyvitski closed 5 years ago

zyvitski commented 5 years ago

Oak master fails to build using latest nightly rust: rustc 1.32.0-nightly (653da4fd0 2018-11-08)

After some investigation I was able to solve some of the errors.

➜ oak git:(master) ✗ cargo build Compiling oak v0.5.8 (/Users/alexanderzywicki/code/oak) error[E0432]: unresolved import syntax::util::small_vector --> src/liboak/rust.rs:21:23 | 21 | pub use syntax::util::small_vector::SmallVector; | ^^^^^^^^^^^^ Could not find small_vector in util

error[E0432]: unresolved import syntax::codemap --> src/liboak/rust.rs:22:17 | 22 | pub use syntax::codemap::{DUMMY_SP, NO_EXPANSION, Span, MultiSpan, Spanned, respan, BytePos}; | ^^^^^^^ Could not find codemap in syntax

error[E0433]: failed to resolve. Use of undeclared type or module Span --> src/liboak/front/ast.rs:72:13 | 72 | span: Span::new(lo,hi,NO_EXPANSION) | ^^^^ Use of undeclared type or module Span

error[E0433]: failed to resolve. Use of undeclared type or module Span --> src/liboak/front/parser.rs:225:9 | 225 | Span::new(lo, hi, NO_EXPANSION), | ^^^^ Use of undeclared type or module Span

error[E0412]: cannot find type Span in this scope --> src/liboak/ast.rs:82:50 82 pub fn multi_locations_err(&self, errors: Vec<(Span, String)>) { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/ast.rs:94:53 94 pub fn multi_locations_warn(&self, warnings: Vec<(Span, String)>) { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/ast.rs:100:32 100 pub fn span_err(&self, span: Span, msg: String) { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/ast.rs:104:33 104 pub fn span_note(&self, span: Span, msg: String) { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/ast.rs:234:21 234 fn span(&self) -> Span { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/ast.rs:41:36 41 pub fn alloc_expr(&mut self, lo: BytePos, hi: BytePos, expr: Expression) -> usize { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/ast.rs:41:49 41 pub fn alloc_expr(&mut self, lo: BytePos, hi: BytePos, expr: Expression) -> usize { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0412]: cannot find type Span in this scope --> src/liboak/front/ast.rs:65:13 65 pub span: Span ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::Span;
15 use syntax::source_map::Span;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/ast.rs:70:18 70 fn spanned(lo: BytePos, hi: BytePos) -> FExpressionInfo { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/ast.rs:70:31 70 fn spanned(lo: BytePos, hi: BytePos) -> FExpressionInfo { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0425]: cannot find value NO_EXPANSION in this scope --> src/liboak/front/ast.rs:72:29 72 span: Span::new(lo,hi,NO_EXPANSION) ^^^^^^^^^^^^ not found in this scope help: possible candidate is found in another module, you can import it into scope
15 use syntax::source_map::NO_EXPANSION;
error[E0412]: cannot find type Span in this scope --> src/liboak/front/ast.rs:78:21 78 fn span(&self) -> Span { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::Span;
15 use syntax::source_map::Span;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/parser.rs:42:32 42 fn alloc_expr(&mut self, lo: BytePos, hi: BytePos, expr: Expression) -> usize { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/parser.rs:42:45 42 fn alloc_expr(&mut self, lo: BytePos, hi: BytePos, expr: Expression) -> usize { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0412]: cannot find type BytePos in this scope --> src/liboak/front/parser.rs:171:32 171 fn parse_type(&mut self, lo: BytePos, expr: usize, rule_name: &str) -> rust::PResult<'a, usize> { ^^^^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::BytePos;
15 use syntax::source_map::BytePos;
error[E0425]: cannot find value NO_EXPANSION in this scope --> src/liboak/front/parser.rs:225:27 225 Span::new(lo, hi, NO_EXPANSION), ^^^^^^^^^^^^ not found in this scope help: possible candidate is found in another module, you can import it into scope
15 use syntax::source_map::NO_EXPANSION;
error[E0412]: cannot find type Span in this scope --> src/liboak/middle/typing/ast.rs:107:13 107 pub span: Span, ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
18 use syntax::ext::quote::rt::Span;
18 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/middle/typing/ast.rs:112:21 112 fn span(&self) -> Span { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
18 use syntax::ext::quote::rt::Span;
18 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/middle/typing/ast.rs:120:18 120 pub fn new(sp: Span, ty: Ty) -> Self { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
18 use syntax::ext::quote::rt::Span;
18 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/middle/typing/ast.rs:140:20 140 pub fn infer(sp: Span) -> Self { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
18 use syntax::ext::quote::rt::Span;
18 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/back/context.rs:250:47 250 pub fn expr_span(&self, expr_idx: usize) -> Span { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
16 use syntax::ext::quote::rt::Span;
16 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/back/code_printer.rs:38:83 38 fn print_module(s: &mut State, module: &Mod, ident: Ident, vis: Visibility, span: Span) ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::Span;
15 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/back/compiler/value.rs:20:40 20 pub fn tuple_value(cx: &ExtCtxt, span: Span, vars_names: Vec) -> RExpr ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/back/compiler/value.rs:36:42 36 pub fn tuple_pattern(cx: &ExtCtxt, span: Span, vars_names: Vec) -> RPat ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
17 use syntax::ext::quote::rt::Span;
17 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/identifier.rs:39:21 39 fn span(&self) -> Span; ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::Span;
15 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/identifier.rs:51:21 51 fn span(&self) -> Span { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::Span;
15 use syntax::source_map::Span;
error[E0412]: cannot find type Span in this scope --> src/liboak/identifier.rs:65:21 65 fn span(&self) -> Span { ^^^^ not found in this scope help: possible candidates are found in other modules, you can import them into scope
15 use syntax::ext::quote::rt::Span;
15 use syntax::source_map::Span;

error[E0063]: missing field inline in initializer of syntax::ast::Mod --> src/liboak/back/compiler/grammar.rs:74:37 | 74 | node: rust::ItemKind::Mod(rust::Mod{ | ^^^^^^^^^ missing inline

error: aborting due to 32 previous errors

Some errors occurred: E0063, E0412, E0425, E0432, E0433. For more information about an error, try rustc --explain E0063. error: Could not compile oak.

To learn more, run the command again with --verbose.

ptal commented 5 years ago

Thank you for the issue and the pull request ;-)