Skip to content

Funny help message "help: consider adding a leading b: bstringify!(foo)" #48872

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Closed
glandium opened this issue Mar 9, 2018 · 2 comments
Closed

Comments

@glandium
Copy link
Contributor

glandium commented Mar 9, 2018

Reduced testcase:

fn foo() -> bool {
    b"".starts_with(stringify!(foo))
}

Compiler output:

error[E0308]: mismatched types
 --> src/main.rs:2:21
  |
2 |     b"".starts_with(stringify!(foo))
  |                     ^^^^^^^^^^^^^^^
  |                     |
  |                     expected slice, found str
  |                     help: consider adding a leading `b`: `bstringify!(foo)`
  |
  = note: expected type `&[u8]`
             found type `&'static str`
@zackmdavis
Copy link
Member

(duplicate of #48835 and #48364, I think)

@kennytm
Copy link
Member

kennytm commented Mar 9, 2018

Closing as duplicate of #48835. Thanks for the bug report anyway!

@kennytm kennytm closed this as completed Mar 9, 2018
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants