mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
feat: Implement object safety
This commit is contained in:
parent
06a40a61b0
commit
6520a43ca3
19 changed files with 1194 additions and 66 deletions
|
@ -66,7 +66,7 @@ use hir_ty::{
|
|||
diagnostics::BodyValidationDiagnostic,
|
||||
error_lifetime, known_const_to_ast,
|
||||
layout::{Layout as TyLayout, RustcEnumVariantIdx, RustcFieldIdx, TagEncoding},
|
||||
method_resolution::{self},
|
||||
method_resolution,
|
||||
mir::{interpret_mir, MutBorrowKind},
|
||||
primitive::UintTy,
|
||||
traits::FnTrait,
|
||||
|
@ -144,6 +144,7 @@ pub use {
|
|||
display::{ClosureStyle, HirDisplay, HirDisplayError, HirWrite},
|
||||
layout::LayoutError,
|
||||
mir::{MirEvalError, MirLowerError},
|
||||
object_safety::{MethodViolationCode, ObjectSafetyViolation},
|
||||
FnAbi, PointerCast, Safety,
|
||||
},
|
||||
// FIXME: Properly encapsulate mir
|
||||
|
@ -2640,6 +2641,10 @@ impl Trait {
|
|||
.count()
|
||||
}
|
||||
|
||||
pub fn object_safety(&self, db: &dyn HirDatabase) -> Option<ObjectSafetyViolation> {
|
||||
hir_ty::object_safety::object_safety(db, self.id)
|
||||
}
|
||||
|
||||
fn all_macro_calls(&self, db: &dyn HirDatabase) -> Box<[(AstId<ast::Item>, MacroCallId)]> {
|
||||
db.trait_data(self.id)
|
||||
.macro_calls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue