-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 14 pull requests #25525
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Just detected it while reading.
…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 has picked a reviewer for you, use r? to override) |
@bors: r+ p=10 force |
📌 Commit a0815c8 has been approved by |
⌛ Testing commit a0815c8 with merge 9f3a7f0... |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
file
is nowfile_name
#25465, Small typo in the docs #25469, Correct two small typos in the Dining Philosophers example. #25472, Change my email #25474, Test that associated types are not required as type parameters #25476, Fix dead links in "The Rust Language FAQ" #25484, Update rust-inside-other-languages.md #25490, Update the shown installed rust version to 1.0 #25493, Make a test compatible with the beta channel #25503, Avoid calling a variable 'string' when discussing strings. #25506, fs::walk_dir example without unstable features #25508, Fixed reserve_exact example #25510, Simplify CString doc comment #25516, std: Reexport std::net::tcp::Incoming #25522