allow type-based search on foreign functions
fixes https://github.com/rust-lang/rust/issues/131804
This commit is contained in:
parent
bed75e7c21
commit
09773b4f24
@ -759,7 +759,10 @@ pub(crate) fn get_function_type_for_search<'tcx>(
|
||||
}
|
||||
});
|
||||
let (mut inputs, mut output, where_clause) = match item.kind {
|
||||
clean::FunctionItem(ref f) | clean::MethodItem(ref f, _) | clean::TyMethodItem(ref f) => {
|
||||
clean::ForeignFunctionItem(ref f, _)
|
||||
| clean::FunctionItem(ref f)
|
||||
| clean::MethodItem(ref f, _)
|
||||
| clean::TyMethodItem(ref f) => {
|
||||
get_fn_inputs_and_outputs(f, tcx, impl_or_trait_generics, cache)
|
||||
}
|
||||
_ => return None,
|
||||
|
8
tests/rustdoc-js/extern-func.js
Normal file
8
tests/rustdoc-js/extern-func.js
Normal file
@ -0,0 +1,8 @@
|
||||
const EXPECTED = [
|
||||
{
|
||||
'query': 'c_float -> c_float',
|
||||
'others': [
|
||||
{ 'path': 'extern_func', 'name': 'sqrt' }
|
||||
],
|
||||
},
|
||||
];
|
5
tests/rustdoc-js/extern-func.rs
Normal file
5
tests/rustdoc-js/extern-func.rs
Normal file
@ -0,0 +1,5 @@
|
||||
use std::ffi::c_float;
|
||||
|
||||
extern "C" {
|
||||
pub fn sqrt(x: c_float) -> c_float;
|
||||
}
|
Loading…
Reference in New Issue
Block a user