mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
feat: Implement object safety
This commit is contained in:
parent
06a40a61b0
commit
6520a43ca3
19 changed files with 1194 additions and 66 deletions
|
@ -2007,7 +2007,7 @@ fn function_traits() {
|
|||
);
|
||||
check_number(
|
||||
r#"
|
||||
//- minicore: coerce_unsized, fn
|
||||
//- minicore: coerce_unsized, fn, dispatch_from_dyn
|
||||
fn add2(x: u8) -> u8 {
|
||||
x + 2
|
||||
}
|
||||
|
@ -2062,7 +2062,7 @@ fn function_traits() {
|
|||
fn dyn_trait() {
|
||||
check_number(
|
||||
r#"
|
||||
//- minicore: coerce_unsized, index, slice
|
||||
//- minicore: coerce_unsized, index, slice, dispatch_from_dyn
|
||||
trait Foo {
|
||||
fn foo(&self) -> u8 { 10 }
|
||||
}
|
||||
|
@ -2085,7 +2085,7 @@ fn dyn_trait() {
|
|||
);
|
||||
check_number(
|
||||
r#"
|
||||
//- minicore: coerce_unsized, index, slice
|
||||
//- minicore: coerce_unsized, index, slice, dispatch_from_dyn
|
||||
trait Foo {
|
||||
fn foo(&self) -> i32 { 10 }
|
||||
}
|
||||
|
@ -2109,7 +2109,7 @@ fn dyn_trait() {
|
|||
);
|
||||
check_number(
|
||||
r#"
|
||||
//- minicore: coerce_unsized, index, slice
|
||||
//- minicore: coerce_unsized, index, slice, dispatch_from_dyn
|
||||
trait A {
|
||||
fn x(&self) -> i32;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ fn size_of_val() {
|
|||
);
|
||||
check_number(
|
||||
r#"
|
||||
//- minicore: coerce_unsized, fmt, builtin_impls
|
||||
//- minicore: coerce_unsized, fmt, builtin_impls, dispatch_from_dyn
|
||||
extern "rust-intrinsic" {
|
||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue