1
Fork 0

Auto merge of #112485 - matthiaskrgr:rollup-ta84xje, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #110141 (expand: Change how `#![cfg(FALSE)]` behaves on crate root)
 - #112369 (More CGU cleanups)
 - #112467 (Compile rustc_driver by default)
 - #112468 (Change format of rustdoc-js tests by putting query and correction directly alongside the expected values)
 - #112473 (Update cargo)
 - #112481 (Ignore tests that hang in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-06-10 10:02:18 +00:00
commit 4b71d79c97
89 changed files with 435 additions and 581 deletions

View file

@ -197,9 +197,11 @@ pub fn pre_configure_attrs(sess: &Session, attrs: &[Attribute]) -> ast::AttrVec
config_tokens: false, config_tokens: false,
lint_node_id: ast::CRATE_NODE_ID, lint_node_id: ast::CRATE_NODE_ID,
}; };
let attrs: ast::AttrVec = attrs
attrs.iter().flat_map(|attr| strip_unconfigured.process_cfg_attr(attr)).collect(); .iter()
if strip_unconfigured.in_cfg(&attrs) { attrs } else { ast::AttrVec::new() } .flat_map(|attr| strip_unconfigured.process_cfg_attr(attr))
.take_while(|attr| !is_cfg(attr) || strip_unconfigured.cfg_true(attr).0)
.collect()
} }
#[macro_export] #[macro_export]

View file

