-
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 28 pull requests #55320
Rollup of 28 pull requests #55320
Conversation
The whole keyword docs thing is pretty new in Rust's history and needs some work before it's a shining gem. Here's hoping I can provide that. I basically shoved in a bunch of the most important information from the reference and the book, along with leaving links to both at the end. I don't think keyword docs need to have complete detail, just all the broad strokes, so if someone's confused about a usage of a keyword they can look at the std documentation for that keyword.
It's pretty basic and could do with more details, but it's a good starter until someone else improves it.
Turns out writing docs on keywords that are used in multiple different places in entirely different contexts gets a little harder. I put a footnote on `*const` syntax just to make sure you can find it if need be, but it might need more detail.
Mostly addressing notes on ambiguous syntax and spurious newlines.
I think it might be used in some other things, but I'm not fluent enough at sifting through the rust compiler's source code to find every use of a specific keyword. This leaves the question of how to document the `extern` keyword, what with how much overlap it has with `crate`, but that's used with ABI stuff so that should be fine.
This commit also splits out linky-line-thingies into two lines, which judging from the source code for tidy, should be enough to make it shut up and accept me for who I am, dammit.
It didn't strictly need to be reworked and I'm not sure my version is better, but oh well, I'm doing it for consistency.
Most of these will eventually be filled, but right now travis-ci enjoys complaining about the fact that there's links that lead nowhere, so they're gone. Hopefully someone remembers to re-add them later.
Thanks to @Centril for these.
Dangit. I really thought I got them all.
This commit is a fix for rust-lang#54408 where on nightly right now whenever generics are inlined the path name listed for the inlined function's debuginfo is a relative path to the cwd, which surely doesn't exist! Previously on beta/stable the debuginfo mentioned an absolute path which still didn't exist, but more predictably didn't exist. The change between stable/nightly is that nightly is now compiled with `--remap-path-prefix` to give a deterministic prefix to all rustc-generated paths in debuginfo. By using `--remap-path-prefix` the previous logic would recognize that the cwd was remapped, causing the original relative path name of the standard library to get emitted. If `--remap-path-prefix` *wasn't* passed in then the logic would create an absolute path name and then create a new source file entry. The fix in this commit is to apply the "recreate the source file entry with an absolute path" logic a bit more aggresively. If the source file's name was remapped then we don't touch it, but otherwise we always take the working dir (which may have been remapped) and then join it to the file to ensure that we process all relative file names as well. The end result is that the standard library should have an absolute path for all file names in debuginfo (using our `--remap-path-prefix` argument) as it does on stable after this patch. Closes rust-lang#54408
Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ```
Aaron Hill pointed out that unnecessary parens around a macro call (paradigmatically, `format!`) yielded a suggestion of hideous macro-expanded code. (The slightly unusual choice of using the pretty-printer to compose suggestions was quite recently commented on in the commit message for 1081bbb ("abolish ICE when pretty-printing async block"), but without any grounds to condemn it as a 𝘣𝘢𝘥 choice. Hill's report provides the grounds.) `span_to_snippet` is fallable as far as the type system is concerned (because, who knows, macros or something), so the pretty-printing can live on in the oft-neglected `else` branch. Resolves rust-lang#55109.
Changes: ```` new_ret_no_self: add sample from rust-lang#3313 to Known Problems section. Support multiline comments and hopefully fix panic Check for comments in collapsible ifs Resolve ICE in needless range loop lint RIIR update_lints: Update changelog links Rename if_let_redundant_pattern_matching to redundant_pattern_matching Add lint for redundant pattern matching for explicit return boolean Fix issue rust-lang#3322: reword help message for len_zero Simplify manual_memcpy suggestion in some cases Fix dogfood Update known problems for unnecessary_fold RIIR update_lints: Replace lint count in README.md Rename `active_lints` to `usable_lints` Add comment on WalkDir vs. fs::read_dir sort_by -> sort_by_key Some more documentation for clippy_dev Use `WalkDir` to also gather from subdirectories Avoid linting `boxed_local` on trait implementations. Website: Make lint categories linkable Restore clippy_dummy's placeholder name Swap order of methods in `needless_range_loop` suggestion in some cases Revert "Exclude pattern guards from unnecessary_fold lint" Exclude pattern guards from unnecessary_fold lint ````
The example was not as clear as it could be because it was making an assumption about the structure of the data in order to multiply the number of collection elements by the item size. This change demonstrates the idea more straightforwardly, without the calculation.
Felix S. Klock II pointed out that this suggestion (introduced in pull-request rust-lang#43178 / eac7410) was being issued for one-field-struct expected types (in which case it is misleading and outright wrong), even though it was only intended for one-field enum-variants (most notably, `Some`). Particularly tender-hearted code-historians may be inclined to show mercy towards the author of rust-lang#43178 on the grounds that it's somewhat confusing that struct field definitions are given in a type called `ty::VariantDef`. Add a conditional to adhere to the original intent. (It would be possible to generalize to structs, but not obviously net desirable.) This adds a level of indentation, so the diff here is going to be easier to read in ignore-whitespace mode (`-w`). Resolves rust-lang#55250.
📌 Commit 65ec48e655d03a0136d0a3297f1cd88e269c9cfb has been approved by |
fix typos in various places
Unimplement ExactSizeIterator for MIR traversing iterators If `root` is not `START_BLOCK`, `basic_blocks().len() - visited` does not represent their exact size.
Remove redundant clone
…ents, r=Aaronepower Do some copy editing on the release notes I was reading through the release notes to find something and noticed some small grammatical and consistency issues. I'm happy to revert any of these changes if folks disagree with them!
Update stdsimd submodule Fixes a SSE2 bug. (rust-lang#55249)
Update compiler-builtins submodule This commit updates our `compiler-builtins` submodule which brings in at least a few improvements for intrinsics on wasm32
Gradually expanding libstd's keyword documentation I'm working on adding new keywords to the documentation and refreshing the incomplete older ones, and I'm hoping that I can eventually add all the standalone-usable keywords after a bunch of incremental work. It would be cool to see the keywords section of std's docs be a definitive reference as to what each keyword means when you see it, and that's what I'm aiming towards with this work. I'm far from a Rust expert so there will inevitably be things to fix in this, also I'm not sure if this should be a bunch of quickly-merged PRs or one gradually-updated PR that gets merged once it's done.
Documents `From` implementations for `Stdio` This PR solves part of rust-lang#51430 by adding a basic summary and an example to each `impl From` inside `process` module (`ChildStdin`, `ChildStdout`, `ChildStderr`, `File`). It does not document if the conversions allocate memory and how expensive they are.
…omatsakis Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs This UI test is sensitive to backtrace output, so it should make sure that backtraces are not enabled by the environment.
…t-jemalloc-ctl, r=nikomatsakis Regression test for rust-lang#54478. This is a regression test for rust-lang#54478. I confirmed that it fails on: rustdoc 1.30.0-beta.12 (96a2298 2018-10-04) and passes on: rustdoc 1.31.0-nightly (f99911a 2018-10-23) Fix rust-lang#54478
…lett Fix doc for new copysign functions Thanks to \@LukasKalbertodt for catching this. Addresses a comment raised in rust-lang#55169 after it was merged.
…tMisdreavus Add line numbers option to rustdoc Fixes rust-lang#22878.
…lfJung Change the ICE from rust-lang#55223 to a hard error
📌 Commit bff4637 has been approved by |
⌛ Testing commit bff4637 with merge f77ea3ab22756ac40bb1c681252a856de0f80b37... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Successful merges:
Option<Box<$t:ty>>
in macro argument #54977 (AcceptOption<Box<$t:ty>>
in macro argument)compute_missing_ctors
. #55167 (Add a "cheap" mode forcompute_missing_ctors
.)From
implementations forStdio
#55200 (DocumentsFrom
implementations forStdio
)