When trying out rustfmt on windows I got an error on my code that compiles. I have defined cross platform modules as such:
#[cfg(target_os = "linux")]
#[path = "proxyimpl/linux.rs"]
pub mod proxyimpl;
#[cfg(not(target_os = "linux"))]
#[path = "proxyimpl/nonlinux.rs"]
pub mod proxyimpl;
When running rustfmt on windows I get the following error
rustfmt .\main.rs
error: couldn't read "\\\\?\\C:\\Users\\<snip>\\Source\\irondragon\\src\\gpioaccess\\proxyimpl/linux.rs": The filename, directory name, or volume label syntax is incorrect. (os error 123)
--> \\?\C:\Users\<snip>\Source\irondragon\src\gpioaccess\mod.rs:68:9
|
68 | pub mod proxyimpl;
| ^^^^^^^^^
thread 'main' panicked at 'Box<Any>', src\libsyntax\parse\mod.rs:215:29
stack backtrace:
0: <std::sync::condvar::WaitTimeoutResult as core::fmt::Debug>::fmt
1: <std::time::SystemTimeError as core::fmt::Display>::fmt
2: std::panicking::Location::column
3: std::panicking::Location::column
4: std::panicking::rust_panic_with_hook
5: <syntax::ext::tt::macro_rules::TokenSet as core::fmt::Debug>::fmt
6: syntax::parse::new_parser_from_tts
7: syntax::parse::parser::Parser::default_submod_path
8: syntax::parse::parser::Parser::parse_item
9: syntax::parse::parser::Parser::parse_visibility
10: syntax::parse::parser::Parser::default_submod_path
11: syntax::parse::parser::Parser::parse_item
12: syntax::parse::parser::Parser::parse_visibility
13: syntax::parse::parser::Parser::parse_crate_mod
14: <unknown>
15: <unknown>
16: <unknown>
17: <unknown>
18: <unknown>
19: std::panicking::update_panic_count
20: _rust_maybe_catch_panic
21: std::rt::lang_start_internal
22: <unknown>
23: <unknown>
24: BaseThreadInitThunk
Changing it to
#[cfg(target_os = "linux")]
#[path = "proxyimpl\\linux.rs"]
pub mod proxyimpl;
#[cfg(not(target_os = "linux"))]
#[path = "proxyimpl\\nonlinux.rs"]
pub mod proxyimpl;
I can run rustfmt on windows, but my travisci build (linux) fails.
When trying out rustfmt on windows I got an error on my code that compiles. I have defined cross platform modules as such:
When running rustfmt on windows I get the following error
Changing it to
I can run rustfmt on windows, but my travisci build (linux) fails.