Run format.
This commit is contained in:
parent
7ca1b2f504
commit
7996df992f
@ -1288,7 +1288,8 @@ fn link_args<'a, B: ArchiveBuilder<'a>>(
|
||||
let more_args = &sess.opts.cg.link_arg;
|
||||
let mut args = args.iter().chain(more_args.iter()).chain(used_link_args.iter());
|
||||
|
||||
if is_pic(sess) && !sess.crt_static(Some(crate_type)) && !args.any(|x| *x == "-static") {
|
||||
if is_pic(sess) && !sess.crt_static(Some(crate_type)) && !args.any(|x| *x == "-static")
|
||||
{
|
||||
position_independent_executable = true;
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,9 @@ pub fn invalid_output_for_target(sess: &Session, crate_type: config::CrateType)
|
||||
if !sess.target.target.options.dynamic_linking {
|
||||
return true;
|
||||
}
|
||||
if sess.crt_static(Some(crate_type)) && !sess.target.target.options.crt_static_allows_dylibs {
|
||||
if sess.crt_static(Some(crate_type))
|
||||
&& !sess.target.target.options.crt_static_allows_dylibs
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,9 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: config::CrateType) -> DependencyList {
|
||||
|
||||
// If the global prefer_dynamic switch is turned off, or the final
|
||||
// executable will be statically linked, prefer static crate linkage.
|
||||
config::CrateType::Executable if !sess.opts.cg.prefer_dynamic || sess.crt_static(Some(ty)) => {
|
||||
config::CrateType::Executable
|
||||
if !sess.opts.cg.prefer_dynamic || sess.crt_static(Some(ty)) =>
|
||||
{
|
||||
Linkage::Static
|
||||
}
|
||||
config::CrateType::Executable => Linkage::Dynamic,
|
||||
|
@ -564,7 +564,7 @@ impl Session {
|
||||
Some(config::CrateType::ProcMacro) => found_positive,
|
||||
Some(_) => !found_negative,
|
||||
None => {
|
||||
// FIXME: When crate_type is not available,
|
||||
// FIXME: When crate_type is not available,
|
||||
// we use compiler options to determine the crate_type.
|
||||
// We can't check `#![crate_type = "proc-macro"]` here.
|
||||
if self.opts.crate_types.contains(&config::CrateType::ProcMacro) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user