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

Rolling together small PRs #12248

Closed
wants to merge 14 commits into from
Closed

Conversation

alexcrichton
Copy link
Member

This passed make check locally, so hopefully it passes on bors!

PR #12206 Steven Fackler Stop unloading syntax libraries … 6b429d0
PR #12209 Felix S Klock II Remove a source of O(n^2) running time in bigints. … 7dc187a
PR #12200 Liigo Zhuang Move base64 and hex from libextra to libserialize 8a5b938
PR #12211 Seo Sanghyeon Resolve type variables when checking casting to char 606c23a
PR #12217 Alex Crichton Include compiler-rt in the distribution tarballs 745aa74
PR #12218 Brendan Zabarauskas Add some missing Show implementations in libstd 957fcb3
PR #12220 tbu- Add documentation for conditional-compilation … 866d6cc
PR #12225 Huon Wilson std::comm: replace Handle.id with a method. … 411a01f
PR #12227 Alex Crichton Relax an assertion in start_selection() … 065e121
PR #12237 Huon Wilson mk: make NO_REBUILD more forceful and more general. … 44e6883
PR #12167 Jeremy Letang remove duplicate function from std::ptr (is_null, is_not_null, offset… … 60bc76f
PR #12222 (though commit sha does not match...) Alex Crichton Register new snapshots 1c5295c
PR #12240 Alex Crichton Lift $dst outside the closure in write! … 76c313c

sfackler and others added 14 commits February 13, 2014 12:50
Externally loaded libraries are able to do things that cause references
to them to survive past the expansion phase (e.g. creating @-box cycles,
launching a task or storing something in task local data). As such, the
library has to stay loaded for the lifetime of the process.
::num::bigint, Remove a source of O(n^2) running time in `fn shr_bits`.

I'll cut to the chase: On my laptop, this brings the running time on
`pidigits 2000` (from src/test/bench/shootout-pidigits.rs) from this:
```
% time ./pidigits 2000 > /dev/null

real	0m7.695s
user	0m7.690s
sys	0m0.005s
```
to this:
```
% time ./pidigits 2000 > /dev/null

real	0m0.322s
user	0m0.318s
sys	0m0.004s
```

The previous code was building up a vector by repeatedly making a
fresh copy for each element that was unshifted onto the front,
yielding quadratic running time.  This fixes that by building up the
vector in reverse order (pushing elements onto the end) and then
reversing it.

(Another option would be to build up a zero-initialized vector of the
desired length and then installing all of the shifted result elements
into their target index, but this was easier to hack up quickly, and
yields the desired asymptotic improvement.  I have been thinking of
adding a `vec::from_fn_rev` to handle this case, maybe I will try that
this weekend.)
This documents in-source conditions using #[cfg(...)] and configurations
pre-defined by the compiler.

Fix rust-lang#7962.
The `id` shouldn't be changed by external code, and exposing it publicly
allows to be accidentally changed.

Also, remove the first element special case in the `select!` macro.
It asserted that the previous count was always nonnegative, but DISCONNECTED is
a valid value for it to see. In order to continue to remember to store
DISCONNECTED after DISCONNECTED was seen, I also added a helper method.

Closes rust-lang#12226
Previously crates like `green` and `native` would still depend on their
parents when running `make check-stage2-green NO_REBUILD=1`, this
ensures that they only depend on their source files.

Also, apply NO_REBUILD to the crate doc tests, so, for example,
`check-stage2-doc-std` will use an already compiled `rustdoc` directly.
If you were writing to something along the lines of `self.foo` then with the new
closure rules it meant that you were borrowing `self` for the entirety of the
closure, meaning that you couldn't format other fields of `self` at the same
time as writing to a buffer contained in `self`.

By lifting the borrow outside of the closure the borrow checker can better
understand that you're only borrowing one of the fields at a time. This had to
use type ascription as well in order to preserve trait object coercions.
List of PRs contained in this rollup:

Closes rust-lang#12167 r=alexcrichton
Closes rust-lang#12200 r=alexcrichton
Closes rust-lang#12206 r=pcwalton
Closes rust-lang#12209 r=huonw
Closes rust-lang#12211 r=pcwalton
Closes rust-lang#12217 r=brson
Closes rust-lang#12218 r=alexcrichton
Closes rust-lang#12220 r=alexcrichton
Closes rust-lang#12222 r=kballard
Closes rust-lang#12225 r=alexcrichton
Closes rust-lang#12227 r=kballard
Closes rust-lang#12237 r=alexcrichton
Closes rust-lang#12240 r=kballard
bors added a commit that referenced this pull request Feb 13, 2014
This passed `make check` locally, so hopefully it passes on bors!
@bors bors closed this Feb 14, 2014
@alexcrichton alexcrichton deleted the rollup branch February 14, 2014 04:20
@pnkfelix
Copy link
Member

In the future when doing roll-ups, can we please include links to the original PR's?

The commits alone don't have forward-references to the PR's that they are associated with, so we end up losing potentially valuable discussion about the PR.

This is all tied into on-going discussion about what meta-data we do and don't have available associated with each commit; see https://mail.mozilla.org/pipermail/rust-dev/2014-February/008684.html

@pnkfelix
Copy link
Member

wait ... @alexcrichton did include such links on PR #12221 ... what's going on here...

@pnkfelix
Copy link
Member

oh I see, PR #12221 didn't land, and this was a subsequent reattempt.

Okay. Anyway, I'll put links to the PRs in the description myself.

@huonw
Copy link
Member

huonw commented Feb 20, 2014

@pnkfelix FWIW there are links in the last patch of this one alexcrichton@640b228

@pnkfelix
Copy link
Member

@huonw yeah, I just realized this after I spent the time to look up each PR in the github history. (Unfortunately I started from the oldest commit in the history so I only discovered this at the end.)

@alexcrichton
Copy link
Member Author

Ah sorry about that, I tried to keep the PRs in a commit so they'd all get closed when merged. It was also easier for me to update the commit rather than come here to update the PR. Should rollups include the closed PRs in both a commit and the PR itself?

@pnkfelix
Copy link
Member

@alexcrichton the technique you used wasn't a problem once I realized what it was.

However, do note that if you use something like this script:

https://mail.mozilla.org/pipermail/rust-dev/2014-February/008710.html

to look up the PR associated with a commit, then you're going to end up looking at this PR, and the way it was written originally, it wasn't obvious to me that I needed to look at the final commit in the series to find the list of PR's (and thus find the end PR that I was looking for).

Its not a big problem; it particular, it wasn't that hard for me to add the list above to the PR after the fact. As long as someone puts the list of PR's somewhere, then there's a reasonable chance that we'll track it down.

(There's a separate issue hidden here that one needs to use a script like the one linked above to go from a commit to its associated PR, but there's already a whole mailing list thread dedicated to discussing that problem.)

bors added a commit that referenced this pull request Feb 21, 2014
…r=alexcrichton

ptr::RawPtr, spell out units used for the `offset` argument.

spell out units used for the `offset` argument, so that callers do not
try to scale to byte units themselves.

(this was originally landed in PR #11002 for the stand-alone functions, but that PR did not modify the `RawPtr` methods, since that had no doc at all at the time.  Now `RawPtr` has the *only* documentation for `offset`, since the stand-alone functions went away in PR #12167 / PR #12248.)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 26, 2024
…, r=blyxyas

Extend `NONMINIMAL_BOOL` lint

Fixes rust-lang#5794.

r? `@blyxyas`

changelog: Extend `NONMINIMAL_BOOL` lint
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.

10 participants