Repository: dtolnay/cargo-expand (language: rust)

Issue:
Installing with cargo install fails due to semver breakage in onig_sys
# Problem

When using `cargo install cargo-expand` the compilation fails due to a [semver-breaking release of `onig_sys`](https://github.com/rust-onig/rust-onig/issues/111). This does not happen when building the repo using `cargo build`. This is due to `Cargo.lock` being pinned to a non-breaking version of `onig_sys`.  `cargo install` doesn't seem to take the lock-file into account when installing it directly from [crates.io](crates.io).

<details>
<summary>Error message on compilation</summary>
<p>

```
$ cargo install cargo-expand
    Updating crates.io index
  Installing cargo-expand v0.4.12
   Compiling proc-macro2 v0.4.30
   Compiling unicode-xid v0.1.0
   Compiling libc v0.2.60
   Compiling syn v0.15.43
   Compiling cc v1.0.38
   Compiling memchr v2.2.1
   Compiling version_check v0.1.5
   Compiling failure_derive v0.1.5
   Compiling log v0.4.8
   Compiling rustc-demangle v0.1.15
   Compiling lazy_static v1.3.0
   Compiling byteorder v1.3.2
   Compiling cfg-if v0.1.9
   Compiling bitflags v1.1.0
   Compiling glob v0.3.0
   Compiling regex-syntax v0.6.11
   Compiling quick-error v1.2.2
   Compiling unicode-width v0.1.5
   Compiling strsim v0.8.0
   Compiling bindgen v0.50.0
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.1
   Compiling termcolor v1.0.5
   Compiling semver-parser v0.7.0
   Compiling shlex v0.1.1
   Compiling peeking_take_while v0.1.2
   Compiling strsim v0.7.0
   Compiling pkg-config v0.3.15
   Compiling fnv v1.0.6
   Compiling ident_case v1.0.1
   Compiling autocfg v0.1.5
   Compiling crc32fast v1.2.0
   Compiling ryu v1.0.0
   Compiling serde v1.0.98
   Compiling safemem v0.3.1
   Compiling ppv-lite86 v0.2.5
   Compiling scopeguard v1.0.0
   Compiling smallvec v0.6.10
   Compiling encoding_index_tests v0.1.4
   Compiling itoa v0.4.4
   Compiling linked-hash-map v0.5.2
   Compiling unicode-segmentation v1.3.0
   Compiling derive_builder v0.7.2
   Compiling xml-rs v0.8.0
   Compiling same-file v1.0.5
   Compiling lazycell v1.2.1
   Compiling shell-words v0.1.0
   Compiling remove_dir_all v0.5.2
   Compiling thread_local v0.3.6
   Compiling nom v4.2.3
   Compiling error-chain v0.12.1
   Compiling humantime v1.2.0
   Compiling textwrap v0.11.0
   Compiling clang-sys v0.28.1
   Compiling backtrace-sys v0.1.31
   Compiling libloading v0.5.2
   Compiling miniz-sys v0.1.12
   Compiling ansi_colours v1.0.1
   Compiling semver v0.9.0
   Compiling bincode v1.1.4
   Compiling line-wrap v0.1.1
   Compiling lock_api v0.3.1
   Compiling encoding-index-singlebyte v1.20141219.5
   Compiling encoding-index-tradchinese v1.20141219.5
   Compiling encoding-index-japanese v1.20141219.5
   Compiling encoding-index-korean v1.20141219.5
   Compiling encoding-index-simpchinese v1.20141219.5
   Compiling c2-chacha v0.2.2
   Compiling yaml-rust v0.4.3
   Compiling walkdir v2.2.9
   Compiling heck v0.3.1
   Compiling rustc_version v0.2.3
   Compiling encoding v0.2.33
   Compiling atty v0.2.13
   Compiling getrandom v0.1.8
   Compiling termios v0.3.1
   Compiling clicolors-control v1.0.0
   Compiling dirs v1.0.5
   Compiling directories v1.0.2
   Compiling aho-corasick v0.7.6
   Compiling content_inspector v0.2.4
   Compiling fxhash v0.2.1
   Compiling base64 v0.10.1
   Compiling quote v0.6.13
   Compiling clap v2.33.0
   Compiling parking_lot_core v0.6.2
   Compiling parking_lot v0.9.0
   Compiling rand_core v0.5.0
   Compiling backtrace v0.3.34
   Compiling flate2 v1.0.9
   Compiling cexpr v0.3.5
   Compiling rand_chacha v0.2.1
   Compiling regex v1.2.1
   Compiling rand v0.7.0
   Compiling tempfile v3.1.0
   Compiling env_logger v0.6.2
   Compiling console v0.7.7
   Compiling toolchain_find v0.1.4
   Compiling synstructure v0.10.2
   Compiling darling_core v0.9.0
   Compiling serde_derive v1.0.98
   Compiling structopt-derive v0.2.18
   Compiling syn-select v0.1.4
   Compiling structopt v0.2.18
   Compiling failure v0.1.5
   Compiling which v2.0.1
   Compiling darling_macro v0.9.0
   Compiling plist v0.4.2
   Compiling serde_json v1.0.40
   Compiling toml v0.5.1
   Compiling darling v0.9.0
   Compiling derive_builder_core v0.5.0
   Compiling onig_sys v69.2.0
   Compiling onig v4.3.2
error[E0412]: cannot find type `OnigRegexMut` in module `onig_sys`
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:142:20
    |
142 |     raw: onig_sys::OnigRegexMut,
    |                    ^^^^^^^^^^^^ help: a type alias with a similar name exists: `OnigRegex`

error[E0412]: cannot find type `OnigRegexMut` in module `onig_sys`
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:320:32
    |
320 |         let mut reg: onig_sys::OnigRegexMut = null_mut();
    |                                ^^^^^^^^^^^^ help: a type alias with a similar name exists: `OnigRegex`

error[E0412]: cannot find type `OnigRegexMut` in module `onig_sys`
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:321:50
    |
321 |         let reg_ptr = &mut reg as *mut onig_sys::OnigRegexMut;
    |                                                  ^^^^^^^^^^^^ help: a type alias with a similar name exists: `OnigRegex`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:326:18
    |
326 |             enc: null(),
    |                  ^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigEncodingTypeST`
               found type `*const _`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:327:18
    |
327 |             par: null(),
    |                  ^^^^^^ types differ in mutability
    |
    = note: expected type `*mut u8`
               found type `*const _`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:328:22
    |
328 |             par_end: null(),
    |                      ^^^^^^ types differ in mutability
    |
    = note: expected type `*mut u8`
               found type `*const _`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:341:17
    |
341 |                 syntax as *const Syntax as *const onig_sys::OnigSyntaxType,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigSyntaxType`
               found type `*const onig_sys::OnigSyntaxType`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:346:19
    |
346 |         if err == onig_sys::ONIG_NORMAL {
    |                   ^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
    |
346 |         if err == onig_sys::ONIG_NORMAL.try_into().unwrap() {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:515:17
    |
515 |                 match_param.as_raw()
    |                 ^^^^^^^^^^^^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigMatchParamStruct`
               found type `*const onig_sys::OnigMatchParamStruct`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/lib.rs:704:17
    |
704 |                 match_param.as_raw()
    |                 ^^^^^^^^^^^^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigMatchParamStruct`
               found type `*const onig_sys::OnigMatchParamStruct`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/find.rs:182:17
    |
182 |                 scan_cb::<F>,
    |                 ^^^^^^^^^^^^ expected enum `std::option::Option`, found fn item
    |
    = note: expected type `std::option::Option<unsafe extern "C" fn(i32, i32, *mut onig_sys::re_registers, *mut std::ffi::c_void) -> i32>`
               found type `extern "C" fn(i32, i32, *const onig_sys::re_registers, *mut std::ffi::c_void) -> i32 {find::<impl Regex>::scan_with_region::scan_cb::<F>}`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:24:22
   |
24 |                 beg: null(),
   |                      ^^^^^^ types differ in mutability
   |
   = note: expected type `*mut i32`
              found type `*const _`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:25:22
   |
25 |                 end: null(),
   |                      ^^^^^^ types differ in mutability
   |
   = note: expected type `*mut i32`
              found type `*const _`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:26:31
   |
26 |                 history_root: null(),
   |                               ^^^^^^ types differ in mutability
   |
   = note: expected type `*mut onig_sys::OnigCaptureTreeNodeStruct`
              found type `*const _`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:53:57
   |
53 |             onig_sys::onig_region_copy(&mut region.raw, ptr);
   |                                                         ^^^ types differ in mutability
   |
   = note: expected type `*mut onig_sys::re_registers`
              found type `*const onig_sys::re_registers`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:84:17
   |
84 |         if r != onig_sys::ONIG_NORMAL {
   |                 ^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
   |
84 |         if r != onig_sys::ONIG_NORMAL.try_into().unwrap() {
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:131:61
    |
131 |         let tree = unsafe { onig_sys::onig_get_capture_tree(&self.raw) };
    |                                                             ^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::re_registers`
               found type `&onig_sys::re_registers`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:191:17
    |
191 |                 &self.raw,
    |                 ^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::re_registers`
               found type `&onig_sys::re_registers`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/region.rs:193:17
    |
193 |                 traverse_cb::<F>,
    |                 ^^^^^^^^^^^^^^^^
    |                 |
    |                 expected enum `std::option::Option`, found fn item
    |                 help: try using a variant of the expected type: `Some(traverse_cb::<F>)`
    |
    = note: expected type `std::option::Option<unsafe extern "C" fn(i32, i32, i32, i32, i32, *mut std::ffi::c_void) -> i32>`
               found type `extern "C" fn(i32, i32, i32, i32, i32, *mut std::ffi::c_void) -> i32 {region::Region::tree_traverse_at::traverse_cb::<F>}`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/match_param.rs:30:17
   |
30 |                 limit as c_uint
   |                 ^^^^^^^^^^^^^^^
   |                 |
   |                 expected u64, found u32
   |                 help: you can convert an `u32` to `u64`: `(limit as c_uint).into()`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/names.rs:64:17
   |
64 |                 foreach_cb::<F>,
   |                 ^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found fn item
   |
   = note: expected type `std::option::Option<unsafe extern "C" fn(*const u8, *const u8, i32, *mut i32, *mut onig_sys::re_pattern_buffer, *mut std::ffi::c_void) -> i32>`
              found type `extern "C" fn(*const u8, *const u8, i32, *const i32, *mut onig_sys::re_pattern_buffer, *mut std::ffi::c_void) -> i32 {names::<impl Regex>::foreach_name::foreach_cb::<F>}`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/syntax.rs:99:51
   |
99 |             let op = onig_sys::onig_get_syntax_op(&self.raw);
   |                                                   ^^^^^^^^^ types differ in mutability
   |
   = note: expected type `*mut onig_sys::OnigSyntaxType`
              found type `&onig_sys::OnigSyntaxType`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/syntax.rs:100:53
    |
100 |             let op2 = onig_sys::onig_get_syntax_op2(&self.raw);
    |                                                     ^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigSyntaxType`
               found type `&onig_sys::OnigSyntaxType`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/syntax.rs:135:88
    |
135 |         SyntaxBehavior::from_bits_truncate(unsafe { onig_sys::onig_get_syntax_behavior(&self.raw) })
    |                                                                                        ^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigSyntaxType`
               found type `&onig_sys::OnigSyntaxType`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/syntax.rs:160:85
    |
160 |         RegexOptions::from_bits_truncate(unsafe { onig_sys::onig_get_syntax_options(&self.raw) })
    |                                                                                     ^^^^^^^^^ types differ in mutability
    |
    = note: expected type `*mut onig_sys::OnigSyntaxType`
               found type `&onig_sys::OnigSyntaxType`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/utils.rs:37:77
   |
37 |         unsafe { onig_sys::onig_unicode_define_user_property(name.as_ptr(), raw_ranges.as_ptr()) };
   |                                                                             ^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `*mut u32`
              found type `*const u32`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/buffers.rs:28:18
   |
27 |     fn encoding(&self) -> onig_sys::OnigEncoding {
   |                           ---------------------- expected `*mut onig_sys::OnigEncodingTypeST` because of return type
28 |         unsafe { &onig_sys::OnigEncodingUTF8 }
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `*mut onig_sys::OnigEncodingTypeST`
              found type `&onig_sys::OnigEncodingTypeST`

error[E0308]: mismatched types
  --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/buffers.rs:97:27
   |
97 |             enc: unsafe { &onig_sys::OnigEncodingASCII },
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `*mut onig_sys::OnigEncodingTypeST`
              found type `&onig_sys::OnigEncodingTypeST`

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/flags.rs:263:13
    |
263 |             onig_sys::ONIG_TRAVERSE_CALLBACK_AT_FIRST;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/flags.rs:266:13
    |
266 |             onig_sys::ONIG_TRAVERSE_CALLBACK_AT_LAST;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32

error[E0308]: mismatched types
   --> /home/oruud/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/onig-4.3.2/src/flags.rs:269:13
    |
269 |             onig_sys::ONIG_TRAVERSE_CALLBACK_AT_BOTH;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32

error: aborting due to 31 previous errors

Some errors have detailed explanations: E0308, E0412.
For more information about an error, try `rustc --explain E0308`.
error: failed to compile `cargo-expand v0.4.12`, intermediate artifacts can be found at `/tmp/cargo-installgfq3Mf`

Caused by:
  Could not compile `onig`.

To learn more, run the command again with --verbose.
```

</p>
</details>

# Solution

- [`syntec`](https://github.com/trishume/syntect) (the dependency which depends on `onig`) needs to:
    - [X] [depend on the newly released `5.0.0` version](https://github.com/trishume/syntect/commit/5afea9d12701cca18fe320e2e593e10ce7b47c5c)
    - [ ] release a new version
- [`prettyprint`](https://github.com/mre/prettyprint) needs to:
    - [ ] depend on the new version of `syntect`
    - [ ] release a new version
- `cargo-expand` needs to:
    - [ ] depend on new version of `prettyprint`
    - [ ] release a new version

# Workaround

As mentionned in the introduction, one can still install this directly from the repo because then the `Cargo.lock` file is honored. However one has to use `cargo build --release` and then copy the resulting binary into a folder in the `$PATH`.



Discussion / hints:
FYI @trishume -- would it be possible to cut a syntect release?
@dtolnay done, published as `v3.2.1`
Thanks! Looks like that did the trick, `cargo install cargo-expand` works again.
Hi, rust newbie here, not sure if this is related, but on Centos 7, cargo can't install v0.4.13 as it fails to compile onig_sys


> cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
> cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

<details><summary>Output of cargo install cargo-expand</summary>
<p>

```
cargo install cargo-expand
    Updating crates.io index
  Downloaded cargo-expand v0.4.13
  Downloaded 1 crate (24.9 KB) in 1.00s
  Installing cargo-expand v0.4.13
  Downloaded syn v0.15.44
  Downloaded structopt v0.2.18
  Downloaded serde v1.0.98
  Downloaded tempfile v3.1.0
  Downloaded toml v0.5.3
  Downloaded libc v0.2.61
  Downloaded toolchain_find v0.1.4
  Downloaded serde_derive v1.0.98
  Downloaded syn-select v0.1.4
  Downloaded structopt-derive v0.2.18
  Downloaded remove_dir_all v0.5.2
  Downloaded dirs v1.0.5
  Downloaded heck v0.3.1
  Downloaded unicode-segmentation v1.3.0
  Downloaded prettyprint v0.7.0
  Downloaded console v0.7.7
  Downloaded error-chain v0.12.1
  Downloaded derive_builder v0.7.2
  Downloaded syntect v3.2.1
  Downloaded shell-words v0.1.0
  Downloaded clicolors-control v1.0.0
  Downloaded darling v0.9.0
  Downloaded ansi_colours v1.0.1
  Downloaded cc v1.0.40
  Downloaded derive_builder_core v0.5.0
  Downloaded content_inspector v0.2.4
  Downloaded bincode v1.1.4
  Downloaded onig v5.0.0
  Downloaded directories v1.0.2
  Downloaded darling_macro v0.9.0
  Downloaded darling_core v0.9.0
  Downloaded yaml-rust v0.4.3
  Downloaded autocfg v0.1.5
  Downloaded strsim v0.7.0
  Downloaded ident_case v1.0.1
  Downloaded rustc-demangle v0.1.16
  Downloaded plist v0.4.2
  Downloaded onig_sys v69.2.0
  Downloaded line-wrap v0.1.1
  Downloaded bindgen v0.50.0
  Downloaded safemem v0.3.1
  Downloaded cexpr v0.3.5
  Downloaded clang-sys v0.28.1
  Downloaded fxhash v0.2.1
  Downloaded peeking_take_while v0.1.2
  Downloaded shlex v0.1.1
  Downloaded glob v0.3.0
  Downloaded which v2.0.1
  Downloaded libloading v0.5.2
  Downloaded nom v4.2.3
   Compiling proc-macro2 v0.4.30
   Compiling unicode-xid v0.1.0
   Compiling libc v0.2.61
   Compiling cc v1.0.40
   Compiling syn v0.15.44
   Compiling memchr v2.2.1
   Compiling failure_derive v0.1.5
   Compiling version_check v0.1.5
   Compiling cfg-if v0.1.9
   Compiling glob v0.3.0
   Compiling lazy_static v1.3.0
   Compiling rustc-demangle v0.1.16
   Compiling log v0.4.8
   Compiling byteorder v1.3.2
   Compiling bitflags v1.1.0
   Compiling unicode-width v0.1.5
   Compiling quick-error v1.2.2
   Compiling regex-syntax v0.6.11
   Compiling semver-parser v0.7.0
   Compiling termcolor v1.0.5
   Compiling vec_map v0.8.1
   Compiling ansi_term v0.11.0
   Compiling bindgen v0.50.0
   Compiling strsim v0.8.0
   Compiling peeking_take_while v0.1.2
   Compiling shlex v0.1.1
   Compiling ident_case v1.0.1
   Compiling strsim v0.7.0
   Compiling fnv v1.0.6
   Compiling pkg-config v0.3.15
   Compiling ryu v1.0.0
   Compiling autocfg v0.1.5
   Compiling crc32fast v1.2.0
   Compiling serde v1.0.98
   Compiling safemem v0.3.1
   Compiling scopeguard v1.0.0
   Compiling smallvec v0.6.10
   Compiling ppv-lite86 v0.2.5
   Compiling itoa v0.4.4
   Compiling linked-hash-map v0.5.2
   Compiling unicode-segmentation v1.3.0
   Compiling xml-rs v0.8.0
   Compiling derive_builder v0.7.2
   Compiling encoding_index_tests v0.1.4
   Compiling same-file v1.0.5
   Compiling lazycell v1.2.1
   Compiling remove_dir_all v0.5.2
   Compiling shell-words v0.1.0
   Compiling nom v4.2.3
   Compiling error-chain v0.12.1
   Compiling clang-sys v0.28.1
   Compiling thread_local v0.3.6
   Compiling backtrace-sys v0.1.31
   Compiling libloading v0.5.2
   Compiling miniz-sys v0.1.12
   Compiling ansi_colours v1.0.1
   Compiling textwrap v0.11.0
   Compiling humantime v1.2.0
   Compiling semver v0.9.0
   Compiling bincode v1.1.4
   Compiling line-wrap v0.1.1
   Compiling lock_api v0.3.1
   Compiling yaml-rust v0.4.3
   Compiling c2-chacha v0.2.2
   Compiling heck v0.3.1
   Compiling encoding-index-korean v1.20141219.5
   Compiling encoding-index-tradchinese v1.20141219.5
   Compiling encoding-index-japanese v1.20141219.5
   Compiling encoding-index-simpchinese v1.20141219.5
   Compiling encoding-index-singlebyte v1.20141219.5
   Compiling walkdir v2.2.9
   Compiling rustc_version v0.2.3
   Compiling encoding v0.2.33
   Compiling atty v0.2.13
   Compiling getrandom v0.1.8
   Compiling termios v0.3.1
   Compiling clicolors-control v1.0.0
   Compiling dirs v1.0.5
   Compiling directories v1.0.2
   Compiling aho-corasick v0.7.6
   Compiling content_inspector v0.2.4
   Compiling quote v0.6.13
   Compiling fxhash v0.2.1
   Compiling base64 v0.10.1
   Compiling parking_lot_core v0.6.2
   Compiling parking_lot v0.9.0
   Compiling clap v2.33.0
   Compiling rand_core v0.5.0
   Compiling cexpr v0.3.5
   Compiling backtrace v0.3.34
   Compiling regex v1.2.1
   Compiling flate2 v1.0.9
   Compiling rand_chacha v0.2.1
   Compiling synstructure v0.10.2
   Compiling darling_core v0.9.0
   Compiling serde_derive v1.0.98
   Compiling structopt-derive v0.2.18
   Compiling syn-select v0.1.4
   Compiling rand v0.7.0
   Compiling env_logger v0.6.2
   Compiling toolchain_find v0.1.4
   Compiling darling_macro v0.9.0
   Compiling structopt v0.2.18
   Compiling tempfile v3.1.0
   Compiling failure v0.1.5
   Compiling darling v0.9.0
   Compiling console v0.7.7
   Compiling plist v0.4.2
   Compiling serde_json v1.0.40
   Compiling toml v0.5.3
   Compiling derive_builder_core v0.5.0
   Compiling which v2.0.1
   Compiling onig_sys v69.2.0
error: failed to compile `cargo-expand v0.4.13`, intermediate artifacts can be found at `/tmp/cargo-installzGaFBZ`

Caused by:
  failed to run custom build command for `onig_sys v69.2.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installzGaFBZ/release/build/onig_sys-abfbb900b7dd5e84/build-script-build` (exit code: 101)
--- stdout
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

--- stderr
thread 'main' panicked at 'Unable to find libclang: "the `libclang` shared library at /usr/lib64/clang-private/libclang.so.6.0 could not be opened: libclangAST.so.6: cannot open shared object file: No such file or directory"', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

```

</p>
</details>

Like @barskern I managed to install expand 0.4.12 from source since its onig_sys is pinned on v69.1.0.

<details><summary>Install steps</summary>
<p>

```
    git clone https://github.com/dtolnay/cargo-expand.git
    cd cargo-expand
    git checkout 0.4.12
    cargo check # onig_sys must be on v69.1.0
    cargo build
    cargo install --locked
```

</p>
</details>

However I could not for 0.4.13 as its pinned on v69.2.0, nor 0.4.12 from crates.io as I can't find a way to pin the version of onig_sys (might be related to rust-lang/cargo#2263).

See rust-onig/rust-onig#109
I still get this error:
```
error: failed to run custom build command for `onig_sys v69.2.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installosjMY5/release/build/onig_sys-fb70de60a02474fa/build-script-build` (exit code: 101)
--- stdout
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config` executable

--- stderr
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'libclang.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', src/libcore/result.rs:999:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-expand v0.4.13`, intermediate artifacts can be found at `/tmp/cargo-installosjMY5`

```

Fix patch:
diff --git a/.travis.yml b/.travis.yml
index 29658ef..83ac520 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ rust:
   - stable
   - beta
   - nightly
-  - 1.32.0
+  - 1.34.0
 
 script:
   - cargo check
diff --git a/Cargo.lock b/Cargo.lock
index 2e003a4..c0cc2ef 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -94,28 +94,6 @@ dependencies = [
  "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "bindgen"
-version = "0.50.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cexpr 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "bitflags"
 version = "1.1.0"
@@ -150,6 +128,7 @@ name = "cargo-expand"
 version = "0.4.13"
 dependencies = [
  "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "onig 4.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "prettyprint 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -157,6 +136,7 @@ dependencies = [
  "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
  "syn-select 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntect 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -168,29 +148,11 @@ name = "cc"
 version = "1.0.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "cexpr"
-version = "0.3.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "cfg-if"
 version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "clang-sys"
-version = "0.28.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
- "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "clap"
 version = "2.33.0"
@@ -407,18 +369,6 @@ name = "encoding_index_tests"
 version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "env_logger"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "error-chain"
 version = "0.12.1"
@@ -469,14 +419,6 @@ name = "fuchsia-cprng"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "fxhash"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "getrandom"
 version = "0.1.10"
@@ -487,11 +429,6 @@ dependencies = [
  "wasi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "glob"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "heck"
 version = "0.3.1"
@@ -533,15 +470,6 @@ name = "libc"
 version = "0.2.62"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "libloading"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "line-wrap"
 version = "0.1.1"
@@ -563,14 +491,6 @@ dependencies = [
  "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "log"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "memchr"
 version = "2.2.1"
@@ -598,32 +518,22 @@ name = "nodrop"
 version = "0.1.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "nom"
-version = "4.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "onig"
-version = "5.0.0"
+version = "4.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
- "onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "onig_sys 69.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "onig_sys"
-version = "69.2.0"
+version = "69.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "bindgen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -652,11 +562,6 @@ dependencies = [
  "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "peeking_take_while"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "pkg-config"
 version = "0.3.15"
@@ -697,7 +602,7 @@ dependencies = [
  "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "syntect 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syntect 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -940,11 +845,6 @@ name = "shell-words"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "shlex"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "smallvec"
 version = "0.6.10"
@@ -1021,7 +921,7 @@ dependencies = [
 
 [[package]]
 name = "syntect"
-version = "3.2.1"
+version = "3.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1030,7 +930,7 @@ dependencies = [
  "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "onig 4.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "plist 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1150,15 +1050,6 @@ name = "wasi"
 version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "which"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "winapi"
 version = "0.3.7"
@@ -1221,15 +1112,12 @@ dependencies = [
 "checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b"
 "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
 "checksum bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9f04a5e50dc80b3d5d35320889053637d15011aed5e66b66b37ae798c65da6f7"
-"checksum bindgen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "65a913de3fa2fa95f2c593bb7e33b1be1ce1ce8a83f34b6bb02e6f01400b96cc"
 "checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd"
 "checksum blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bf775a81bb2d464e20ff170ac20316c7b08a43d11dbc72f0f82e8e8d3d6d0499"
 "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
 "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101"
 "checksum cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "b548a4ee81fccb95919d4e22cfea83c7693ebfd78f0495493178db20b3139da7"
-"checksum cexpr 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7fa24eb00d5ffab90eaeaf1092ac85c04c64aaf358ea6f84505b8116d24c6af"
 "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
-"checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853"
 "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
 "checksum clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73abfd4c73d003a674ce5d2933fca6ce6c42480ea84a5ffe0a2dc39ed56300f9"
 "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
@@ -1253,16 +1141,13 @@ dependencies = [
 "checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a"
 "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
 "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
-"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
 "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9"
 "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
 "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
 "checksum flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682"
 "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
-"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
 "checksum getrandom 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6171a6cc63fbabbe27c2b5ee268e8b7fe5dc1eb0dd2dfad537c1dfed6f69117e"
-"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
 "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
 "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114"
 "checksum ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
@@ -1270,21 +1155,17 @@ dependencies = [
 "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
 "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
 "checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
-"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
 "checksum line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
 "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
 "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc"
-"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
 "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
 "checksum miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9e3ae51cea1576ceba0dde3d484d30e6e5b86dee0b2d412fe3a16a15c98202"
 "checksum miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10"
 "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
-"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
-"checksum onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4e723fc996fff1aeab8f62205f3e8528bf498bdd5eadb2784d2d31f30077947"
-"checksum onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a8d4efbf5f59cece01f539305191485b651acb3785b9d5eef05749f0496514e"
+"checksum onig 4.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8518fcb2b1b8c2f45f0ad499df4fda6087fc3475ca69a185c173b8315d2fb383"
+"checksum onig_sys 69.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388410bf5fa341f10e58e6db3975f4bea1ac30247dd79d37a9e5ced3cb4cc3b0"
 "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
 "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
-"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
 "checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af"
 "checksum plist 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a9f075f6394100e7c105ed1af73fb1859d6fd14e49d4290d578120beb167f"
 "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b"
@@ -1320,7 +1201,6 @@ dependencies = [
 "checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425"
 "checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704"
 "checksum shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39acde55a154c4cd3ae048ac78cc21c25f3a0145e44111b523279113dce0d94a"
-"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
 "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7"
 "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
 "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
@@ -1330,7 +1210,7 @@ dependencies = [
 "checksum syn 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "158521e6f544e7e3dcfc370ac180794aa38cb34a1b1e07609376d4adcf429b93"
 "checksum syn-select 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "eae797fe9aa6ee5b478f3ae7b2ca1db303443853bcf65d6192e7f134124333a8"
 "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f"
-"checksum syntect 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fb5b18814fd5c81187d0b01b60a5b57e9577d6dc1e5e0b104443930005179e46"
+"checksum syntect 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e80b8831c5a543192ffc3727f01cf0e57579c6ac15558e3048bfb5708892167b"
 "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
 "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e"
 "checksum termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625"
@@ -1346,7 +1226,6 @@ dependencies = [
 "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
 "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e"
 "checksum wasi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd5442abcac6525a045cc8c795aedb60da7a2e5e89c7bf18a0d5357849bb23c7"
-"checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164"
 "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770"
 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
 "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9"
diff --git a/Cargo.toml b/Cargo.toml
index f99dd33..f1e13ab 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,12 +13,14 @@ readme = "README.md"
 
 [dependencies]
 atty = "0.2"
-prettyprint = "0.7"
+onig = "=4.3.3"
+prettyprint = "=0.7.0"
 proc-macro2 = "0.4"
 quote = { version = "0.6", default-features = false }
 serde = { version = "1.0", features = ["derive"] }
 structopt = "0.2"
 syn-select = "0.1.4"
+syntect = "=3.2.0"
 tempfile = "3.0"
 termcolor = "1.0"
 toml = "0.5"


Test patch: