From 66673eae2b3d3185607d29ee341d2db8a81a46e0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 18 Jun 2021 00:42:32 +0300 Subject: internal: retire famous_defs_fixture This is now done declaratively via `minicore`. --- crates/ide_db/src/helpers.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crates/ide_db/src/helpers.rs') diff --git a/crates/ide_db/src/helpers.rs b/crates/ide_db/src/helpers.rs index 00900cdc2..d96028cbc 100644 --- a/crates/ide_db/src/helpers.rs +++ b/crates/ide_db/src/helpers.rs @@ -74,12 +74,19 @@ pub fn visit_file_defs( /// somewhat similar to the known paths infra inside hir, but it different; We /// want to make sure that IDE specific paths don't become interesting inside /// the compiler itself as well. +/// +/// Note that, by default, rust-analyzer tests **do not** include core or std +/// libraries. If you are writing tests for functionality using [`FamousDefs`], +/// you'd want to include [minicore](test_utils::MiniCore) declaration at the +/// start of your tests: +/// +/// ``` +/// //- minicore: iterator, ord, derive +/// ``` pub struct FamousDefs<'a, 'b>(pub &'a Semantics<'b, RootDatabase>, pub Option); #[allow(non_snake_case)] impl FamousDefs<'_, '_> { - pub const FIXTURE: &'static str = include_str!("helpers/famous_defs_fixture.rs"); - pub fn std(&self) -> Option { self.find_crate("std") } -- cgit v1.2.3