Skip to content

Add more ergonomic clone tests #138628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

spastorino
Copy link
Member

I've added some extra tests.

r? @nikomatsakis

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 17, 2025

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));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is interesting

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I noted on Zulip, the problem here is that you this test defaults to Rust 2015. On newer editions, it works fine.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I noted on Zulip, the problem here is that you this test defaults to Rust 2015. On newer editions, it works fine.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2025
@spastorino spastorino force-pushed the add-more-ergonomic-clone-tests branch from 2fea7b3 to ca4a582 Compare April 8, 2025 17:05
@spastorino
Copy link
Member Author

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.

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 9, 2025

📌 Commit ca4a582 has been approved by nikomatsakis

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 9, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2025
…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
@bors bors merged commit 3507f35 into rust-lang:master Apr 10, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 10, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2025
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`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 19, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants