Add more ergonomic clone tests#138628
Conversation
|
|
||
| fn foo() { | ||
| // The type is a tuple and doesn't implement UseCloned | ||
| let x = (Arc::new("foo".to_owned()), Arc::new(vec![1, 2, 3]), Arc::new(1)); |
There was a problem hiding this comment.
This case is interesting
There was a problem hiding this comment.
As I noted on Zulip, the problem here is that you this test defaults to Rust 2015. On newer editions, it works fine.
There was a problem hiding this comment.
My suggestion is (1) upgrade the tests to Rust 2024 and (2) require Rust 2021 for use closures. The reason to require Rust 2021 is because the use rules interact with the way that captures work and the last time we changed those rules was Rust 2021. I do not want to have to think about how use interacts with older rules.
|
|
||
| fn foo() { | ||
| // The type is a tuple and doesn't implement UseCloned | ||
| let x = (Arc::new("foo".to_owned()), Arc::new(vec![1, 2, 3]), Arc::new(1)); |
There was a problem hiding this comment.
As I noted on Zulip, the problem here is that you this test defaults to Rust 2015. On newer editions, it works fine.
2fea7b3 to
ca4a582
Compare
|
Addressed the test issue and I think this is ready to merge. I can open a different PR to make the code be edition 2021 only. |
|
@bors r+ rollup |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#138470 (Test interaction between RFC 2229 migration and use closures) - rust-lang#138628 (Add more ergonomic clone tests) - rust-lang#139164 (std: improve documentation for get_mut() methods regarding forgotten guards) - rust-lang#139488 (Add missing regression GUI test) - rust-lang#139489 (compiletest: Add directive `dont-require-annotations`) - rust-lang#139513 (Report higher-ranked trait error when higher-ranked projection goal fails in new solver) - rust-lang#139521 (triagebot: roll compiler reviewers for rustc/unstable book) - rust-lang#139532 (Update `u8`-to-and-from-`i8` suggestions.) - rust-lang#139551 (report call site of inlined scopes for large assignment lints) - rust-lang#139575 (Remove redundant words) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138628 - spastorino:add-more-ergonomic-clone-tests, r=nikomatsakis Add more ergonomic clone tests I've added some extra tests. r? `@nikomatsakis`
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#138470 (Test interaction between RFC 2229 migration and use closures) - rust-lang#138628 (Add more ergonomic clone tests) - rust-lang#139164 (std: improve documentation for get_mut() methods regarding forgotten guards) - rust-lang#139488 (Add missing regression GUI test) - rust-lang#139489 (compiletest: Add directive `dont-require-annotations`) - rust-lang#139513 (Report higher-ranked trait error when higher-ranked projection goal fails in new solver) - rust-lang#139521 (triagebot: roll compiler reviewers for rustc/unstable book) - rust-lang#139532 (Update `u8`-to-and-from-`i8` suggestions.) - rust-lang#139551 (report call site of inlined scopes for large assignment lints) - rust-lang#139575 (Remove redundant words) r? `@ghost` `@rustbot` modify labels: rollup
I've added some extra tests.
r? @nikomatsakis