-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PathBuf instead of String where applicable #46335
Conversation
src/librustc_driver/driver.rs
Outdated
} | ||
|
||
pub fn source_name(input: &Input) -> String { | ||
pub fn source_name(input: &Input) -> FileName { | ||
match *input { | ||
// FIXME (#9639): This needs to handle non-utf8 paths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this FIXME still relevant in this place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fixed with this PR, but there's no repro example on the issue
503e433
to
12c9233
Compare
Travis likes it now |
☔ The latest upstream changes (presumably #46338) made this pull request unmergeable. Please resolve the merge conflicts. |
rebased |
Excellent, looks great! Will do detailed review tomorrow. |
src/libsyntax/parse/parser.rs
Outdated
parser.directory.path = sess.codemap() | ||
.span_to_unmapped_path(parser.span) | ||
.to_string() | ||
.into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need PathBuf
-> String
-> PathBuf
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. I have no idea what I did there. That was probably some intermediate step to get stuff to compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no, I remember why. This is FileName -> String -> PathBuf
. I should probably change the path
field to be a FileName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And fixed
There are two
|
I assumed (wrongly) that |
Makes sense! @bors r+ |
📌 Commit 7870500 has been approved by |
⌛ Testing commit 78705008cc10f1a0fc8495b79ae87561330db61f with merge 4fd6bd5f3faa692795a2907ff09115df2071fe62... |
💔 Test failed - status-travis |
Legit. Aux builder pretty-fulldeps |
That was a weird one. |
@oli-obk That sounds like a rustbuild bug... |
@kennytm I'm not sure, since it's explicitly done on the aux builder, this might be intentional |
@oli-obk The |
@bors r=jseyfried |
📌 Commit c273d45 has been approved by |
🔒 Merge conflict |
☔ The latest upstream changes (presumably #46605) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors delegate+ |
✌️ @oli-obk can now approve this pull request |
@bors r=jseyfried |
📌 Commit d732da8 has been approved by |
Use PathBuf instead of String where applicable r? @jseyfried
☀️ Test successful - status-appveyor, status-travis |
@oli-obk RLS and Rustfmt have both been fixed (using your commits), could you send a PR to update them in the Rust repo and unbreak them for testing (if you only touch the submodules and Cargo.lock, then pre-emptive r=me, p=1). |
on it |
This fixes an accidental regression rust-lang#46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
…on, r=estebank rustc: Spawn `cmd /c` for `.bat` scripts This fixes an accidental regression rust-lang#46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
…on, r=estebank rustc: Spawn `cmd /c` for `.bat` scripts This fixes an accidental regression rust-lang#46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
This fixes an accidental regression rust-lang#46335 where the behavior of `Path::ends_with` is different from `str::ends_with` (paths operate over components, strs operate over chars).
r? @jseyfried