kaegi / alass

"Automatic Language-Agnostic Subtitle Synchronization"
GNU General Public License v3.0
994 stars 52 forks source link

Compilation fails with "use of unstable library feature try_from" #16

Closed mardukbp closed 4 years ago

mardukbp commented 4 years ago

On macOS 10.13 I installed the latest Rust and issued cargo install alass-cli. The compilation failed with the following output:

error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130)                       
   --> /Users/marduk/.cargo/registry/src/github.com-1ecc6299db9ec823/alass-core-2.0.0/src/rating_type.rs:18:9                                
    |                                                                                                                                        
18  |   pub use rating_i64::*;                                                                                                               
    |           ^^^^^^^^^^                                                                                                                   
...                                                                                                                                          
134 | / mod rating_i64 {                                                                                                                     
135 | |     use crate::{TimeDelta, TimeSpan};                                                                                                
136 | |     use std::cmp::min;                                                                                                               
137 | |                                                                                                                                      
...   |                                                                                                                                      
225 | |     impl RatingDeltaExt for RatingDelta {}                                                                                           
226 | | }                                                                                                                                    
    | |_- not an extern crate passed with `--extern`                                                                                         
    |                                                                                                                                        
note: this import refers to the module defined here                                                                                          
   --> /Users/marduk/.cargo/registry/src/github.com-1ecc6299db9ec823/alass-core-2.0.0/src/rating_type.rs:134:1                               
    |                                                                                                                                        
134 | / mod rating_i64 {                                                                                                                     
135 | |     use crate::{TimeDelta, TimeSpan};                                                                                                
136 | |     use std::cmp::min;                                                                                                               
137 | |                                                                                                                                      
...   |                                                                                                                                      
225 | |     impl RatingDeltaExt for RatingDelta {}                                                                                           
226 | | }                                                                                                                                    
    | |_^                                                                                                                                    

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)                                                                  
  --> /Users/marduk/.cargo/registry/src/github.com-1ecc6299db9ec823/alass-core-2.0.0/src/alass.rs:25:5                                       
   |                                                                                                                                         
25 | use std::convert::TryInto;                                                                                                              
   |     ^^^^^^^^^^^^^^^^^^^^^                                                                                                               

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)                                                                  
   --> /Users/marduk/.cargo/registry/src/github.com-1ecc6299db9ec823/alass-core-2.0.0/src/alass.rs:162:32                                    
    |                                                                                                                                        
162 |         let num_slots: usize = TryInto::<usize>::try_into((max_offset - min_offset).as_i64()).unwrap();                                
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                              

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)                                                                  
  --> /Users/marduk/.cargo/registry/src/github.com-1ecc6299db9ec823/alass-core-2.0.0/src/alass.rs:77:61                                      
   |                                                                                                                                         
77 |         let len: usize = (max_offset - min_offset).as_i64().try_into().unwrap();                                                        
   |                                                             ^^^^^^^^                                                                    

error[E0658]: use of unstable library feature 'try_from' (see issue #33417)                                                                  
  --> /Users/marduk/.cargo/registry/src/github.com-1ecc6299db9ec823/alass-core-2.0.0/src/alass.rs:90:65                                      
   |                                                                                                                                         
90 |                     let idx: usize = (idx - sigma_min).as_i64().try_into().unwrap();                                                    
   |                                                                 ^^^^^^^^                                                                

error: aborting due to 5 previous errors                                                                     
kaegi commented 4 years ago

I'd think your compiler version is too old. TryInto is stable since 1.34.0.

kaegi commented 4 years ago

For me, compilation works without a problem.

What is the output of rustc --version or cargo --version?

mardukbp commented 4 years ago

You are right. I do not know what happened. I thought I had the latest version installed. Thanks for your help!