简体   繁体   中英

Cannot compile stb_truetype 0.2.4 because “slice pattern syntax is experimental”

I was following a tutorial on how to setup the piston library , but when I tried to compile it I got the following error message:

error[E0658]: slice pattern syntax is experimental (see issue #23121)
   --> /home/alexander/.cargo/registry/src/github.com-1ecc6299db9ec823/stb_truetype-0.2.4/src/lib.rs:606:13
    |
606 |         let [g1, g2] = if self.index_to_loc_format == 0 {
    |             ^^^^^^^^

I am using the same versions of all the libraries and the same code, what did I do wrong?

Slices patterns have been stabilized in rustc 1.26.0 (2018-05-10) .

On older compilers, they were only available experimentally, that is: 1) requiring a nightly compiler, 2) requiring the using crate to explicitly enable them with #![feature(slice_patterns)] , which newer versions of piston do not do.

You will have to update your compiler to use this version of piston.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM