Fix raw-dylib with link_name
This commit is contained in:
parent
7f115e3cd2
commit
3c184db386
13 changed files with 140 additions and 4 deletions
|
@ -495,14 +495,13 @@ impl<'tcx> Collector<'tcx> {
|
|||
}
|
||||
};
|
||||
|
||||
let import_name_type = self
|
||||
.tcx
|
||||
.codegen_fn_attrs(item.id.def_id)
|
||||
let codegen_fn_attrs = self.tcx.codegen_fn_attrs(item.id.def_id);
|
||||
let import_name_type = codegen_fn_attrs
|
||||
.link_ordinal
|
||||
.map_or(import_name_type, |ord| Some(PeImportNameType::Ordinal(ord)));
|
||||
|
||||
DllImport {
|
||||
name: item.ident.name,
|
||||
name: codegen_fn_attrs.link_name.unwrap_or(item.ident.name),
|
||||
import_name_type,
|
||||
calling_convention,
|
||||
span: item.span,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue