add debug_assert_ne + assert_ne#35074
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
9812ee7 to
ee12bde
Compare
src/libcore/macros.rs
Outdated
There was a problem hiding this comment.
not sure what to put here
There was a problem hiding this comment.
macros are a bit odd, since they become insta-stable. Right now, since should be 1.12.0. Unsure about feature, since it won't have one. @alexcrichton ?
There was a problem hiding this comment.
I think the feature effectively doesn't matter -- assert_ne would be fine.
|
hi! does this need tests? i'm struggling to find where would love some direction on where/if to write tests. otherwise i think this should be good to go! |
c469651 to
123a54a
Compare
|
ok! tests added. thanks for the point in the right direction @steveklabnik 🐬 |
There was a problem hiding this comment.
I think this may need our standard license header to pass make tidy
There was a problem hiding this comment.
got it, @steveklabnik said it didn't, but i'll add it
fa0eb14 to
3f404f4
Compare
|
@bors: r+ 3f404f40d01f8a3f03d2ad219f81cb236d416f15 |
|
lemme know if you'd like me to squash ;) |
|
⌛ Testing commit 3f404f4 with merge aa5ce78... |
|
💔 Test failed - auto-linux-64-nopt-t |
|
@ashleygwilliams sure! Looks like the stability attributes may also need to be uncommented? |
76ddf5d to
ec8a8ef
Compare
|
@bors: r+ |
|
📌 Commit ec8a8ef has been approved by |
|
⌛ Testing commit ec8a8ef with merge 8e68479... |
|
💔 Test failed - auto-mac-64-opt-rustbuild |
|
Hmm, I don't see why this failed. |
|
Hm I guess maybe that could be a bug in rustbuild where it's using the wrong standard library, but I'd be surprised if that just came up! @ashleygwilliams does |
|
@ashleygwilliams of did you pass |
|
am waiting on it now @alexcrichton |
|
fails the same on my local machine as it fails in travis. |
|
Oh right these macros are defined in libcore but need to be reexported from the standard library |
|
lol omg I KNEW IT. i had been bugging @steveklabnik about needing to "register" the macros somewhere. commit + squash coming up |
0bafa78 to
8960845
Compare
src/libstd/lib.rs
Outdated
8960845 to
01d085b
Compare
i am unclear what this means. |
|
@bors: r+ Ah yeah that's fine, travis is broken right now unfortunately :( |
|
📌 Commit 01d085b has been approved by |
|
⌛ Testing commit 01d085b with merge 848e652... |
|
💔 Test failed - auto-linux-32-nopt-t |
|
@bors: retry |
|
🔒 Merge conflict |
|
/cc @ashleygwilliams , let's get that merge conflict fixed |
01d085b to
3d8d557
Compare
|
@bors: r+ |
|
📌 Commit 3d8d557 has been approved by |
|
Homu still seems to think this isn't mergeable @alexcrichton :/ |
|
Actually, it appears it was just a bad cache, it's working now 👍 |
add debug_assert_ne + assert_ne ~~✨ work in progress, please do not merge ✨~~ fixes #35073
This improves navigation and code highlighting inside the following macros:
assert!(a == b);
debug_assert!(a == b);
assert_eq!(a, b);
debug_assert_eq!(a, b);
assert_ne!(a, b);
debug_assert_ne!(a, b);
For assert! and debug_assert! format arguments are supported:
assert!(a == b, "Some text");
assert!(a == b, "Text {} {} syntax", "with", "format");
Different parenthesis are supported:
assert!(a == b);
assert![a == b];
assert!{a == b};
Fixes intellij-rust#636
assert_ne! is stable since Rust 1.12.
rust-lang/rust#35074
This improves navigation and code highlighting inside the following macros:
assert!(a == b);
debug_assert!(a == b);
assert_eq!(a, b);
debug_assert_eq!(a, b);
assert_ne!(a, b);
debug_assert_ne!(a, b);
Format arguments are supported:
assert!(a == b, "Text {} {} syntax", "with", "format");
assert!(a == b, "Some text");
assert_eq!(a, b, "Some text");
assert_ne!(a, b, "Some text");
Different parenthesis are supported:
assert!(a == b);
assert![a == b];
assert!{a == b};
Fixes intellij-rust#636
assert_ne! is stable since Rust 1.12.
rust-lang/rust#35074
✨ work in progress, please do not merge ✨fixes #35073