Skip to content

assert_eq!() cannot be used on Path #15625

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

Closed
o11c opened this issue Jul 12, 2014 · 3 comments
Closed

assert_eq!() cannot be used on Path #15625

o11c opened this issue Jul 12, 2014 · 3 comments

Comments

@o11c
Copy link

o11c commented Jul 12, 2014

Since Path isn't Show, it can't be used. This would be useful, for when you're actually comparing some container of Path, such as Option<Path> or Vec<Path>.

As an alternative, I tried .map(|p| p.display()) on both sides, but Display doesn't impl PartialEq, so it can't be used either. That means either .as_str().unwrap(), or just give up on the nicely printed failure and use plain assert!

@vks
Copy link
Contributor

vks commented Aug 29, 2014

Is there any reason why Show is not implemented using display?

@frewsxcv
Copy link
Member

frewsxcv commented Feb 3, 2015

Show was recently deprecated in favor of Debug. According to the current documentation, Path implements Debug.

screen shot 2015-02-02 at 9 38 14 pm

This can probably be closed.

@Gankra Gankra closed this as completed Feb 3, 2015
@kmcallister
Copy link
Contributor

Yep, I can use assert_eq! on Path as of rustc 1.0.0-nightly (52c74e6 2015-01-29 22:54:19 +0000)

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 18, 2023
fix: Don't skip closure captures after let-else

As I understand that `return` was left there by accident. It caused capture analysis to skip the rest of the block after a let-else, and then missed captures caused incorrect results in borrowck, closure hints, layout calculation, etc.

Fixes rust-lang#15623

I didn't understand why I using the example from rust-lang#15623 as-is doesn't work - I don't get the warnings unless I remove the `call_me()` call, even on the same commit as my own RA version which does show those warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants