Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error: expected identifier, found `<`
- --> src/compile.rs:142:61
- |
- 142 | ...en => ParseRule{ prefix: Compiler::<'b>::<'b>::grouping, infix: null...
- | --------- ^ expected identifier
- | |
- | while parsing this struct
- error[E0308]: mismatched types
- --> src/compile.rs:142:84
- |
- 139 | ... = || {};
- | -- the found closure
- ...
- 142 | ...en => ParseRule{ prefix: Compiler::<'b>::<'b>::grouping, infix: null_fn, p...
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- error[E0308]: mismatched types
- --> src/compile.rs:143:45
- |
- 143 | ...x: Compiler::<'b>::unary, infix: Compiler::<'b>::binary, prec: Term },
- | ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found fn item `for<'b> fn(&'b mut Compiler<'_>) {Compiler::<'_>::unary}`
- error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
- --> src/compile.rs:143:91
- |
- 44 | pub struct Compiler<'a> {
- | ----------------------- function or associated item `binary` not found for this struct
- ...
- 143 | Minus => ParseRule{ prefix: Compiler::<'b>::unary, infix: Compiler::<'b>::binary, p...
- | ^^^^^^ function or associated item not found in `Compiler<'b>`
- |
- note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
- --> src/compile.rs:53:5
- |
- 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- help: there is a method `unary` with a similar name
- |
- 143 | Minus => ParseRule{ prefix: Compiler::<'b>::unary, infix: Compiler::<'b>::unary, prec: Term },
- | ~~~~~
- error[E0308]: mismatched types
- --> src/compile.rs:144:45
- |
- 139 | ... let null_fn = || {};
- | -- the found closure
- ...
- 144 | ... Plus => ParseRule{ prefix: null_fn, infix: Compiler::<'b>:...
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
- --> src/compile.rs:144:77
- |
- 44 | pub struct Compiler<'a> {
- | ----------------------- function or associated item `binary` not found for this struct
- ...
- 144 | Plus => ParseRule{ prefix: null_fn, infix: Compiler::<'b>::binary, p...
- | ^^^^^^ function or associated item not found in `Compiler<'b>`
- |
- note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
- --> src/compile.rs:53:5
- |
- 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- help: there is a method `unary` with a similar name
- |
- 144 | Plus => ParseRule{ prefix: null_fn, infix: Compiler::<'b>::unary, prec: Term },
- | ~~~~~
- error[E0308]: mismatched types
- --> src/compile.rs:145:45
- |
- 139 | ... let null_fn = || {};
- | -- the found closure
- ...
- 145 | ... Slash => ParseRule{ prefix: null_fn, infix: Compiler::<'b>:...
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
- --> src/compile.rs:145:77
- |
- 44 | pub struct Compiler<'a> {
- | ----------------------- function or associated item `binary` not found for this struct
- ...
- 145 | Slash => ParseRule{ prefix: null_fn, infix: Compiler::<'b>::binary, p...
- | ^^^^^^ function or associated item not found in `Compiler<'b>`
- |
- note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
- --> src/compile.rs:53:5
- |
- 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- help: there is a method `unary` with a similar name
- |
- 145 | Slash => ParseRule{ prefix: null_fn, infix: Compiler::<'b>::unary, prec: Factor },
- | ~~~~~
- error[E0308]: mismatched types
- --> src/compile.rs:146:45
- |
- 139 | ... let null_fn = || {};
- | -- the found closure
- ...
- 146 | ... Star => ParseRule{ prefix: null_fn, infix: Compiler::<'b>:...
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
- --> src/compile.rs:146:77
- |
- 44 | pub struct Compiler<'a> {
- | ----------------------- function or associated item `binary` not found for this struct
- ...
- 146 | Star => ParseRule{ prefix: null_fn, infix: Compiler::<'b>::binary, p...
- | ^^^^^^ function or associated item not found in `Compiler<'b>`
- |
- note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
- --> src/compile.rs:53:5
- |
- 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- help: there is a method `unary` with a similar name
- |
- 146 | Star => ParseRule{ prefix: null_fn, infix: Compiler::<'b>::unary, prec: Factor },
- | ~~~~~
- error[E0308]: mismatched types
- --> src/compile.rs:147:45
- |
- 147 | ...x: Compiler::<'b>::number, infix: null_fn, prec: Null },
- | ^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found fn item `for<'b> fn(&'b mut Compiler<'_>) {Compiler::<'_>::number}`
- error[E0308]: mismatched types
- --> src/compile.rs:147:76
- |
- 139 | ... = || {};
- | -- the found closure
- ...
- 147 | ...=> ParseRule{ prefix: Compiler::<'b>::number, infix: null_fn, pre...
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- error[E0308]: mismatched types
- --> src/compile.rs:148:45
- |
- 139 | ... let null_fn = || {};
- | -- the found closure
- ...
- 148 | ... _ => ParseRule{ prefix: null_fn, infix: null_fn, prec: ...
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- error[E0308]: mismatched types
- --> src/compile.rs:148:61
- |
- 139 | ...ull_fn = || {};
- | -- the found closure
- ...
- 148 | ... => ParseRule{ prefix: null_fn, infix: null_fn, prec: Null },
- | ^^^^^^^ incorrect number of function parameters
- |
- = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
- found closure `{closure@src/compile.rs:139:23: 139:25}`
- warning: unused variable: `level`
- --> src/compile.rs:134:36
- |
- 134 | fn parse_precedence(&mut self, level: Precedence) {
- | ^^^^^ help: if this is intentional, prefix it with an underscore: `_level`
- |
- = note: `#[warn(unused_variables)]` on by default
- warning: unused variable: `tokens`
- --> src/main.rs:27:13
- |
- 27 | let tokens = lex(&source).unwrap();
- | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_tokens`
- warning: variable does not need to be mutable
- --> src/main.rs:17:9
- |
- 17 | let mut chunk = Chunk::new();
- | ----^^^^^
- | |
- | help: remove this `mut`
- |
- = note: `#[warn(unused_mut)]` on by default
- Some errors have detailed explanations: E0308, E0599.
- For more information about an error, try `rustc --explain E0308`.
- warning: `crafting-interpreters` (bin "crafting-interpreters") generated 3 warnings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement