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 17 pull requests #81085

Closed
wants to merge 61 commits into from
Closed

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Jan 16, 2021

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

frewsxcv and others added 30 commits December 17, 2020 22:55
As per T-lang consensus, this uses a branch to handle the dangling case.
The discussed optimization of only doing the branch in the T: ?Sized
case is left for a followup patch, as doing so is not trivial
(as it requires specialization for correctness, not just optimization).
There was one directory that had only a single test and there was also a
test in the top-level directory. This moves both of them to
`feature-gates/`.
The use of Result allows for making use of a reconstructed original value on failed
projections.
Add `as_rchunks` (and friends) to slices

`@est31` mentioned (rust-lang#76354 (comment)) that, for completeness, there needed to be an `as_chunks`-like method that chunks from the end (with the remainder at the beginning) like `rchunks` does.

So here's a PR for `as_rchunks: &[T] -> (&[T], &[[T; N]])` and `as_rchunks_mut: &mut [T] -> (&mut [T], &mut [[T; N]])`.

But as I was doing this and copy-pasting `from_raw_parts` calls, I thought that I should extract that into an unsafe method.  It started out a private helper, but it seemed like `as_chunks_unchecked` could be reasonable as a "real" method, so I added docs and made it public.  Let me know if you think it doesn't pull its weight.
…atsakis

Remove giant badge in README

Is it meant to be this big? I haven't seen any other open source project with this sort of thing
Explain why borrows can't be held across yield point in async blocks

For rust-lang#78938.
…-ou-se

Clarify what the effects of a 'logic error' are

This clarifies what a 'logic error' is (which is a term used to describe what happens if you put things in a hash table or btree and then use something like a refcell to break the internal ordering). This tries to be as vague as possible, as we don't really want to promise what happens, except "bad things, but not UB". This was discussed in rust-lang#80657
…RalfJung

Re-stabilize Weak::as_ptr and friends for unsized T

As per [T-lang consensus](https://hackmd.io/7r3_is6uTz-163fsOV8Vfg), this uses a branch to handle the dangling case. The discussed optimization of only doing the branch in the T: ?Sized case is left for a followup patch, as doing so is not trivial (as it requires specialization) and not _obviously_ better (as it requires using `wrapping_offset` rather than `offset` more).

<details><summary>Basically said optimization</summary>

Specialize on `T: Sized`:

```rust
fn as_ptr(&self) -> *const T {
    if [ T is Sized ] || !is_dangling(ptr) {
        (ptr as *mut T).set_ptr_value( (ptr as *mut u8).wrapping_offset(data_offset) )
    } else {
        ptr::null()
    }
}

fn from_raw(*const T) -> Self {
    if [ T is Sized ] || !ptr.is_null() {
        let ptr = (ptr as *mut RcBox).set_ptr_value( (ptr as *mut u8).wrapping_offset(-data_offset) );
        Weak { ptr }
    } else {
        Weak::new()
    }
}
```

(but with more `set_ptr_value` to avoid `Sized` restrictions and maintain metadata.)

Written in this fashion, this is not a correctness-critical specialization (i.e. so long as `[ T is Sized ]` is false for unsized `T`, it can be `rand()` for sized `T` without breaking correctness), but it's still touchy, so I'd rather do it in another PR with separate review.

---
</details>

This effectively reverts rust-lang#80422 and re-establishes rust-lang#74160. T-libs [previously signed off](rust-lang#74160 (comment)) on this stable API change in rust-lang#74160.
…crum

Make `x.py --color always` apply to logging too

Follow-up to rust-lang#78548, rust-lang#79004.

r? ``@Mark-Simulacrum``
…acrum

Add a regression test for rust-lang#76281

This has been fixed between 1.47.0-nightly (663d2f5 2020-08-22) and 1.47.0-nightly (5180f3d 2020-08-23). Maybe fixed by rust-lang#73526?

Created `wasm` dir, it currently has only one test but I'll move some wasm-related tests there as a follow-up.

Closes rust-lang#76281
…arkor

Do not suggest invalid code in pattern with loop

Fixes rust-lang#80913
…Simulacrum

Stabilize the poll_map feature

Stabilizes the `poll_map` feature as tracked by rust-lang#63514 (with a completed FCP).
…nization, r=Mark-Simulacrum

Put all feature gate tests under `feature-gates/`

There was one directory that had only a single test and there was also a
test in the top-level directory. This moves both of them to
`feature-gates/`.
…r=jyn514

Remove doctree::Import

Per the title. Part of cleaning up doctree
doctest: Reset errors before dropping the parse session

The first parse is to collect whether the code contains macros, has
`main`, and uses other crates. In that pass we ignore errors as those
will be reported when the test file is actually built.

For that we need to reset errors in the `Diagnostic` otherwise when
dropping it unhandled errors will be reported as compiler bugs.

Fixes rust-lang#80992
…ark-Simulacrum

Add a regression test for rust-lang#50041

AFAICT the test case never landed alongside the fix for the issue.
…=jyn514

codegen_cranelift: Fix redundant semicolon warn
…Simulacrum

Add sample code for Rc::new_cyclic
@rustbot rustbot added the rollup A PR which is a rollup label Jan 16, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 16, 2021

@bors r+ p=17 rollup

@bors
Copy link
Contributor

bors commented Jan 16, 2021

📌 Commit ce803a1 has been approved by m-ou-se

@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 Jan 16, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 16, 2021

Uh,

@bors rollup=never

@bors
Copy link
Contributor

bors commented Jan 16, 2021

⌛ Testing commit ce803a1 with merge 0487d5bfd406c0fd728387ab7dcad7b48b5cc62f...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-distcheck failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

failures:

---- [codegen] codegen/slice-as_chunks.rs stdout ----

error: verification with 'FileCheck' failed
status: exit code: 1
command: "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/slice-as_chunks/slice-as_chunks.ll" "/checkout/obj/build/tmp/distcheck/src/test/codegen/slice-as_chunks.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
/checkout/obj/build/tmp/distcheck/src/test/codegen/slice-as_chunks.rs:12:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: lshr i64 %x.1, 2
                ^
/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/slice-as_chunks/slice-as_chunks.ll:15:2: note: scanning from here
 %len.i = and i64 %x.1, -4
 ^
/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/slice-as_chunks/slice-as_chunks.ll:15:9: note: possible intended match here
 %len.i = and i64 %x.1, -4


Input file: /checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen/slice-as_chunks/slice-as_chunks.ll
Check file: /checkout/obj/build/tmp/distcheck/src/test/codegen/slice-as_chunks.rs

-dump-input=help explains the following input dump.
Input was:
<<<<<<
           .
           .
           .
           .
          10: @alloc47 = private unnamed_addr constant <{ i8*, [16 x i8] }> <{ i8* getelementptr inbounds (<{ [63 x i8] }>, <{ [63 x i8] }>* @alloc46, i32 0, i32 0, i32 0), [16 x i8] c"?\00\00\00\00\00\00\00[\00\00\00\05\00\00\00" }>, align 8
          11: 
          12: ; Function Attrs: nonlazybind uwtable
          13: define { [0 x [4 x i8]]*, i64 } @chunks4([0 x i8]* noalias nonnull readonly align 1 %x.0, i64 %x.1) unnamed_addr #0 {
          14: start:
          15:  %len.i = and i64 %x.1, -4
next:12'0      X~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
next:12'1             ?                  possible intended match
          16:  %_71.i.i.i = icmp slt i64 %len.i, 0
next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          17:  br i1 %_71.i.i.i, label %bb6.i.i.i, label %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$9as_chunks17h5eb20245ca5b2171E.exit"
next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          18: 
next:12'0     ~
          19: bb6.i.i.i: ; preds = %start
next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
          20: ; call core::panicking::panic
next:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           .
           .
>>>>>>

---
test result: FAILED. 207 passed; 1 failed; 33 ignored; 0 measured; 0 filtered out; finished in 4.09s



command did not execute successfully: "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/obj/build/tmp/distcheck/src/test/codegen" "--build-base" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/test/codegen" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "codegen" "--mode" "codegen" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/tmp/distcheck/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--llvm-version" "11.0.1-rust-1.51.0-nightly" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine extensions frontendopenmp fuzzmutate globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target testingsupport textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xray" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/tmp/distcheck/build/bootstrap/debug/bootstrap test --stage 2
Build completed unsuccessfully in 0:19:44
Build completed unsuccessfully in 0:19:44
make: *** [check] Error 1
Makefile:42: recipe for target 'check' failed

command did not execute successfully: "make" "check"
expected success, got: exit code: 2

@bors
Copy link
Contributor

bors commented Jan 16, 2021

💔 Test failed - checks-actions

@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 Jan 16, 2021
@m-ou-se m-ou-se closed this Jan 16, 2021
@m-ou-se m-ou-se deleted the rollup-wc09hs8 branch January 16, 2021 17:29
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.