Skip to content

Conversation

topecongiro
Copy link
Contributor

This PR adds tests for the following issues:
#15953, #18446, #22874 and #23311.

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

fn main() {
match "foo".as_bytes() {
b"food" => (),
[b'f', ..] => (), //~ ERROR expected an array or slice, found `&[u8]` [E0529]
Copy link
Contributor

Choose a reason for hiding this comment

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

Rules for slice patterns slightly changed since #23311 was filed.
[b'f', ..] needs to be replaced with &[b'f', ..] to reproduce the old behavior.

@alexcrichton
Copy link
Member

Thanks @topecongiro! r=me with @petrochenkov's suggestion

@topecongiro
Copy link
Contributor Author

topecongiro commented Mar 7, 2017

@petrochenkov Thank you for your comment!
r=alexcrichton (Is this correct?)

EDIT: I realized that after replacing [b'f', ..] with &[b'f', ..], the test no more fails. So I moved it from compile-fail to run-pass.

@petrochenkov
Copy link
Contributor

@bors r=alexcrichton

@bors
Copy link
Collaborator

bors commented Mar 7, 2017

📌 Commit 7dc36e9 has been approved by alexcrichton

arielb1 pushed a commit to arielb1/rust that referenced this pull request Mar 8, 2017
…excrichton

Add tests for issues with the 'E-needtest' label.

This PR adds tests for the following issues:
bors added a commit that referenced this pull request Mar 9, 2017
@bors bors merged commit 7dc36e9 into rust-lang:master Mar 9, 2017
@bors
Copy link
Collaborator

bors commented Mar 9, 2017

⌛ Testing commit 7dc36e9 with merge 3087a1f...

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

Successfully merging this pull request may close these issues.

5 participants