Skip to content
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

Merged
merged 1 commit into from
Dec 14, 2017
Merged

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Nov 28, 2017

}

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
Copy link
Member

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?

Copy link
Contributor Author

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

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2017
@oli-obk oli-obk force-pushed the cleanups branch 2 times, most recently from 503e433 to 12c9233 Compare November 29, 2017 11:48
@oli-obk
Copy link
Contributor Author

oli-obk commented Nov 29, 2017

Travis likes it now

@bors
Copy link
Contributor

bors commented Dec 1, 2017

☔ The latest upstream changes (presumably #46338) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 1, 2017

rebased

@jseyfried
Copy link
Contributor

Excellent, looks great! Will do detailed review tomorrow.

parser.directory.path = sess.codemap()
.span_to_unmapped_path(parser.span)
.to_string()
.into();
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And fixed

@kennytm
Copy link
Member

kennytm commented Dec 4, 2017

There are two run-pass-fulldeps tests failed with "position 0 does not resolve to a source location".

[01:01:07] ---- [run-pass] run-pass-fulldeps/issue-35829.rs stdout ----
[01:01:07] 	
[01:01:07] error: test run failed!
[01:01:07] status: exit code: 101
[01:01:07] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/issue-35829.stage2-x86_64-unknown-linux-gnu"
[01:01:07] stdout:
[01:01:07] ------------------------------------------
[01:01:07] 
[01:01:07] ------------------------------------------
[01:01:07] stderr:
[01:01:07] ------------------------------------------
[01:01:07] thread 'main' panicked at 'Some tests failed', /checkout/src/tools/compiletest/src/main.rs:331:21
[01:01:07] thread 'main' panicked at 'position 0 does not resolve to a source location', /checkout/src/libsyntax/codemap.rs:632:8
[01:01:07] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:01:07] 
[01:01:07] ------------------------------------------
[01:01:07] 
[01:01:07] thread '[run-pass] run-pass-fulldeps/issue-35829.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2570:8
[01:01:07] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:01:07] 
[01:01:07] ---- [run-pass] run-pass-fulldeps/qquote.rs stdout ----
[01:01:07] 	
[01:01:07] error: test run failed!
[01:01:07] status: exit code: 101
[01:01:07] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/qquote.stage2-x86_64-unknown-linux-gnu"
[01:01:07] stdout:
[01:01:07] ------------------------------------------
[01:01:07] 
[01:01:07] ------------------------------------------
[01:01:07] stderr:
[01:01:07] ------------------------------------------
[01:01:07] thread 'main' panicked at 'position 0 does not resolve to a source location', /checkout/src/libsyntax/codemap.rs:632:8
[01:01:07] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:01:07] 
[01:01:07] ------------------------------------------
[01:01:07] 
[01:01:07] thread '[run-pass] run-pass-fulldeps/qquote.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2570:8
[01:01:07] 
[01:01:07] 
[01:01:07] failures:
[01:01:07]     [run-pass] run-pass-fulldeps/issue-35829.rs
[01:01:07]     [run-pass] run-pass-fulldeps/qquote.rs
[01:01:07] 
[01:01:07] test result: FAILED. 84 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 5, 2017

I assumed (wrongly) that span_to_unmapped_path handled DUMMY_SP, reintroduced the check that was there berfore

@jseyfried
Copy link
Contributor

Makes sense! @bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2017

📌 Commit 7870500 has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Dec 5, 2017

⌛ Testing commit 78705008cc10f1a0fc8495b79ae87561330db61f with merge 4fd6bd5f3faa692795a2907ff09115df2071fe62...

@bors
Copy link
Contributor

bors commented Dec 6, 2017

💔 Test failed - status-travis

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2017

Legit. Aux builder pretty-fulldeps

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 6, 2017
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2017

That was a weird one. ./x.py test never catches it. ./x.py test src/run-pass-fulldeps/pretty doesn't catch it if ./x.py test ran through successfully before.

@kennytm
Copy link
Member

kennytm commented Dec 6, 2017

@oli-obk That sounds like a rustbuild bug...

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 6, 2017
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 6, 2017

@kennytm I'm not sure, since it's explicitly done on the aux builder, this might be intentional

@kennytm
Copy link
Member

kennytm commented Dec 6, 2017

@oli-obk The ./x.py test never catches it is intentional, but ./x.py test src/run-pass-fulldeps/pretty doesn't catch it is certainly not. But I'm assuming you're running it in --stage 2 since some tests can't be run in earlier stages.

@kennytm
Copy link
Member

kennytm commented Dec 14, 2017

@bors r=jseyfried

@bors
Copy link
Contributor

bors commented Dec 14, 2017

📌 Commit c273d45 has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Dec 14, 2017

🔒 Merge conflict

@bors
Copy link
Contributor

bors commented Dec 14, 2017

☔ The latest upstream changes (presumably #46605) made this pull request unmergeable. Please resolve the merge conflicts.

@kennytm
Copy link
Member

kennytm commented Dec 14, 2017

@bors delegate+

@bors
Copy link
Contributor

bors commented Dec 14, 2017

✌️ @oli-obk can now approve this pull request

@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 14, 2017

@bors r=jseyfried

@bors
Copy link
Contributor

bors commented Dec 14, 2017

📌 Commit d732da8 has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Dec 14, 2017

⌛ Testing commit d732da8 with merge 8624ea5...

bors added a commit that referenced this pull request Dec 14, 2017
Use PathBuf instead of String where applicable

r? @jseyfried
@bors
Copy link
Contributor

bors commented Dec 14, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: jseyfried
Pushing 8624ea5 to master...

@nrc
Copy link
Member

nrc commented Dec 15, 2017

@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).

@oli-obk oli-obk deleted the cleanups branch December 15, 2017 07:08
@oli-obk
Copy link
Contributor Author

oli-obk commented Dec 15, 2017

on it

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 16, 2018
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).
kennytm added a commit to kennytm/rust that referenced this pull request Jan 17, 2018
…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).
kennytm added a commit to kennytm/rust that referenced this pull request Jan 17, 2018
…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).
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 18, 2018
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants