Commit Graph

323 Commits

Author SHA1 Message Date
bors[bot]
766297e69f Merge #173
173: Put the user-provided attributes first r=Dylan-DPC a=nox


`#[derive]` should always come after any proc macro attribute.

Co-authored-by: Anthony Ramine <n.oxyde@gmail.com>
2019-03-14 16:32:34 +00:00
Anthony Ramine
5580478557 Put the user-provided attributes first
`#[derive]` should always come after any proc macro attribute.
2019-03-14 11:50:34 +01:00
bors[bot]
bb53c1999b Merge #171
171: Fix running tests on on "stable" Rust r=KodrAus a=Mart-Bogdan

Currently all tests can be run only on nightly toolchain.
This PR fixes this, by using compiletest_rs with feature "stable" which works on stable rust, as well as on Nightly.

**P.S.** I wanted to make some use of cfg flags, but this solution seems working, despite loading but more packages then with nightly only.

**P.P.S.** What about specifying exact version of **compiletest_rs**, like "0.3.18", which is current, to not break further builds/tests ?

Co-authored-by: Bogdan Mart <mart.bogdan@gmail.com>
2019-01-30 04:24:45 +00:00
Bogdan Mart
87caf028b1 Use compiletest_rs flags supported by stable toolchain, and fixed it's version in place.
Made Travis CI run all tests on almost all platforms, except oldest rustc 1.20 which is incompatible with compiletest_rs.

Now all tests could be run locally without Nightly, and on more platforms in CI.
2019-01-26 10:20:34 +02:00
David Tolnay
cf2d746367
Update changelog for 1.0.4 2018-08-21 15:58:48 -04:00
David Tolnay
518aaf9149
Release 1.0.4 2018-08-21 15:54:08 -04:00
bors[bot]
7ec3fe2d7c Merge #165
165: Use local_inner_macros to resolve all helper macros within $crate r=Dylan-DPC a=dtolnay

This fixes the following error when using Rust 2018 style macro imports.

```rust
use bitflags::bitflags;
```

```console
error: cannot find macro `__bitflags!` in this scope
  --> src/main.rs:5:1
   |
5  | / bitflags! {
6  | |     struct Flags: u32 {
7  | |         const A = 0b00000001;
8  | |         const B = 0b00000010;
...  |
11 | |     }
12 | | }
   | |_^ help: you could try the macro: `bitflags`
   |
```

The `local_inner_macros` modifier resolves all macro invocations made from within that macro as helpers in the same crate. So if `bitflags!` expands to an invocation of `__bitflags!` then this would be resolved as `$crate::__bitflags!` rather than requiring the caller to have `__bitflags` in scope.

The attribute is ignored by pre-2018 compilers so bitflags will continue to work as normal with #[macro_use].

In the future when dropping compatibility with pre-2018 compilers we can remove the `local_inner_macros` modifier and use our own explicit `$crate::` prefixes on invocations of helper macros.

Co-authored-by: David Tolnay <dtolnay@gmail.com>
2018-07-27 06:23:21 +00:00
David Tolnay
e72681e4fa
Use local_inner_macros to resolve all helper macros within $crate
This fixes the following error when using Rust 2018 style macro imports.

    use bitflags::bitflags;

    error: cannot find macro `__bitflags!` in this scope
      --> src/main.rs:5:1
       |
    5  | / bitflags! {
    6  | |     struct Flags: u32 {
    7  | |         const A = 0b00000001;
    8  | |         const B = 0b00000010;
    ...  |
    11 | |     }
    12 | | }
       | |_^ help: you could try the macro: `bitflags`
       |

The `local_inner_macros` modifier resolves all macro invocations made
from within that macro as helpers in the same crate. So if `bitflags!`
expands to an invocation of `__bitflags!` then this would be resolved as
`$crate::__bitflags!` rather than requiring the caller to have
`__bitflags` in scope.

The attribute is ignored by pre-2018 compilers so bitflags will continue
to work as normal with #[macro_use].

In the future when dropping compatibility with pre-2018 compilers we can
remove the `local_inner_macros` modifier and use our own explicit
`$crate::` prefixes on invocations of helper macros.
2018-07-26 09:58:34 -07:00
bors[bot]
a588e91234 Merge #164
164: add badges like rand crate r=Dylan-DPC a=bcko

Latest version, Documentation, Minimum version, and License badges are added.
Thank you for checking my pull request! :)

Co-authored-by: BC Ko <bcko@users.noreply.github.com>
2018-07-01 08:22:37 +00:00
BC Ko
85af8f25ba
add badges like rand crate
Latest version, Documentation, Minimum version, and License badges are added.
Thank you for checking my pull request! :)
2018-06-30 21:56:53 -07:00
bors[bot]
1a636fea09 Merge #162
162: bors is here r=KodrAus a=Dylan-DPC



Co-authored-by: dylan_DPC <dylan.dpc@gmail.com>
Co-authored-by: Dylan DPC <dylan.dpc@gmail.com>
2018-05-31 23:45:08 +00:00
Dylan DPC
3460795d85
Update bors.toml 2018-05-31 22:45:21 +05:30
dylan_DPC
9aa6a8b696 bors is here 2018-05-31 17:28:26 +05:30
Ashley Mannix
5e5b50de93 add a gitter badge to readme (#161) 2018-05-31 15:17:09 +05:30
Ashley Mannix
40e336e5bf add code of conduct (#160) 2018-05-31 15:09:56 +05:30
Ashley Mannix
8b7ad83d70
Update url refs to bitflags for new org (#159) 2018-05-31 19:16:13 +10:00
David Tolnay
056b4a1073
Specify compiler version to test in osx 2018-04-30 10:29:33 -07:00
David Tolnay
83ec594e5b
Update changelog for 1.0.3 2018-04-30 10:28:58 -07:00
David Tolnay
e11d8c8f64
Release 1.0.3 2018-04-30 10:25:17 -07:00
David Tolnay
5debe8133b
Remove i128 feature flag in test
This feature has been stabilized in nightly.
2018-04-30 10:24:34 -07:00
David Tolnay
3d0f160cdf
Set up a cargo workspace 2018-04-30 10:23:26 -07:00
David Tolnay
08167e663d
Format with rustfmt 0.6.0 2018-04-30 10:20:42 -07:00
David Tolnay
0797951572
Merge pull request #157 from Alex-Addy/master
Improve zero value flag handling and documentation.
2018-04-30 10:18:56 -07:00
Alex Addy
6b1bc88740 Improve zero flag handling and documentation. 2018-04-30 08:15:47 -04:00
David Tolnay
74aa397b0e
Release 1.0.2 2018-04-25 19:36:19 -07:00
David Tolnay
fa536969e6
Changelog for 1.0.2 2018-04-25 19:35:54 -07:00
David Tolnay
a8cda0922e
Merge pull request #156 from CAD97/patch-1
Don't include example off docs.rs
2018-04-25 19:29:02 -07:00
David Tolnay
0f42a0085d
Revert example_generated::Flags to pub 2018-04-25 19:26:31 -07:00
David Tolnay
07a4252f25
Merge pull request #153 from hcpl/fix-examples
Fix the example `Flags` struct
2018-04-25 19:26:07 -07:00
David Tolnay
a9a1dd8a93
Merge pull request #149 from hmvp/master
Fix clippy lints
2018-04-25 19:19:45 -07:00
Christopher Durham
5dd6762d27
Don't build example by default 2018-04-25 21:40:48 -04:00
hcpl
ce6c4462ab Fix the example Flags struct
So that it actually match the one in the crate level docs.
2018-04-09 23:54:01 +03:00
Hmvp
3ae42624f5 Fix clippy lints
https://rust-lang-nursery.github.io/rust-clippy/v0.0.187/index.html#redundant_field_names
2018-03-06 15:19:39 +01:00
Alex Crichton
13e54b43c9 Tweak travis config
No need to test on so many OSX platforms which unfortunately are pretty slow
nowadays.
2017-12-08 08:07:14 -08:00
David Tolnay
f2ccedd7e1
Link PR numbers in changelog 2017-11-12 08:14:10 -08:00
David Tolnay
35bc087182
Add 1.0.1 to changelog 2017-11-12 08:09:13 -08:00
David Tolnay
4b02847266
Release 1.0.1 2017-11-12 08:02:47 -08:00
David Tolnay
4afd947483
Merge pull request #136 from Amanieu/missing_inline
Adding missing #[inline]
2017-11-12 07:57:39 -08:00
David Tolnay
9bbf370c02
Merge pull request #135 from GabrielMajeri/add-vis-macros
Add stable code for pub restricted
2017-11-12 07:48:00 -08:00
Amanieu d'Antras
4954ea106b Add missing #[inline] 2017-11-12 15:40:31 +00:00
Gabriel Majeri
0ecb9f568f Add stable code for bitflags visibility 2017-11-08 07:36:16 +02:00
David Tolnay
8e163c64ec Merge pull request #132 from rust-lang-nursery/align
Clean up excessive indentation
2017-10-22 14:54:45 -07:00
David Tolnay
dcfb29e6fd Merge pull request #133 from tamird/generalize
DRY the macro
2017-10-22 14:45:32 -07:00
Tamir Duberstein
f0853cbd5a
Generalize visibility handling 2017-10-22 17:26:49 -04:00
Tamir Duberstein
dea389434d
Remove unnecessary and confusing keywords 2017-10-22 17:26:49 -04:00
Tamir Duberstein
d9027fb8be
Run external test suite on stable as well
Unstable still only runs on nightly.
2017-10-22 17:26:48 -04:00
David Tolnay
fdfc321c84
Clean up excessive indentation
I don't like this deliberately aligned, excessively indented style. It seems to
have fallen out of favor with rustfmt as well -- see their decision about
alignment of where-clauses.
2017-10-22 13:11:09 -07:00
David Tolnay
c5217d3416 Merge pull request #131 from rust-lang-nursery/vistest
Compile and test the visibility example code
2017-10-22 13:06:14 -07:00
David Tolnay
c404e428ca
Compile and test the visibility example code 2017-10-22 12:48:07 -07:00
David Tolnay
5d3790e6fe Merge pull request #127 from tamird/master
Move tests to test suite crate
2017-10-22 12:44:44 -07:00