Skip to content
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

Shared-kind typarams shouldn't be copyable #984

Closed
brson opened this issue Sep 27, 2011 · 3 comments
Closed

Shared-kind typarams shouldn't be copyable #984

brson opened this issue Sep 27, 2011 · 3 comments
Labels
A-type-system Area: Type system

Comments

@brson
Copy link
Contributor

brson commented Sep 27, 2011

Because ~resource is shared kind it is not safe to copy shared kinds for which we don't know the type. This means that the ty param @T must not be copied. On first blush this seems quite restrictive since shared boxes may not be used as ty params when they need to be copied.

@brson
Copy link
Contributor Author

brson commented Sep 27, 2011

This also seems to imply that fn <@T> can't do vector addition or append on [T]:

// compile-fail/unique-vec-res.rs
resource r(i: @mutable int) {
    *i = *i + 1;
}

fn f<@T>(i: [T], j: [T]) {
    // Shouldn't be able to do this copy of j
    let k = i + j;
}

fn main() {
    let i1 = @mutable 0;
    let i2 = @mutable 1;
    let r1 <- [~r(i1)];
    let r2 <- [~r(i2)];
    f(r1, r2);
    log_err *i1;
    log_err *i2;                                                                                                                                                              
}

@brson
Copy link
Contributor Author

brson commented Sep 27, 2011

This isn't actually required until #977 is implemented

@marijnh
Copy link
Contributor

marijnh commented Nov 15, 2011

This is handled/superseded by the new kind system (#1177).

@marijnh marijnh closed this as completed Nov 15, 2011
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
I saw in rust-lang#81037
that when you document private items with rustdoc the
`x86 AVX-512 BITALG` feature comment does not contain
scape characters in the message and therefore rustdoc
was emiting warnings.

This fixes it.
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Documentation: Applications (new section)

* Address Jai's comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

2 participants