Advertisement
theultraman20

err

Jul 6th, 2024
1,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 9.49 KB | None | 0 0
  1.  
  2. error: expected identifier, found `<`
  3.    --> src/compile.rs:142:61
  4.     |
  5. 142 | ...en => ParseRule{ prefix: Compiler::<'b>::<'b>::grouping, infix: null...
  6.     |          ---------                          ^ expected identifier
  7.     |          |
  8.     |          while parsing this struct
  9.  
  10. error[E0308]: mismatched types
  11.    --> src/compile.rs:142:84
  12.     |
  13. 139 | ... = || {};
  14.     |       -- the found closure
  15. ...
  16. 142 | ...en => ParseRule{ prefix: Compiler::<'b>::<'b>::grouping, infix: null_fn, p...
  17.     |                                                                    ^^^^^^^ incorrect number of function parameters
  18.     |
  19.     = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  20.                   found closure `{closure@src/compile.rs:139:23: 139:25}`
  21.  
  22. error[E0308]: mismatched types
  23.    --> src/compile.rs:143:45
  24.     |
  25. 143 | ...x: Compiler::<'b>::unary, infix: Compiler::<'b>::binary, prec: Term },
  26.     |       ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
  27.     |
  28.     = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  29.                   found fn item `for<'b> fn(&'b mut Compiler<'_>) {Compiler::<'_>::unary}`
  30.  
  31. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  32.    --> src/compile.rs:143:91
  33.     |
  34. 44  | pub struct Compiler<'a> {
  35.    | ----------------------- function or associated item `binary` not found for this struct
  36. ...
  37. 143 |             Minus =>     ParseRule{ prefix: Compiler::<'b>::unary, infix: Compiler::<'b>::binary, p...
  38.    |                                                                                           ^^^^^^ function or associated item not found in `Compiler<'b>`
  39.     |
  40. note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  41.    --> src/compile.rs:53:5
  42.     |
  43. 53  |     pub fn new(tokens: Vec<Token<'a>>) -> Self {
  44.    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  45. help: there is a method `unary` with a similar name
  46.    |
  47. 143 |             Minus =>     ParseRule{ prefix: Compiler::<'b>::unary, infix: Compiler::<'b>::unary, prec: Term },
  48.    |                                                                                           ~~~~~
  49.  
  50. error[E0308]: mismatched types
  51.   --> src/compile.rs:144:45
  52.    |
  53. 139 | ... let null_fn = || {};
  54.    |                   -- the found closure
  55. ...
  56. 144 | ...     Plus =>      ParseRule{ prefix: null_fn, infix: Compiler::<'b>:...
  57.     |                                         ^^^^^^^ incorrect number of function parameters
  58.     |
  59.     = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  60.                   found closure `{closure@src/compile.rs:139:23: 139:25}`
  61.  
  62. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  63.    --> src/compile.rs:144:77
  64.     |
  65. 44  | pub struct Compiler<'a> {
  66.    | ----------------------- function or associated item `binary` not found for this struct
  67. ...
  68. 144 |             Plus =>      ParseRule{ prefix: null_fn, infix: Compiler::<'b>::binary, p...
  69.     |                                                                             ^^^^^^ function or associated item not found in `Compiler<'b>`
  70.    |
  71. note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  72.   --> src/compile.rs:53:5
  73.    |
  74. 53  |     pub fn new(tokens: Vec<Token<'a>>) -> Self {
  75.     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  76. help: there is a method `unary` with a similar name
  77.     |
  78. 144 |             Plus =>      ParseRule{ prefix: null_fn, infix: Compiler::<'b>::unary, prec: Term },
  79.    |                                                                             ~~~~~
  80.  
  81. error[E0308]: mismatched types
  82.   --> src/compile.rs:145:45
  83.    |
  84. 139 | ... let null_fn = || {};
  85.    |                   -- the found closure
  86. ...
  87. 145 | ...     Slash =>     ParseRule{ prefix: null_fn, infix: Compiler::<'b>:...
  88.     |                                         ^^^^^^^ incorrect number of function parameters
  89.     |
  90.     = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  91.                   found closure `{closure@src/compile.rs:139:23: 139:25}`
  92.  
  93. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  94.    --> src/compile.rs:145:77
  95.     |
  96. 44  | pub struct Compiler<'a> {
  97.    | ----------------------- function or associated item `binary` not found for this struct
  98. ...
  99. 145 |             Slash =>     ParseRule{ prefix: null_fn, infix: Compiler::<'b>::binary, p...
  100.     |                                                                             ^^^^^^ function or associated item not found in `Compiler<'b>`
  101.    |
  102. note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  103.   --> src/compile.rs:53:5
  104.    |
  105. 53  |     pub fn new(tokens: Vec<Token<'a>>) -> Self {
  106.     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  107. help: there is a method `unary` with a similar name
  108.     |
  109. 145 |             Slash =>     ParseRule{ prefix: null_fn, infix: Compiler::<'b>::unary, prec: Factor },
  110.    |                                                                             ~~~~~
  111.  
  112. error[E0308]: mismatched types
  113.   --> src/compile.rs:146:45
  114.    |
  115. 139 | ... let null_fn = || {};
  116.    |                   -- the found closure
  117. ...
  118. 146 | ...     Star =>      ParseRule{ prefix: null_fn, infix: Compiler::<'b>:...
  119.     |                                         ^^^^^^^ incorrect number of function parameters
  120.     |
  121.     = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  122.                   found closure `{closure@src/compile.rs:139:23: 139:25}`
  123.  
  124. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  125.    --> src/compile.rs:146:77
  126.     |
  127. 44  | pub struct Compiler<'a> {
  128.    | ----------------------- function or associated item `binary` not found for this struct
  129. ...
  130. 146 |             Star =>      ParseRule{ prefix: null_fn, infix: Compiler::<'b>::binary, p...
  131.     |                                                                             ^^^^^^ function or associated item not found in `Compiler<'b>`
  132.    |
  133. note: if you're trying to build a new `Compiler<'b>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  134.   --> src/compile.rs:53:5
  135.    |
  136. 53  |     pub fn new(tokens: Vec<Token<'a>>) -> Self {
  137.     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  138. help: there is a method `unary` with a similar name
  139.     |
  140. 146 |             Star =>      ParseRule{ prefix: null_fn, infix: Compiler::<'b>::unary, prec: Factor },
  141.    |                                                                             ~~~~~
  142.  
  143. error[E0308]: mismatched types
  144.   --> src/compile.rs:147:45
  145.    |
  146. 147 | ...x: Compiler::<'b>::number, infix: null_fn, prec: Null },
  147.     |       ^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
  148.     |
  149.     = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  150.                   found fn item `for<'b> fn(&'b mut Compiler<'_>) {Compiler::<'_>::number}`
  151.  
  152. error[E0308]: mismatched types
  153.    --> src/compile.rs:147:76
  154.     |
  155. 139 | ... = || {};
  156.     |       -- the found closure
  157. ...
  158. 147 | ...=>    ParseRule{ prefix: Compiler::<'b>::number, infix: null_fn, pre...
  159.    |                                                            ^^^^^^^ incorrect number of function parameters
  160.    |
  161.    = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  162.                  found closure `{closure@src/compile.rs:139:23: 139:25}`
  163.  
  164. error[E0308]: mismatched types
  165.   --> src/compile.rs:148:45
  166.    |
  167. 139 | ... let null_fn = || {};
  168.    |                   -- the found closure
  169. ...
  170. 148 | ...     _ =>         ParseRule{ prefix: null_fn, infix: null_fn, prec: ...
  171.    |                                         ^^^^^^^ incorrect number of function parameters
  172.    |
  173.    = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  174.                  found closure `{closure@src/compile.rs:139:23: 139:25}`
  175.  
  176. error[E0308]: mismatched types
  177.   --> src/compile.rs:148:61
  178.    |
  179. 139 | ...ull_fn = || {};
  180.    |             -- the found closure
  181. ...
  182. 148 | ... =>         ParseRule{ prefix: null_fn, infix: null_fn, prec: Null },
  183.    |                                                   ^^^^^^^ incorrect number of function parameters
  184.    |
  185.    = note: expected fn pointer `for<'a, 'b> fn(&'a mut Compiler<'b>)`
  186.                  found closure `{closure@src/compile.rs:139:23: 139:25}`
  187.  
  188. warning: unused variable: `level`
  189.   --> src/compile.rs:134:36
  190.    |
  191. 134 |     fn parse_precedence(&mut self, level: Precedence) {
  192.    |                                    ^^^^^ help: if this is intentional, prefix it with an underscore: `_level`
  193.    |
  194.    = note: `#[warn(unused_variables)]` on by default
  195.  
  196. warning: unused variable: `tokens`
  197.  --> src/main.rs:27:13
  198.   |
  199. 27 |         let tokens = lex(&source).unwrap();
  200.   |             ^^^^^^ help: if this is intentional, prefix it with an underscore: `_tokens`
  201.  
  202. warning: variable does not need to be mutable
  203.  --> src/main.rs:17:9
  204.   |
  205. 17 |     let mut chunk = Chunk::new();
  206.   |         ----^^^^^
  207.   |         |
  208.   |         help: remove this `mut`
  209.   |
  210.   = note: `#[warn(unused_mut)]` on by default
  211.  
  212. Some errors have detailed explanations: E0308, E0599.
  213. For more information about an error, try `rustc --explain E0308`.
  214. warning: `crafting-interpreters` (bin "crafting-interpreters") generated 3 warnings
  215.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement