mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Merge pull request #18649 from roife/fix-issue-18648
minor: enhance name suggestion for `Arc<T>` and `Rc<T>`
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
/// # Examples
|
||||
/// `Option<Name>` -> `Name`
|
||||
/// `Result<User, Error>` -> `User`
|
||||
const WRAPPER_TYPES: &[&str] = &["Box", "Option", "Result"];
|
||||
const WRAPPER_TYPES: &[&str] = &["Box", "Arc", "Rc", "Option", "Result"];
|
||||
|
||||
/// Prefixes to strip from methods names
|
||||
///
|
||||
@@ -858,6 +858,32 @@ fn bar() -> Result<Seed, Error> {}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn arc_value() {
|
||||
check(
|
||||
r#"
|
||||
struct Arc<T>(*const T);
|
||||
struct Seed;
|
||||
fn bar() -> Arc<Seed> {}
|
||||
fn foo() { $0(bar())$0; }
|
||||
"#,
|
||||
"seed",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rc_value() {
|
||||
check(
|
||||
r#"
|
||||
struct Rc<T>(*const T);
|
||||
struct Seed;
|
||||
fn bar() -> Rc<Seed> {}
|
||||
fn foo() { $0(bar())$0; }
|
||||
"#,
|
||||
"seed",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ref_call() {
|
||||
check(
|
||||
|
||||
Reference in New Issue
Block a user