When crate_type is None,check compiler options

This commit is contained in:
12101111 2020-03-10 15:36:23 +08:00
parent 75e6cfc79b
commit cfff1b4c12

View File

@ -559,7 +559,7 @@ pub fn crt_static_feature(&self, crate_type: Option<config::CrateType>) -> bool
if found_positive || found_negative {
found_positive
} else if crate_type == Some(config::CrateType::ProcMacro)
|| self.opts.crate_types.contains(&config::CrateType::ProcMacro)
|| crate_type == None && self.opts.crate_types.contains(&config::CrateType::ProcMacro)
{
// FIXME: When crate_type is not available,
// we use compiler options to determine the crate_type.