Question to vibe Rust programmers (using bleeding edge Rust)

⚓ Rust    📅 2026-01-13    👤 surdeus    👁️ 1      

surdeus

I noticed that most of my Rust questions to AI get answered using the bleeding edge Rust. For example, I needed to cut trailing slashes in PathBuf. AI gave me three options:

  1. To remove a trailing separator from a PathBuf in Rust, you should use the pop_trailing_sep() method, available through the #![feature(path_trailing_sep)] nightly feature, or the stable trim_trailing_sep() method if working with an immutable Path reference.
    Using pop_trailing_sep (Nightly Rust)
  2. Using trim_trailing_sep (Stable Rust)
    For stable Rust, you can use the trim_trailing_sep() method on a Path reference. This returns a new &Path without the trailing separator. You can then convert it back to a PathBuf if necessary:
    rust
  3. Using components() iterator to re-build PathBuf

Despite that suggestion (2) claims to use the stable Rust, it sill uses nightly build feature,

error[E0658]: use of unstable library feature `path_trailing_sep`
   --> ./simterminal/src/rust/terminal.rs:312:55
    |
312 |                     let trimmed_path: &Path = cwd_new.trim_trailing_sep();
    |                                                       ^^^^^^^^^^^^^^^^^
    |
    = note: see issue #142503 <https://github.com/rust-lang/rust/issues/142503> for more information

error: aborting due to 1 previous error

So I ended with the suggestion (3). So my question: when you actually do the vibe coding in Rust, is your final code 'nightly build' based, or stable?

1 post - 1 participant

Read full topic

🏷️ Rust_feed