8000 Use phantomdata instead of &'db () · rust-lang/rust-analyzer@ab8258d · GitHub
[go: up one dir, main page]

Skip to content

Commit ab8258d

Browse files
committed
Use phantomdata instead of &'db ()
1 parent f185653 commit ab8258d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/hir-ty/src/next_solver/interner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,23 +265,23 @@ pub use crate::_interned_vec_db as interned_vec_db;
265265

266266
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
267267
pub struct DbInterner<'db> {
268-
pub(crate) db: &'db (),
268+
pub(crate) db: std::marker::PhantomData<&'db ()>,
269269
pub(crate) krate: Option<Crate>,
270270
pub(crate) block: Option<BlockId>,
271271
}
272272

273273
impl<'db> DbInterner<'db> {
274274
// FIXME(next-solver): remove this method
275275
pub fn new() -> DbInterner<'db> {
276-
DbInterner { db: &(), krate: None, block: None }
276+
DbInterner { db: std::marker::PhantomData, krate: None, block: None }
277277
}
278278

279279
pub fn new_with(
280280
_db: &'db dyn HirDatabase,
281281
krate: Option<Crate>,
282282
block: Option<BlockId>,
283283
) -> DbInterner<'db> {
284-
DbInterner { db: &(), krate: krate, block: None }
284+
DbInterner { db: std::marker::PhantomData, krate: krate, block: None }
285285
}
286286

287287
pub fn db(&self) -> &'db dyn HirDatabase {

crates/hir-ty/src/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn solve_nextsolver<'db>(
179179
crate::next_solver::tls::with_db(db, || {
180180
// FIXME: should use analysis_in_body, but that needs GenericDefId::Block
181181
let context = SolverContext(
182-
DbInterner { db: &(), krate: Some(krate), block }
182+
DbInterner { db: std::marker::PhantomData, krate: Some(krate), block }
183183
.infer_ctxt()
184184
.build(TypingMode::non_body_analysis()),
185185
);

0 commit comments

Comments
 (0)
0