mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Semantic getter
This commit is contained in:
parent
6c7526d308
commit
98676efdc5
9 changed files with 401 additions and 63 deletions
|
@ -35,6 +35,7 @@
|
|||
//! fmt: result
|
||||
//! bool_impl: option, fn
|
||||
//! add:
|
||||
//! as_ref: sized
|
||||
|
||||
pub mod marker {
|
||||
// region:sized
|
||||
|
@ -113,8 +114,9 @@ pub mod clone {
|
|||
}
|
||||
// endregion:clone
|
||||
|
||||
// region:from
|
||||
|
||||
pub mod convert {
|
||||
// region:from
|
||||
pub trait From<T>: Sized {
|
||||
fn from(_: T) -> Self;
|
||||
}
|
||||
|
@ -136,8 +138,14 @@ pub mod convert {
|
|||
t
|
||||
}
|
||||
}
|
||||
// endregion:from
|
||||
|
||||
// region:as_ref
|
||||
pub trait AsRef<T: ?Sized> {
|
||||
fn as_ref(&self) -> &T;
|
||||
}
|
||||
// endregion:as_ref
|
||||
}
|
||||
// endregion:from
|
||||
|
||||
pub mod ops {
|
||||
// region:coerce_unsized
|
||||
|
@ -609,6 +617,7 @@ pub mod prelude {
|
|||
cmp::{Eq, PartialEq}, // :eq
|
||||
cmp::{Ord, PartialOrd}, // :ord
|
||||
convert::{From, Into}, // :from
|
||||
convert::AsRef, // :as_ref
|
||||
default::Default, // :default
|
||||
iter::{IntoIterator, Iterator}, // :iterator
|
||||
macros::builtin::derive, // :derive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue