Confusing error message about not being able to load a cargo file

I left my rust project a few months ago and just recently opened it back up to continue and I cant get past this new error. It was all working fine last time I was here in december. The error I listed below shows up right after all the warnings after running the script. (Those warnings just being about unused vars) I dont understand why it cant find the file, since I can physically find the file myself by using the path its also using. I've tried deleting the crates from my system and redownloading, it redownloads and then gives me the same error. What should I do with this?

Im unsure if this matters, but the crate referenced in the error isnt directly in my toml, bracket-lib = "0.8.1" Thats the one thats downloading it.

Error message:
thread 'main' panicked at 'Failed to load texture: IoError(Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." })', C:\Users\travi\.cargo\registry\src\\bracket-terminal-0.8.5\src\hal\gl_common\

Apologies if this post would be better written another way, this is my first post here so I'd be glad to edit it as requested.

What you are seeing isn't a compile error. Your code actually compiled just fine, but then when it ran it triggered a panic - panics are usually used to indicate a programming bug or when the programmer can't be bothered handling errors properly so they just crash the process.

In particular, it looks like the bracket-terminal crate is trying to load an image texture from disk and blowing up because it doesn't exist (the NotFound bit).

If you set the RUST_BACKTRACE environment variable to 1 you'll see a backtrace which tells you which functions were being called when the panic happened. From there, you should be able to figure out where the filename variable came from, and therefore which file is missing.

If you were the one supplying the filename then it's your responsibility to make sure you've got the right value, otherwise if it's something hard-coded by the bracket-terminal or bracket-lib crates you should file a ticket against their repo.

Something to keep in mind when using filenames is that relative files are resolved relative to the current directory. So if you can locate the file just fine when in one folder, but the program still can't find it, make sure you run the program from the same folder. It also pays to do an idiot check and print the filename being used just in case you've done something silly.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.