diff options
| author | A4-Tacks <wdsjxhno1001@163.com> | 2025-06-04 10:08:41 +0800 |
|---|---|---|
| committer | A4-Tacks <wdsjxhno1001@163.com> | 2025-07-16 17:16:56 +0800 |
| commit | e0bb7299d02b44ba53113cc35b904aa788645a58 (patch) | |
| tree | 3ed5c78e4f61405558f5e00ceef2556a70444cab /compiler/rustc_codegen_llvm/src | |
| parent | 42758bbbd52a72bd2f39415ac33870459e1a00af (diff) | |
| download | rust-e0bb7299d02b44ba53113cc35b904aa788645a58.tar.gz rust-e0bb7299d02b44ba53113cc35b904aa788645a58.zip | |
Add AsRef and Borrow for generate_mut_trait_impl
- AsRef -> AsMut
- Borrow -> BorrowMut
Example
====================
```rust
//- minicore: as_ref
struct Foo(i32);
impl<T> core::convert::AsRef$0<i32> for Foo {
fn as_ref(&self) -> &i32 {
&self.0
}
}
```
->
```rust
struct Foo(i32);
$0impl<T> core::convert::AsMut<i32> for Foo {
fn as_mut(&mut self) -> &mut i32 {
&self.0
}
}
impl<T> core::convert::AsRef<i32> for Foo {
fn as_ref(&self) -> &i32 {
&self.0
}
}
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
