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 6 pull requests #65227

Closed
wants to merge 32 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 9, 2019

Successful merges:

Failed merges:

r? @ghost

csmoe and others added 30 commits October 6, 2019 14:07
- The attribute is behind a feature gate.
- Error if both #[naked] and #[track_caller] are applied to the same function.
- Error if #[track_caller] is applied to a non-function item.
- Error if ABI is not "rust"
- Error if #[track_caller] is applied to a trait function.

Error codes and descriptions are pending.
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Prevents number collision with another approved PR.
Co-Authored-By: varkor <github@varkor.com>
Updates LLVM to pick up the cherry-picked support for correctly
handling exception handling with aggregates passed by value. This will
be necessary to continue to support Emscripten's exception handling
once we switch using Emscripten's LLVM backend. See rust-lang#63649.
Implement (HashMap) Entry::insert as per rust-lang#60142

Implementation of `Entry::insert` as per @SimonSapin's comment on rust-lang#60142. This requires a patch to hashbrown:

```diff
diff --git a/src/rustc_entry.rs b/src/rustc_entry.rs
index fefa5c3..7de8300 100644
--- a/src/rustc_entry.rs
+++ b/src/rustc_entry.rs
@@ -546,6 +546,32 @@ impl<'a, K, V> RustcVacantEntry<'a, K, V> {
         let bucket = self.table.insert_no_grow(self.hash, (self.key, value));
         unsafe { &mut bucket.as_mut().1 }
     }
+
+    /// Sets the value of the entry with the RustcVacantEntry's key,
+    /// and returns a RustcOccupiedEntry.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use hashbrown::HashMap;
+    /// use hashbrown::hash_map::RustcEntry;
+    ///
+    /// let mut map: HashMap<&str, u32> = HashMap::new();
+    ///
+    /// if let RustcEntry::Vacant(v) = map.rustc_entry("poneyland") {
+    ///     let o = v.insert_and_return(37);
+    ///     assert_eq!(o.get(), &37);
+    /// }
+    /// ```
+     #[inline]
+    pub fn insert_and_return(self, value: V) -> RustcOccupiedEntry<'a, K, V> {
+        let bucket = self.table.insert_no_grow(self.hash, (self.key, value));
+        RustcOccupiedEntry {
+            key: None,
+            elem: bucket,
+            table: self.table
+        }
+    }
 }

 impl<K, V> IterMut<'_, K, V> {
```

This is also only an implementation for HashMap. I tried implementing for BTreeMap, but I don't really understand BTreeMap's internals and require more guidance on implementing the equivalent `VacantEntry::insert_and_return` such that it returns an `OccupiedEntry`. Notably, following the original PR's modifications I end up needing a `Handle<NodeRef<marker::Mut<'_>, _, _, marker::LeafOrInternal>, _>` while I only have a `Handle<NodeRef<marker::Mut<'_>, _, _, marker::Internal>, _>` and don't know how to proceed.

(To be clear, I'm not asking for guidance right now; I'd be happy getting only the HashMap implementation — the subject of this PR — reviewed and ready, and leave the BTreeMap implementation for a latter PR.)
…varkor

Function pointers as const generic arguments

Makes function pointers as const generic arguments usable.

Fixes rust-lang#62395

r? @varkor
`#[track_caller]` feature gate (RFC 2091 1/N)

RFC text: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md
Tracking issue: rust-lang#47809

I started with @ayosec's commit to add the feature gate with tests and rebased it onto current master. I fixed up some tidy lints and added a test.
Suggest to add `move` keyword for generator capture

 Closes rust-lang#64382
r? @estebank
add more info in debug traces for gcu merging

to help in investigation of CGU partitioning problems e.g rust-lang#64913
…exceptions, r=nikic

Update LLVM for Emscripten exception handling support

Updates LLVM to pick up the cherry-picked support for correctly
handling exception handling with aggregates passed by value. This will
be necessary to continue to support Emscripten's exception handling
once we switch using Emscripten's LLVM backend. See rust-lang#63649.
@Centril Centril added the rollup A PR which is a rollup label Oct 9, 2019
@Centril
Copy link
Contributor Author

Centril commented Oct 9, 2019

@bors r+ p=6 rollup=never

@bors
Copy link
Contributor

bors commented Oct 9, 2019

📌 Commit 813785b 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 Oct 9, 2019
@bors
Copy link
Contributor

bors commented Oct 9, 2019

⌛ Testing commit 813785b with merge c587071...

bors added a commit that referenced this pull request Oct 9, 2019
Rollup of 6 pull requests

Successful merges:

 - #64656 (Implement (HashMap) Entry::insert as per #60142)
 - #64986 (Function pointers as const generic arguments)
 - #65037 (`#[track_caller]` feature gate (RFC 2091 1/N))
 - #65166 (Suggest to add `move` keyword for generator capture)
 - #65175 (add more info in debug traces for gcu merging)
 - #65220 (Update LLVM for Emscripten exception handling support)

Failed merges:

r? @ghost
@rust-highfive
Copy link
Collaborator

The job i686-apple 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.
2019-10-09T03:24:07.7879320Z diff of stderr:
2019-10-09T03:24:07.7879430Z 
2019-10-09T03:24:07.7880090Z 10   --> $DIR/raw-ptr-const-param.rs:7:38
2019-10-09T03:24:07.7880230Z 11    |
2019-10-09T03:24:07.7880320Z 12 LL |     let _: Const<{15 as *const _}> = Const::<{10 as *const _}>;
2019-10-09T03:24:07.7881300Z -    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Scalar(0x000000000000000f) : *const u32`, found `Scalar(0x000000000000000a) : *const u32`
2019-10-09T03:24:07.7881540Z +    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Scalar(0x0000000f) : *const u32`, found `Scalar(0x0000000a) : *const u32`
2019-10-09T03:24:07.7881670Z 14    |
2019-10-09T03:24:07.7882500Z -    = note: expected type `Const<Scalar(0x000000000000000f) : *const u32>`
2019-10-09T03:24:07.7883190Z -               found type `Const<Scalar(0x000000000000000a) : *const u32>`
2019-10-09T03:24:07.7883340Z +    = note: expected type `Const<Scalar(0x0000000f) : *const u32>`
2019-10-09T03:24:07.7883440Z +               found type `Const<Scalar(0x0000000a) : *const u32>`
2019-10-09T03:24:07.7883640Z 18 error: aborting due to previous error
2019-10-09T03:24:07.7883710Z 19 
2019-10-09T03:24:07.7883750Z 
2019-10-09T03:24:07.7883810Z 
2019-10-09T03:24:07.7883810Z 
2019-10-09T03:24:07.7883880Z The actual stderr differed from the expected stderr.
2019-10-09T03:24:07.7884670Z Actual stderr saved to /Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/test/ui/const-generics/raw-ptr-const-param/raw-ptr-const-param.stderr
2019-10-09T03:24:07.7885370Z To update references, rerun the tests and pass the `--bless` flag
2019-10-09T03:24:07.7886220Z To only update this specific test, also pass `--test-args const-generics/raw-ptr-const-param.rs`
2019-10-09T03:24:07.7886400Z error: 1 errors occurred comparing output.
2019-10-09T03:24:07.7886490Z status: exit code: 1
2019-10-09T03:24:07.7886490Z status: exit code: 1
2019-10-09T03:24:07.7887880Z command: "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/stage2/bin/rustc" "/Users/vsts/agent/2.158.0/work/1/s/src/test/ui/const-generics/raw-ptr-const-param.rs" "-Zthreads=1" "--target=i686-apple-darwin" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/test/ui/const-generics/raw-ptr-const-param" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "-L" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/test/ui/const-generics/raw-ptr-const-param/auxiliary" "-A" "unused"
2019-10-09T03:24:07.7889170Z ------------------------------------------
2019-10-09T03:24:07.7889240Z 
2019-10-09T03:24:07.7889850Z ------------------------------------------
2019-10-09T03:24:07.7889950Z stderr:
---
2019-10-09T03:24:07.7892080Z 
2019-10-09T03:24:07.7892360Z error[E0308]: mismatched types
2019-10-09T03:24:07.7893130Z   --> /Users/vsts/agent/2.158.0/work/1/s/src/test/ui/const-generics/raw-ptr-const-param.rs:7:38
2019-10-09T03:24:07.7893280Z    |
2019-10-09T03:24:07.7893370Z LL |     let _: Const<{15 as *const _}> = Const::<{10 as *const _}>; //~ mismatched types
2019-10-09T03:24:07.7893520Z    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Scalar(0x0000000f) : *const u32`, found `Scalar(0x0000000a) : *const u32`
2019-10-09T03:24:07.7893650Z    |
2019-10-09T03:24:07.7893730Z    = note: expected type `Const<Scalar(0x0000000f) : *const u32>`
2019-10-09T03:24:07.7893860Z               found type `Const<Scalar(0x0000000a) : *const u32>`
2019-10-09T03:24:07.7894010Z error: aborting due to previous error
2019-10-09T03:24:07.7894060Z 
2019-10-09T03:24:07.7894730Z For more information about this error, try `rustc --explain E0308`.
2019-10-09T03:24:07.7894820Z 
---
2019-10-09T03:24:07.7958000Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-10-09T03:24:07.7958240Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-10-09T03:24:07.7973810Z 
2019-10-09T03:24:07.7974270Z 
2019-10-09T03:24:07.7977970Z command did not execute successfully: "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/stage0-tools-bin/compiletest" "--compile-lib-path" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/stage2/lib" "--run-lib-path" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/stage2/lib/rustlib/i686-apple-darwin/lib" "--rustc-path" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/stage2/bin/rustc" "--src-base" "/Users/vsts/agent/2.158.0/work/1/s/src/test/ui" "--build-base" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/test/ui" "--stage-id" "stage2-i686-apple-darwin" "--mode" "ui" "--target" "i686-apple-darwin" "--host" "i686-apple-darwin" "--llvm-filecheck" "/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/llvm/build/bin/FileCheck" "--nodejs" "/usr/local/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/Users/vsts/agent/2.158.0/work/1/s/build/i686-apple-darwin/native/rust-test-helpers" "--docck-python" "/usr/local/bin/python2.7" "--lldb-python" "/usr/bin/python" "--lldb-version" "lldb-902.0.79.2\n  Swift-4.1\n" "--lldb-python-dir" "/Applications/Xcode_9.3.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python" "--llvm-version" "9.0.0-rust-1.40.0-dev\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-10-09T03:24:07.7979220Z 
2019-10-09T03:24:07.7979270Z 
2019-10-09T03:24:07.7989460Z failed to run: /Users/vsts/agent/2.158.0/work/1/s/build/bootstrap/debug/bootstrap test
2019-10-09T03:24:07.7989640Z Build completed unsuccessfully in 1:33:38
2019-10-09T03:24:07.7989640Z Build completed unsuccessfully in 1:33:38
2019-10-09T03:24:07.8075440Z == clock drift check ==
2019-10-09T03:24:07.8129440Z   local time: Wed Oct  9 03:24:07 UTC 2019
2019-10-09T03:24:07.9001710Z   network time: Wed, 09 Oct 2019 03:24:07 GMT
2019-10-09T03:24:07.9002330Z == end clock drift check ==
2019-10-09T03:24:07.9166740Z ##[error]Bash exited with code '1'.
2019-10-09T03:24:07.9212420Z ##[section]Starting: Upload CPU usage statistics
2019-10-09T03:24:07.9241100Z ==============================================================================
2019-10-09T03:24:07.9241440Z Task         : Bash
2019-10-09T03:24:07.9241650Z Description  : Run a Bash script on macOS, Linux, or Windows

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
Copy link
Contributor

bors commented Oct 9, 2019

💔 Test failed - checks-azure

@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 9, 2019
@Centril Centril closed this Oct 9, 2019
@Centril Centril deleted the rollup-6qslas2 branch October 9, 2019 03: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.

None yet

10 participants