Commit Graph

100593 Commits

Author SHA1 Message Date
Adam Perry
012116f860 Add InstanceDef::ReifyShim for track_caller functions. 2019-10-09 20:19:09 -07:00
bors
aa45e032d9 Auto merge of #64939 - nnethercote:snapshot-cleanups, r=nikomatsakis
Snapshot clean-ups

Two minor clean-ups involving snapshots.
2019-10-10 00:19:29 +00:00
bors
ece4977138 Auto merge of #65249 - matthewjasper:revert-into-drop, r=nnethercote
Revert "Make `into` schedule drop for the destination"

This was a *very* large perf regression in some cases. I'll undo the revert once I have time to avoid the regression.
2019-10-09 20:29:05 +00:00
Matthew Jasper
a0342c8965 Revert "Make into schedule drop for the destination"
This reverts commit 37026837a3.
2019-10-09 21:13:18 +01:00
Esteban Küber
4bb1592402 Suggest if let on let refutable binding 2019-10-09 12:25:48 -07:00
ben
89cc0467a2 Pretty print raw pointers in consts as '{pointer}'. 2019-10-10 08:11:31 +13:00
Esteban Küber
faf8a2af7a Only suggest change mut if vars are resolved 2019-10-09 11:42:29 -07:00
Esteban Küber
2c6bcac535 review comments 2019-10-09 10:17:29 -07:00
Esteban Küber
4fcaa4a283 review comments 2019-10-09 10:17:29 -07:00
Esteban Küber
722bb515e2 Obligation must apply modulo regions 2019-10-09 10:17:29 -07:00
Esteban Küber
acd6540a74 Tweak wording 2019-10-09 10:17:29 -07:00
Esteban Küber
6d6d978baa Note when a mutable trait object is needed 2019-10-09 10:17:29 -07:00
Oliver Scherer
76fe6a41ba Refactor a nested if to a match 2019-10-09 19:12:49 +02:00
Oliver Scherer
76a7667e79 Move test next to likeminded ones 2019-10-09 19:09:08 +02:00
bors
20cc752726 Auto merge of #65228 - Wind-River:real_master, r=dtolnay
vxworks: add checking (r == 0)
2019-10-09 16:31:49 +00:00
Andreas Jonson
6ae36a37ac make it possible to add args to cargo in x.py
eg. make it easier to test -Ztimings for rustc
2019-10-09 17:45:19 +02:00
Vadim Petrochenkov
48f8beddd8 resolve: Use field spans for reporting the private constructor error 2019-10-09 18:07:22 +03:00
Vadim Petrochenkov
5d8af38329 resolve: Keep field spans for diagnostics 2019-10-09 18:07:22 +03:00
Michael Woerister
0ee6a96eb7 Remove some outdated comments about dependency tracking from cstore_impl. 2019-10-09 16:58:17 +02:00
Michael Woerister
003d5a6367 self-profiling: Add events for tracking crate metadata loading related activities. 2019-10-09 16:58:17 +02:00
Michael Woerister
9dbd7be70f Cache the DepNodeIndex of upstream crates in order to avoid multiple locks and table lookups on each access of crate metadata. 2019-10-09 16:58:10 +02:00
Igor Aleksanov
15f571bbd3 Move unstable book entry into compiler flags directory 2019-10-09 17:43:27 +03:00
bors
321ccbe1db Auto merge of #65208 - michaelwoerister:sp-events-review-2, r=wesleywiser
self-profiling: Add events for everything except trait selection.

This is the followup PR to https://github.com/rust-lang/rust/pull/64840.

Trait selection events are still missing (at least those not covered by regular queries).

r? @wesleywiser (or @Mark-Simulacrum if @wesleywiser is not available at the moment)
2019-10-09 12:51:07 +00:00
Michael Woerister
ceb1a9cfe3 self-profiling: Add events for everything except trait selection. 2019-10-09 13:40:44 +02:00
Konrad Borowski
3f9d834fb3
Add failing example for Self in supertrait listing in E0038 documentation 2019-10-09 12:33:24 +02:00
bors
e59dab52d4 Auto merge of #65198 - nnethercote:fix-65080, r=Mark-Simulacrum
Speed up `TokenStream` concatenation

This PR fixes the quadratic behaviour identified in #65080.

r? @Mark-Simulacrum
2019-10-09 08:57:26 +00:00
Igor Aleksanov
56077605fd Follow the styling guide 2019-10-09 10:29:20 +03:00
Igor Aleksanov
d7423f143d Add an entry to the unstable book 2019-10-09 10:03:27 +03:00
Igor Aleksanov
375a051f7f Make interface of the feature more convenient 2019-10-09 10:03:08 +03:00
Igor Aleksanov
8231f46a8f Resolve divergency with master 2019-10-09 09:52:08 +03:00
bors
275cf4bcac Auto merge of #65229 - Centril:rollup-wnr46vg, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #64656 (Implement (HashMap) Entry::insert as per #60142)
 - #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)

Failed merges:

r? @ghost
2019-10-09 03:32:21 +00:00
Mazdak Farrokhzad
e27f029836
Rollup merge of #65175 - andjo403:partitioning, r=zackmdavis
add more info in debug traces for gcu merging

