Advertisement
theultraman20

err

Jul 6th, 2024
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.33 KB | None | 0 0
  1. erpreters)
  2. error[E0573]: expected type, found module `self`
  3. --> src/compile.rs:18:24
  4. |
  5. 18 | prefix: Fn<&'a mut self>,
  6. | ^^^^ help: a self type with a similar name exists (notice the capitalization): `Self`
  7.  
  8. error[E0573]: expected type, found module `self`
  9. --> src/compile.rs:19:23
  10. |
  11. 19 | infix: Fn<&'a mut self>,
  12. | ^^^^ help: a self type with a similar name exists (notice the capitalization): `Self`
  13.  
  14. error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
  15. --> src/compile.rs:18:13
  16. |
  17. 18 | prefix: Fn<&'a mut self>,
  18. | ^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(&'a mut self) -> ()`
  19. |
  20. = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
  21.  
  22. error[E0191]: the value of the associated type `Output` in `FnOnce` must be specified
  23. --> src/compile.rs:18:13
  24. |
  25. 18 | prefix: Fn<&'a mut self>,
  26. | ^^^^^^^^^^^^^^^^ help: specify the associated type: `Fn<&'a mut self, Output = Type>`
  27.  
  28. error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
  29. --> src/compile.rs:19:12
  30. |
  31. 19 | infix: Fn<&'a mut self>,
  32. | ^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(&'a mut self) -> ()`
  33. |
  34. = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
  35.  
  36. error[E0191]: the value of the associated type `Output` in `FnOnce` must be specified
  37. --> src/compile.rs:19:12
  38. |
  39. 19 | infix: Fn<&'a mut self>,
  40. | ^^^^^^^^^^^^^^^^ help: specify the associated type: `Fn<&'a mut self, Output = Type>`
  41.  
  42. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  43. --> src/compile.rs:143:71
  44. |
  45. 44 | pub struct Compiler<'a> {
  46. | ----------------------- function or associated item `binary` not found for this struct
  47. ...
  48. 143 | Minus => ParseRule{ prefix: Self::unary, infix: Self::binary, p...
  49. | ^^^^^^ function or associated item not found in `Compiler<'a>`
  50. |
  51. note: if you're trying to build a new `Compiler<'a>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  52. --> src/compile.rs:53:5
  53. |
  54. 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
  55. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  56. help: there is a method `unary` with a similar name
  57. |
  58. 143 | Minus => ParseRule{ prefix: Self::unary, infix: Self::unary, prec: Term },
  59. | ~~~~~
  60.  
  61. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  62. --> src/compile.rs:144:67
  63. |
  64. 44 | pub struct Compiler<'a> {
  65. | ----------------------- function or associated item `binary` not found for this struct
  66. ...
  67. 144 | Plus => ParseRule{ prefix: null_fn, infix: Self::binary, p...
  68. | ^^^^^^ function or associated item not found in `Compiler<'a>`
  69. |
  70. note: if you're trying to build a new `Compiler<'a>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  71. --> src/compile.rs:53:5
  72. |
  73. 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
  74. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  75. help: there is a method `unary` with a similar name
  76. |
  77. 144 | Plus => ParseRule{ prefix: null_fn, infix: Self::unary, prec: Term },
  78. | ~~~~~
  79.  
  80. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  81. --> src/compile.rs:145:67
  82. |
  83. 44 | pub struct Compiler<'a> {
  84. | ----------------------- function or associated item `binary` not found for this struct
  85. ...
  86. 145 | Slash => ParseRule{ prefix: null_fn, infix: Self::binary, p...
  87. | ^^^^^^ function or associated item not found in `Compiler<'a>`
  88. |
  89. note: if you're trying to build a new `Compiler<'a>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  90. --> src/compile.rs:53:5
  91. |
  92. 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
  93. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  94. help: there is a method `unary` with a similar name
  95. |
  96. 145 | Slash => ParseRule{ prefix: null_fn, infix: Self::unary, prec: Factor },
  97. | ~~~~~
  98.  
  99. error[E0599]: no function or associated item named `binary` found for struct `Compiler` in the current scope
  100. --> src/compile.rs:146:67
  101. |
  102. 44 | pub struct Compiler<'a> {
  103. | ----------------------- function or associated item `binary` not found for this struct
  104. ...
  105. 146 | Star => ParseRule{ prefix: null_fn, infix: Self::binary, p...
  106. | ^^^^^^ function or associated item not found in `Compiler<'a>`
  107. |
  108. note: if you're trying to build a new `Compiler<'a>`, consider using `Compiler::<'a>::new` which returns `Compiler<'_>`
  109. --> src/compile.rs:53:5
  110. |
  111. 53 | pub fn new(tokens: Vec<Token<'a>>) -> Self {
  112. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  113. help: there is a method `unary` with a similar name
  114. |
  115. 146 | Star => ParseRule{ prefix: null_fn, infix: Self::unary, prec: Factor },
  116. | ~~~~~
  117.  
  118. warning: unused variable: `level`
  119. --> src/compile.rs:134:36
  120. |
  121. 134 | fn parse_precedence(&mut self, level: Precedence) {
  122. | ^^^^^ help: if this is intentional, prefix it with an underscore: `_level`
  123. |
  124. = note: `#[warn(unused_variables)]` on by default
  125.  
  126. warning: unused variable: `tokens`
  127. --> src/main.rs:27:13
  128. |
  129. 27 | let tokens = lex(&source).unwrap();
  130. | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_tokens`
  131.  
  132. warning: variable does not need to be mutable
  133. --> src/main.rs:17:9
  134. |
  135. 17 | let mut chunk = Chunk::new();
  136. | ----^^^^^
  137. | |
  138. | help: remove this `mut`
  139. |
  140. = note: `#[warn(unused_mut)]` on by default
  141.  
  142. error[E0782]: trait objects must include the `dyn` keyword
  143. --> src/compile.rs:18:13
  144. |
  145. 18 | prefix: Fn<&'a mut self>,
  146. | ^^^^^^^^^^^^^^^^
  147. |
  148. help: add `dyn` keyword before this trait
  149. |
  150. 18 | prefix: dyn Fn<&'a mut self>,
  151. | +++
  152.  
  153. error[E0782]: trait objects must include the `dyn` keyword
  154. --> src/compile.rs:19:12
  155. |
  156. 19 | infix: Fn<&'a mut self>,
  157. | ^^^^^^^^^^^^^^^^
  158. |
  159. help: add `dyn` keyword before this trait
  160. |
  161. 19 | infix: dyn Fn<&'a mut self>,
  162. | +++
  163.  
  164. Some errors have detailed explanations: E0191, E0573, E0599, E0658, E0782.
  165. For more information about an error, try `rustc --explain E0191`.
  166. warning: `crafting-interpreters` (bin "crafting-interpreters") generated 3 warnings
  167. error: could not compile `crafting-interpreters` (bin "crafting-interpreters") due to 12 previous errors; 3 warnings emitted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement