« first day (2175 days earlier)      last day (1313 days later) » 

5:41 PM
Odd. rust-analyzer has sometimes been complaining about an unresolved import to snafu::Snafu, although the project compiles fine.
 
 
2 hours later…
7:38 PM
I really don't understand the syntax of the cfg predicates and the documentation doesn't help
How would you say a block is for unix but not android ?
This doesn't work (it's compiled for android):
    #[cfg(all(unix,not(android)))]
(and removing the all(...) step isn't accepted by rustc
 
8:10 PM
@DenysSéguret std uses #[cfg(target_os = "android")] for Android stuff
 
Yes but I have a lot of code which works on all unix platforms except Android, and I'm looking for the right cfg predicate for that
 
@DenysSéguret #[cfg(all(unix,not(target_os = "android")))] maybe?
not sure if the unix part is necessary though
 
Except it's compiled when I use the android target
(the unix part is necessary because those things don't work on windows)
 
oh right
 
This seems to work:
#[cfg(not(any(target_family="windows",target_os="android")))]
It's not exactly the same but covers my need
I suspect cfg predicate expressions are horribly buggy, which explains why they're not properly documented
 
 
2 hours later…
10:37 PM
@DenysSéguret I feel your pain, the configuration predicates always felt dodgy to me. Have you tried adding two cfgs there? #[cfg(target_family = "unix")] #[cfg(not(target_os = "android"))] fn f() {} ?
(Not sure about its result, but it could work..)
 

« first day (2175 days earlier)      last day (1313 days later) »