These are chat archives for rust-lang/rust

20th
Sep 2015
Sebastián Estévez
@phact
Sep 20 2015 18:48

Why does this work:
include_str!("../www/index.html");


But this doesn't:
let name_desc:&'static str = "../www/index.html";

include_str!(name_desc);

they're both the same type

Erik Hedvall
@Ogeon
Sep 20 2015 18:56
Macros can't access the values of variables. They can't even know that it's a variable, because they will only read the syntax and not the meaning of it. include_str!(name_desc) is like saying "do something with this identifier and spit out some code".