@ -1039,7 +1039,12 @@ trait InvocationCollectorNode: HasAttrs + HasNodeId + Sized {
) -> Result<Self::OutputTy, Self> { ) -> Result<Self::OutputTy, Self> {
Ok(noop_flat_map(node, collector)) Ok(noop_flat_map(node, collector))
} }
fn expand_cfg_false(&mut self, collector: &mut InvocationCollector<'_, '_>, span: Span) { fn expand_cfg_false(
&mut self,
collector: &mut InvocationCollector<'_, '_>,
_pos: usize,
span: Span,
) {
collector.cx.emit_err(RemoveNodeNotSupported { span, descr: Self::descr() }); collector.cx.emit_err(RemoveNodeNotSupported { span, descr: Self::descr() });
} }
@ -1409,8 +1414,15 @@ impl InvocationCollectorNode for ast::Crate {
fn noop_visit<V: MutVisitor>(&mut self, visitor: &mut V) { fn noop_visit<V: MutVisitor>(&mut self, visitor: &mut V) {
noop_visit_crate(self, visitor) noop_visit_crate(self, visitor)
} }
fn expand_cfg_false(&mut self, collector: &mut InvocationCollector<'_, '_>, _span: Span) { fn expand_cfg_false(
self.attrs.clear(); &mut self,
collector: &mut InvocationCollector<'_, '_>,
pos: usize,
_span: Span,
) {
// Attributes above `cfg(FALSE)` are left in place, because we may want to configure
// some global crate properties even on fully unconfigured crates.
self.attrs.truncate(pos);
// Standard prelude imports are left in the crate for backward compatibility. // Standard prelude imports are left in the crate for backward compatibility.
self.items.truncate(collector.cx.num_standard_library_imports); self.items.truncate(collector.cx.num_standard_library_imports);
} }
@ -1804,7 +1816,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
continue; continue;
} }
node.expand_cfg_false(self, span); node.expand_cfg_false(self, pos, span);
continue; continue;
} }
sym::cfg_attr => { sym::cfg_attr => {

View file

@ -129,14 +129,13 @@ struct PlacedRootMonoItems<'tcx> {
/// The codegen units, sorted by name to make things deterministic. /// The codegen units, sorted by name to make things deterministic.
codegen_units: Vec<CodegenUnit<'tcx>>, codegen_units: Vec<CodegenUnit<'tcx>>,
roots: FxHashSet<MonoItem<'tcx>>,
internalization_candidates: FxHashSet<MonoItem<'tcx>>, internalization_candidates: FxHashSet<MonoItem<'tcx>>,
} }
// The output CGUs are sorted by name. // The output CGUs are sorted by name.
fn partition<'tcx, I>( fn partition<'tcx, I>(
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
mono_items: &mut I, mono_items: I,
max_cgu_count: usize, max_cgu_count: usize,
usage_map: &UsageMap<'tcx>, usage_map: &UsageMap<'tcx>,
) -> Vec<CodegenUnit<'tcx>> ) -> Vec<CodegenUnit<'tcx>>
@ -150,7 +149,7 @@ where
// In the first step, we place all regular monomorphizations into their // In the first step, we place all regular monomorphizations into their
// respective 'home' codegen unit. Regular monomorphizations are all // respective 'home' codegen unit. Regular monomorphizations are all
// functions and statics defined in the local crate. // functions and statics defined in the local crate.
let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = { let PlacedRootMonoItems { mut codegen_units, internalization_candidates } = {
let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots"); let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots");
place_root_mono_items(cx, mono_items) place_root_mono_items(cx, mono_items)
}; };
@ -174,9 +173,9 @@ where
// monomorphizations have to go into each codegen unit. These additional // monomorphizations have to go into each codegen unit. These additional
// monomorphizations can be drop-glue, functions from external crates, and // monomorphizations can be drop-glue, functions from external crates, and
// local functions the definition of which is marked with `#[inline]`. // local functions the definition of which is marked with `#[inline]`.
let mono_item_placements = { {
let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_inline_items"); let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_inline_items");
place_inlined_mono_items(cx, &mut codegen_units, roots) place_inlined_mono_items(cx, &mut codegen_units)
}; };
for cgu in &mut codegen_units { for cgu in &mut codegen_units {
@ -189,12 +188,7 @@ where
// more freedom to optimize. // more freedom to optimize.
if !tcx.sess.link_dead_code() { if !tcx.sess.link_dead_code() {
let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_internalize_symbols"); let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_internalize_symbols");
internalize_symbols( internalize_symbols(cx, &mut codegen_units, internalization_candidates);
cx,
&mut codegen_units,
mono_item_placements,
internalization_candidates,
);
} }
let instrument_dead_code = let instrument_dead_code =
@ -239,12 +233,11 @@ where
fn place_root_mono_items<'tcx, I>( fn place_root_mono_items<'tcx, I>(
cx: &PartitioningCx<'_, 'tcx>, cx: &PartitioningCx<'_, 'tcx>,
mono_items: &mut I, mono_items: I,
) -> PlacedRootMonoItems<'tcx> ) -> PlacedRootMonoItems<'tcx>
where where
I: Iterator<Item = MonoItem<'tcx>>, I: Iterator<Item = MonoItem<'tcx>>,
{ {
let mut roots = FxHashSet::default();
let mut codegen_units = FxHashMap::default(); let mut codegen_units = FxHashMap::default();
let is_incremental_build = cx.tcx.sess.opts.incremental.is_some(); let is_incremental_build = cx.tcx.sess.opts.incremental.is_some();
let mut internalization_candidates = FxHashSet::default(); let mut internalization_candidates = FxHashSet::default();
@ -295,7 +288,6 @@ where
} }
codegen_unit.items_mut().insert(mono_item, (linkage, visibility)); codegen_unit.items_mut().insert(mono_item, (linkage, visibility));
roots.insert(mono_item);
} }
// Always ensure we have at least one CGU; otherwise, if we have a // Always ensure we have at least one CGU; otherwise, if we have a
@ -308,7 +300,7 @@ where
let mut codegen_units: Vec<_> = codegen_units.into_values().collect(); let mut codegen_units: Vec<_> = codegen_units.into_values().collect();
codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str())); codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str()));
PlacedRootMonoItems { codegen_units, roots, internalization_candidates } PlacedRootMonoItems { codegen_units, internalization_candidates }
} }
// This function requires the CGUs to be sorted by name on input, and ensures // This function requires the CGUs to be sorted by name on input, and ensures
@ -404,67 +396,28 @@ fn merge_codegen_units<'tcx>(
codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str())); codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str()));
} }
/// For symbol internalization, we need to know whether a symbol/mono-item is
/// used from outside the codegen unit it is defined in. This type is used
/// to keep track of that.
#[derive(Clone, PartialEq, Eq, Debug)]
enum MonoItemPlacement {
SingleCgu { cgu_name: Symbol },
MultipleCgus,
}
fn place_inlined_mono_items<'tcx>( fn place_inlined_mono_items<'tcx>(
cx: &PartitioningCx<'_, 'tcx>, cx: &PartitioningCx<'_, 'tcx>,
codegen_units: &mut [CodegenUnit<'tcx>], codegen_units: &mut [CodegenUnit<'tcx>],
roots: FxHashSet<MonoItem<'tcx>>, ) {
) -> FxHashMap<MonoItem<'tcx>, MonoItemPlacement> {
let mut mono_item_placements = FxHashMap::default();
let single_codegen_unit = codegen_units.len() == 1;
for cgu in codegen_units.iter_mut() { for cgu in codegen_units.iter_mut() {
// Collect all items that need to be available in this codegen unit. // Collect all inlined items that need to be available in this codegen unit.
let mut reachable = FxHashSet::default(); let mut reachable_inlined_items = FxHashSet::default();
for root in cgu.items().keys() { for root in cgu.items().keys() {
// Insert the root item itself, plus all inlined items that are // Get all inlined items that are reachable from it without going
// reachable from it without going via another root item. // via another root item.
reachable.insert(*root); get_reachable_inlined_items(cx.tcx, *root, cx.usage_map, &mut reachable_inlined_items);
get_reachable_inlined_items(cx.tcx, *root, cx.usage_map, &mut reachable);
} }
// Add all monomorphizations that are not already there. // Add all monomorphizations that are not already there.
for mono_item in reachable { for inlined_item in reachable_inlined_items {
if !cgu.items().contains_key(&mono_item) { assert!(!cgu.items().contains_key(&inlined_item));
if roots.contains(&mono_item) {
bug!("GloballyShared mono-item inlined into other CGU: {:?}", mono_item);
}
// This is a CGU-private copy. // This is a CGU-private copy.
cgu.items_mut().insert(mono_item, (Linkage::Internal, Visibility::Default)); cgu.items_mut().insert(inlined_item, (Linkage::Internal, Visibility::Default));
}
if !single_codegen_unit {
// If there is more than one codegen unit, we need to keep track
// in which codegen units each monomorphization is placed.
match mono_item_placements.entry(mono_item) {
Entry::Occupied(e) => {
let placement = e.into_mut();
debug_assert!(match *placement {
MonoItemPlacement::SingleCgu { cgu_name } => cgu_name != cgu.name(),
MonoItemPlacement::MultipleCgus => true,
});
*placement = MonoItemPlacement::MultipleCgus;
}
Entry::Vacant(e) => {
e.insert(MonoItemPlacement::SingleCgu { cgu_name: cgu.name() });
}
}
}
} }
} }
return mono_item_placements;
fn get_reachable_inlined_items<'tcx>( fn get_reachable_inlined_items<'tcx>(
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
item: MonoItem<'tcx>, item: MonoItem<'tcx>,
@ -483,20 +436,40 @@ fn place_inlined_mono_items<'tcx>(
fn internalize_symbols<'tcx>( fn internalize_symbols<'tcx>(
cx: &PartitioningCx<'_, 'tcx>, cx: &PartitioningCx<'_, 'tcx>,
codegen_units: &mut [CodegenUnit<'tcx>], codegen_units: &mut [CodegenUnit<'tcx>],
mono_item_placements: FxHashMap<MonoItem<'tcx>, MonoItemPlacement>,
internalization_candidates: FxHashSet<MonoItem<'tcx>>, internalization_candidates: FxHashSet<MonoItem<'tcx>>,
) { ) {
if codegen_units.len() == 1 { /// For symbol internalization, we need to know whether a symbol/mono-item
// Fast path for when there is only one codegen unit. In this case we /// is used from outside the codegen unit it is defined in. This type is
// can internalize all candidates, since there is nowhere else they /// used to keep track of that.
// could be used from. #[derive(Clone, PartialEq, Eq, Debug)]
for cgu in codegen_units { enum MonoItemPlacement {
for candidate in &internalization_candidates { SingleCgu { cgu_name: Symbol },
cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); MultipleCgus,
}
let mut mono_item_placements = FxHashMap::default();
let single_codegen_unit = codegen_units.len() == 1;
if !single_codegen_unit {
for cgu in codegen_units.iter_mut() {
for item in cgu.items().keys() {
// If there is more than one codegen unit, we need to keep track
// in which codegen units each monomorphization is placed.
match mono_item_placements.entry(*item) {
Entry::Occupied(e) => {
let placement = e.into_mut();
debug_assert!(match *placement {
MonoItemPlacement::SingleCgu { cgu_name } => cgu_name != cgu.name(),
MonoItemPlacement::MultipleCgus => true,
});
*placement = MonoItemPlacement::MultipleCgus;
}
Entry::Vacant(e) => {
e.insert(MonoItemPlacement::SingleCgu { cgu_name: cgu.name() });
}
}
} }
} }
return;
} }
// For each internalization candidates in each codegen unit, check if it is // For each internalization candidates in each codegen unit, check if it is
@ -509,21 +482,24 @@ fn internalize_symbols<'tcx>(
// This item is no candidate for internalizing, so skip it. // This item is no candidate for internalizing, so skip it.
continue; continue;
} }
debug_assert_eq!(mono_item_placements[item], home_cgu);
if let Some(user_items) = cx.usage_map.get_user_items(*item) { if !single_codegen_unit {
if user_items debug_assert_eq!(mono_item_placements[item], home_cgu);
.iter()
.filter_map(|user_item| { if let Some(user_items) = cx.usage_map.get_user_items(*item) {
// Some user mono items might not have been if user_items
// instantiated. We can safely ignore those. .iter()
mono_item_placements.get(user_item) .filter_map(|user_item| {
}) // Some user mono items might not have been
.any(|placement| *placement != home_cgu) // instantiated. We can safely ignore those.
{ mono_item_placements.get(user_item)
// Found a user from another CGU, so skip to the next item })
// without marking this one as internal. .any(|placement| *placement != home_cgu)
continue; {
// Found a user from another CGU, so skip to the next item
// without marking this one as internal.
continue;
}
} }
} }
@ -864,15 +840,10 @@ fn debug_dump<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx>, label: &str, cgus: &[CodegenUnit<
cgu.size_estimate() cgu.size_estimate()
); );
// The order of `cgu.items()` is non-deterministic; sort it by name for (item, linkage) in cgu.items_in_deterministic_order(tcx) {
// to give deterministic output.
let mut items: Vec<_> = cgu.items().iter().collect();
items.sort_by_key(|(item, _)| item.symbol_name(tcx).name);
for (item, linkage) in items {
let symbol_name = item.symbol_name(tcx).name; let symbol_name = item.symbol_name(tcx).name;
let symbol_hash_start = symbol_name.rfind('h'); let symbol_hash_start = symbol_name.rfind('h');
let symbol_hash = symbol_hash_start.map_or("<no hash>", |i| &symbol_name[i..]); let symbol_hash = symbol_hash_start.map_or("<no hash>", |i| &symbol_name[i..]);
let size = item.size_estimate(tcx); let size = item.size_estimate(tcx);
let _ = with_no_trimmed_paths!(writeln!( let _ = with_no_trimmed_paths!(writeln!(
s, s,
@ -951,12 +922,8 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Co
let (codegen_units, _) = tcx.sess.time("partition_and_assert_distinct_symbols", || { let (codegen_units, _) = tcx.sess.time("partition_and_assert_distinct_symbols", || {
sync::join( sync::join(
|| { || {
let mut codegen_units = partition( let mut codegen_units =
tcx, partition(tcx, items.iter().copied(), tcx.sess.codegen_units(), &usage_map);
&mut items.iter().copied(),
tcx.sess.codegen_units(),
&usage_map,
);
codegen_units[0].make_primary(); codegen_units[0].make_primary();
&*tcx.arena.alloc_from_iter(codegen_units) &*tcx.arena.alloc_from_iter(codegen_units)
}, },

View file

@ -667,7 +667,7 @@ impl Step for Rustc {
/// Compiler documentation is distributed separately, so we make sure /// Compiler documentation is distributed separately, so we make sure
/// we do not merge it with the other documentation from std, test and /// we do not merge it with the other documentation from std, test and
/// proc_macros. This is largely just a wrapper around `cargo doc`. /// proc_macros. This is largely just a wrapper around `cargo doc`.
fn run(self, builder: &Builder<'_>) { fn run(mut self, builder: &Builder<'_>) {
let stage = self.stage; let stage = self.stage;
let target = self.target; let target = self.target;
@ -725,6 +725,11 @@ impl Step for Rustc {
cargo.rustdocflag("ena=https://docs.rs/ena/latest/"); cargo.rustdocflag("ena=https://docs.rs/ena/latest/");
let mut to_open = None; let mut to_open = None;
if self.crates.is_empty() {
self.crates = INTERNER.intern_list(vec!["rustc_driver".to_owned()]);
};
for krate in &*self.crates { for krate in &*self.crates {
// Create all crate output directories first to make sure rustdoc uses // Create all crate output directories first to make sure rustdoc uses
// relative links. // relative links.

@ -1 +1 @@
Subproject commit b0fa79679e717cd077b7fc0fa4166f47107f1ba9 Subproject commit 49b6d9e179a91cf7645142541c9563443f64bf2b

View file

@ -22,6 +22,10 @@ function contentToDiffLine(key, value) {
return `"${key}": "${value}",`; return `"${key}": "${value}",`;
} }
function shouldIgnoreField(fieldName) {
return fieldName === "query" || fieldName === "correction";
}
// This function is only called when no matching result was found and therefore will only display // This function is only called when no matching result was found and therefore will only display
// the diff between the two items. // the diff between the two items.
function betterLookingDiff(entry, data) { function betterLookingDiff(entry, data) {
@ -135,6 +139,9 @@ function valueCheck(fullPath, expected, result, error_text, queryName) {
} else if (expected !== null && typeof expected !== "undefined" && } else if (expected !== null && typeof expected !== "undefined" &&
expected.constructor == Object) { // eslint-disable-line eqeqeq expected.constructor == Object) { // eslint-disable-line eqeqeq
for (const key in expected) { for (const key in expected) {
if (shouldIgnoreField(key)) {
continue;
}
if (!Object.prototype.hasOwnProperty.call(expected, key)) { if (!Object.prototype.hasOwnProperty.call(expected, key)) {
continue; continue;
} }
@ -184,6 +191,9 @@ function runSearch(query, expected, doSearch, loadedFile, queryName) {
const error_text = []; const error_text = [];
for (const key in expected) { for (const key in expected) {
if (shouldIgnoreField(key)) {
continue;
}
if (!Object.prototype.hasOwnProperty.call(expected, key)) { if (!Object.prototype.hasOwnProperty.call(expected, key)) {
continue; continue;
} }
@ -260,41 +270,49 @@ function checkResult(error_text, loadedFile, displaySuccess) {
return 1; return 1;
} }
function runCheck(loadedFile, key, callback) { function runCheckInner(callback, loadedFile, entry, getCorrections, extra) {
const expected = loadedFile[key]; if (typeof entry.query !== "string") {
const query = loadedFile.QUERY; console.log("FAILED");
console.log("==> Missing `query` field");
if (Array.isArray(query)) { return false;
if (!Array.isArray(expected)) { }
console.log("FAILED"); let error_text = callback(entry.query, entry, extra ? "[ query `" + entry.query + "`]" : "");
console.log(`==> If QUERY variable is an array, ${key} should be an array too`); if (checkResult(error_text, loadedFile, false) !== 0) {
return 1; return false;
} else if (query.length !== expected.length) { }
console.log("FAILED"); if (entry.correction !== undefined) {
console.log(`==> QUERY variable should have the same length as ${key}`); error_text = runCorrections(entry.query, entry.correction, getCorrections, loadedFile);
return 1; if (checkResult(error_text, loadedFile, false) !== 0) {
return false;
} }
for (let i = 0; i < query.length; ++i) { }
const error_text = callback(query[i], expected[i], "[ query `" + query[i] + "`]"); return true;
if (checkResult(error_text, loadedFile, false) !== 0) { }
function runCheck(loadedFile, key, getCorrections, callback) {
const expected = loadedFile[key];
if (Array.isArray(expected)) {
for (const entry of expected) {
if (!runCheckInner(callback, loadedFile, entry, getCorrections, true)) {
return 1; return 1;
} }
} }
console.log("OK"); } else if (!runCheckInner(callback, loadedFile, expected, getCorrections, false)) {
} else { return 1;
const error_text = callback(query, expected, "");
if (checkResult(error_text, loadedFile, true) !== 0) {
return 1;
}
} }
console.log("OK");
return 0; return 0;
} }
function hasCheck(content, checkName) {
return content.startsWith(`const ${checkName}`) || content.includes(`\nconst ${checkName}`);
}
function runChecks(testFile, doSearch, parseQuery, getCorrections) { function runChecks(testFile, doSearch, parseQuery, getCorrections) {
let checkExpected = false; let checkExpected = false;
let checkParsed = false; let checkParsed = false;
let checkCorrections = false; let testFileContent = readFile(testFile);
let testFileContent = readFile(testFile) + "exports.QUERY = QUERY;";
if (testFileContent.indexOf("FILTER_CRATE") !== -1) { if (testFileContent.indexOf("FILTER_CRATE") !== -1) {
testFileContent += "exports.FILTER_CRATE = FILTER_CRATE;"; testFileContent += "exports.FILTER_CRATE = FILTER_CRATE;";
@ -302,21 +320,17 @@ function runChecks(testFile, doSearch, parseQuery, getCorrections) {
testFileContent += "exports.FILTER_CRATE = null;"; testFileContent += "exports.FILTER_CRATE = null;";
} }
if (testFileContent.indexOf("\nconst EXPECTED") !== -1) { if (hasCheck(testFileContent, "EXPECTED")) {
testFileContent += "exports.EXPECTED = EXPECTED;"; testFileContent += "exports.EXPECTED = EXPECTED;";
checkExpected = true; checkExpected = true;
} }
if (testFileContent.indexOf("\nconst PARSED") !== -1) { if (hasCheck(testFileContent, "PARSED")) {
testFileContent += "exports.PARSED = PARSED;"; testFileContent += "exports.PARSED = PARSED;";
checkParsed = true; checkParsed = true;
} }
if (testFileContent.indexOf("\nconst CORRECTIONS") !== -1) { if (!checkParsed && !checkExpected) {
testFileContent += "exports.CORRECTIONS = CORRECTIONS;";
checkCorrections = true;
}
if (!checkParsed && !checkExpected && !checkCorrections) {
console.log("FAILED"); console.log("FAILED");
console.log("==> At least `PARSED`, `EXPECTED`, or `CORRECTIONS` is needed!"); console.log("==> At least `PARSED` or `EXPECTED` is needed!");
return 1; return 1;
} }
@ -324,20 +338,15 @@ function runChecks(testFile, doSearch, parseQuery, getCorrections) {
let res = 0; let res = 0;
if (checkExpected) { if (checkExpected) {
res += runCheck(loadedFile, "EXPECTED", (query, expected, text) => { res += runCheck(loadedFile, "EXPECTED", getCorrections, (query, expected, text) => {
return runSearch(query, expected, doSearch, loadedFile, text); return runSearch(query, expected, doSearch, loadedFile, text);
}); });
} }
if (checkParsed) { if (checkParsed) {
res += runCheck(loadedFile, "PARSED", (query, expected, text) => { res += runCheck(loadedFile, "PARSED", getCorrections, (query, expected, text) => {
return runParser(query, expected, parseQuery, text); return runParser(query, expected, parseQuery, text);
}); });
} }
if (checkCorrections) {
res += runCheck(loadedFile, "CORRECTIONS", (query, expected) => {
return runCorrections(query, expected, getCorrections, loadedFile);
});
}
return res; return res;
} }
@ -367,8 +376,7 @@ function loadSearchJS(doc_folder, resource_suffix) {
}, },
getCorrections: function(queryStr, filterCrate, currentCrate) { getCorrections: function(queryStr, filterCrate, currentCrate) {
const parsedQuery = searchModule.parseQuery(queryStr); const parsedQuery = searchModule.parseQuery(queryStr);
searchModule.execQuery(parsedQuery, searchWords, searchModule.execQuery(parsedQuery, searchWords, filterCrate, currentCrate);
filterCrate, currentCrate);
return parsedQuery.correction; return parsedQuery.correction;
}, },
parseQuery: searchModule.parseQuery, parseQuery: searchModule.parseQuery,

View file

@ -1,6 +1,5 @@
const QUERY = '&';
const EXPECTED = { const EXPECTED = {
'query': '&',
'others': [ 'others': [
{ 'path': 'std', 'name': 'reference' }, { 'path': 'std', 'name': 'reference' },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = '+';
const EXPECTED = { const EXPECTED = {
'query': '+',
'others': [ 'others': [
{ 'path': 'std::ops', 'name': 'AddAssign' }, { 'path': 'std::ops', 'name': 'AddAssign' },
{ 'path': 'std::ops', 'name': 'Add' }, { 'path': 'std::ops', 'name': 'Add' },

View file

@ -1,6 +1,5 @@
const QUERY = '!';
const EXPECTED = { const EXPECTED = {
'query': '!',
'others': [ 'others': [
{ 'path': 'std', 'name': 'never' }, { 'path': 'std', 'name': 'never' },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = '<';
const EXPECTED = { const EXPECTED = {
'query': '<',
'others': [ 'others': [
{ 'name': 'Ord' }, { 'name': 'Ord' },
], ],

View file

@ -1,8 +1,7 @@
// ignore-order // ignore-order
const QUERY = '[';
const EXPECTED = { const EXPECTED = {
'query': '[',
'others': [ 'others': [
{ 'path': 'std', 'name': 'slice' }, { 'path': 'std', 'name': 'slice' },
{ 'path': 'std::ops', 'name': 'IndexMut' }, { 'path': 'std::ops', 'name': 'IndexMut' },

View file

@ -1,8 +1,7 @@
// ignore-order // ignore-order
const QUERY = 'RawFd::as_raw_fd';
const EXPECTED = { const EXPECTED = {
'query': 'RawFd::as_raw_fd',
'others': [ 'others': [
// Reproduction test for https://github.com/rust-lang/rust/issues/78724 // Reproduction test for https://github.com/rust-lang/rust/issues/78724
// Validate that type alias methods get the correct path. // Validate that type alias methods get the correct path.

View file

@ -1,6 +1,5 @@
const QUERY = 'String';
const EXPECTED = { const EXPECTED = {
'query': 'String',
'others': [ 'others': [
{ 'path': 'std::string', 'name': 'String' }, { 'path': 'std::string', 'name': 'String' },
{ 'path': 'std::ffi', 'name': 'CString' }, { 'path': 'std::ffi', 'name': 'CString' },

View file

@ -1,8 +1,7 @@
// ignore-order // ignore-order
const QUERY = 'is_nan';
const EXPECTED = { const EXPECTED = {
'query': 'is_nan',
'others': [ 'others': [
{ 'path': 'std::f32', 'name': 'is_nan' }, { 'path': 'std::f32', 'name': 'is_nan' },
{ 'path': 'std::f64', 'name': 'is_nan' }, { 'path': 'std::f64', 'name': 'is_nan' },

View file

@ -1,6 +1,5 @@
const QUERY = 'enum:Option';
const EXPECTED = { const EXPECTED = {
'query': 'enum:Option',
'others': [ 'others': [
{ 'path': 'std::option', 'name': 'Option' }, { 'path': 'std::option', 'name': 'Option' },
], ],

View file

@ -1,9 +1,9 @@
// exact-check // exact-check
const QUERY = '"hashmap"';
const FILTER_CRATE = 'core'; const FILTER_CRATE = 'core';
const EXPECTED = { const EXPECTED = {
'query': 'hashmap',
'others': [ 'others': [
], ],
}; };

View file

@ -1,6 +1,5 @@
const QUERY = 'fn:forget';
const EXPECTED = { const EXPECTED = {
'query': 'fn:forget',
'others': [ 'others': [
{ 'path': 'std::mem', 'name': 'forget' }, { 'path': 'std::mem', 'name': 'forget' },
{ 'path': 'std::fmt', 'name': 'format' }, { 'path': 'std::fmt', 'name': 'format' },

View file

@ -1,6 +1,5 @@
const QUERY = 'from_u';
const EXPECTED = { const EXPECTED = {
'query': 'from_u',
'others': [ 'others': [
{ 'path': 'std::char', 'name': 'from_u32' }, { 'path': 'std::char', 'name': 'from_u32' },
{ 'path': 'std::str', 'name': 'from_utf8' }, { 'path': 'std::str', 'name': 'from_utf8' },

View file

@ -1,8 +1,7 @@
// ignore-order // ignore-order
const QUERY = 'fn';
const EXPECTED = { const EXPECTED = {
'query': 'fn',
'others': [ 'others': [
{ 'path': 'std', 'name': 'fn', ty: 15 }, // 15 is for primitive types { 'path': 'std', 'name': 'fn', ty: 15 }, // 15 is for primitive types
{ 'path': 'std', 'name': 'fn', ty: 21 }, // 21 is for keywords { 'path': 'std', 'name': 'fn', ty: 21 }, // 21 is for keywords

View file

@ -1,8 +1,7 @@
// ignore-order // ignore-order
const QUERY = 'panic';
const EXPECTED = { const EXPECTED = {
'query': 'panic',
'others': [ 'others': [
{ 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros { 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros
{ 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules { 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules

View file

@ -1,6 +1,5 @@
const QUERY = 'macro:print';
const EXPECTED = { const EXPECTED = {
'query': 'macro:print',
'others': [ 'others': [
{ 'path': 'std', 'name': 'print' }, { 'path': 'std', 'name': 'print' },
{ 'path': 'std', 'name': 'println' }, { 'path': 'std', 'name': 'println' },

View file

@ -1,6 +1,5 @@
const QUERY = '!';
const EXPECTED = { const EXPECTED = {
'query': '!',
'others': [ 'others': [
{ 'path': 'std', 'name': 'never' }, { 'path': 'std', 'name': 'never' },
], ],

View file

@ -1,15 +1,12 @@
const QUERY = [
'option, fnonce -> option',
'option -> default',
];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'option, fnonce -> option',
'others': [ 'others': [
{ 'path': 'std::option::Option', 'name': 'map' }, { 'path': 'std::option::Option', 'name': 'map' },
], ],
}, },
{ {
'query': 'option -> default',
'others': [ 'others': [
{ 'path': 'std::option::Option', 'name': 'unwrap_or_default' }, { 'path': 'std::option::Option', 'name': 'unwrap_or_default' },
{ 'path': 'std::option::Option', 'name': 'get_or_insert_default' }, { 'path': 'std::option::Option', 'name': 'get_or_insert_default' },

View file

@ -1,50 +1,6 @@
const QUERY = [
'<P>',
'-> <P>',
'a<"P">',
'"P" "P"',
'P "P"',
'"p" p',
'"const": p',
"a<:a>",
"a<::a>",
"((a))",
"(p -> p",
"::a::b",
"a::::b",
"a::b::",
":a",
"a b:",
"a (b:",
"_:",
"_:a",
"a-bb",
"a>bb",
"ab'",
"a->",
'"p" <a>',
'"p" a<a>',
"a,<",
"aaaaa<>b",
"fn:aaaaa<>b",
"->a<>b",
"a<->",
"a:: a",
"a ::a",
"a<a>:",
"a<>:",
"a,:",
" a<> :",
"mod : :",
"a!a",
"a!!",
"mod:a!",
"a!::a",
"a<",
];
const PARSED = [ const PARSED = [
{ {
query: '<P>',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "<P>", original: "<P>",
@ -53,6 +9,7 @@ const PARSED = [
error: "Found generics without a path", error: "Found generics without a path",
}, },
{ {
query: '-> <P>',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "-> <P>", original: "-> <P>",
@ -61,6 +18,7 @@ const PARSED = [
error: "Found generics without a path", error: "Found generics without a path",
}, },
{ {
query: 'a<"P">',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<\"P\">", original: "a<\"P\">",
@ -69,6 +27,7 @@ const PARSED = [
error: "Unexpected `\"` in generics", error: "Unexpected `\"` in generics",
}, },
{ {
query: '"P" "P"',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "\"P\" \"P\"", original: "\"P\" \"P\"",
@ -77,6 +36,7 @@ const PARSED = [
error: "Cannot have more than one literal search element", error: "Cannot have more than one literal search element",
}, },
{ {
query: 'P "P"',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "P \"P\"", original: "P \"P\"",
@ -85,6 +45,7 @@ const PARSED = [
error: "Cannot use literal search when there is more than one element", error: "Cannot use literal search when there is more than one element",
}, },
{ {
query: '"p" p',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "\"p\" p", original: "\"p\" p",
@ -93,6 +54,7 @@ const PARSED = [
error: "You cannot have more than one element if you use quotes", error: "You cannot have more than one element if you use quotes",
}, },
{ {
query: '"const": p',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "\"const\": p", original: "\"const\": p",
@ -101,6 +63,7 @@ const PARSED = [
error: "You cannot use quotes on type filter", error: "You cannot use quotes on type filter",
}, },
{ {
query: "a<:a>",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<:a>", original: "a<:a>",
@ -109,6 +72,7 @@ const PARSED = [
error: "Expected type filter before `:`", error: "Expected type filter before `:`",
}, },
{ {
query: "a<::a>",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<::a>", original: "a<::a>",
@ -117,6 +81,7 @@ const PARSED = [
error: "Unexpected `::`: paths cannot start with `::`", error: "Unexpected `::`: paths cannot start with `::`",
}, },
{ {
query: "((a))",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "((a))", original: "((a))",
@ -125,6 +90,7 @@ const PARSED = [
error: "Unexpected `(`", error: "Unexpected `(`",
}, },
{ {
query: "(p -> p",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "(p -> p", original: "(p -> p",
@ -133,6 +99,7 @@ const PARSED = [
error: "Unexpected `(`", error: "Unexpected `(`",
}, },
{ {
query: "::a::b",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "::a::b", original: "::a::b",
@ -141,6 +108,7 @@ const PARSED = [
error: "Paths cannot start with `::`", error: "Paths cannot start with `::`",
}, },
{ {
query: "a::::b",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a::::b", original: "a::::b",
@ -149,6 +117,7 @@ const PARSED = [
error: "Unexpected `::::`", error: "Unexpected `::::`",
}, },
{ {
query: "a::b::",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a::b::", original: "a::b::",
@ -157,6 +126,7 @@ const PARSED = [
error: "Paths cannot end with `::`", error: "Paths cannot end with `::`",
}, },
{ {
query: ":a",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: ":a", original: ":a",
@ -165,6 +135,7 @@ const PARSED = [
error: "Expected type filter before `:`", error: "Expected type filter before `:`",
}, },
{ {
query: "a b:",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a b:", original: "a b:",
@ -173,6 +144,7 @@ const PARSED = [
error: "Unexpected `:` (expected path after type filter)", error: "Unexpected `:` (expected path after type filter)",
}, },
{ {
query: "a (b:",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a (b:", original: "a (b:",
@ -181,6 +153,7 @@ const PARSED = [
error: "Unexpected `(`", error: "Unexpected `(`",
}, },
{ {
query: "_:",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "_:", original: "_:",
@ -189,6 +162,7 @@ const PARSED = [
error: "Unexpected `:` (expected path after type filter)", error: "Unexpected `:` (expected path after type filter)",
}, },
{ {
query: "_:a",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "_:a", original: "_:a",
@ -197,6 +171,7 @@ const PARSED = [
error: "Unknown type filter `_`", error: "Unknown type filter `_`",
}, },
{ {
query: "a-bb",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a-bb", original: "a-bb",
@ -205,6 +180,7 @@ const PARSED = [
error: "Unexpected `-` (did you mean `->`?)", error: "Unexpected `-` (did you mean `->`?)",
}, },
{ {
query: "a>bb",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a>bb", original: "a>bb",
@ -213,6 +189,7 @@ const PARSED = [
error: "Unexpected `>` (did you mean `->`?)", error: "Unexpected `>` (did you mean `->`?)",
}, },
{ {
query: "ab'",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "ab'", original: "ab'",
@ -221,6 +198,7 @@ const PARSED = [
error: "Unexpected `'`", error: "Unexpected `'`",
}, },
{ {
query: "a->",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a->", original: "a->",
@ -229,6 +207,7 @@ const PARSED = [
error: "Expected at least one item after `->`", error: "Expected at least one item after `->`",
}, },
{ {
query: '"p" <a>',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '"p" <a>', original: '"p" <a>',
@ -237,6 +216,7 @@ const PARSED = [
error: "Found generics without a path", error: "Found generics without a path",
}, },
{ {
query: '"p" a<a>',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '"p" a<a>', original: '"p" a<a>',
@ -245,6 +225,7 @@ const PARSED = [
error: "You cannot have more than one element if you use quotes", error: "You cannot have more than one element if you use quotes",
}, },
{ {
query: "a,<",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'a,<', original: 'a,<',
@ -253,6 +234,7 @@ const PARSED = [
error: 'Found generics without a path', error: 'Found generics without a path',
}, },
{ {
query: "aaaaa<>b",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'aaaaa<>b', original: 'aaaaa<>b',
@ -261,6 +243,7 @@ const PARSED = [
error: 'Expected `,`, ` `, `:` or `->`, found `b`', error: 'Expected `,`, ` `, `:` or `->`, found `b`',
}, },
{ {
query: "fn:aaaaa<>b",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'fn:aaaaa<>b', original: 'fn:aaaaa<>b',
@ -269,6 +252,7 @@ const PARSED = [
error: 'Expected `,`, ` `, `:` or `->`, found `b`', error: 'Expected `,`, ` `, `:` or `->`, found `b`',
}, },
{ {
query: "->a<>b",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '->a<>b', original: '->a<>b',
@ -277,6 +261,7 @@ const PARSED = [
error: 'Expected `,` or ` `, found `b`', error: 'Expected `,` or ` `, found `b`',
}, },
{ {
query: "a<->",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'a<->', original: 'a<->',
@ -285,6 +270,7 @@ const PARSED = [
error: 'Unexpected `-` after `<`', error: 'Unexpected `-` after `<`',
}, },
{ {
query: "a:: a",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'a:: a', original: 'a:: a',
@ -293,6 +279,7 @@ const PARSED = [
error: 'Paths cannot end with `::`', error: 'Paths cannot end with `::`',
}, },
{ {
query: "a ::a",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'a ::a', original: 'a ::a',
@ -301,6 +288,7 @@ const PARSED = [
error: 'Paths cannot start with `::`', error: 'Paths cannot start with `::`',
}, },
{ {
query: "a<a>:",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<a>:", original: "a<a>:",
@ -309,6 +297,7 @@ const PARSED = [
error: 'Unexpected `<` in type filter', error: 'Unexpected `<` in type filter',
}, },
{ {
query: "a<>:",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<>:", original: "a<>:",
@ -317,6 +306,7 @@ const PARSED = [
error: 'Unexpected `<` in type filter', error: 'Unexpected `<` in type filter',
}, },
{ {
query: "a,:",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a,:", original: "a,:",
@ -325,6 +315,7 @@ const PARSED = [
error: 'Unexpected `,` in type filter', error: 'Unexpected `,` in type filter',
}, },
{ {
query: " a<> :",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<> :", original: "a<> :",
@ -333,6 +324,7 @@ const PARSED = [
error: 'Unexpected `<` in type filter', error: 'Unexpected `<` in type filter',
}, },
{ {
query: "mod : :",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "mod : :", original: "mod : :",
@ -341,6 +333,7 @@ const PARSED = [
error: 'Unexpected `:`', error: 'Unexpected `:`',
}, },
{ {
query: "a!a",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a!a", original: "a!a",
@ -349,6 +342,7 @@ const PARSED = [
error: 'Unexpected `!`: it can only be at the end of an ident', error: 'Unexpected `!`: it can only be at the end of an ident',
}, },
{ {
query: "a!!",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a!!", original: "a!!",
@ -357,6 +351,7 @@ const PARSED = [
error: 'Cannot have more than one `!` in an ident', error: 'Cannot have more than one `!` in an ident',
}, },
{ {
query: "mod:a!",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "mod:a!", original: "mod:a!",
@ -365,6 +360,7 @@ const PARSED = [
error: 'Invalid search type: macro `!` and `mod` both specified', error: 'Invalid search type: macro `!` and `mod` both specified',
}, },
{ {
query: "a!::a",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a!::a", original: "a!::a",
@ -373,6 +369,7 @@ const PARSED = [
error: 'Cannot have associated items in macros', error: 'Cannot have associated items in macros',
}, },
{ {
query: "a<",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a<", original: "a<",

View file

@ -1,17 +1,6 @@
const QUERY = [
'fn:foo',
'enum : foo',
'macro<f>:foo',
'macro!',
'macro:mac!',
'a::mac!',
'-> fn:foo',
'-> fn:foo<fn:bar>',
'-> fn:foo<fn:bar, enum : baz::fuzz>',
];
const PARSED = [ const PARSED = [
{ {
query: 'fn:foo',
elems: [{ elems: [{
name: "foo", name: "foo",
fullPath: ["foo"], fullPath: ["foo"],
@ -27,6 +16,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'enum : foo',
elems: [{ elems: [{
name: "foo", name: "foo",
fullPath: ["foo"], fullPath: ["foo"],
@ -42,6 +32,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'macro<f>:foo',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "macro<f>:foo", original: "macro<f>:foo",
@ -50,6 +41,7 @@ const PARSED = [
error: "Unexpected `<` in type filter", error: "Unexpected `<` in type filter",
}, },
{ {
query: 'macro!',
elems: [{ elems: [{
name: "macro", name: "macro",
fullPath: ["macro"], fullPath: ["macro"],
@ -65,6 +57,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'macro:mac!',
elems: [{ elems: [{
name: "mac", name: "mac",
fullPath: ["mac"], fullPath: ["mac"],
@ -80,6 +73,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a::mac!',
elems: [{ elems: [{
name: "a::mac", name: "a::mac",
fullPath: ["a", "mac"], fullPath: ["a", "mac"],
@ -95,6 +89,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: '-> fn:foo',
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "-> fn:foo", original: "-> fn:foo",
@ -110,6 +105,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: '-> fn:foo<fn:bar>',
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "-> fn:foo<fn:bar>", original: "-> fn:foo<fn:bar>",
@ -134,6 +130,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: '-> fn:foo<fn:bar, enum : baz::fuzz>',
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "-> fn:foo<fn:bar, enum : baz::fuzz>", original: "-> fn:foo<fn:bar, enum : baz::fuzz>",

View file

@ -1,14 +1,6 @@
const QUERY = [
'A<B<C<D>, E>',
'p<> u8',
'"p"<a>',
'p<u<x>>',
'p<u<x>, r>',
'p<u<x, r>>',
];
const PARSED = [ const PARSED = [
{ {
query: 'A<B<C<D>, E>',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'A<B<C<D>, E>', original: 'A<B<C<D>, E>',
@ -17,6 +9,7 @@ const PARSED = [
error: 'Unclosed `<`', error: 'Unclosed `<`',
}, },
{ {
query: 'p<> u8',
elems: [ elems: [
{ {
name: "p", name: "p",
@ -42,6 +35,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: '"p"<a>',
elems: [ elems: [
{ {
name: "p", name: "p",
@ -67,6 +61,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'p<u<x>>',
elems: [ elems: [
{ {
name: "p", name: "p",
@ -100,6 +95,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'p<u<x>, r>',
elems: [ elems: [
{ {
name: "p", name: "p",
@ -140,6 +136,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'p<u<x, r>>',
elems: [ elems: [
{ {
name: "p", name: "p",

View file

@ -1,14 +1,6 @@
const QUERY = [
"R<!>",
"!",
"a!",
"a!::b",
"!::b",
"a!::b!",
];
const PARSED = [ const PARSED = [
{ {
query: "R<!>",
elems: [{ elems: [{
name: "r", name: "r",
fullPath: ["r"], fullPath: ["r"],
@ -32,6 +24,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "!",
elems: [{ elems: [{
name: "!", name: "!",
fullPath: ["!"], fullPath: ["!"],
@ -47,6 +40,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "a!",
elems: [{ elems: [{
name: "a", name: "a",
fullPath: ["a"], fullPath: ["a"],
@ -62,6 +56,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "a!::b",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a!::b", original: "a!::b",
@ -70,6 +65,7 @@ const PARSED = [
error: "Cannot have associated items in macros", error: "Cannot have associated items in macros",
}, },
{ {
query: "!::b",
elems: [{ elems: [{
name: "!::b", name: "!::b",
fullPath: ["!", "b"], fullPath: ["!", "b"],
@ -85,6 +81,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "a!::b!",
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a!::b!", original: "a!::b!",

View file

@ -1,7 +1,6 @@
const QUERY = ['R<P>'];
const PARSED = [ const PARSED = [
{ {
query: 'R<P>',
elems: [{ elems: [{
name: "r", name: "r",
fullPath: ["r"], fullPath: ["r"],

View file

@ -1,7 +1,6 @@
const QUERY = ['A::B', 'A::B,C', 'A::B<f>,C', 'mod::a'];
const PARSED = [ const PARSED = [
{ {
query: 'A::B',
elems: [{ elems: [{
name: "a::b", name: "a::b",
fullPath: ["a", "b"], fullPath: ["a", "b"],
@ -17,6 +16,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'A::B,C',
elems: [ elems: [
{ {
name: "a::b", name: "a::b",
@ -42,6 +42,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'A::B<f>,C',
elems: [ elems: [
{ {
name: "a::b", name: "a::b",
@ -75,6 +76,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'mod::a',
elems: [{ elems: [{
name: "mod::a", name: "mod::a",
fullPath: ["mod", "a"], fullPath: ["mod", "a"],

View file

@ -1,15 +1,6 @@
const QUERY = [
'-> "p"',
'"p",',
'"p" -> a',
'"a" -> "p"',
'->"-"',
'"a',
'""',
];
const PARSED = [ const PARSED = [
{ {
query: '-> "p"',
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: '-> "p"', original: '-> "p"',
@ -25,6 +16,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: '"p",',
elems: [{ elems: [{
name: "p", name: "p",
fullPath: ["p"], fullPath: ["p"],
@ -40,6 +32,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: '"p" -> a',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '"p" -> a', original: '"p" -> a',
@ -48,6 +41,7 @@ const PARSED = [
error: "You cannot have more than one element if you use quotes", error: "You cannot have more than one element if you use quotes",
}, },
{ {
query: '"a" -> "p"',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '"a" -> "p"', original: '"a" -> "p"',
@ -56,6 +50,7 @@ const PARSED = [
error: "Cannot have more than one literal search element", error: "Cannot have more than one literal search element",
}, },
{ {
query: '->"-"',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '->"-"', original: '->"-"',
@ -64,6 +59,7 @@ const PARSED = [
error: 'Unexpected `-` in a string element', error: 'Unexpected `-` in a string element',
}, },
{ {
query: '"a',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '"a', original: '"a',
@ -72,6 +68,7 @@ const PARSED = [
error: 'Unclosed `"`', error: 'Unclosed `"`',
}, },
{ {
query: '""',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: '""', original: '""',

View file

@ -1,13 +1,6 @@
const QUERY = [
"-> F<P>",
"-> P",
"->,a",
"aaaaa->a",
"-> !",
];
const PARSED = [ const PARSED = [
{ {
query: "-> F<P>",
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "-> F<P>", original: "-> F<P>",
@ -31,6 +24,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "-> P",
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "-> P", original: "-> P",
@ -46,6 +40,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "->,a",
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "->,a", original: "->,a",
@ -61,6 +56,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "aaaaa->a",
elems: [{ elems: [{
name: "aaaaa", name: "aaaaa",
fullPath: ["aaaaa"], fullPath: ["aaaaa"],
@ -83,6 +79,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: "-> !",
elems: [], elems: [],
foundElems: 1, foundElems: 1,
original: "-> !", original: "-> !",

View file

@ -1,17 +1,8 @@
// ignore-tidy-tab // ignore-tidy-tab
const QUERY = [
'aaaaaa b',
'a b',
'a,b',
'a\tb',
'a<b c>',
'a<b,c>',
'a<b\tc>',
];
const PARSED = [ const PARSED = [
{ {
query: 'aaaaaa b',
elems: [ elems: [
{ {
name: 'aaaaaa', name: 'aaaaaa',
@ -37,6 +28,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a b',
elems: [ elems: [
{ {
name: 'a', name: 'a',
@ -62,6 +54,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a,b',
elems: [ elems: [
{ {
name: 'a', name: 'a',
@ -87,6 +80,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a\tb',
elems: [ elems: [
{ {
name: 'a', name: 'a',
@ -112,6 +106,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a<b c>',
elems: [ elems: [
{ {
name: 'a', name: 'a',
@ -144,6 +139,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a<b,c>',
elems: [ elems: [
{ {
name: 'a', name: 'a',
@ -176,6 +172,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a<b\tc>',
elems: [ elems: [
{ {
name: 'a', name: 'a',

View file

@ -1,18 +1,10 @@
// This test is mostly to check that the parser still kinda outputs something // This test is mostly to check that the parser still kinda outputs something
// (and doesn't enter an infinite loop!) even though the query is completely // (and doesn't enter an infinite loop!) even though the query is completely
// invalid. // invalid.
const QUERY = [
'a b',
'a b',
'a,b(c)',
'aaa,a',
',,,,',
'mod :',
'mod\t:',
];
const PARSED = [ const PARSED = [
{ {
query: 'a b',
elems: [ elems: [
{ {
name: "a", name: "a",
@ -38,6 +30,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a b',
elems: [ elems: [
{ {
name: "a", name: "a",
@ -63,6 +56,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'a,b(c)',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: "a,b(c)", original: "a,b(c)",
@ -71,6 +65,7 @@ const PARSED = [
error: "Unexpected `(`", error: "Unexpected `(`",
}, },
{ {
query: 'aaa,a',
elems: [ elems: [
{ {
name: "aaa", name: "aaa",
@ -96,6 +91,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: ',,,,',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: ",,,,", original: ",,,,",
@ -104,6 +100,7 @@ const PARSED = [
error: null, error: null,
}, },
{ {
query: 'mod :',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'mod :', original: 'mod :',
@ -112,6 +109,7 @@ const PARSED = [
error: "Unexpected `:` (expected path after type filter)", error: "Unexpected `:` (expected path after type filter)",
}, },
{ {
query: 'mod\t:',
elems: [], elems: [],
foundElems: 0, foundElems: 0,
original: 'mod\t:', original: 'mod\t:',

View file

@ -1,7 +1,6 @@
const QUERY = 'hashset::insert';
const EXPECTED = { const EXPECTED = {
'others': [ query: 'hashset::insert',
others: [
// ensure hashset::insert comes first // ensure hashset::insert comes first
{ 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' }, { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' },
{ 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' }, { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' },

View file

@ -1,15 +1,6 @@
const QUERY = [
'i8',
'u32',
'str',
'char',
'unit',
'tuple',
'fn',
];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'i8',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',
@ -19,6 +10,7 @@ const EXPECTED = [
] ]
}, },
{ {
'query': 'u32',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',
@ -28,6 +20,7 @@ const EXPECTED = [
] ]
}, },
{ {
'query': 'str',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',
@ -37,6 +30,7 @@ const EXPECTED = [
] ]
}, },
{ {
'query': 'char',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',
@ -46,6 +40,7 @@ const EXPECTED = [
] ]
}, },
{ {
'query': 'unit',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',
@ -55,6 +50,7 @@ const EXPECTED = [
] ]
}, },
{ {
'query': 'tuple',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',
@ -64,6 +60,7 @@ const EXPECTED = [
] ]
}, },
{ {
'query': 'fn',
'others': [ 'others': [
{ {
'path': 'std', 'path': 'std',

View file

@ -1,9 +1,9 @@
// exact-check // exact-check
const QUERY = 'prinltn';
const FILTER_CRATE = 'std'; const FILTER_CRATE = 'std';
const EXPECTED = { const EXPECTED = {
'query': 'prinltn',
'others': [ 'others': [
{ 'path': 'std', 'name': 'println' }, { 'path': 'std', 'name': 'println' },
{ 'path': 'std', 'name': 'print' }, { 'path': 'std', 'name': 'print' },

View file

@ -1,9 +1,9 @@
// ignore-order // ignore-order
const QUERY = '"error"';
const FILTER_CRATE = 'std'; const FILTER_CRATE = 'std';
const EXPECTED = { const EXPECTED = {
'query': '"error"',
'others': [ 'others': [
{ 'path': 'std', 'name': 'error' }, { 'path': 'std', 'name': 'error' },
{ 'path': 'std::fmt', 'name': 'Error' }, { 'path': 'std::fmt', 'name': 'Error' },

View file

@ -1,8 +1,7 @@
// exact-check // exact-check
const QUERY = 'reference::shrink';
const EXPECTED = { const EXPECTED = {
'query': 'reference::shrink',
// avoid including the method that's not going to be in the HTML // avoid including the method that's not going to be in the HTML
'others': [], 'others': [],
}; };

View file

@ -1,9 +1,8 @@
// exact-check // exact-check
// https://github.com/rust-lang/rust/issues/103357 // https://github.com/rust-lang/rust/issues/103357
const QUERY = 'regex';
const EXPECTED = { const EXPECTED = {
'query': 'regex',
'others': [], 'others': [],
'in_args': [], 'in_args': [],
'returned': [], 'returned': [],

View file

@ -1,6 +1,5 @@
const QUERY = 'struct:"string"';
const EXPECTED = { const EXPECTED = {
'query': 'struct:"string"',
'in_args': [ 'in_args': [
{ 'path': 'std::string::String', 'name': 'ne' }, { 'path': 'std::string::String', 'name': 'ne' },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = 'struct:string';
const EXPECTED = { const EXPECTED = {
'query': 'struct:string',
'in_args': [ 'in_args': [
{ 'path': 'std::string::String', 'name': 'ne' }, { 'path': 'std::string::String', 'name': 'ne' },
], ],

View file

@ -1,8 +1,7 @@
// should-fail // should-fail
const QUERY = 'fn';
const EXPECTED = { const EXPECTED = {
'query': 'fn',
'others': [ 'others': [
{ 'path': 'std', 'name': 'fn', ty: 14 }, { 'path': 'std', 'name': 'fn', ty: 14 },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = 'String::from_ut';
const EXPECTED = { const EXPECTED = {
'query': 'String::from_ut',
'others': [ 'others': [
{ 'path': 'std::string::String', 'name': 'from_utf8' }, { 'path': 'std::string::String', 'name': 'from_utf8' },
{ 'path': 'std::string::String', 'name': 'from_utf8' }, { 'path': 'std::string::String', 'name': 'from_utf8' },

View file

@ -1,6 +1,5 @@
const QUERY = 'struct:VecD';
const EXPECTED = { const EXPECTED = {
'query': 'struct:VecD',
'others': [ 'others': [
{ 'path': 'std::collections', 'name': 'VecDeque' }, { 'path': 'std::collections', 'name': 'VecDeque' },
{ 'path': 'std::vec', 'name': 'Vec' }, { 'path': 'std::vec', 'name': 'Vec' },

View file

@ -1,9 +1,9 @@
// exact-check // exact-check
const QUERY = 'macro:print';
const FILTER_CRATE = 'std'; const FILTER_CRATE = 'std';
const EXPECTED = { const EXPECTED = {
'query': 'macro:print',
'others': [ 'others': [
{ 'path': 'std', 'name': 'print' }, { 'path': 'std', 'name': 'print' },
{ 'path': 'std', 'name': 'println' }, { 'path': 'std', 'name': 'println' },

View file

@ -1,6 +1,5 @@
const QUERY = 'Vec::new';
const EXPECTED = { const EXPECTED = {
'query': 'Vec::new',
'others': [ 'others': [
{ 'path': 'std::vec::Vec', 'name': 'new' }, { 'path': 'std::vec::Vec', 'name': 'new' },
{ 'path': 'alloc::vec::Vec', 'name': 'new' }, { 'path': 'alloc::vec::Vec', 'name': 'new' },

View file

@ -1,6 +1,5 @@
const QUERY = 'Fo';
const EXPECTED = { const EXPECTED = {
'query': 'Fo',
'others': [ 'others': [
{ 'path': 'basic', 'name': 'Foo' }, { 'path': 'basic', 'name': 'Foo' },
], ],

View file

@ -1,9 +1,8 @@
// exact-check // exact-check
const QUERY = 'true';
const FILTER_CRATE = 'some_other_crate'; const FILTER_CRATE = 'some_other_crate';
const EXPECTED = { const EXPECTED = {
'query': 'true',
'others': [], 'others': [],
}; };

View file

@ -1,10 +1,9 @@
// exact-check // exact-check
const QUERY = '"true"';
const FILTER_CRATE = 'doc_alias_filter'; const FILTER_CRATE = 'doc_alias_filter';
const EXPECTED = { const EXPECTED = {
'query': '"true"',
'others': [ 'others': [
{ {
'path': 'doc_alias_filter', 'path': 'doc_alias_filter',

View file

@ -1,11 +1,8 @@
// exact-check // exact-check
const QUERY = [
'Demon Lord',
];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'Demon Lord',
'others': [ 'others': [
{ {
'path': 'doc_alias_whitespace', 'path': 'doc_alias_whitespace',

View file

@ -1,31 +1,6 @@
const QUERY = [
'StructItem',
'StructFieldItem',
'StructMethodItem',
'ImplTraitItem',
'StructImplConstItem',
'ImplTraitFunction',
'EnumItem',
'VariantItem',
'EnumMethodItem',
'TypedefItem',
'TraitItem',
'TraitTypeItem',
'AssociatedConstItem',
'TraitFunctionItem',
'FunctionItem',
'ModuleItem',
'ConstItem',
'StaticItem',
'UnionItem',
'UnionFieldItem',
'UnionMethodItem',
'MacroItem',
];
const EXPECTED = [ const EXPECTED = [
{ {
// StructItem 'query': 'StructItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -37,7 +12,7 @@ const EXPECTED = [
], ],
}, },
{ {
// StructFieldItem 'query': 'StructFieldItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Struct', 'path': 'doc_alias::Struct',
@ -49,7 +24,7 @@ const EXPECTED = [
], ],
}, },
{ {
// StructMethodItem 'query': 'StructMethodItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Struct', 'path': 'doc_alias::Struct',
@ -61,11 +36,11 @@ const EXPECTED = [
], ],
}, },
{ {
// ImplTraitItem 'query': 'ImplTraitItem',
'others': [], 'others': [],
}, },
{ {
// StructImplConstItem 'query': 'StructImplConstItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Struct', 'path': 'doc_alias::Struct',
@ -77,7 +52,7 @@ const EXPECTED = [
], ],
}, },
{ {
// ImplTraitFunction 'query': 'ImplTraitFunction',
'others': [ 'others': [
{ {
'path': 'doc_alias::Struct', 'path': 'doc_alias::Struct',
@ -89,7 +64,7 @@ const EXPECTED = [
], ],
}, },
{ {
// EnumItem 'query': 'EnumItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -101,7 +76,7 @@ const EXPECTED = [
], ],
}, },
{ {
// VariantItem 'query': 'VariantItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Enum', 'path': 'doc_alias::Enum',
@ -113,7 +88,7 @@ const EXPECTED = [
], ],
}, },
{ {
// EnumMethodItem 'query': 'EnumMethodItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Enum', 'path': 'doc_alias::Enum',
@ -125,7 +100,7 @@ const EXPECTED = [
], ],
}, },
{ {
// TypedefItem 'query': 'TypedefItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -137,7 +112,7 @@ const EXPECTED = [
], ],
}, },
{ {
// TraitItem 'query': 'TraitItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -149,7 +124,7 @@ const EXPECTED = [
], ],
}, },
{ {
// TraitTypeItem 'query': 'TraitTypeItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Trait', 'path': 'doc_alias::Trait',
@ -161,7 +136,7 @@ const EXPECTED = [
], ],
}, },
{ {
// AssociatedConstItem 'query': 'AssociatedConstItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Trait', 'path': 'doc_alias::Trait',
@ -173,7 +148,7 @@ const EXPECTED = [
], ],
}, },
{ {
// TraitFunctionItem 'query': 'TraitFunctionItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Trait', 'path': 'doc_alias::Trait',
@ -185,7 +160,7 @@ const EXPECTED = [
], ],
}, },
{ {
// FunctionItem 'query': 'FunctionItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -197,7 +172,7 @@ const EXPECTED = [
], ],
}, },
{ {
// ModuleItem 'query': 'ModuleItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -209,7 +184,7 @@ const EXPECTED = [
], ],
}, },
{ {
// ConstItem 'query': 'ConstItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -225,7 +200,7 @@ const EXPECTED = [
], ],
}, },
{ {
// StaticItem 'query': 'StaticItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -237,7 +212,7 @@ const EXPECTED = [
], ],
}, },
{ {
// UnionItem 'query': 'UnionItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',
@ -255,7 +230,7 @@ const EXPECTED = [
], ],
}, },
{ {
// UnionFieldItem 'query': 'UnionFieldItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Union', 'path': 'doc_alias::Union',
@ -267,7 +242,7 @@ const EXPECTED = [
], ],
}, },
{ {
// UnionMethodItem 'query': 'UnionMethodItem',
'others': [ 'others': [
{ {
'path': 'doc_alias::Union', 'path': 'doc_alias::Union',
@ -279,7 +254,7 @@ const EXPECTED = [
], ],
}, },
{ {
// MacroItem 'query': 'MacroItem',
'others': [ 'others': [
{ {
'path': 'doc_alias', 'path': 'doc_alias',

View file

@ -1,6 +1,5 @@
const QUERY = 'si::pc';
const EXPECTED = { const EXPECTED = {
'query': 'si::pc',
'others': [ 'others': [
{ 'path': 'exact_match::Si', 'name': 'pc' }, { 'path': 'exact_match::Si', 'name': 'pc' },
{ 'path': 'exact_match::Psi', 'name': 'pc' }, { 'path': 'exact_match::Psi', 'name': 'pc' },

View file

@ -1,6 +1,5 @@
const QUERY = 'MyForeignType::my_method';
const EXPECTED = { const EXPECTED = {
'query': 'MyForeignType::my_method',
'others': [ 'others': [
// Test case for https://github.com/rust-lang/rust/pull/96887#pullrequestreview-967154358 // Test case for https://github.com/rust-lang/rust/pull/96887#pullrequestreview-967154358
// Validates that the parent path for a foreign type method is correct. // Validates that the parent path for a foreign type method is correct.

View file

@ -1,68 +1,56 @@
// exact-check // exact-check
const QUERY = [
'Aaaaaaa -> u32',
'Aaaaaaa -> bool',
'Aaaaaaa -> usize',
'Read -> u64',
'trait:Read -> u64',
'struct:Read -> u64',
'bool -> u64',
'Ddddddd -> u64',
'-> Ddddddd'
];
const EXPECTED = [ const EXPECTED = [
{ {
// Aaaaaaa -> u32 'query': 'Aaaaaaa -> u32',
'others': [ 'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'bbbbbbb' }, { 'path': 'generics_impl::Aaaaaaa', 'name': 'bbbbbbb' },
], ],
}, },
{ {
// Aaaaaaa -> bool 'query': 'Aaaaaaa -> bool',
'others': [ 'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'ccccccc' }, { 'path': 'generics_impl::Aaaaaaa', 'name': 'ccccccc' },
], ],
}, },
{ {
// Aaaaaaa -> usize 'query': 'Aaaaaaa -> usize',
'others': [ 'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'read' }, { 'path': 'generics_impl::Aaaaaaa', 'name': 'read' },
], ],
}, },
{ {
// Read -> u64 'query': 'Read -> u64',
'others': [ 'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' }, { 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' }, { 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
], ],
}, },
{ {
// trait:Read -> u64 'query': 'trait:Read -> u64',
'others': [ 'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' }, { 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' }, { 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
], ],
}, },
{ {
// struct:Read -> u64 'query': 'struct:Read -> u64',
'others': [], 'others': [],
}, },
{ {
// bool -> u64 'query': 'bool -> u64',
'others': [ 'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'fffffff' }, { 'path': 'generics_impl::Ddddddd', 'name': 'fffffff' },
], ],
}, },
{ {
// Ddddddd -> u64 'query': 'Ddddddd -> u64',
'others': [ 'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' }, { 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
], ],
}, },
{ {
// -> Ddddddd 'query': '-> Ddddddd',
'others': [ 'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'hhhhhhh' }, { 'path': 'generics_impl::Ddddddd', 'name': 'hhhhhhh' },
], ],

View file

@ -1,14 +1,9 @@
// exact-check // exact-check
const QUERY = [
'Result<SomeTrait>',
'Zzzzzzzzzzzzzzzzzz',
'Nonononononononono',
];
const EXPECTED = [ const EXPECTED = [
// check one of the generic items // check one of the generic items
{ {
'query': 'Result<SomeTrait>',
'in_args': [ 'in_args': [
{ 'path': 'generics_multi_trait', 'name': 'beta' }, { 'path': 'generics_multi_trait', 'name': 'beta' },
], ],
@ -17,6 +12,7 @@ const EXPECTED = [
], ],
}, },
{ {
'query': 'Zzzzzzzzzzzzzzzzzz',
'in_args': [ 'in_args': [
{ 'path': 'generics_multi_trait', 'name': 'beta' }, { 'path': 'generics_multi_trait', 'name': 'beta' },
], ],
@ -26,6 +22,7 @@ const EXPECTED = [
}, },
// ignore the name of the generic itself // ignore the name of the generic itself
{ {
'query': 'Nonononononononono',
'in_args': [], 'in_args': [],
'returned': [], 'returned': [],
}, },

View file

@ -1,31 +1,24 @@
// exact-check // exact-check
const QUERY = [
'-> Out<First<Second>>',
'-> Out<Second<First>>',
'-> Out<First, Second>',
'-> Out<Second, First>',
];
const EXPECTED = [ const EXPECTED = [
{ {
// -> Out<First<Second>> 'query': '-> Out<First<Second>>',
'others': [ 'others': [
{ 'path': 'generics_nested', 'name': 'alef' }, { 'path': 'generics_nested', 'name': 'alef' },
], ],
}, },
{ {
// -> Out<Second<First>> 'query': '-> Out<Second<First>>',
'others': [], 'others': [],
}, },
{ {
// -> Out<First, Second> 'query': '-> Out<First, Second>',
'others': [ 'others': [
{ 'path': 'generics_nested', 'name': 'bet' }, { 'path': 'generics_nested', 'name': 'bet' },
], ],
}, },
{ {
// -> Out<Second, First> 'query': '-> Out<Second, First>',
'others': [ 'others': [
{ 'path': 'generics_nested', 'name': 'bet' }, { 'path': 'generics_nested', 'name': 'bet' },
], ],

View file

@ -1,22 +1,9 @@
// exact-check // exact-check
const QUERY = [
'Result<SomeTrait>',
'Result<SomeTraiz>',
'OtherThingxxxxxxxx',
'OtherThingxxxxxxxy',
];
const CORRECTIONS = [
null,
null,
null,
'OtherThingxxxxxxxx',
];
const EXPECTED = [ const EXPECTED = [
// Result<SomeTrait>
{ {
'query': 'Result<SomeTrait>',
'correction': null,
'in_args': [ 'in_args': [
{ 'path': 'generics_trait', 'name': 'beta' }, { 'path': 'generics_trait', 'name': 'beta' },
], ],
@ -24,13 +11,15 @@ const EXPECTED = [
{ 'path': 'generics_trait', 'name': 'bet' }, { 'path': 'generics_trait', 'name': 'bet' },
], ],
}, },
// Result<SomeTraiz>
{ {
'query': 'Result<SomeTraiz>',
'correction': null,
'in_args': [], 'in_args': [],
'returned': [], 'returned': [],
}, },
// OtherThingxxxxxxxx
{ {
'query': 'OtherThingxxxxxxxx',
'correction': null,
'in_args': [ 'in_args': [
{ 'path': 'generics_trait', 'name': 'alpha' }, { 'path': 'generics_trait', 'name': 'alpha' },
], ],
@ -38,8 +27,9 @@ const EXPECTED = [
{ 'path': 'generics_trait', 'name': 'alef' }, { 'path': 'generics_trait', 'name': 'alef' },
], ],
}, },
// OtherThingxxxxxxxy
{ {
'query': 'OtherThingxxxxxxxy',
'correction': 'OtherThingxxxxxxxx',
'in_args': [ 'in_args': [
{ 'path': 'generics_trait', 'name': 'alpha' }, { 'path': 'generics_trait', 'name': 'alpha' },
], ],

View file

@ -1,20 +1,8 @@
// exact-check // exact-check
const QUERY = [
'R<P>',
'R<struct:P>',
'R<enum:P>',
'"P"',
'P',
'ExtraCreditStructMulti<ExtraCreditInnerMulti, ExtraCreditInnerMulti>',
'TraitCat',
'TraitDog',
'Result<String>',
];
const EXPECTED = [ const EXPECTED = [
{ {
// R<P> 'query': 'R<P>',
'returned': [ 'returned': [
{ 'path': 'generics', 'name': 'alef' }, { 'path': 'generics', 'name': 'alef' },
], ],
@ -23,7 +11,7 @@ const EXPECTED = [
], ],
}, },
{ {
// R<struct:P> 'query': 'R<struct:P>',
'returned': [ 'returned': [
{ 'path': 'generics', 'name': 'alef' }, { 'path': 'generics', 'name': 'alef' },
], ],
@ -32,12 +20,12 @@ const EXPECTED = [
], ],
}, },
{ {
// R<enum:P> 'query': 'R<enum:P>',
'returned': [], 'returned': [],
'in_args': [], 'in_args': [],
}, },
{ {
// "P" 'query': '"P"',
'others': [ 'others': [
{ 'path': 'generics', 'name': 'P' }, { 'path': 'generics', 'name': 'P' },
], ],
@ -49,7 +37,7 @@ const EXPECTED = [
], ],
}, },
{ {
// P 'query': 'P',
'returned': [ 'returned': [
{ 'path': 'generics', 'name': 'alef' }, { 'path': 'generics', 'name': 'alef' },
], ],
@ -58,26 +46,26 @@ const EXPECTED = [
], ],
}, },
{ {
// "ExtraCreditStructMulti"<ExtraCreditInnerMulti, ExtraCreditInnerMulti> 'query': '"ExtraCreditStructMulti"<ExtraCreditInnerMulti, ExtraCreditInnerMulti>',
'in_args': [ 'in_args': [
{ 'path': 'generics', 'name': 'extracreditlabhomework' }, { 'path': 'generics', 'name': 'extracreditlabhomework' },
], ],
'returned': [], 'returned': [],
}, },
{ {
// TraitCat 'query': 'TraitCat',
'in_args': [ 'in_args': [
{ 'path': 'generics', 'name': 'gamma' }, { 'path': 'generics', 'name': 'gamma' },
], ],
}, },
{ {
// TraitDog 'query': 'TraitDog',
'in_args': [ 'in_args': [
{ 'path': 'generics', 'name': 'gamma' }, { 'path': 'generics', 'name': 'gamma' },
], ],
}, },
{ {
// Result<String> 'query': 'Result<String>',
'others': [], 'others': [],
'returned': [ 'returned': [
{ 'path': 'generics', 'name': 'super_soup' }, { 'path': 'generics', 'name': 'super_soup' },

View file

@ -1,32 +1,24 @@
// ignore-order // ignore-order
const QUERY = [
'Aaaaaaa -> i32',
'Aaaaaaa -> Aaaaaaa',
'Aaaaaaa -> usize',
'-> Aaaaaaa',
'Aaaaaaa',
];
const EXPECTED = [ const EXPECTED = [
{ {
// Aaaaaaa -> i32 'query': 'Aaaaaaa -> i32',
'others': [ 'others': [
{ 'path': 'impl_trait::Ccccccc', 'name': 'eeeeeee' }, { 'path': 'impl_trait::Ccccccc', 'name': 'eeeeeee' },
], ],
}, },
{ {
// Aaaaaaa -> Aaaaaaa 'query': 'Aaaaaaa -> Aaaaaaa',
'others': [ 'others': [
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' }, { 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' },
], ],
}, },
{ {
// Aaaaaaa -> usize 'query': 'Aaaaaaa -> usize',
'others': [], 'others': [],
}, },
{ {
// -> Aaaaaaa 'query': '-> Aaaaaaa',
'others': [ 'others': [
{ 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' }, { 'path': 'impl_trait::Ccccccc', 'name': 'fffffff' },
{ 'path': 'impl_trait::Ccccccc', 'name': 'ddddddd' }, { 'path': 'impl_trait::Ccccccc', 'name': 'ddddddd' },
@ -34,7 +26,7 @@ const EXPECTED = [
], ],
}, },
{ {
// Aaaaaaa 'query': 'Aaaaaaa',
'others': [ 'others': [
{ 'path': 'impl_trait', 'name': 'Aaaaaaa' }, { 'path': 'impl_trait', 'name': 'Aaaaaaa' },
], ],

View file

@ -1,8 +1,7 @@
// exact-check // exact-check
const QUERY = 'abracadabra!';
const EXPECTED = { const EXPECTED = {
'query': 'abracadabra!',
'others': [ 'others': [
{ 'path': 'macro_search', 'name': 'abracadabra' }, { 'path': 'macro_search', 'name': 'abracadabra' },
{ 'path': 'macro_search', 'name': 'abracadabra_b' }, { 'path': 'macro_search', 'name': 'abracadabra_b' },

View file

@ -1,6 +1,5 @@
const QUERY = 'ig::pc';
const EXPECTED = { const EXPECTED = {
'query': 'ig::pc',
'others': [ 'others': [
{ 'path': 'module_substring::Sig', 'name': 'pc' }, { 'path': 'module_substring::Sig', 'name': 'pc' },
{ 'path': 'module_substring::Si', 'name': 'pc' }, { 'path': 'module_substring::Si', 'name': 'pc' },

View file

@ -1,8 +1,7 @@
// exact-check // exact-check
const QUERY = 'b::ccccccc';
const EXPECTED = { const EXPECTED = {
'query': 'b::ccccccc',
'others': [ 'others': [
// `ccccccc` is an exact match for all three of these. // `ccccccc` is an exact match for all three of these.
// However `b` is a closer match for `bb` than for any // However `b` is a closer match for `bb` than for any

View file

@ -1,33 +1,30 @@
// exact-check // exact-check
const QUERY = [
"i32",
"str",
"primitive:str",
"struct:str",
"TotoIsSomewhere",
];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'i32',
'in_args': [ 'in_args': [
{ 'path': 'primitive', 'name': 'foo' }, { 'path': 'primitive', 'name': 'foo' },
], ],
}, },
{ {
'query': 'str',
'returned': [ 'returned': [
{ 'path': 'primitive', 'name': 'foo' }, { 'path': 'primitive', 'name': 'foo' },
], ],
}, },
{ {
'query': 'primitive:str',
'returned': [ 'returned': [
{ 'path': 'primitive', 'name': 'foo' }, { 'path': 'primitive', 'name': 'foo' },
], ],
}, },
{ {
'query': 'struct:str',
'returned': [], 'returned': [],
}, },
{ {
'query': 'TotoIsSomewhere',
'others': [], 'others': [],
'in_args': [], 'in_args': [],
'returned': [], 'returned': [],

View file

@ -1,14 +1,14 @@
// exact-check // exact-check
const QUERY = ['constructor', '__proto__'];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'constructor',
'others': [], 'others': [],
'returned': [], 'returned': [],
'in_args': [], 'in_args': [],
}, },
{ {
'query': '__proto__',
'others': [], 'others': [],
'returned': [], 'returned': [],
'in_args': [], 'in_args': [],

View file

@ -1,33 +1,25 @@
// ignore-order // ignore-order
const QUERY = [
'Aaaaaaa -> i32',
'Aaaaaaa -> Aaaaaaa',
'Aaaaaaa -> usize',
'-> Aaaaaaa',
'Aaaaaaa',
];
const EXPECTED = [ const EXPECTED = [
{ {
// Aaaaaaa -> i32 'query': 'Aaaaaaa -> i32',
'others': [ 'others': [
{ 'path': 'raw_pointer::Ccccccc', 'name': 'eeeeeee' }, { 'path': 'raw_pointer::Ccccccc', 'name': 'eeeeeee' },
], ],
}, },
{ {
// Aaaaaaa -> Aaaaaaa 'query': 'Aaaaaaa -> Aaaaaaa',
'others': [ 'others': [
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' }, { 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' },
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' }, { 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' },
], ],
}, },
{ {
// Aaaaaaa -> usize 'query': 'Aaaaaaa -> usize',
'others': [], 'others': [],
}, },
{ {
// -> Aaaaaaa 'query': '-> Aaaaaaa',
'others': [ 'others': [
{ 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' }, { 'path': 'raw_pointer::Ccccccc', 'name': 'fffffff' },
{ 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' }, { 'path': 'raw_pointer::Ccccccc', 'name': 'ggggggg' },
@ -36,7 +28,7 @@ const EXPECTED = [
], ],
}, },
{ {
// Aaaaaaa 'query': 'Aaaaaaa',
'others': [ 'others': [
{ 'path': 'raw_pointer', 'name': 'Aaaaaaa' }, { 'path': 'raw_pointer', 'name': 'Aaaaaaa' },
], ],

View file

@ -1,15 +1,15 @@
// exact-check // exact-check
const QUERY = ['Subscriber', 'AnotherOne'];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'Subscriber',
'others': [ 'others': [
{ 'path': 'reexport::fmt', 'name': 'Subscriber' }, { 'path': 'reexport::fmt', 'name': 'Subscriber' },
{ 'path': 'reexport', 'name': 'FmtSubscriber' }, { 'path': 'reexport', 'name': 'FmtSubscriber' },
], ],
}, },
{ {
'query': 'AnotherOne',
'others': [ 'others': [
{ 'path': 'reexport', 'name': 'AnotherOne' }, { 'path': 'reexport', 'name': 'AnotherOne' },
], ],

View file

@ -1,18 +1,15 @@
// exact-check // exact-check
const QUERY = [
'P',
'P, P',
];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'P',
'in_args': [ 'in_args': [
{ 'path': 'search_bag_semantics', 'name': 'alacazam' }, { 'path': 'search_bag_semantics', 'name': 'alacazam' },
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' }, { 'path': 'search_bag_semantics', 'name': 'abracadabra' },
], ],
}, },
{ {
'query': 'P, P',
'others': [ 'others': [
{ 'path': 'search_bag_semantics', 'name': 'abracadabra' }, { 'path': 'search_bag_semantics', 'name': 'abracadabra' },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = 'P';
const EXPECTED = { const EXPECTED = {
'query': 'P',
'others': [ 'others': [
{ 'path': 'search_short_types', 'name': 'P' }, { 'path': 'search_short_types', 'name': 'P' },
{ 'path': 'search_short_types::VeryLongTypeName', 'name': 'p' }, { 'path': 'search_short_types::VeryLongTypeName', 'name': 'p' },

View file

@ -1,63 +1,52 @@
// exact-check // exact-check
const QUERY = [
'R<primitive:slice<P>>',
'primitive:slice<R<P>>',
'R<primitive:slice<Q>>',
'primitive:slice<R<Q>>',
'R<primitive:array<Q>>',
'primitive:array<R<Q>>',
'primitive:array<TraitCat>',
'primitive:array<TraitDog>',
];
const EXPECTED = [ const EXPECTED = [
{ {
// R<primitive:slice<P>> 'query': 'R<primitive:slice<P>>',
'returned': [], 'returned': [],
'in_args': [ 'in_args': [
{ 'path': 'slice_array', 'name': 'alpha' }, { 'path': 'slice_array', 'name': 'alpha' },
], ],
}, },
{ {
// primitive:slice<R<P>> 'query': 'primitive:slice<R<P>>',
'returned': [ 'returned': [
{ 'path': 'slice_array', 'name': 'alef' }, { 'path': 'slice_array', 'name': 'alef' },
], ],
'in_args': [], 'in_args': [],
}, },
{ {
// R<primitive:slice<Q>> 'query': 'R<primitive:slice<Q>>',
'returned': [], 'returned': [],
'in_args': [], 'in_args': [],
}, },
{ {
// primitive:slice<R<Q>> 'query': 'primitive:slice<R<Q>>',
'returned': [], 'returned': [],
'in_args': [], 'in_args': [],
}, },
{ {
// R<primitive:array<Q>> 'query': 'R<primitive:array<Q>>',
'returned': [ 'returned': [
{ 'path': 'slice_array', 'name': 'bet' }, { 'path': 'slice_array', 'name': 'bet' },
], ],
'in_args': [], 'in_args': [],
}, },
{ {
// primitive:array<R<Q>> 'query': 'primitive:array<R<Q>>',
'returned': [], 'returned': [],
'in_args': [ 'in_args': [
{ 'path': 'slice_array', 'name': 'beta' }, { 'path': 'slice_array', 'name': 'beta' },
], ],
}, },
{ {
// primitive::array<TraitCat> 'query': 'primitive:array<TraitCat>',
'in_args': [ 'in_args': [
{ 'path': 'slice_array', 'name': 'gamma' }, { 'path': 'slice_array', 'name': 'gamma' },
], ],
}, },
{ {
// primitive::array<TraitDog> 'query': 'primitive:array<TraitDog>',
'in_args': [ 'in_args': [
{ 'path': 'slice_array', 'name': 'gamma' }, { 'path': 'slice_array', 'name': 'gamma' },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = 'name';
const EXPECTED = { const EXPECTED = {
'query': 'name',
'others': [ 'others': [
{ 'path': 'struct_like_variant::Enum::Bar', 'name': 'name', 'desc': 'This is a name.' }, { 'path': 'struct_like_variant::Enum::Bar', 'name': 'name', 'desc': 'This is a name.' },
], ],

View file

@ -1,6 +1,5 @@
const QUERY = 'waker_from';
const EXPECTED = { const EXPECTED = {
'query': 'waker_from',
'others': [ 'others': [
{ 'path': 'substring::SuperWaker', 'name': 'local_waker_from_nonlocal' }, { 'path': 'substring::SuperWaker', 'name': 'local_waker_from_nonlocal' },
{ 'path': 'substring::SuperWakerTask', 'name': 'local_waker_from_nonlocal' }, { 'path': 'substring::SuperWakerTask', 'name': 'local_waker_from_nonlocal' },

View file

@ -1,19 +1,20 @@
// ignore-tidy-linelength // ignore-tidy-linelength
const QUERY = ['summaries', 'summaries::Sidebar', 'summaries::Sidebar2'];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'summaries',
'others': [ 'others': [
{ 'path': '', 'name': 'summaries', 'desc': 'This <em>summary</em> has a link, [<code>code</code>], and <code>Sidebar2</code> intra-doc.' }, { 'path': '', 'name': 'summaries', 'desc': 'This <em>summary</em> has a link, [<code>code</code>], and <code>Sidebar2</code> intra-doc.' },
], ],
}, },
{ {
'query': 'summaries::Sidebar',
'others': [ 'others': [
{ 'path': 'summaries', 'name': 'Sidebar', 'desc': 'This <code>code</code> will be rendered in a code tag.' }, { 'path': 'summaries', 'name': 'Sidebar', 'desc': 'This <code>code</code> will be rendered in a code tag.' },
], ],
}, },
{ {
'query': 'summaries::Sidebar2',
'others': [ 'others': [
{ 'path': 'summaries', 'name': 'Sidebar2', 'desc': '' }, { 'path': 'summaries', 'name': 'Sidebar2', 'desc': '' },
], ],

View file

@ -1,28 +1,31 @@
const QUERY = ['trait<nested>', '-> trait<nested>', 't1, t2', '-> shazam', 'drizzel -> shazam'];
const EXPECTED = [ const EXPECTED = [
{ {
'query': 'trait<nested>',
'in_args': [ 'in_args': [
{ 'path': 'where_clause', 'name': 'abracadabra' }, { 'path': 'where_clause', 'name': 'abracadabra' },
], ],
}, },
{ {
'query': '-> trait<nested>',
'others': [ 'others': [
{ 'path': 'where_clause', 'name': 'alacazam' }, { 'path': 'where_clause', 'name': 'alacazam' },
], ],
}, },
{ {
'query': 't1, t2',
'others': [ 'others': [
{ 'path': 'where_clause', 'name': 'presto' }, { 'path': 'where_clause', 'name': 'presto' },
], ],
}, },
{ {
'query': '-> shazam',
'others': [ 'others': [
{ 'path': 'where_clause', 'name': 'bippety' }, { 'path': 'where_clause', 'name': 'bippety' },
{ 'path': 'where_clause::Drizzel', 'name': 'boppety' }, { 'path': 'where_clause::Drizzel', 'name': 'boppety' },
], ],
}, },
{ {
'query': 'drizzel -> shazam',
'others': [ 'others': [
{ 'path': 'where_clause::Drizzel', 'name': 'boppety' }, { 'path': 'where_clause::Drizzel', 'name': 'boppety' },
], ],

View file

@ -1,6 +1,4 @@
// It is unclear whether a fully unconfigured crate should link to standard library, // `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
// or what its `no_std`/`no_core`/`compiler_builtins` status, more precisely. // This crate has no such attribute, therefore this crate does link to libstd.
// Currently the usual standard library prelude is added to such crates,
// and therefore they link to libstd.
#![cfg(FALSE)] #![cfg(FALSE)]

View file

@ -0,0 +1,5 @@
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
// Therefore this crate does link to libstd.
#![cfg(FALSE)]
#![no_std]

View file

@ -0,0 +1,8 @@
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
// Therefore this crate doesn't link to libstd.
// no-prefer-dynamic
#![no_std]
#![crate_type = "lib"]
#![cfg(FALSE)]

View file

@ -1,5 +1,4 @@
// It is unclear which features should be in effect in a fully unconfigured crate (issue #104633). // Features above `cfg(FALSE)` are in effect in a fully unconfigured crate (issue #104633).
// Currently none on the features are in effect, so we get the feature gates reported.
// check-pass // check-pass
// compile-flags: --crate-type lib // compile-flags: --crate-type lib
@ -8,8 +7,7 @@
#![cfg(FALSE)] #![cfg(FALSE)]
#![feature(box_syntax)] #![feature(box_syntax)]
macro mac() {} //~ WARN `macro` is experimental macro mac() {} // OK
//~| WARN unstable syntax can change at any point in the future
trait A = Clone; //~ WARN trait aliases are experimental trait A = Clone; //~ WARN trait aliases are experimental
//~| WARN unstable syntax can change at any point in the future //~| WARN unstable syntax can change at any point in the future

View file

@ -1,5 +1,5 @@
warning: trait aliases are experimental warning: trait aliases are experimental
--> $DIR/cfg-false-feature.rs:14:1 --> $DIR/cfg-false-feature.rs:12:1
| |
LL | trait A = Clone; LL | trait A = Clone;
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
@ -9,19 +9,8 @@ LL | trait A = Clone;
= warning: unstable syntax can change at any point in the future, causing a hard error! = warning: unstable syntax can change at any point in the future, causing a hard error!
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
warning: `macro` is experimental
--> $DIR/cfg-false-feature.rs:11:1
|
LL | macro mac() {}
| ^^^^^^^^^^^^^^
|
= note: see issue #39412 <https://github.com/rust-lang/rust/issues/39412> for more information
= help: add `#![feature(decl_macro)]` to the crate attributes to enable
= warning: unstable syntax can change at any point in the future, causing a hard error!
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
warning: box pattern syntax is experimental warning: box pattern syntax is experimental
--> $DIR/cfg-false-feature.rs:18:9 --> $DIR/cfg-false-feature.rs:16:9
| |
LL | let box _ = Box::new(0); LL | let box _ = Box::new(0);
| ^^^^^ | ^^^^^
@ -31,5 +20,5 @@ LL | let box _ = Box::new(0);
= warning: unstable syntax can change at any point in the future, causing a hard error! = warning: unstable syntax can change at any point in the future, causing a hard error!
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
warning: 3 warnings emitted warning: 2 warnings emitted

View file

@ -0,0 +1,10 @@
// No error, panic handler is supplied by libstd linked though the empty library.
// check-pass
// aux-build: cfg_false_lib_no_std_after.rs
#![no_std]
extern crate cfg_false_lib_no_std_after as _;
fn main() {}

View file

@ -0,0 +1,11 @@
// Error, the linked empty library is `no_std` and doesn't provide a panic handler.
// dont-check-compiler-stderr
// error-pattern: `#[panic_handler]` function required, but not found
// aux-build: cfg_false_lib_no_std_before.rs
#![no_std]
extern crate cfg_false_lib_no_std_before as _;
fn main() {}

View file

@ -1,5 +1,4 @@
// Currently no error because the panic handler is supplied by libstd linked though the empty // No error, panic handler is supplied by libstd linked though the empty library.
// library, but the desirable behavior is unclear (see comments in cfg_false_lib.rs).
// check-pass // check-pass
// aux-build: cfg_false_lib.rs // aux-build: cfg_false_lib.rs

View file

@ -1,4 +1,5 @@
// build-pass // build-pass
// ignore-compare-mode-next-solver (hangs)
// Closures include captured types twice in a type tree. // Closures include captured types twice in a type tree.
// //

View file

@ -1,5 +1,6 @@
// build-fail // build-fail
// normalize-stderr-test: ".nll/" -> "/" // normalize-stderr-test: ".nll/" -> "/"
// ignore-compare-mode-next-solver (hangs)
trait Mirror { trait Mirror {
type Image; type Image;

View file

@ -1,11 +1,11 @@
error: reached the recursion limit while instantiating `<(&(&(..., ...), ...), ...) as Foo>::recurse` error: reached the recursion limit while instantiating `<(&(&(..., ...), ...), ...) as Foo>::recurse`
--> $DIR/issue-37311.rs:17:9 --> $DIR/issue-37311.rs:18:9
| |
LL | (self, self).recurse(); LL | (self, self).recurse();
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
| |
note: `<T as Foo>::recurse` defined here note: `<T as Foo>::recurse` defined here
--> $DIR/issue-37311.rs:16:5 --> $DIR/issue-37311.rs:17:5
| |
LL | fn recurse(&self) { LL | fn recurse(&self) {
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^

View file

@ -1,4 +1,6 @@
// run-pass // run-pass
// ignore-compare-mode-next-solver (hangs)
//! This snippet causes the type length to blowup exponentially, //! This snippet causes the type length to blowup exponentially,
//! so check that we don't accidentally exceed the type length limit. //! so check that we don't accidentally exceed the type length limit.
// FIXME: Once the size of iterator adaptors is further reduced, // FIXME: Once the size of iterator adaptors is further reduced,

View file

@ -2,6 +2,7 @@
// compile-flags: -Copt-level=0 // compile-flags: -Copt-level=0
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash" // normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//~^^^ ERROR overflow evaluating the requirement //~^^^ ERROR overflow evaluating the requirement
// ignore-compare-mode-next-solver (hangs)
fn main() { fn main() {
let mut iter = 0u8..1; let mut iter = 0u8..1;

View file

@ -1,5 +1,5 @@
warning: function cannot return without recursing warning: function cannot return without recursing
--> $DIR/issue-83150.rs:11:1 --> $DIR/issue-83150.rs:12:1
| |
LL | fn func<T: Iterator<Item = u8>>(iter: &mut T) { LL | fn func<T: Iterator<Item = u8>>(iter: &mut T) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@ -9,10 +9,10 @@ LL | func(&mut iter.map(|x| x + 1))
= help: a `loop` may express intention better if this is on purpose = help: a `loop` may express intention better if this is on purpose
= note: `#[warn(unconditional_recursion)]` on by default = note: `#[warn(unconditional_recursion)]` on by default
error[E0275]: overflow evaluating the requirement `Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>: Iterator` error[E0275]: overflow evaluating the requirement `Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:13:24: 13:27]>: Iterator`
| |
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`) = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`)
= note: required for `&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:12:24: 12:27]>` to implement `Iterator` = note: required for `&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:13:24: 13:27]>` to implement `Iterator`
= note: 65 redundant requirements hidden = note: 65 redundant requirements hidden
= note: required for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<..., ...>, ...>, ...>, ...>, ...>, ...>, ...>` to implement `Iterator` = note: required for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<..., ...>, ...>, ...>, ...>, ...>, ...>, ...>` to implement `Iterator`
= note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-83150/issue-83150.long-type-hash.txt' = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-83150/issue-83150.long-type-hash.txt'

View file

@ -3,6 +3,7 @@
// error-pattern: overflow evaluating the requirement `<std::iter::Empty<()> as Iterator>::Item == ()` // error-pattern: overflow evaluating the requirement `<std::iter::Empty<()> as Iterator>::Item == ()`
// error-pattern: function cannot return without recursing // error-pattern: function cannot return without recursing
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash" // normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
// ignore-compare-mode-next-solver (hangs)
// Regression test for #91949. // Regression test for #91949.
// This hanged *forever* on 1.56, fixed by #90423. // This hanged *forever* on 1.56, fixed by #90423.

View file

@ -1,5 +1,5 @@
warning: function cannot return without recursing warning: function cannot return without recursing
--> $DIR/issue-91949-hangs-on-recursion.rs:23:1 --> $DIR/issue-91949-hangs-on-recursion.rs:24:1
| |
LL | / fn recurse<T>(elements: T) -> Vec<char> LL | / fn recurse<T>(elements: T) -> Vec<char>
LL | | where LL | | where
@ -16,7 +16,7 @@ error[E0275]: overflow evaluating the requirement `<std::iter::Empty<()> as Iter
| |
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`) = help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`)
note: required for `IteratorOfWrapped<(), std::iter::Empty<()>>` to implement `Iterator` note: required for `IteratorOfWrapped<(), std::iter::Empty<()>>` to implement `Iterator`
--> $DIR/issue-91949-hangs-on-recursion.rs:16:32 --> $DIR/issue-91949-hangs-on-recursion.rs:17:32
| |
LL | impl<T, I: Iterator<Item = T>> Iterator for IteratorOfWrapped<T, I> { LL | impl<T, I: Iterator<Item = T>> Iterator for IteratorOfWrapped<T, I> {
| -------- ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ | -------- ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^