-
Notifications
You must be signed in to change notification settings - Fork 13k
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
If traits-as-types no longer implicitly passed-by-reference, then rustc should reject passing them by value #5088
Comments
see also #4406 |
I guess we also need to reject polymorphic-instantiations like |
I'm not quite sure what you were going for here... it's not quite what I meant to suggest, anyhow. I meant to suggest that if you have:
Then under the rules I proposed (and later retracted) in #5086, it would be illegal to have an object type Now, in either scenario, suppose I wanted to have a function like
Here the point is that it only calls In that case, I can refactor my trait
and I can rewrite
This will work fine. Of course, as I proposed in #5087, I'd like to say that no object-type
but it is not legal to write
|
Just to clarify my motivation to Niko: (The rest of the code surrounding this was either
|
Seems non-critical for 0.7. Nominating for milestone 2 (well-defined). |
trait-as-type with no sigil is an error; this should be fixed. declining nomination as we think it's fixed. |
Switch to GitHub Actions - Part 2 - From within This is a continuation of rust-lang#5071. This time from a branch inside the rust-lang/rust-clippy repo, not from my fork, since secrets are not available in PRs from forks. Copying the description of rust-lang#5071 to here: Closes rust-lang#4577 ~~This is just an experiment. I don't think we have a consensus _if_ we should move away from travis/appveyor.~~ We have consensus: rust-lang/rust-clippy#5071 (comment) ~~GHA would let us run up to 20 concurrent jobs. Since we have 15 integration tests and 4 (linux, linux 32-bit, macos, windows) basic tests, we would be able to run everything concurrently.~~ The org has a limit of 60 jobs across the org, so we limit the matrix of the integration tests to 6 concurrent jobs. ~~Also IIUC we only have to build Clippy once for every initegration test and then only check the repos.~~ Nope, dependent jobs exist, but they won't keep the artifacts (not even the checkout). TODO before merge: - [x] Add `DEPLOY_KEY` secret to github repo - [x] test deployment on test branch `gh-test`# - [x] Test normal deployment - [x] Test deployment no changes - [x] Test deployment of tag - [x] talk with `@rust-lang/infra` for bors, `@rust-lang/infra` is good with the move (crater also uses GHA+bors) - [x] ~~Get remark + clippy_dev check to work on pushes (https://github.uint.cloudmunity/t5/GitHub-Actions/~Builds-are-not-triggered-with-on-paths/m-p/44075; I contacted GH support about this) ~~That seems to start working again yesterday. Let's hope it keeps working.~~ Or not: df9be48. Now it works again: 723786a. I think we should wait, until this is reliable. It appears, that it doesn't work on force pushes (sometimes?): 5814142~~ We need to run the bors tests unconditionally anyway (47138d1) so it doesn't really matter. - [x] ~~impl homu checks for GHA rust-lang/rust-clippy#5071 (comment) -- I prepared: flip1995/rust-central-station@f40230d. I'd suggest to first add GHA and keep the travis and appveyor checks for a few days and to remove them in a second pass. The bors dummy jobs are added in rust-lang/rust-clippy@1a83b7a and work as expected: rust-lang/rust-clippy#5088 (comment). I opened rust-lang/rust-central-station#578 See rust-lang/rust-clippy#5088 (comment) - [x] ~Add GHA badge to Cargo.toml (blocked on rust-lang/crates.io # 1838)~ Added a FIXME in 2332b57 - [x] ~Maybe we should also wait until GHA supports yaml anchors. https://github.uint.cloudmunity/t5/GitHub-Actions/Support-for-YAML-anchors/td-p/30336/~ WIll probably not be implemented in the near future. - [x] Add back travis + appveyor files for transition period (!) changelog: none
…shearth,llogiq,flip1995 I like to move it, move it GHA now runs in the background for 6 days (rust-lang#5088) Since then ~~15~~ 19 PRs were successfully merged and Travis+Appveyor agreed on the status in every case. ([GitHub PR search query](https://github.com/rust-lang/rust-clippy/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Amerged+merged%3A%3E%3D2020-02-12T15%3A42%3A00+sort%3Aupdated-desc+NOT+%5Bgh-pages%5D+in%3Atitle)) Some PRs were: - rust-lang#5163 - rust-lang#5170 - rust-lang#5168 - rust-lang#5173 - rust-lang#5171 - rust-lang#5156 - rust-lang#4809 - rust-lang#5177 - rust-lang#5182 - rust-lang#5183 - rust-lang#5184 - rust-lang#5185 - rust-lang#5186 - rust-lang#5181 - rust-lang#5189 Bug with GHA: - When a rustc PR gets merged between the `integration_build` and the `integration` job, the `integration` job will fail. This happened once in rust-lang#5162, but not in the past 6 days. Even if it would happen every 4th PR we would save time, since splitting up the integration build and tests saves 5-7 minutes per run and a complete run takes 15-17 minutes - Sometimes the MacOS build takes up to an hour to download the master toolchain. Until now, this happend 2 or 3 times and can be resolved by a `@bors r3try`+canceling the previous run (restarting single jobs is not supported yet) ## Before merging this, rust-lang/rust-central-station#578 has to get merged This PR is for starting the discussion and to get consensus (@rust-lang/clippy) on a final move to GHA. If we're ready, I'll contact Pietro, to finalize the move. changelog: Clippy completely runs on GHA now 🎉 --- BTW: The deployment already runs on GHA, instead of Travis.
�If traits no longer implicitly passed-by-reference, then rustc should reject passing traits by value.
My understanding from #3635 is that traits were once implicitly boxed with
@
, but now you must explicitly include an pointer-type annotation when you use a trait as an object type.I illustrate some of the cases that arise in the code sample below; the comments indicate how I think each case should be handled.
The heart of this ticket is that I am suggesting that
rustc
be changed so thatfromV
below would be rejected, as it does not make sense to passByVal
by-value, since e.g. it is a trait and therefore we do not know what the underlying object-size is. (Alternatively, rustc could treat it as an implicitly polymorphic function, analogous tofromT
in the example. But I think that would be a mistake -- if the user wants polymorphism, they should the syntax for it.)The
ByDel
example is my attempt to implement a suggestion that Niko gave me, where he was suggesting dividing a trait carrying both object-compatible and object-incompatible methods (see #5086) into two traits, where the object-incompatible trait would inherit from the object-compatible one. I see now that #5086 is closed; I do not yet know what that implies for the state of Niko's suggestion.The text was updated successfully, but these errors were encountered: