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 28 pull requests #55320

Closed
wants to merge 82 commits into from
Closed

Rollup of 28 pull requests #55320

wants to merge 82 commits into from

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Oct 24, 2018

Successful merges:

iirelu and others added 30 commits September 3, 2018 16:25
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.
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.
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 25, 2018
@kennytm kennytm changed the title Rollup of 22 pull requests Rollup of 28 pull requests Oct 25, 2018
@kennytm
Copy link
Member Author

kennytm commented Oct 25, 2018

@bors r+

Added #53931, #55200, #55296, #55306, #55328, #54921.

@bors
Copy link
Contributor

bors commented Oct 25, 2018

📌 Commit 65ec48e655d03a0136d0a3297f1cd88e269c9cfb has been approved by kennytm

@RalfJung
Copy link
Member

FWIW, #55262 got another commit since it got rolled up here... it's not a terrible loss though if it gets skipped, @oli-obk just needs to remember to fix that typo another time.

Unimplement ExactSizeIterator for MIR traversing iterators

If `root` is not `START_BLOCK`, `basic_blocks().len() - visited` does not represent their exact size.
…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 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.
@kennytm
Copy link
Member Author

kennytm commented Oct 25, 2018

@bors r+

Updated #55262.

@bors
Copy link
Contributor

bors commented Oct 25, 2018

📌 Commit bff4637 has been approved by kennytm

@bors
Copy link
Contributor

bors commented Oct 25, 2018

⌛ Testing commit bff4637 with merge f77ea3ab22756ac40bb1c681252a856de0f80b37...

@bors
Copy link
Contributor

bors commented Oct 25, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2018
@rust-highfive
Copy link
Collaborator

The job arm-android of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[01:39:36] test slice::sort_unstable ... ok
[01:39:36] 
[01:39:36] failures:
[01:39:36] 
[01:39:36] ---- num::flt2dec::strategy::dragon::shortest_sanity_test stdout ----
[01:39:36] thread 'num::flt2dec::strategy::dragon::shortest_sanity_test' panicked at 'shortest mismatch for v=ldexp_f32(1.0, 25): actual ("2", 1), expected ("33554432", 8)', libcore/../libcore/tests/num/flt2dec/mod.rs:249:5
[01:39:36] ---- num::flt2dec::strategy::dragon::test_to_exact_exp_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::dragon::test_to_exact_exp_str' panicked at 'assertion failed: `(left == right)`
[01:39:36] thread 'num::flt2dec::strategy::dragon::test_to_exact_exp_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0e0"`,
[01:39:36]  right: `"1e-45"`', libcore/../libcore/tests/num/flt2dec/mod.rs:806:5
[01:39:36] ---- num::flt2dec::strategy::dragon::test_to_exact_fixed_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::dragon::test_to_exact_fixed_str' panicked at 'assertion failed: `(left == right)`
[01:39:36] thread 'num::flt2dec::strategy::dragon::test_to_exact_fixed_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0.0000000000000000000000000000000000000000000000000000000000000000"`,
[01:39:36]  right: `"0.0000000000000000000000000000000000000000000014012984643248170709"`', libcore/../libcore/tests/num/flt2dec/mod.rs:1059:5
[01:39:36] ---- num::flt2dec::strategy::dragon::test_to_shortest_exp_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::dragon::test_to_shortest_exp_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0"`,
[01:39:36]   left: `"0"`,
[01:39:36]  right: `"1e-45"`', libcore/../libcore/tests/num/flt2dec/mod.rs:662:5
[01:39:36] ---- num::flt2dec::strategy::dragon::test_to_shortest_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::dragon::test_to_shortest_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0"`,
[01:39:36]   left: `"0"`,
[01:39:36]  right: `"0.000000000000000000000000000000000000000000001"`', libcore/../libcore/tests/num/flt2dec/mod.rs:548:5
[01:39:36] ---- num::flt2dec::strategy::grisu::shortest_sanity_test stdout ----
[01:39:36] ---- num::flt2dec::strategy::grisu::shortest_sanity_test stdout ----
[01:39:36] thread 'num::flt2dec::strategy::grisu::shortest_sanity_test' panicked at 'shortest mismatch for v=ldexp_f32(1.0, 25): actual ("2", 1), expected ("33554432", 8)', libcore/../libcore/tests/num/flt2dec/mod.rs:249:5
[01:39:36] ---- num::flt2dec::strategy::grisu::test_to_exact_exp_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::grisu::test_to_exact_exp_str' panicked at 'assertion failed: `(left == right)`
[01:39:36] thread 'num::flt2dec::strategy::grisu::test_to_exact_exp_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0e0"`,
[01:39:36]  right: `"1e-45"`', libcore/../libcore/tests/num/flt2dec/mod.rs:806:5
[01:39:36] ---- num::flt2dec::strategy::grisu::test_to_exact_fixed_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::grisu::test_to_exact_fixed_str' panicked at 'assertion failed: `(left == right)`
[01:39:36] thread 'num::flt2dec::strategy::grisu::test_to_exact_fixed_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0.0000000000000000000000000000000000000000000000000000000000000000"`,
[01:39:36]  right: `"0.0000000000000000000000000000000000000000000014012984643248170709"`', libcore/../libcore/tests/num/flt2dec/mod.rs:1059:5
[01:39:36] ---- num::flt2dec::strategy::grisu::test_to_shortest_exp_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::grisu::test_to_shortest_exp_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0"`,
[01:39:36]   left: `"0"`,
[01:39:36]  right: `"1e-45"`', libcore/../libcore/tests/num/flt2dec/mod.rs:662:5
[01:39:36] ---- num::flt2dec::strategy::grisu::test_to_shortest_str stdout ----
[01:39:36] thread 'num::flt2dec::strategy::grisu::test_to_shortest_str' panicked at 'assertion failed: `(left == right)`
[01:39:36]   left: `"0"`,
[01:39:36]   left: `"0"`,
[01:39:36]  right: `"0.000000000000000000000000000000000000000000001"`', libcore/../libcore/tests/num/flt2dec/mod.rs:548:5
[01:39:36] ---- num::flt2dec::strategy::dragon::exact_sanity_test stdout ----
[01:39:36] ---- num::flt2dec::strategy::dragon::exact_sanity_test stdout ----
[01:39:36] thread 'num::flt2dec::strategy::dragon::exact_sanity_test' panicked at 'expected finite, got Zero instead', libcore/../libcore/tests/num/flt2dec/mod.rs:31:25
[01:39:36] ---- num::flt2dec::strategy::grisu::exact_sanity_test stdout ----
[01:39:36] ---- num::flt2dec::strategy::grisu::exact_sanity_test stdout ----
[01:39:36] thread 'num::flt2dec::strategy::grisu::exact_sanity_test' panicked at 'expected finite, got Zero instead', libcore/../libcore/tests/num/flt2dec/mod.rs:31:25
[01:39:36] 
[01:39:36] failures:
[01:39:36]     num::flt2dec::strategy::dragon::exact_sanity_test
[01:39:36]     num::flt2dec::strategy::dragon::shortest_sanity_test
---
[01:39:36] 
[01:39:36] error: test failed, to rerun pass '--test coretests'
[01:39:36] 
[01:39:36] 
[01:39:36] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "arm-linux-androideabi" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--"
[01:39:36] 
[01:39:36] 
[01:39:36] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target arm-linux-androideabi
[01:39:36] Build completed unsuccessfully in 1:28:17
---
travis_time:end:136f0422:start=1540458968974590799,finish=1540458968987283211,duration=12692412
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:06867afb
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:22bcc17d
travis_time:start:22bcc17d
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0014c44b
$ dmesg | grep -i kill

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 @TimNN. (Feature Requests)

@kennytm kennytm closed this Oct 25, 2018
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 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 S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.