Better HN
topnewbestaskshowjobs
Log inSign up

dogamak

3 karma · joined Mar 3, 2017 (9y ago) · 3 submissions

[ my public key: https://keybase.io/dogamak; my proof: https://keybase.io/dogamak/sigs/PdQyBn5_0_OHgifA7dwYqHLJosht6m5D9crFawEk_4E ]
Submissions

comment 9y ago · link · parent

Additionally tests in "tests/" are compiled to independent binaries on which the test suite is run on separately, which results into verbose and redundant output when ran.

Also if you keep your tests under "src/", you can't just stick them wherever you want; you need to have #[cfg(tests)] on every module declaration leading to the test function, otherwise the test is ignored silently. From time to time I find old tests that have not ran once because of a missing attribute somewhere upwards the module hierarchy.

comment 9y ago · link · parent

I agree, the macro scoping is just a small part of the rewrite but it is a problem (especially ergonomically) that rust should have got right the first time around.

Right now macros don't quite feel like they are part of the core language, but instead a hack or plugin slapped haphazardly on top of the compiler.

comment 9y ago · link · parent

Macros and the importing and scoping of them is a mess in rust right now and major rewrite of the macro system is underway. Currently crates have no way to re-export macros from other crates and #[use_macros] brings all macros in the imported crate to the local crate's namespace as-is (no way to prevent possible naming conflicts)