to help in investigation of CGU partitioning problems e.g https://github.com/rust-lang/rust/issues/64913
2019-10-09 05:31:38 +02:00
Mazdak Farrokhzad
5bbdcb6734
Rollup merge of #65166 - csmoe:async-move, r=estebank
Suggest to add `move` keyword for generator capture

 Closes #64382
r? @estebank
2019-10-09 05:31:36 +02:00
Mazdak Farrokhzad
ae5bb7e289
Rollup merge of #65037 - anp:track-caller, r=oli-obk
`#[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: https://github.com/rust-lang/rust/issues/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.
2019-10-09 05:31:35 +02:00
Mazdak Farrokhzad
27240fe77b
Rollup merge of #64656 - passcod:map-entry-insert, r=Amanieu
Implement (HashMap) Entry::insert as per #60142

Implementation of `Entry::insert` as per @SimonSapin's comment on #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.)
2019-10-09 05:31:33 +02:00
Baoshan Pang
175db95b3d add checking (r == 0) 2019-10-08 18:57:17 -07:00
Konrad Borowski
7dc4bf4f93
Change incorrect trait name in E0038 error documentation 2019-10-09 01:03:56 +02:00
Jon Gjengset
45aca119a6
Stabilize mem::take (mem_take)
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08 18:04:18 -04:00
Félix Saparelli
bdcc21cbc4 Implement (HashMap) Entry::insert as per #60142 2019-10-09 11:00:29 +13:00
bors
b5bd31ec6d Auto merge of #65223 - Centril:rollup-5sdvdni, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #64284 (Warn if include macro fails to include entire file)
 - #65081 (Remove -Zprofile-queries)
 - #65133 (typeck: prohibit foreign statics w/ generics)
 - #65135 (Add check for missing tests for error codes)
 - #65141 (Replace code of conduct with link)
 - #65194 (Use structured suggestion for removal of `as_str()` call)
 - #65213 (Ignore `ExprKind::DropTemps` for some ref suggestions)

Failed merges:

r? @ghost
2019-10-08 21:32:07 +00:00
Mazdak Farrokhzad
ff51611c42
Rollup merge of #65213 - estebank:peel-drop-temps, r=Centril
Ignore `ExprKind::DropTemps` for some ref suggestions

Introduce `Expr::peel_drop_temps()` to ignore `ExprKind::DropTemps` for suggestions that depend on the `ExprKind` for accuracy.
2019-10-08 23:31:28 +02:00
Mazdak Farrokhzad
4a6304fb05
Rollup merge of #65194 - estebank:remove_str, r=petrochenkov
Use structured suggestion for removal of `as_str()` call

Follow up to #64739.
2019-10-08 23:31:27 +02:00
Mazdak Farrokhzad
88d75c36c3
Rollup merge of #65141 - BO41:code-of-conduct, r=Mark-Simulacrum
Replace code of conduct with link

This will replace the code of conduct and link to a single version at https://www.rust-lang.org/conduct.html
Fixes https://github.com/rust-lang/rust/pull/61531#issuecomment-501473787

r? @Mark-Simulacrum
2019-10-08 23:31:25 +02:00
Mazdak Farrokhzad
ecd6229f72
Rollup merge of #65135 - GuillaumeGomez:add-error-code-check, r=Mark-Simulacrum
Add check for missing tests for error codes

Fixes #64811.

r? @Mark-Simulacrum
2019-10-08 23:31:24 +02:00
Mazdak Farrokhzad
9b989ea298
Rollup merge of #65133 - davidtwco:issue-65035-static-with-generic-in-foreign-mod, r=petrochenkov
typeck: prohibit foreign statics w/ generics

Fixes #65035 and fixes #65025.

This PR modifies resolve to disallow foreign statics that have
generics.

`improper_ctypes` is not written to support type parameters, as these
are normally disallowed before the lint is run. Thus, type parameters in
foreign statics must be prohibited before the lint.

The only other case where this *could* have occured is in functions,
but typeck prohibits this with a "foreign items may not have type
parameters" error - a similar error did not exist for statics, because
statics cannot have type parameters, but they can use any
type parameters that are in scope (which isn't the case for functions).
2019-10-08 23:31:22 +02:00
Mazdak Farrokhzad
3f2ae44ba4
Rollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, r=michaelwoerister
Remove -Zprofile-queries

r? @michaelwoerister

Per [zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/57361RemoveZprofilequeries.html).
2019-10-08 23:31:20 +02:00
Mazdak Farrokhzad
fc068222d0
Rollup merge of #64284 - Mark-Simulacrum:include-warn, r=petrochenkov
Warn if include macro fails to include entire file

This currently introduces an error, mainly because that was just simpler, and I'm not entirely certain if we can introduce a lint without an RFC and such.

This is primarily to get feedback on the approach and overall aim -- in particular, do we think this is helpful? If so, we probably will need lang-team sign off and decide if it should be an error (as currently introduced by this PR), a lint, or a warning.

r? @petrochenkov

cc https://github.com/rust-lang/rust/issues/35560
2019-10-08 23:31:19 +02:00
Thomas Lively
2c81089425 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 #63649.
2019-10-08 13:07:27 -07:00
Amanieu d'Antras
dfe76a1093 Split non-CAS atomic support off into target_has_atomic_load_store 2019-10-08 20:34:30 +01:00
ben
5986fe24bd Update ui tests 2019-10-09 06:58:39 +13:00