I was browsing the axum docs for FromRequest and wanted to see how they handled the implementations for tuples:
all_the_tuples!(impl_from_request); I looked around the file and could not find the definition, so I checked the imports, and still nothing. Not even a glob import. I thought maybe the docs.rs source code was somehow different but the same was on github. Searching the code I found that it was declared in macros.rs, without #[macro_export]. Looking at lib.rs I found this:
#[macro_use] pub(crate) mod macros; ... pub mod extract; extract/mod.rs
mod tuple; I setup a test on the playground and it worked. I know that macros have to be declared before they can be used (textual scope) but why does it work cross file without needing an import or path qualification?
10 posts - 4 participants

