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

Rollup of 14 pull requests #25525

Merged
merged 49 commits into from
May 17, 2015
Merged

Rollup of 14 pull requests #25525

merged 49 commits into from
May 17, 2015

Conversation

eddyb and others added 30 commits May 14, 2015 01:47
Using regular pointer arithmetic to iterate collections of zero-sized types
doesn't work, because we'd get the same pointer all the time. Our
current solution is to convert the pointer to an integer, add an offset
and then convert back, but this inhibits certain optimizations.

What we should do instead is to convert the pointer to one that points
to an i8*, and then use a LLVM GEP instructions without the inbounds
flag to perform the pointer arithmetic. This allows to generate pointers
that point outside allocated objects without causing UB (as long as you
don't dereference them), and it wraps around using two's complement,
i.e. it behaves exactly like the wrapping_* operations we're currently
using, with the added benefit of LLVM being able to better optimize the
resulting IR.
Helps prevent mixed content warnings if accessing docs over HTTPS.

Closes rust-lang#25459
Just detected it while reading.
Helps prevent mixed content warnings if accessing docs over HTTPS.

Closes rust-lang#25459
Using regular pointer arithmetic to iterate collections of zero-sized types
doesn't work, because we'd get the same pointer all the time. Our
current solution is to convert the pointer to an integer, add an offset
and then convert back, but this inhibits certain optimizations.

What we should do instead is to convert the pointer to one that points
to an i8\*, and then use a LLVM GEP instructions without the inbounds
flag to perform the pointer arithmetic. This allows to generate pointers
that point outside allocated objects without causing UB (as long as you
don't dereference them), and it wraps around using two's complement,
i.e. it behaves exactly like the wrapping_* operations we're currently
using, with the added benefit of LLVM being able to better optimize the
resulting IR.
…pe_2, r=nrc

fix rust-lang#24968
report more friendly error message for Self when fn args
copy from rust-lang#25096
r? @nrc  @arielb1
Newcomers to Rust need to learn the distinctinion between `&str` and
`String`, so additonally having `string` in an example risks confusion.
The current version of the example won't compile due to unstable features.
This is an attempt to fix that, at the cost of slightly more verbose code.
ftxqxd and others added 19 commits May 17, 2015 11:25
The same example for ``reverse`` were in the ``reserve_exact``'s example.
This allows compiling entire crates from memory or preprocessing source files before they are tokenized.

Minor API refactoring included, which is a [breaking-change] for libsyntax users:
* `ParseSess::{next_node_id, reserve_node_ids}` moved to rustc's `Session`
* `new_parse_sess` -> `ParseSess::new`
* `new_parse_sess_special_handler` -> `ParseSess::with_span_handler`
* `mk_span_handler` -> `SpanHandler::new`
* `default_handler` -> `Handler::new`
* `mk_handler` -> `Handler::with_emitter`
* `string_to_filemap(sess source, path)` -> `sess.codemap().new_filemap(path, source)`
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
…alexcrichton

This PR fixes two little typos in the Dining Philosophers example.

Also, there are two style points that may have been oversights but may have been deliberate, so I'll just bring them up here:

1) In the last paragraph, you say

> You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names.

You already said something similar to this in the Guessing Game, but maybe you intended for this example to be independent of that one.

2) In "Rust Inside Other Languages," you introduce the idea of the "global interpreter lock" and then refer to it as the GIL a few paragraphs later without explicitly stating that GIL == global interpreter lock. It's reasonable to expect readers to make the connection, but maybe that's not what you intended.

Excellent work on the examples! Congrats on 1.0!

r? @steveklabnik
…nt-lang-faq, r=alexcrichton

In "The Rust Language FAQ", some of the links to example projects/modules written in Rust are dead links. This PR updates them.
…rsion, r=alexcrichton

Rust is out of beta 🎉 

r? @steveklabnik
Newcomers to Rust need to learn the distinctinion between `&str` and
`String`, so additonally having `string` in an example risks confusion.
…crichton

The current version of the example won't compile due to unstable features.
This is an attempt to fix that, at the cost of slightly more verbose code.

Using rust 1.0.0 (a59de37).

It might be obvious, but I'm not well versed with rust, so feedback is very welcome.
The same example for ``reverse`` were in the ``reserve_exact``'s example.
No need for `&b"foo"[..]` to make a CString, `"foo"` will do.
…fackler

This iterator was mistakenly not reexported at the top level, preventing
actually naming the type!

Closes rust-lang#25519
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@Manishearth
Copy link
Member Author

@bors: r+ p=10 force

@bors
Copy link
Contributor

bors commented May 17, 2015

📌 Commit a0815c8 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented May 17, 2015

⌛ Testing commit a0815c8 with merge 9f3a7f0...

bors added a commit that referenced this pull request May 17, 2015
@bors bors merged commit a0815c8 into rust-lang:master May 17, 2015
@bors bors mentioned this pull request May 17, 2015
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.