Module vs Item in RBE

⚓ Rust    📅 2025-09-05    👤 surdeus    👁️ 3      

surdeus

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Module vs Item in RBE

Hi -

I started reading RBE today and in print.html, I stumbled upon this statement:

In line 43, #[allow(dead_code)] is an attribute which only applies to the module after it.

And lines 43 and 44 are:

#[allow(dead_code)] // disable `dead_code` which warn against unused module
struct Structure(i32);

I have a bit of ADHD so I searched for the formal definition of a module in Rust, and if I am not mistaken, a struct is not a module, but an item (see grammar).

Is the word module used in RBE intentionally or is it a mistake?

Best regards.

3 posts - 2 participants

Read full topic

🏷️ Rust_feed