Don't expose hir::Path out of hir

Conjecture: it's impossible to use hir::Path *correctly* from an IDE.

I am not entirely sure about this, and we might need to add it back at
some point, but I have to arguments that convince me that we probably
won't:

* `hir::Path` has to know about hygiene, which an IDE can't set up
  properly.

* `hir::Path` lacks identity, but you actually have to know identity
  to resolve it correctly
This commit is contained in:
Aleksey Kladov 2020-08-15 18:50:41 +02:00
parent 2052d33b9b
commit 0ca1ba29e8
9 changed files with 51 additions and 92 deletions

View file

@ -48,7 +48,7 @@ pub use hir_def::{
builtin_type::BuiltinType,
docs::Documentation,
nameres::ModuleSource,
path::{ModPath, Path, PathKind},
path::ModPath,
type_ref::{Mutability, TypeRef},
};
pub use hir_expand::{
@ -60,4 +60,7 @@ pub use hir_ty::display::HirDisplay;
// These are negative re-exports: pub using these names is forbidden, they
// should remain private to hir internals.
#[allow(unused)]
use hir_expand::hygiene::Hygiene;
use {
hir_def::path::{Path, PathKind},
hir_expand::hygiene::Hygiene,
};