repo stringclasses 1
value | pull_number int64 24 411 | instance_id stringlengths 21 22 | issue_numbers sequencelengths 1 2 | base_commit stringlengths 40 40 | patch stringlengths 348 114k | test_patch stringlengths 393 86.1k | problem_statement stringlengths 285 2.62k | hints_text stringlengths 0 2.14k | created_at stringlengths 20 20 | version stringclasses 10
values |
|---|---|---|---|---|---|---|---|---|---|---|
bitflags/bitflags | 411 | bitflags__bitflags-411 | [
"406"
] | 9c4b93c931e34a5104f50e20be1bdd15bc593b0e | diff --git a/src/lib.rs b/src/lib.rs
index 8f722591..b5e8911b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -38,7 +38,7 @@ bitflags! {
See the docs for the `bitflags` macro for the full syntax.
-Also see the [`example_generated`] module for an example of what the `bitflags` macro generates for a flags type.
+Also se... | diff --git a/tests/compile-pass/bitflags_impl_attrs.rs b/tests/compile-pass/bitflags_impl_attrs.rs
new file mode 100644
index 00000000..91d89823
--- /dev/null
+++ b/tests/compile-pass/bitflags_impl_attrs.rs
@@ -0,0 +1,13 @@
+extern crate bitflags;
+
+struct Example(u64);
+
+bitflags::bitflags! {
+ /// Docs on the `i... | Allow specifying attributes in `impl` mode
I'm considering `cfg`-gating the use of `bitflags!` in my libraries, and to that end it would be nice if it was possible to apply attributes to the generated `impl`s as well.
The naive solution would be:
```rust
pub struct Flags(u8);
#[cfg(feature = "bitflags")]
bitfl... | Thanks for the report @madsmtm! Anywhere attributes are allowed to be specified we should support in the macros as much as possible. I think this is just a missing piece of functionality for the impl mode. | 2024-06-24T23:17:40Z | 2.5 |
bitflags/bitflags | 380 | bitflags__bitflags-380 | [
"378"
] | 472e392c0d082c0894b18fb31f4e68e0b145e29c | diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index e5edec86..4f4c6c1d 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -84,18 +84,19 @@ jobs:
cd ./tests/smoke-test
cargo +$msrv build
- mips:
- name: Tests / MIPS (Big Endian)
+ miri:
+ na... | diff --git a/src/tests/iter.rs b/src/tests/iter.rs
index 889ebcb7..54b1d27d 100644
--- a/src/tests/iter.rs
+++ b/src/tests/iter.rs
@@ -3,6 +3,7 @@ use super::*;
use crate::Flags;
#[test]
+#[cfg(not(miri))] // Very slow in miri
fn roundtrip() {
for a in 0u8..=255 {
for b in 0u8..=255 {
diff --git a/sr... | Documenting bitflags: how to get documentation for the generated bitflags
Some code that I'm writing uses the `#![warn(missing_docs)]` macro to enforce a requirement that all public interfaces have documentation. I haven't been able to figure out how to generate documentation when using the `bitflags!` macro; I also ha... | https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=530756068e54aa56eb519dd66c9fdfc5
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f782c74e49e8c4c4ae940125265eb7ed
Thanks @rusty-snake! Those would actually make some great compile-pass tests 🤔 | 2023-10-09T04:48:32Z | 2.4 |
bitflags/bitflags | 366 | bitflags__bitflags-366 | [
"364"
] | 09f71f492d0f76d63cd286c3869c70676297e204 | diff --git a/examples/custom_bits_type.rs b/examples/custom_bits_type.rs
index 0364a2bd..8924bfdf 100644
--- a/examples/custom_bits_type.rs
+++ b/examples/custom_bits_type.rs
@@ -1,6 +1,6 @@
use std::ops::{BitAnd, BitOr, BitXor, Not};
-use bitflags::{Flags, Flag, Bits};
+use bitflags::{Bits, Flag, Flags};
// Defi... | diff --git a/src/tests.rs b/src/tests.rs
new file mode 100644
index 00000000..cb41f75a
--- /dev/null
+++ b/src/tests.rs
@@ -0,0 +1,107 @@
+mod all;
+mod bits;
+mod complement;
+mod contains;
+mod difference;
+mod empty;
+mod eq;
+mod extend;
+mod flags;
+mod fmt;
+mod from_bits;
+mod from_bits_retain;
+mod from_bits_tr... | Inconsistent debug output for flag with no bits
In a bitflags type where one of the named value has the value 0, the debug output for the type sometimes includes that value by name, and sometimes doesn't, apparently depending on whether any unrecognized bits are present. For example, this:
```rust
use bitflags::bitfl... | The value `0` isn’t recommended as a flag value because it behaves surprisingly with formatting, and with `is_any`.
If you do want to define a zero-valued flag I’d suggest defining the constant outside of the `bitflags!` macro. | 2023-06-26T07:21:41Z | 2.3 |
bitflags/bitflags | 355 | bitflags__bitflags-355 | [
"357"
] | 31d3e4afefc964045156d7fe3622733f48511353 | "diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml\nindex 6ebd5a74..15d1f950 1006(...TRUNCATED) | "diff --git a/tests/compile-fail/bitflags_custom_bits.rs b/tests/compile-fail/bitflags_custom_bits.r(...TRUNCATED) | "Clippy warnings around \"manual implementation of an assign operation\"\nHi.\r\n\r\nI've run into a(...TRUNCATED) | 2023-05-17T11:22:15Z | 2.3 | |
bitflags/bitflags | 351 | bitflags__bitflags-351 | [
"348"
] | 1d8388bf4ce18afde846d220ad8b6e0dc40aae94 | "diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml\nindex a32e1d55..6ebd5a74 1006(...TRUNCATED) | "diff --git a/tests/compile-fail/visibility/private_flags.rs b/tests/compile-fail/access_outside_vis(...TRUNCATED) | "Allow external impls of Bits and BitFlags\nThe `BitFlags` trait is currently sealed, and is only su(...TRUNCATED) | "As for `Bits`, it can be reasonably reduced to:\r\n\r\n```rust\r\npub trait Bits:\r\n Clone\r\n (...TRUNCATED) | 2023-05-04T06:16:51Z | 2.2 |
bitflags/bitflags | 345 | bitflags__bitflags-345 | [
"344"
] | cbcafa710fc31172511e62efa06ad9eb214e4734 | "diff --git a/src/example_generated.rs b/src/example_generated.rs\nindex 9c1ba46a..b7589014 100644\n(...TRUNCATED) | "diff --git a/tests/compile-pass/large.rs b/tests/compile-pass/large.rs\nnew file mode 100644\nindex(...TRUNCATED) | "Bitflags reverses order of multiline doc comments\nWhen compiling code like\r\n```\r\nbitflags! {\r(...TRUNCATED) | "This should be trivially fixed by swapping the order attributes are \"pushed\" in `__declare_bitfla(...TRUNCATED) | 2023-04-24T04:29:26Z | 2.2 |
bitflags/bitflags | 341 | bitflags__bitflags-341 | [
"308"
] | dc971042c8132a5381ab3e2165983ee7f9d44c63 | "diff --git a/src/lib.rs b/src/lib.rs\nindex 7ba784c5..a4a40467 100644\n--- a/src/lib.rs\n+++ b/src/(...TRUNCATED) | "diff --git a/tests/compile-pass/doc_alias.rs b/tests/compile-pass/doc_alias.rs\nnew file mode 10064(...TRUNCATED) | "Cannot use `#[doc(alias)]`\nThe following code:\r\n```rs\r\nbitflags::bitflags! {\r\n #[doc(alias (...TRUNCATED) | "This is a general problem for attributes that can't be applied to expressions now. In methods like (...TRUNCATED) | 2023-04-18T00:36:26Z | 2.1 |
bitflags/bitflags | 282 | bitflags__bitflags-282 | [
"228"
] | 810dc35aba3df7314de01b93c7aa137968e925d4 | "diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml\nindex b7b2486e..f00ed6c2 1006(...TRUNCATED) | "diff --git a/tests/basic.rs b/tests/basic.rs\nindex 73a52bec..790ec41c 100644\n--- a/tests/basic.rs(...TRUNCATED) | "Add an option for checking for valid bits is in the getter rather than constructor\nHi, I want to u(...TRUNCATED) | "Related: #188, #200, #207, #208, #211\n@niklasf @KodrAus worked on #200 \nBump!\r\n\r\nI'll do the (...TRUNCATED) | 2022-05-25T04:14:38Z | 1.3 |
bitflags/bitflags | 281 | bitflags__bitflags-281 | [
"215"
] | f38ce72d11ef3e264d4b62f360bd8a5597b916d9 | "diff --git a/src/bitflags_trait.rs b/src/bitflags_trait.rs\nindex 0ffee465..440d5274 100644\n--- a/(...TRUNCATED) | "diff --git a/tests/compile-fail/cfg/multi.stderr b/tests/compile-fail/cfg/multi.stderr\ndeleted fil(...TRUNCATED) | "Debug formatting leads to less desireable output\n[Link to rust playground](https://play.rust-lang.(...TRUNCATED) | "I think the current algorithm used for debug output is to loop over all flags and append identifier(...TRUNCATED) | 2022-05-03T06:59:46Z | 1.3 |
bitflags/bitflags | 276 | bitflags__bitflags-276 | [
"275"
] | 0141a07e55184304857384b0093d00959f0acfa6 | "diff --git a/src/lib.rs b/src/lib.rs\nindex ab7656e7..b9d77f7c 100644\n--- a/src/lib.rs\n+++ b/src/(...TRUNCATED) | "diff --git a/tests/compile-fail/non_integer_base/all_defined.stderr.beta b/tests/compile-fail/non_i(...TRUNCATED) | "from_bits accepts non existing flags\n```rs\r\n #[test]\r\n fn test_from_bits_edge_cases() {\(...TRUNCATED) | 2022-04-19T09:54:30Z | 1.3 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4