Remove unnecessary Option
This commit is contained in:
parent
efb56160c9
commit
d223c28c7d
@ -156,7 +156,7 @@ fn normalize_projection(
|
||||
&self,
|
||||
projection: crate::ProjectionTy,
|
||||
env: Arc<crate::TraitEnvironment>,
|
||||
) -> Option<crate::Ty>;
|
||||
) -> Ty;
|
||||
|
||||
#[salsa::invoke(trait_solve_wait)]
|
||||
#[salsa::transparent]
|
||||
|
@ -69,10 +69,10 @@ pub(crate) fn normalize_projection_query(
|
||||
db: &dyn HirDatabase,
|
||||
projection: ProjectionTy,
|
||||
env: Arc<TraitEnvironment>,
|
||||
) -> Option<Ty> {
|
||||
let mut table = InferenceTable::new(db, env.clone());
|
||||
) -> Ty {
|
||||
let mut table = InferenceTable::new(db, env);
|
||||
let ty = table.normalize_projection_ty(projection);
|
||||
Some(table.resolve_completely(ty))
|
||||
table.resolve_completely(ty)
|
||||
}
|
||||
|
||||
/// Solve a trait goal using Chalk.
|
||||
|
@ -2880,7 +2880,12 @@ pub fn normalize_trait_assoc_type(
|
||||
})
|
||||
.build();
|
||||
|
||||
db.normalize_projection(projection, self.env.clone()).map(|ty| self.derived(ty))
|
||||
let ty = db.normalize_projection(projection, self.env.clone());
|
||||
if ty.is_unknown() {
|
||||
None
|
||||
} else {
|
||||
Some(self.derived(ty))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_copy(&self, db: &dyn HirDatabase) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user