This document summarizes common pitfalls encountered during development.
- Avoid using
println!()
in release code for VSCode extensions, as this can lead to unexpected behaviors. - If the user mistakenly uses
lib.rs
instead oflib.hsy
, ensure that errors are reported inCorgi.toml
.
- This issue might be related to environment variables set in the fish shell. Consider using the
-gx
flag.
- This error may occur if you are using
libtorch.so
from the Python package, which does not include all necessary dependencies.
- Solution: Restart VSCode to refresh environment variables.
- Refer to the Rust Cargo Documentation for dynamic library paths.
- This might be due to a mismatched edition key in
Cargo.toml
.
- Ensure there are no type errors in TypeScript code.
- Compare with
rust-analyzer
as a last resort. - Watch for infinite loops.
- Refer to VSCode Marketplace.
- Note: Version 94.1 is problematic due to numerous bugs; use 94.0 instead.
- Ensure that the
db
trait extends the otherdb
trait.
- The issue might be due to feature flags introduced by the dependency, affecting other dependencies (e.g.,
smallvec/union
).
-
Use the command:
cargo update -p bson:0.11.1 --precise 0.10.0
-
Example of handling optional trailing commas in macros:
($Name:ident { $($Variant:ident),* $(,)? }) => { // ^^^^^
-
Set the frame format with the following command:
settings set frame-format frame #${frame.index}: ${frame.pc}{ ${module.file.basename}{\`${function.name}}}{ at ${line.file.fullpath}:${line.number}}\n
- Search for "Server Logging: Enabled" in its settings.
- This issue is still under investigation.
- It’s highly recommended to read Using Regular Expressions in Visual Studio.
- Captured groups are particularly useful.
- Refer to the Rust Documentation for details on the
path
attribute.
- Try installing the appropriate version of
libstdc++
:
sudo apt install libstdc++-14-dev
or another relevant version.
- Crate Name: Ensure the crate name is in snake case.
tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::new(
"husky_websocket_utils=info",
))
.with(tracing_subscriber::fmt::layer())
.init();
panic using any type:
std::panic::panic_any(t)
https://stackoverflow.com/questions/24512356/how-to-use-variadic-macros-to-call-nested-constructors
https://doc.rust-lang.org/std/panic/struct.AssertUnwindSafe.html
Maybe it got shadowed in the way.
crates/vmir/husky-vmir/src/expr.rs not using eval_expr_itself properly
vscode will convert tab into space even for raw string, be careful
https://askubuntu.com/questions/1491254/installing-cuda-on-ubuntu-23-10-libt5info-not-installable
Note that the tutorial for ubuntu24 is different from ubuntu23.
Please check fish_variables and config.fish
Please check $PYTHONPATH
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
install nvidia container toolkit
don't listen to llms, they suck at this.
If a closure has a &mut
reference to a variable, not writing out the exact type can lead to rustc borrow checker error.
use crate::*;
pub(crate) fn foldm_aux<Engine, S, I, R>(
engine: &mut Engine,
state: &S,
mut iter: impl Iterator<Item = I> + Clone,
fs: &[&dyn Fn(&mut Engine, &S, &I) -> S],
g: &impl Fn(&mut Engine, &S) -> MiracleAltMaybeResult<R>,
) -> MiracleAltMaybeResult<R>
where
Engine: HasMiracleFull,
{
let Some(item) = iter.next() else {
return g(engine, state);
};
let fs = fs
.iter()
.map(|f| {
|engine| -> MiracleAltMaybeResult<R> {
let state = f(engine, state, &item);
foldm_aux(engine, &state, iter.clone(), fs, g)
}
})
.collect::<Vec<_>>();
engine.exec_batch2(&fs)
}
in crates/abstractions/miracle/src/foldm.rs
.