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 8 pull requests #69463

Closed
wants to merge 26 commits into from

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

HeroicKatora and others added 26 commits January 31, 2020 21:08
Usually, references to the interior are only created by the `Deref` and
`DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell`
already has to cope with leaks of such guards which, when it occurs,
effectively makes it impossible to ever acquire a mutable guard or any
guard for `Ref` and `RefMut` respectively. It is already safe to use
this to create a reference to the inner of the ref cell that lives as
long as the reference to the `RefCell` itself, e.g.

```rust
fn leak(r: &RefCell<usize>) -> Option<&usize> {
    let guard = r.try_borrow().ok()?;
    let leaked = Box::leak(Box::new(guard));
    Some(&*leaked)
}
```

The newly added methods allow the same reference conversion without an
indirection over a leaked allocation and composing with both borrow and
try_borrow without additional method combinations.
This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.
…olnay

Add primitive module to libcore

This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.

Fixes rust-lang#44865
…tolnay

Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference

Usually, references to the interior are only created by the `Deref` and
`DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell`
already has to cope with leaks of such guards which, when it occurs,
effectively makes it impossible to ever acquire a mutable guard or any
guard for `Ref` and `RefMut` respectively. It is already safe to use
this to create a reference to the inner of the ref cell that lives as
long as the reference to the `RefCell` itself, e.g.

```rust
fn leak(r: &RefCell<usize>) -> Option<&usize> {
    let guard = r.try_borrow().ok()?;
    let leaked = Box::leak(Box::new(guard));
    Some(&*leaked)
}
```

The newly added methods allow the same reference conversion without an
indirection over a leaked allocation. It's placed on the `Ref`/`RefMut` to
compose with both borrow and try_borrow directly.
…acrum

debug_assert a few more raw pointer methods

Fixes rust-lang#53871
…crum

Deduplicate identifier printing a bit

rust-lang#67010 introduced a couple more subtly different ways to print an identifier.
This PR attempts to restore the order.

The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required.

r? @Mark-Simulacrum
syntax: Remove `Nt(Impl,Trait,Foreign)Item`

Follow-up to rust-lang#69366.
r? @Centril
…bank

Minor refactoring of statement parsing

Extracted out of rust-lang#69445.

r? @estebank
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Feb 25, 2020

📌 Commit 6e392e2 has been approved by Dylan-DPC

@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 Feb 25, 2020
@Dylan-DPC-zz Dylan-DPC-zz added the rollup A PR which is a rollup label Feb 25, 2020
@bors
Copy link
Contributor

bors commented Feb 25, 2020

⌛ Testing commit 6e392e2 with merge f81b3bb9764dc39151666f137db4666aeee6f452...

@bors
Copy link
Contributor

