Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lengyijun committed Jun 22, 2024
1 parent c4eead5 commit 88e242e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ui/pathbuf_init_then_push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
use std::path::PathBuf;

fn main() {
let mut path_buf = PathBuf::new();
let mut path_buf = PathBuf::new(); //~ ERROR: calls to `push` immediately after creation
path_buf.push("foo");

path_buf = PathBuf::from("foo");
path_buf = PathBuf::from("foo"); //~ ERROR: calls to `push` immediately after creation
path_buf.push("bar");

let bar = "bar";
path_buf = PathBuf::from("foo");
path_buf = PathBuf::from("foo"); //~ ERROR: calls to `push` immediately after creation
path_buf.push(bar);

let mut path_buf = PathBuf::from("foo").join("bar");
let mut path_buf = PathBuf::from("foo").join("bar"); //~ ERROR: calls to `push` immediately after creation
path_buf.push("buz");

let mut x = PathBuf::new();
Expand Down

0 comments on commit 88e242e

Please sign in to comment.