News for hackers. Stuff that matters.
Re:Rust Weird Expressions by tanaypingalkar on Friday May 14, 2021 @01:51PM (#27157389)
i think this = #[]; is for rust analyser, not sure , can anyone tell me what is this #[];
Re:Rust Weird Expressions by steveklabnik on Friday May 14, 2021 @02:02PM (#27157547)
It is called an "attribute" and it is part of the language itself.

There is also #![]. The difference is what they apply to, #[] applies to the following thing, #![] applies to the parent thing. You'll see #![] to enable nightly features in Rust, for example, and #[] for things like custom derives.