space-menace icon indicating copy to clipboard operation
space-menace copied to clipboard

Couldn't build on Manjaro

Open juliohq opened this issue 3 years ago • 2 comments

OS: Manjaro Linux x86_64 Kernel: 5.10.42-1-MANJARO CPU: Intel Celeron J1800 (2) @ 2.415GHz GPU: Intel Atom Processor Z36xxx/Z37xxx Series Graphics & Display RAM: 4G

Got the following error:

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:243:55 | 243 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1); | ^^^^^^^^^^^^^^^ expected usize, found u32`

error[E0277]: no implementation for usize & u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:243:53 | 243 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1); | ^ no implementation for usize & u32 | = help: the trait BitAnd<u32> is not implemented for usize

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:261:40 | 261 | let (q, r) = shift.ceil_divmod(Limb::BITS); | ^^^^^^^^^^ expected usize, found u32 | help: you can convert a u32 to a usize and panic if the converted value doesn't fit | 261 | let (q, r) = shift.ceil_divmod(Limb::BITS.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigint.rs:85:24 | 85 | let bytes = bits / Limb::BITS; | ^^^^^^^^^^ expected usize, found u32

error[E0277]: cannot divide usize by u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigint.rs:85:22 | 85 | let bytes = bits / Limb::BITS; | ^ no implementation for usize / u32 | = help: the trait Div<u32> is not implemented for usize

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1045:42 | 1045 | let mut count = index.saturating_mul(Limb::BITS); | ^^^^^^^^^^ expected usize, found u32 | help: you can convert a u32 to a usize and panic if the converted value doesn't fit | 1045 | let mut count = index.saturating_mul(Limb::BITS.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1060:28 | 1060 | Limb::BITS.checked_mul(x.len()) | ^^^^^^^ expected u32, found usize | help: you can convert a usize to a u32 and panic if the converted value doesn't fit | 1060 | Limb::BITS.checked_mul(x.len().try_into().unwrap()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1061:22 | 1061 | .map(|v| v - nlz) | ^^^ expected u32, found usize

error[E0277]: cannot subtract usize from u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1061:20 | 1061 | .map(|v| v - nlz) | ^ no implementation for u32 - usize | = help: the trait Sub<usize> is not implemented for u32

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1062:20 | 1062 | .unwrap_or(usize::max_value()) | ^^^^^^^^^^^^^^^^^^ expected u32, found usize | help: you can convert a usize to a u32 and panic if the converted value doesn't fit | 1062 | .unwrap_or(usize::max_value().try_into().unwrap()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1060:5 | 1056 | pub fn bit_length(x: &[Limb]) -> usize { | ----- expected usize because of return type ... 1060 | / Limb::BITS.checked_mul(x.len()) 1061 | | .map(|v| v - nlz) 1062 | | .unwrap_or(usize::max_value()) | |______________________________________^ expected usize, found u32 | help: you can convert a u32 to a usize and panic if the converted value doesn't fit | 1060 | Limb::BITS.checked_mul(x.len()) 1061 | .map(|v| v - nlz) 1062 | .unwrap_or(usize::max_value()).try_into().unwrap() |

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1087:23 | 1087 | debug_assert!(n < bits && n != 0); | ^^^^ expected usize, found u32 | help: you can convert a u32 to a usize and panic if the converted value doesn't fit | 1087 | debug_assert!(n < bits.try_into().unwrap() && n != 0); | ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1094:25 | 1094 | let lshift = bits - n; | ^ expected u32, found usize

error[E0277]: cannot subtract usize from u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1094:23 | 1094 | let lshift = bits - n; | ^ no implementation for u32 - usize | = help: the trait Sub<usize> is not implemented for u32

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1135:19 | 1135 | let rem = n % bits; | ^^^^ expected usize, found u32

error[E0277]: cannot mod usize by u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1135:17 | 1135 | let rem = n % bits; | ^ no implementation for usize % u32 | = help: the trait Rem<u32> is not implemented for usize

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1136:19 | 1136 | let div = n / bits; | ^^^^ expected usize, found u32

error[E0277]: cannot divide usize by u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1136:17 | 1136 | let div = n / bits; | ^ no implementation for usize / u32 | = help: the trait Div<u32> is not implemented for usize

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1192:23 | 1192 | debug_assert!(n < bits); | ^^^^ expected usize, found u32 | help: you can convert a u32 to a usize and panic if the converted value doesn't fit | 1192 | debug_assert!(n < bits.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1202:25 | 1202 | let rshift = bits - n; | ^ expected u32, found usize

error[E0277]: cannot subtract usize from u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1202:23 | 1202 | let rshift = bits - n; | ^ no implementation for u32 - usize | = help: the trait Sub<usize> is not implemented for u32

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1254:19 | 1254 | let rem = n % bits; | ^^^^ expected usize, found u32

error[E0277]: cannot mod usize by u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1254:17 | 1254 | let rem = n % bits; | ^ no implementation for usize % u32 | = help: the trait Rem<u32> is not implemented for usize

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1255:19 | 1255 | let div = n / bits; | ^^^^ expected usize, found u32

error[E0277]: cannot divide usize by u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1255:17 | 1255 | let div = n / bits; | ^ no implementation for usize / u32 | = help: the trait Div<u32> is not implemented for usize

error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:2066:27 | 2066 | let rs = Limb::BITS - s; | ^ expected u32, found usize

error[E0277]: cannot subtract usize from u32 --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:2066:25 | 2066 | let rs = Limb::BITS - s; | ^ no implementation for u32 - usize | = help: the trait Sub<usize> is not implemented for u32

error: aborting due to 27 previous errors

Some errors have detailed explanations: E0277, E0308. For more information about an error, try rustc --explain E0277. error: could not compile lexical-core

To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: build failed`

juliohq avatar Jul 05 '21 12:07 juliohq

Add

[patch.crates-io]
lexical-core = {git = 'https://github.com/Alexhuszagh/rust-lexical' }

to the bottom of Cargo.toml file, run cargo update and rebuild the project.

Details: https://github.com/rust-lang/rust/issues/81654

Aivean avatar Dec 01 '21 04:12 Aivean

I have same issue, after following suggestions above I've got into another issue:

$ cargo run --release  # first attempt
....
   Compiling space-menace v0.1.0 (/home/ruslan/Projects/rust/space-menace)  
warning: unused import: `GenericBox`                                                                                                        
  --> src/entities/flier.rs:15:28                                                                                                           
   |                                                                                                                                        
15 |         Directions, Flier, GenericBox, Motion,                                                                                         
   |                            ^^^^^^^^^^                                                                                                     |                                                                                                                                        
   = note: `#[warn(unused_imports)]` on by default                                                                                          
                                                                                                                                            
warning: `space-menace` (bin "space-menace") generated 1 warning                                                                            
    Finished release [optimized] target(s) in 15m 58s                                                                                       
     Running `target/release/space-menace`                                                                                                  
[INFO][amethyst::app] Initializing Amethyst...                                                                                              
[INFO][amethyst::app] Version: 0.15.3                                                                                                       
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu                                                                                    
[INFO][amethyst::app] Amethyst git commit: UNKNOWN                                                                                          
[INFO][amethyst::app] Rustc version: 1.59.0 Stable                                                                                          
[INFO][winit::platform::platform::x11::window] Guessed window DPI factor: 1                                                                 
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!  
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
load_flier: scale = 2                                                                                                                       
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /h
ome/ruslan/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/util/input.rs:94:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4194304) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(983040) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(65536) is still used                                                     
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2048) is still used                                                        
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2097152) is still used                                                     
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16384) is still used                                                       
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(8192) is still used                                                        [ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(32768) is still used                                                       
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(524288) is still used                                                      
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(262144) is still used     
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used                                                     
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4194304) is still used                                                     
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(131072) is still used                                                      
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4096) is still used                                                        
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(256) is still used                                                         
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated                                                               
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 56, freed: 
0 }                                                                                                                                         
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated                                                               
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 55, freed: 
0 }                                                                                
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                          
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?     
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?               
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?              
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                  
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                    [ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                                    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?                                                    
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?               
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?


$ cargo run --release   # all later attempts
warning: Patch `lexical-core v0.8.5 (https://github.com/Alexhuszagh/rust-lexical#17dca4a1)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
warning: unused import: `GenericBox`
  --> src/entities/flier.rs:15:28
   |
15 |         Directions, Flier, GenericBox, Motion,
   |                            ^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: `space-menace` (bin "space-menace") generated 1 warning
    Finished release [optimized] target(s) in 0.29s
     Running `target/release/space-menace`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.15.3
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: UNKNOWN
[INFO][amethyst::app] Rustc version: 1.59.0 Stable
[INFO][winit::platform::platform::x11::window] Guessed window DPI factor: 1
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
thread 'main' panicked at 'attempted to leave type `platform::platform::x11::util::input::PointerState` uninitialized, which is invalid', /h
ome/ruslan/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/linux/x11/util/input.rs:94:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

koutoftimer avatar May 26 '22 13:05 koutoftimer