From e161fa1a6b3752da0a9279298eedf5b84a5fe49f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 2 Sep 2023 23:04:37 +0200 Subject: Correctly handle paths from foreign items --- tests/rustdoc-js/full-path-function.js | 18 ++++++++++++++++++ tests/rustdoc-js/full-path-function.rs | 1 + 2 files changed, 19 insertions(+) (limited to 'tests/rustdoc-js') diff --git a/tests/rustdoc-js/full-path-function.js b/tests/rustdoc-js/full-path-function.js index 9d3c3a4506c..48be51b156f 100644 --- a/tests/rustdoc-js/full-path-function.js +++ b/tests/rustdoc-js/full-path-function.js @@ -22,4 +22,22 @@ const EXPECTED = [ { 'path': 'full_path_function::b::Sac', 'name': 'bar2' }, ], }, + { + 'query': 'string::string -> u32', + 'others': [ + { 'path': 'full_path_function::b::Sac', 'name': 'string' }, + ], + }, + { + 'query': 'alloc::string::string -> u32', + 'others': [ + { 'path': 'full_path_function::b::Sac', 'name': 'string' }, + ], + }, + { + 'query': 'alloc::string -> u32', + 'others': [ + { 'path': 'full_path_function::b::Sac', 'name': 'string' }, + ], + }, ]; diff --git a/tests/rustdoc-js/full-path-function.rs b/tests/rustdoc-js/full-path-function.rs index c1ec1e1731b..8dcc3f2b69d 100644 --- a/tests/rustdoc-js/full-path-function.rs +++ b/tests/rustdoc-js/full-path-function.rs @@ -12,5 +12,6 @@ pub mod b { pub fn len(&self) -> usize { 0 } pub fn bar(&self, w: u32) -> usize { 0 } pub fn bar2(&self, w: u32) -> u32 { 0 } + pub fn string(w: String) -> u32 { 0 } } } -- cgit 1.4.1-3-g733a5