bors commented Feb 25, 2020

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job arm-android of your PR failed (pretty log, 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.
2020-02-25T21:10:35.2221682Z failures:
2020-02-25T21:10:35.2221816Z 
2020-02-25T21:10:35.2229798Z ---- [codegen] codegen/repeat-trusted-len.rs stdout ----
2020-02-25T21:10:35.2230769Z 
2020-02-25T21:10:35.2232164Z error: verification with 'FileCheck' failed
2020-02-25T21:10:35.2232429Z status: exit code: 1
2020-02-25T21:10:35.2233314Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/repeat-trusted-len/repeat-trusted-len.ll" "/checkout/src/test/codegen/repeat-trusted-len.rs"
2020-02-25T21:10:35.2234244Z ------------------------------------------
2020-02-25T21:10:35.2234405Z 
2020-02-25T21:10:35.2234917Z ------------------------------------------
2020-02-25T21:10:35.2235364Z stderr:
2020-02-25T21:10:35.2235364Z stderr:
2020-02-25T21:10:35.2237259Z ------------------------------------------
2020-02-25T21:10:35.2239588Z /checkout/src/test/codegen/repeat-trusted-len.rs:16:11: error: CHECK: expected string not found in input
2020-02-25T21:10:35.2242042Z // CHECK:***@llvm.memset.p0i8.[[USIZE]](i8* {{(nonnull )?}}align 1{{.*}} %{{[0-9]+}}, i8 42, [[USIZE]] 100000, i1 false)
2020-02-25T21:10:35.2243315Z           ^
2020-02-25T21:10:35.2243993Z /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/repeat-trusted-len/repeat-trusted-len.ll:17:33: note: scanning from here
2020-02-25T21:10:35.2244787Z define void @repeat_take_collect(%"alloc::vec::Vec<u8>"* noalias nocapture sret dereferenceable(12)) unnamed_addr #1 personality i32 (i32, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
2020-02-25T21:10:35.2245412Z                                 ^
2020-02-25T21:10:35.2246032Z /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/repeat-trusted-len/repeat-trusted-len.ll:17:33: note: with "USIZE" equal to "i32"
2020-02-25T21:10:35.2246825Z define void @repeat_take_collect(%"alloc::vec::Vec<u8>"* noalias nocapture sret dereferenceable(12)) unnamed_addr #1 personality i32 (i32, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
2020-02-25T21:10:35.2247412Z                                 ^
2020-02-25T21:10:35.2248043Z /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/repeat-trusted-len/repeat-trusted-len.ll:17:33: note: with "USIZE" equal to "i32"
2020-02-25T21:10:35.2248822Z define void @repeat_take_collect(%"alloc::vec::Vec<u8>"* noalias nocapture sret dereferenceable(12)) unnamed_addr #1 personality i32 (i32, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
2020-02-25T21:10:35.2249410Z                                 ^
2020-02-25T21:10:35.2250675Z /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/repeat-trusted-len/repeat-trusted-len.ll:30:2: note: possible intended match here
2020-02-25T21:10:35.2253279Z  tail call void @llvm.memset.p0i8.i64(i8* nonnull align 1 %1, i8 42, i64 100000, i1 false) #4, !noalias !11
2020-02-25T21:10:35.2253758Z 
2020-02-25T21:10:35.2254284Z ------------------------------------------
2020-02-25T21:10:35.2254483Z 
2020-02-25T21:10:35.2254612Z 
---
2020-02-25T21:10:35.2257508Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-02-25T21:10:35.2258084Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-02-25T21:10:35.2258320Z 
2020-02-25T21:10:35.2258562Z 
2020-02-25T21:10:35.2262834Z 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/arm-linux-androideabi/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/codegen" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen" "--stage-id" "stage2-arm-linux-androideabi" "--mode" "codegen" "--target" "arm-linux-androideabi" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--linker" "/android/ndk/arm-14/bin/arm-linux-androideabi-clang" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/arm-linux-androideabi/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--llvm-version" "9.0.1-rust-1.43.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--remote-test-client" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "/android/ndk/arm-14" "--color" "always"
2020-02-25T21:10:35.2267640Z 
2020-02-25T21:10:35.2267755Z 
2020-02-25T21:10:35.2331702Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target arm-linux-androideabi
2020-02-25T21:10:35.2332131Z Build completed unsuccessfully in 2:28:57
2020-02-25T21:10:35.2332131Z Build completed unsuccessfully in 2:28:57
2020-02-25T21:10:35.2332432Z == clock drift check ==
2020-02-25T21:10:35.2352985Z   local time: Tue Feb 25 21:10:35 UTC 2020
2020-02-25T21:10:35.5270086Z   network time: Tue, 25 Feb 2020 21:10:35 GMT
2020-02-25T21:10:35.5303784Z == end clock drift check ==
2020-02-25T21:10:38.2734805Z 
2020-02-25T21:10:38.2830126Z ##[error]Bash exited with code '1'.
2020-02-25T21:10:38.2906572Z ##[section]Starting: Checkout rust-lang/rust@auto to s
2020-02-25T21:10:38.2911284Z ==============================================================================
2020-02-25T21:10:38.2911650Z Task         : Get sources
2020-02-25T21:10:38.2912000Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@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 Feb 25, 2020
@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-bbvwpkv branch February 26, 2020 01:16
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.