1. 16 Nov, 2018 7 commits
    • Federico Mena Quintero's avatar
    • Alex Crichton's avatar
      Refactor explicit production of errors · ee47726d
      Alex Crichton authored
      I was reading over the gnome-class macro crate recently and I was having
      a difficult time getting up to speed on the error handling of the crate
      as it was using a number of patterns I hadn't seen before. I was also
      wondering how only one `Span` was necessary to create an error when
      multi-token spans were needed sometimes, which led me in the end to
      start a refactor here.
      The first point of refactoring was to ensure that multi-token errors
      were handled. Although the `syn` crate has a `Spanned` trait it doesn't
      actually work on stable Rust, so the errors coming out of gnome-class
      today weren't compatible with being spanned over multiple tokens. I
      added a convenience API in https://github.com/dtolnay/syn/pull/538 and
      have started using that here to construct syn `Error` instances.
      Next I opted to lift similar error handling from the `failure` crate
      here as well. This was primarily the `bail!` macro as well as the
      `format_err!` macro, used to quickly return and create errors with
      formatted messages.
      Using this macro I was able to replace most of the support traits in
      `src/errors.rs` with local error handling and/or various other idioms.
      Afterwards the crate (to me at least) feels much more idiomatic in terms
      of error handling where `?` is still maximally used, returning an error
      is easy to do, and there aren't too many traits/methods to discover when
      learning how to work with errors.
    • Federico Mena Quintero's avatar
    • Jordan Petridis's avatar
      Cargo: build the tests against rust 2015 · 3e982566
      Jordan Petridis authored
      The library is building against rust 2018 but the test can't
      compile succesfully against that.
    • Alex Crichton's avatar
      Tweak `get_type_slow` slightly · f62a7c2d
      Alex Crichton authored
      A few changes included in this small refactoring:
      * The return value is asserted to not be `G_TYPE_INVALID`
      * Instead of `catch_unwind` a `Drop` implementation is used.
      * When spinning, use `yield_now` to ensure that not too much work is
      Closes #39
    • Jordan Petridis's avatar
      Build agaisnt Rust 2018 edition · 150a6af7
      Jordan Petridis authored
      Looks like we are hitting a compiler bug so we need to enable
      `extern_crate_item_prelude`. Should be fixed by the time
      Rust 2018 is released though.
      [1] https://github.com/rust-lang/rust/issues/55599
    • Jordan Petridis's avatar
  2. 15 Nov, 2018 14 commits
  3. 11 Nov, 2018 1 commit
  4. 10 Nov, 2018 1 commit
  5. 09 Nov, 2018 3 commits
  6. 08 Nov, 2018 2 commits
  7. 01 Nov, 2018 1 commit
  8. 31 Oct, 2018 1 commit
  9. 30 Oct, 2018 1 commit
  10. 29 Oct, 2018 1 commit
  11. 28 Oct, 2018 1 commit
  12. 27 Oct, 2018 2 commits
  13. 24 Oct, 2018 1 commit
  14. 20 Oct, 2018 2 commits
  15. 19 Oct, 2018 1 commit
  16. 18 Oct, 2018 1 commit