Skip to content

rc: Use ~T for allocation - #8022

Closed
bluss wants to merge 1 commit into
rust-lang:masterfrom
bluss:rc-owned
Closed

rc: Use ~T for allocation#8022
bluss wants to merge 1 commit into
rust-lang:masterfrom
bluss:rc-owned

Conversation

@bluss

@bluss bluss commented Jul 24, 2013

Copy link
Copy Markdown
Contributor

Simplify Rc/RcMut by using ~T when allocating a reference counted
box.

cc @thestinger

Simplify Rc<T>/RcMut<T> by using ~T when allocating a reference counted
box.
@bluss

bluss commented Jul 24, 2013

Copy link
Copy Markdown
Contributor Author

There is a new kind 'static that is used for @T now, and it's a supertrait of Send, can it be used by Rc/RcMut too?

@thestinger

Copy link
Copy Markdown
Contributor

@blake2-ppc: I'm not sure. Do you mean adding it as the type bound?

@bluss

bluss commented Jul 24, 2013

Copy link
Copy Markdown
Contributor Author

Using 'static it instead of <T: Send>, if it's possible.

@thestinger

Copy link
Copy Markdown
Contributor

Landing as part of #7982.

@thestinger thestinger closed this Jul 24, 2013
@thestinger

Copy link
Copy Markdown
Contributor

@blake2-ppc: I'm not sure if it would be enough, Send works for preventing cycles because Rc and RcMut are both non-Send, but I think they're 'static since they don't contain borrowed pointers.

@bluss

bluss commented Jul 24, 2013

Copy link
Copy Markdown
Contributor Author

Rc and RcMut are 'static. I think that using 'static and making Rc/RcMut non-static is a different tradeoff and probably not what's wanted.

@bluss
bluss deleted the rc-owned branch July 24, 2013 18:09
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
8021: Enable searching for builtin types r=matklad a=Veykril

Not too sure how useful this is for reference search overall, but for completeness sake it should be there 
![image](https://user-images.githubusercontent.com/3757771/111132711-f69db600-8579-11eb-8c90-22fd6862d11f.png)

Also enables document highlighting for them.


8022: some clippy::performance fixes r=matklad a=matthiaskrgr

use vec![] instead of Vec::new() + push()
avoid redundant clones
use chars instead of &str for single char patterns in ends_with() and starts_with()
allocate some Vecs with capacity to avoid unnecessary resizing

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants