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 11 pull requests #59538

Closed
wants to merge 40 commits into from
Closed

Rollup of 11 pull requests #59538

wants to merge 40 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 29, 2019

Successful merges:

Failed merges:

r? @ghost

Aaron1011 and others added 30 commits March 26, 2019 15:39
By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes rust-lang#58463
This commit removes the check that disallows the `#[non_exhaustive]`
attribute from being placed on enum variants and removes the associated
tests.

Further, this commit lowers the visibility of enum variant constructors
when the variant is marked as non-exhaustive.
This commit updates the unstable book and diagnostics to reflect that
the `#[non_exhaustive]` attribute is now available for enum variants.
This commit adds support for non-exhaustive enum variants in rustdoc,
extending the existing support for non-exhaustive enums and structs.
Wrapped lines earlier such that it is more coherent with the rest of the text.

Co-Authored-By: DevQps <[email protected]>
Removed duplicate line.

Co-Authored-By: DevQps <[email protected]>
Calling `Read::read` or `Write::write` without checking the returned
`usize` value is almost always an error.  Example code in the
documentation should demonstrate how to use the return value correctly.
Otherwise, people might copy the example code thinking that it is okay
to "fire and forget" these methods.
This was incorrectly copypasta'd from RepeatWith.
…=oli-obk

Fix stack overflow when generating debuginfo for 'recursive' type

By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes rust-lang#58463
…rochenkov

Recover from parse error in tuple syntax
…d, r=davidtwco

Account for short-hand field syntax when suggesting borrow

Fix rust-lang#52965.
…=alexcrichton

Fix broken download link in the armhf-gnu image

Thanks to @johnterickson for pointing this out!

r? @alexcrichton
…, r=petrochenkov

Whitelist some rustc attrs

These rustc attrs are used within libcore, and were causing failures when one mixed incremental compilation with bootstrapping (due to a default of `-D warnings` when bootstrapping).

Fix rust-lang#59523
Fix rust-lang#59524

Cc rust-lang#58633
…ntril

Improve the dbg! macro docs

# Description

As stated has been discussed in rust-lang#58383 the docs do not clearly state why it is useful to have the option to use `dbg!` in release builds as well. This PR should change that.

closes rust-lang#58383
In doc examples, don't ignore read/write results

Calling `Read::read` or `Write::write` without checking the returned `usize` value is almost always an error.  Example code in the documentation should demonstrate how to use the return value correctly.  Otherwise, people might copy the example code thinking that it is okay to "fire and forget" these methods.
…r=GuillaumeGomez

rustdoc: collapse blanket impls in the same way as normal impls

If the rustdoc setting _Auto-hide trait implementations documentation_ is activated (on by default), normal trait implementations are collapsed by default.

Blanket impls on the other hand are not collapsed. I'm not sure whether this is intended, but considering that the blanket impls for `From`, `Into`, `TryFrom`, ... are on every type, it would reduce the documentation bloat if these would also be collapsed when the setting is active.

(I'm not really familiar with the codebase and therefore just copied the code for the normal impl collapsing, but I could deduplicate it into a method, of course, too.)
Fix OnceWith docstring.

This was incorrectly copypasta'd from RepeatWith.
@Centril
Copy link
Contributor Author

Centril commented Mar 29, 2019

@bors r+ p=11

@bors
Copy link
Contributor

bors commented Mar 29, 2019

📌 Commit dca1e72 has been approved by Centril

@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 Mar 29, 2019
@bors
Copy link
Contributor

bors commented Mar 30, 2019

⌛ Testing commit dca1e72 with merge 4db75c82faacd201c042e7bbfb0d1d3b9b781b94...

@bors
Copy link
Contributor

bors commented Mar 30, 2019

💔 Test failed - checks-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 Mar 30, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu 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:32:15] test [incremental] incremental/issue-49595/issue-49595.rs ... ok
[01:32:15] test [incremental] incremental/issue-54059.rs ... ok
[01:32:15] test [incremental] incremental/issue-59523-on-implemented-is-not-unused.rs ... ok
[01:32:15] test [incremental] incremental/krate-inherent.rs ... ok
[01:32:15] test [incremental] incremental/issue-59524-layout-scalar-valid-range-is-not-unused.rs ... ok
[01:32:16] test [incremental] incremental/krate-inlined.rs ... ok
[01:32:16] test [incremental] incremental/krate_reassign_34991/main.rs ... ok
[01:32:17] test [incremental] incremental/remove_crate/main.rs ... ok
[01:32:17] test [incremental] incremental/remapped_paths_cc/main.rs ... ok
---
[01:32:59] test [debuginfo-both] debuginfo/vec.rs ... ignored
[01:32:59] 
[01:32:59] failures:
[01:32:59] 
[01:32:59] ---- [debuginfo-both] debuginfo/generic-struct.rs stdout ----
[01:32:59] NOTE: compiletest thinks it is using GDB with native rust support
[01:32:59] NOTE: compiletest thinks it is using GDB version 8002000
[01:32:59] 
[01:32:59] error: line not found in debugger output: $1 = generic_struct::AGenericStruct<i32, i32> {key: 0, value: 1}
[01:32:59] status: exit code: 0
[01:32:59] command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/generic-struct/generic-struct.debugger.script"
[01:32:59] ------------------------------------------
[01:32:59] ------------------------------------------
[01:32:59] GNU gdb (Ubuntu 8.2-0ubuntu1) 8.2
[01:32:59] Copyright (C) 2018 Free Software Foundation, Inc.
[01:32:59] License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[01:32:59] This is free software: you are free to change and redistribute it.
[01:32:59] There is NO WARRANTY, to the extent permitted by law.
[01:32:59] Type "show copying" and "show warranty" for details.
[01:32:59] This GDB was configured as "x86_64-linux-gnu".
[01:32:59] Type "show configuration" for configuration details.
[01:32:59] For bug reporting instructions, please see:
[01:32:59] <http://www.gnu.org/software/gdb/bugs/>.
[01:32:59] Find the GDB manual and other documentation resources online at:
[01:32:59]     <http://www.gnu.org/software/gdb/documentation/>.
[01:32:59] 
[01:32:59] For help, type "help".
[01:32:59] Type "apropos word" to search for commands related to "word".
[01:32:59] Breakpoint 1 at 0x1318: file /checkout/src/test/debuginfo/generic-struct.rs, line 63.
[01:32:59] [Thread debugging using libthread_db enabled]
[01:32:59] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[01:32:59] 
[01:32:59] Breakpoint 1, generic_struct::main () at /checkout/src/test/debuginfo/generic-struct.rs:63
[01:32:59] 63     zzz(); // #break
[01:32:59] $1 = generic_struct::AGenericStruct<i32, <recursive_type>> {key: 0, value: 1}
[01:32:59] $2 = generic_struct::AGenericStruct<i32, f64> {key: 2, value: 3.5}
[01:32:59] $3 = generic_struct::AGenericStruct<f64, i32> {key: 4.5, value: 5}
[01:32:59] $4 = generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, <recursive_type>>> {key: 6.5, value: generic_struct::AGenericStruct<i32, f64> {key: 7, value: 8.5}}
[01:32:59] A debugging session is active.
[01:32:59] 
[01:32:59]  Inferior 1 [process 21426] will be killed.
[01:32:59] 
[01:32:59] Quit anyway? (y or n) [answered Y; input not from terminal]
[01:32:59] ------------------------------------------
[01:32:59] stderr:
[01:32:59] ------------------------------------------
[01:32:59] 
[01:32:59] 
[01:32:59] ------------------------------------------
[01:32:59] 
[01:32:59] thread 'main' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:32:59] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:32:59] 
[01:32:59] ---- [debuginfo-both] debuginfo/pretty-std-collections.rs stdout ----
[01:32:59] NOTE: compiletest thinks it is using GDB with native rust support
[01:32:59] NOTE: compiletest thinks it is using GDB version 8002000
[01:32:59] 
[01:32:59] error: line not found in debugger output: $2 = BTreeMap<i32, i32>(len: 15) = {[0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, [13] = 13, [14] = 14}
[01:32:59] status: exit code: 0
[01:32:59] command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/pretty-std-collections/pretty-std-collections.debugger.script"
[01:32:59] ------------------------------------------
[01:32:59] ------------------------------------------
[01:32:59] GNU gdb (Ubuntu 8.2-0ubuntu1) 8.2
[01:32:59] Copyright (C) 2018 Free Software Foundation, Inc.
[01:32:59] License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[01:32:59] This is free software: you are free to change and redistribute it.
[01:32:59] There is NO WARRANTY, to the extent permitted by law.
[01:32:59] Type "show copying" and "show warranty" for details.
[01:32:59] This GDB was configured as "x86_64-linux-gnu".
[01:32:59] Type "show configuration" for configuration details.
[01:32:59] For bug reporting instructions, please see:
[01:32:59] <http://www.gnu.org/software/gdb/bugs/>.
[01:32:59] Find the GDB manual and other documentation resources online at:
[01:32:59]     <http://www.gnu.org/software/gdb/documentation/>.
[01:32:59] 
[01:32:59] For help, type "help".
[01:32:59] Type "apropos word" to search for commands related to "word".
[01:32:59] Breakpoint 1 at 0x151fa: file /checkout/src/test/debuginfo/pretty-std-collections.rs, line 63.
[01:32:59] [Thread debugging using libthread_db enabled]
[01:32:59] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[01:32:59] 
[01:32:59] Breakpoint 1, pretty_std_collections::main () at /checkout/src/test/debuginfo/pretty-std-collections.rs:63
[01:32:59] 63     zzz(); // #break
[01:32:59] $1 = BTreeSet<i32>(len: 15) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}
[01:32:59] $2 = BTreeMap<i32, <recursive_type>>(len: 15) = {[0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7, [8] = 8, [9] = 9, [10] = 10, [11] = 11, [12] = 12, [13] = 13, [14] = 14}
[01:32:59] $3 = VecDeque<i32>(len: 3, cap: 8) = {5, 3, 7}
[01:32:59] $4 = VecDeque<i32>(len: 7, cap: 8) = {2, 3, 4, 5, 6, 7, 8}
[01:32:59] A debugging session is active.
[01:32:59] 
[01:32:59]  Inferior 1 [process 22034] will be killed.
[01:32:59] 
[01:32:59] Quit anyway? (y or n) [answered Y; input not from terminal]
[01:32:59] ------------------------------------------
[01:32:59] stderr:
[01:32:59] ------------------------------------------
[01:32:59] 
---
[01:32:59] test result: FAILED. 83 passed; 2 failed; 35 ignored; 0 measured; 0 filtered out
[01:32:59] 
[01:32:59] 
[01:32:59] 
[01:32:59] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/debuginfo" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "debuginfo-both" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0-rust-1.35.0-dev\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:32:59] 
[01:32:59] 
[01:32:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:32:59] Build completed unsuccessfully in 1:29:47
---
travis_time:end:03209fc4:start=1553913136531641234,finish=1553913136537806598,duration=6165364
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01cc1acc
$ 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:12817428
travis_time:start:12817428
$ 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:02c84cb8
$ 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)

@Centril Centril closed this Mar 30, 2019
@Centril Centril deleted the rollup branch March 30, 2019 06:50
@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.