-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Polymorphically creating traits barely works #7673
Comments
Nominating for the backwards-compatible milestone because it's blocking removing |
owned1 and owned2 I don't understand and merit more investigation, same with managed1 and managed2. Odd. owned3 is legit, the problem is that |
cc #6004 and #3273 This is a rewrite of TLS to get towards not requiring `@` when using task local storage. Most of the rewrite is straightforward, although there are two caveats: 1. Changing `local_set` to not require `@` is blocked on #7673 2. The code in `local_pop` is some of the most unsafe code I've written. A second set of eyes should definitely scrutinize it... The public-facing interface currently hasn't changed, although it will have to change because `local_data::get` cannot return `Option<T>`, nor can it return `Option<&T>` (the lifetime isn't known). This will have to be changed to be given a closure which yield `&T` (or as an Option). I didn't do this part of the api rewrite in this pull request as I figured that it could wait until when `@` is fully removed. This also doesn't deal with the issue of using something other than functions as keys, but I'm looking into using static slices (as mentioned in the issues).
These all work now, flagging as needstest |
Note that to work the casts must be |
Closes rust-lang#2074. Closes rust-lang#5008. Closes rust-lang#7519. Closes rust-lang#7673. Closes rust-lang#7770. Closes rust-lang#8171.
Since 3b6314c the pretty printer seems to only print trait bounds for `ast::ty_path(...)`s that have a generics arguments list. That seems wrong, so let's always print them. Closes rust-lang#9253, un-xfails test for rust-lang#7673.
…affate Move code generated by `update_lints` to includes Move code generated by `update_lints` to includes changelog: none
Move module declarations back into lib.rs With rust-lang#7673 we moved a lot of things from lib.rs to lib.foo.rs. Unfortunately, rustfmt doesn't seem to work when module declarations are included via `include!` (and trying the `mod foo; use foo::*;` trick doesn't seem to work much either in our specific case). With this PR we continue generating everything in subfiles except for module declarations, which are now generated within lib.rs. changelog: none
I was confused by the following code:
The only function which compiles is
managed3
. I was surprised that none of the others worked at all. Formanaged3
, you're required to put a box in a box to get the trait out, while for all the others you just can't create the trait cast at all.A very surprising result for me was that
owned3
didn't work, even though its managed equivalent did work. The error message was different fromowned1/2
, but I still wasn't really able to decipher any of the errors or understand why they exist.Are these all legitimate errors? Are some of these supposed to work but they aren't? If these are legitimate errors, I'm of the opinion that the error messages should be a bit more descriptive
The text was updated successfully, but these errors were encountered: