| |_________^ expected CompiledInstruction, found Instruction
|
note: method defined here
--> C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:2003:12
|
2003 | pub fn push(&mut self, value: T) {
| ^^^^
error[E0609]: no field rpc_url on type RpcConfig
--> src/main.rs:291:29
|
291 | self.config.rpc.rpc_url, self.config.api_keys.helius_api_key
| ^^^^^^^ unknown field
|
= note: available fields are: solana_rpc_url, fallback_url
error[E0609]: no field rpc_url on type RpcConfig
--> src/main.rs:320:29
|
320 | self.config.rpc.rpc_url, self.config.api_keys.helius_api_key
| ^^^^^^^ unknown field
|
= note: available fields are: solana_rpc_url, fallback_url
error[E0053]: method update has an incompatible type for trait
--> src\gui.rs:236:55
|
236 | fn update(&mut self, ctx: &egui::Context, _frame: &eframe::epi::Frame) {
| ^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected signature fn(&mut BotGui, &eframe::egui::Context, &mut eframe::Frame)
found signature fn(&mut BotGui, &eframe::egui::Context, &eframe::Frame)
help: change the parameter type to match the trait
|
236 | fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
| ~~~~~~~~~~~~~~~~~~
error[E0502]: cannot borrow logs as immutable because it is also borrowed as mutable
--> src\gui.rs:230:27
|
230 | logs.drain(0..logs.len() - 1000);
| ---- ----- ^^^^ immutable borrow occurs here
| | |
| | mutable borrow later used by call
| mutable borrow occurs here
Assistant
Some errors have detailed explanations: E0053, E0107, E0277, E0308, E0407, E0412, E0502, E0599, E0603...
For more information about an error, try rustc --explain E0053.
warning: solana_rust_bot (bin "solana_rust_bot") generated 2 warnings
error: could not compile solana_rust_bot (bin "solana_rust_bot") due to 24 previous errors; 2 warnings emitted
(pytorch_cuda) PS C:\solana_rust_bot> conda activate pytorch_cuda
(pytorch_cuda) PS C:\solana_rust_bot> $rust_MIN_STACK = "16777216"
(pytorch_cuda) PS C:\solana_rust_bot> cargo build --release --jobs 15
warning: unused manifest key: build
warning: output filename collision.
The bin target solana_rust_bot in package solana_rust_bot v0.1.0 (C:\solana_rust_bot) has the same output filename as the lib target solana_rust_bot in package solana_rust_bot v0.1.0 (C:\solana_rust_bot).
Colliding filename is: C:\solana_rust_bot\target\release\deps\solana_rust_bot.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see https://github.com/rust-lang/cargo/issues/6313.
warning: output filename collision.
The bin target solana_rust_bot in package solana_rust_bot v0.1.0 (C:\solana_rust_bot) has the same output filename as the lib target solana_rust_bot in package solana_rust_bot v0.1.0 (C:\solana_rust_bot).
Colliding filename is: C:\solana_rust_bot\target\release\solana_rust_bot.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see https://github.com/rust-lang/cargo/issues/6313.
Compiling solana_rust_bot v0.1.0 (C:\solana_rust_bot)
error: cannot find macro info in this scope
--> src\gpu_bridge.rs:59:17
|
59 | info!("✅ Token validation passed (GPU Score: {:.2})", score);
| ^^^^
|
help: consider importing one of these macros
|
1 + use crate::info;
|
1 + use log::info;
|
1 + use solana_program::info;
|
error: cannot find macro info in this scope
--> src\gpu_bridge.rs:60:17
|
60 | info!(
| ^^^^
|
help: consider importing one of these macros
|
1 + use crate::info;
|
1 + use log::info;
|
1 + use solana_program::info;
|
error: cannot find macro info in this scope
--> src\gpu_bridge.rs:64:17
|
64 | info!(
| ^^^^
|
help: consider importing one of these macros
|
1 + use crate::info;
|
1 + use log::info;
|
1 + use solana_program::info;
|
error: cannot find macro info in this scope
--> src\gpu_bridge.rs:68:17
|
68 | info!(" Burnt: {}", metadata["burnt"].as_bool().unwrap_or(false));
| ^^^^
|
help: consider importing one of these macros
|
1 + use crate::info;
|
1 + use log::info;
|
1 + use solana_program::info;
|
error: cannot find macro info in this scope
--> src\gpu_bridge.rs:69:17
|
69 | info!(
| ^^^^
|
help: consider importing one of these macros
|
1 + use crate::info;
|
1 + use log::info;
|
1 + use solana_program::info;
|
error[E0407]: method name is not a member of trait eframe::epi::App
--> src\gui.rs:245:5
|
245 | / fn name(&self) -> &str {
246 | | "Solana Sniper Bot"
247 | | }
| |_____^ not a member of trait eframe::epi::App
error[E0412]: cannot find type Bot in this scope
--> src\gpu_bridge.rs:48:6
|
48 | impl Bot {
| ^^^
|
::: C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\boxed.rs:235:1
|
235 | / pub struct Box<
236 | | T: ?Sized,
237 | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
238 | | >(Unique, A);
| |_- similarly named struct Box defined here
|
help: a struct with a similar name exists
|
48 | impl Box {
| ~~~
help: consider importing this struct
|
1 + use crate::Bot;
|
error[E0412]: cannot find type Bot in this scope
--> src\gui.rs:10:14
|
10 | bot: Arc,
| ^^^
|
::: C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\boxed.rs:235:1
|
235 | / pub struct Box<
236 | | T: ?Sized,
237 | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
238 | | >(Unique, A);
| |_- similarly named struct Box defined here
|
help: a struct with a similar name exists
|
10 | bot: Arc,
| ~~~
help: consider importing this struct
|
2 + use crate::Bot;
|
error[E0412]: cannot find type Bot in this scope
--> src\gui.rs:33:25
|
33 | pub fn new(bot: Arc) -> Self {
| ^^^
|
::: C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\boxed.rs:235:1
|
235 | / pub struct Box<
236 | | T: ?Sized,
237 | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
238 | | >(Unique, A);
| |_- similarly named struct Box defined here
|
help: a struct with a similar name exists
|
33 | pub fn new(bot: Arc) -> Self {
| ~~~
help: consider importing this struct
|
2 + use crate::Bot;
|
error[E0603]: module epi is private
--> src\gui.rs:3:20
|
3 | eframe::{egui, epi},
| ^^^ private module
|
note: the module epi is defined here
--> C:\Users\Orsen.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.22.0\src\lib.rs:135:1
|
135 | mod epi;
| ^^^^^^^
error[E0603]: struct GpuAnalyzer is private
--> src/main.rs:6:24
|
6 | use crate::gpu_bridge::GpuAnalyzer;
| ^^^^^^^^^^^ private struct
|
note: the struct GpuAnalyzer is defined here
--> src\gpu_bridge.rs:6:1
|
6 | struct GpuAnalyzer {
| ^^^^^^^^^^^^^^^^^^
error[E0603]: module epi is private
--> src\gui.rs:235:14
|
235 | impl eframe::epi::App for BotGui {
| ^^^ private module
|
note: the module epi is defined here
--> C:\Users\Orsen.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.22.0\src\lib.rs:135:1
|
135 | mod epi;
| ^^^^^^^
help: consider importing this trait instead
|
235 | impl eframe::App for BotGui {
| ~~~~~~~~~~~
error[E0603]: module epi is private
--> src\gui.rs:236:64
|
236 | fn update(&mut self, ctx: &egui::Context, _frame: &eframe::epi::Frame) {
| ^^^ private module
|
note: the module epi is defined here
--> C:\Users\Orsen.cargo\registry\src\index.crates.io-6f17d22bba15001f\eframe-0.22.0\src\lib.rs:135:1
|
135 | mod epi;
| ^^^^^^^
help: consider importing this struct instead
|
236 | fn update(&mut self, ctx: &egui::Context, _frame: &eframe::Frame) {
| ~~~~~~~~~~~~~
warning: unused import: crate::gui::BotGui
--> src/main.rs:7:5
|
7 | use crate::gui::BotGui;use config::File as ConfigFile;
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
error[E0599]: no method named send found for struct SplitSink in the current scope
--> src/main.rs:179:26
|
178 | / write
179 | | .send(WsMessage::Text(subscribe_message.to_string()))
| |________________________-^^^^
|
::: C:\Users\Orsen.cargo\registry\src\index.crates.io-6f17d22bba15001f\futures-util-0.3.31\src\sink\mod.rs:220:8
|
220 | fn send(&mut self, item: Item) -> Send<', Self, Item>
| ---- the method is available for SplitSink<WebSocketStream<tokio_tungstenite::MaybeTlsStream<tokio::net::TcpStream>>, tokio_tungstenite::tungstenite::Message> here
|
= help: items from traits can only be used if the trait is in scope
help: trait SinkExt which provides send is implemented but not in scope; perhaps you want to import it
|
1 + use futures_util::SinkExt;
|
help: there is a method send_all with a similar name
|
179 | .send_all(WsMessage::Text(subscribe_message.to_string()))
| ~~~~~~~~
error[E0599]: no method named extract_token_address found for reference &Bot in the current scope
--> src/main.rs:236:59
|
236 | if let Some(token_address) = self.extract_token_address(log) {
| -----^^^^^^^^^^^^^^^^^^^^^-----
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: Bot::extract_token_address(log)
|
= note: found the following associated functions; to be used as methods, functions must have a self parameter
note: the candidate is defined in an impl for the type Bot
--> src/main.rs:269:5
|
269 | fn extract_token_address(log: &serde_json::Value) -> Option {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the size for values of type str cannot be known at compilation time
--> src/main.rs:236:32
|
236 | if let Some(token_address) = self.extract_token_address(log) {
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait Sized is not implemented for str
note: required by a bound in std::prelude::v1::Some
--> C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\option.rs:571:17
|
571 | pub enum Option {
| ^ required by this bound in std::prelude::v1::Some
...
579 | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| ---- required by a bound in this tuple variant
error[E0308]: mismatched types
--> src/main.rs:257:52
|
257 | ... self.process_token(token_address).await?;
| ------------- ^^^^^^^^^^^^^- help: try using a conversion method: .to_string()
| | |
| | expected String, found str
| arguments to this method are incorrect
|
note: method defined here
--> src/main.rs:276:14
|
276 | async fn process_token(&self, token_address: String) -> Result<()> {
| ^^^^^^^^^^^^^ ---------------------
error[E0308]: mismatched types
--> src/main.rs:442:27
|
442 | instructions.push(ComputeBudgetInstruction::set_compute_unit_limit(
| ____________----^
| | |
| | arguments to this method are incorrect
443 | | COMPUTE_UNIT_LIMIT,
444 | | ));
| |^ expected CompiledInstruction, found Instruction
|
note: method defined here
--> C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:2003:12
|
2003 | pub fn push(&mut self, value: T) {
| ^^^^
error[E0308]: mismatched types
--> src/main.rs:445:27
|
445 | instructions.push(ComputeBudgetInstruction::set_compute_unit_price(
| ____________----^
| | |
| | arguments to this method are incorrect
446 | | self.config.trading.priority_fee,
447 | | ));
| |^ expected CompiledInstruction, found Instruction
|
note: method defined here
--> C:\Users\Orsen.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:2003:12
|
2003 | pub fn push(&mut self, value: T) {
| ^^^^
error[E0609]: no field rpc_url on type RpcConfig
--> src/main.rs:291:29
|
291 | self.config.rpc.rpc_url, self.config.api_keys.helius_api_key
| ^^^^^^^ unknown field
|
= note: available fields are: solana_rpc_url, fallback_url
error[E0609]: no field rpc_url on type RpcConfig
--> src/main.rs:320:29
|
320 | self.config.rpc.rpc_url, self.config.api_keys.helius_api_key
| ^^^^^^^ unknown field
|
= note: available fields are: solana_rpc_url, fallback_url
error[E0053]: method update has an incompatible type for trait
--> src\gui.rs:236:55
|
236 | fn update(&mut self, ctx: &egui::Context, _frame: &eframe::epi::Frame) {
| ^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected signature fn(&mut BotGui, &eframe::egui::Context, &mut eframe::Frame)
found signature fn(&mut BotGui, &eframe::egui::Context, &eframe::Frame)
help: change the parameter type to match the trait
|
236 | fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
| ~~~~~~~~~~~~~~~~~~
error[E0502]: cannot borrow logs as immutable because it is also borrowed as mutable
--> src\gui.rs:230:27
|
230 | logs.drain(0..logs.len() - 1000);
| ---- ----- ^^^^ immutable borrow occurs here
| | |
| | mutable borrow later used by call
| mutable borrow occurs here
Some errors have detailed explanations: E0053, E0107, E0277, E0308, E0407, E0412, E0502, E0599, E0603...
For more information about an error, try rustc --explain E0053.
warning: solana_rust_bot (bin "solana_rust_bot") generated 2 warnings
error: could not compile solana_rust_bot (bin "solana_rust_bot") due to 24 previous errors; 2 warnings emitted
You have a number of errors in your Rust code, and I'll explain what's going wrong in each case and how you might resolve them. Let’s go through them one by one.
1. Error: no field 'rpc_url' on type 'RpcConfig'
This error is telling you that you're trying to access a field rpc_url on a struct RpcConfig which doesn't exist. Instead, you should use self.config.rpc.solana_rpc_url or self.config.rpc.fallback_url as suggested by the compiler.
2. Error: enum takes 2 generic arguments but 1 generic argument was supplied
You are trying to use a Result type with only one generic parameter. Change the function signature to include the second type parameter: async fn validate_token(&self, metadata: &serde_json::Value) -> Result<bool, E> where E is the error type you expect.
3. Error: method 'update' has an incompatible type for trait
Your update method’s parameter types don't match the expected signature. Change _frame from &eframe::Frame to &mut eframe::Frame in the method signature.
4. Error: cannot borrow 'logs' as immutable because it is also borrowed as mutable
This happens when you try to immutably access a variable while it’s borrowed mutably. Restructure your logic, maybe by separating the mutable and immutable borrows.
5. Error: cannot find macro info
The info! macro is not in scope. You need to use use log::info; or use crate::info; at the top of your file, depending on where the macro is defined.
6. Error: no method named 'send' found for struct 'SplitSink'
The method send isn't found because the trait SinkExt isn't in scope. Add use futures_util::SinkExt; to your imports.
7. Error: this is an associated function, not a method
You’re trying to call extract_token_address as a method on self. Since it does not take self as a parameter, you should call it like an associated function: Bot::extract_token_address(log).
8. Error: mismatched types
This usually involves expecting a String but receiving a &str. Call .to_string() on any &str variable when pushing it into collections that expect a String.
9. Error: module 'epi' is private
Seems that epi is a private module in the eframe crate. Instead of using eframe::epi, switch the impl to use eframe::App.
10. Error: struct 'GpuAnalyzer' is private
To use GpuAnalyzer, you must change its visibility to pub. Modify its definition to pub struct GpuAnalyzer { ... }.
11. Error: cannot find type Box in this scope
The type Bot being referenced is not in scope. Ensure you import it with use crate::Bot;.
12. Warning about output filename collision
You have targets with the same name. Rename either the binary or the library in your Cargo.toml file to avoid collision.
Summary Steps to Fix
Update struct fields in your code to match current definitions.
Adjust function signatures to comply with required generics.
Fix borrow checking issues in your code.
Add necessary imports for used methods and macros.
Correct the use of associated methods vs function calls.
Make your structs public or adjust imports accordingly.
Resolve the filename collision by renaming targets.
After making these changes, try running cargo build again to see if the issues persist.