You might have looked at #[derive(Debug)] and assumed it's some weird compiler magic. It is not. It is a so-called procedural macro, that is, a macro that doesn't simply expand at compile time but instead runs at compile time. This way, you can inject code into the actual compilation process. The most useful application for this is creating custom derives, with which you can generate new code based on the analysis of existing code.
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine