Commit Graph

100391 Commits

Author SHA1 Message Date
Tyler Mandry
9917f062a9
Rollup merge of #65276 - varkor:toolstate-no-ping, r=Mark-Simulacrum
Don't cc rust-lang/compiler for toolstate changes

Fixes https://github.com/rust-lang/rust/issues/65238.
2019-10-11 15:09:54 -07:00
Tyler Mandry
48051e4a79
Rollup merge of #65266 - rust-lang:must-use-join, r=dtolnay
Mark Path::join as must_use

I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?
2019-10-11 15:09:53 -07:00
Tyler Mandry
e4eb54dae8
Rollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=Centril
Deduplicate is_{freeze,copy,sized}_raw

Fixes #65259

Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.
2019-10-11 15:09:51 -07:00
Tyler Mandry
2403c37ede
Rollup merge of #65220 - tlively:update-llvm-for-emscripten-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 #63649.
2019-10-11 15:09:50 -07:00
Tyler Mandry
7a2bb04eb5
Rollup merge of #65205 - GuillaumeGomez:long-err-explanation-E0568, r=estebank
Add long error explanation for E0568

Part of #61137.
2019-10-11 15:09:48 -07:00
Tyler Mandry
6687edcbef
Rollup merge of #65200 - xfix:patch-20, r=GuillaumeGomez
Add ?Sized bound to a supertrait listing in E0038 error documentation

This example failed to compile because of implicit `Sized` bound for `A` parameter that wasn't required by `Trait`.
2019-10-11 15:09:47 -07:00
Tyler Mandry
728adc446c
Rollup merge of #65191 - varkor:const-generics-test-cases, r=nikomatsakis
Add some regression tests

- Add a test for #62187.
- Clean up the directory structure in `src/test/ui/const-generics`
- Closes #64792.
- Closes #57399.
- Closes #57271.
2019-10-11 15:09:45 -07:00
Tyler Mandry
ec1d008f65
Rollup merge of #65048 - Kixunil:patch-1, r=KodrAus
Added doc about behavior of extend on HashMap

It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
2019-10-11 15:09:44 -07:00
Tyler Mandry
ea0d155f2d
Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkor
Function pointers as const generic arguments

Makes function pointers as const generic arguments usable.

Fixes #62395

r? @varkor
2019-10-11 15:09:42 -07:00
Tyler Mandry
215b09194f
Rollup merge of #64337 - rick68:patch-17, r=Dylan-DPC
libstd: Fix typos in doc
2019-10-11 15:09:41 -07:00
bors
6767d9b90b Auto merge of #64877 - lzutao:stabilize-repeat_generic_slice, r=SimonSapin
Stabilize `slice::repeat` (feature `repeat_generic_slice`)

Closes #48784
r? @SimonSapin
2019-10-11 18:03:20 +00:00
bors
d4f7f974b8 Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapin
Stabilize mem::take (mem_take)

Tracking issue: https://github.com/rust-lang/rust/issues/61129

r? @matklad
2019-10-11 12:45:20 +00:00
bors
000d90b11f Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum
minimize the rust-std component

This changes the `rust-std` dist component to only include the artifacts of compiling the `libstd` step, as listed in `.libstd.stamp`. This does include `test` and `proc-macro` as well. The remaining _unstable_ libraries that are built as part of `rustc` are packaged into a new `rustc-dev` component, intended for use in the development of closely related tools (clippy, miri, rls).

Here are the component sizes from the [try build](https://dev-static.rust-lang.org/dist/2019-10-07/index.html):

| Name | Size
| --- | ---
| rust-std-nightly-x86_64-unknown-linux-gnu.tar.gz | 23.94 MiB
| rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | 17.4 MiB
| rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.gz | 182.03 MiB
| rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | 157.91 MiB

Fixes #61978
Fixes #62486
2019-10-10 23:43:55 +00:00
bors
898f36c83c Auto merge of #65153 - da-x:issue-58017, r=petrochenkov
Improve message when attempting to instantiate tuple structs with private fields

Fixes #58017, fixes #39703.

```
error[E0603]: tuple struct `Error` is private
  --> main.rs:22:16
   |
2  |     pub struct Error(usize, pub usize, usize);
   |                      -----             ----- field is private
   |                      |
   |                      field is private
...
22 |     let x = a::Error(3, 1, 2);
   |                ^^^^^
   |
   = note: a tuple struct constructor is private if any of its fields is private
```
2019-10-10 19:40:48 +00:00
varkor
fb392c5ed6
Don't cc rust-lang/compiler for toolstate changes 2019-10-10 17:23:28 +01:00
bors
58b54911fa Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisa
Add llvm.sideeffect to potential infinite loops and recursions

LLVM assumes that a thread will eventually cause side effect. This is
not true in Rust if a loop or recursion does nothing in its body,
causing undefined behavior even in common cases like `loop {}`.
Inserting llvm.sideeffect fixes the undefined behavior.

As a micro-optimization, only insert llvm.sideeffect when jumping back
in blocks or calling a function.

A patch for LLVM is expected to allow empty non-terminate code by
default and fix this issue from LLVM side.

https://github.com/rust-lang/rust/issues/28728

**UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
2019-10-10 15:40:39 +00:00
Guillaume Gomez
3c62bdcf6b Update ui tests 2019-10-10 15:56:59 +02:00
Guillaume Gomez
847ad6a2ee Add long error explanation for E0568 2019-10-10 15:56:59 +02:00
bors
9c588c1e23 Auto merge of #65140 - petrochenkov:disapp, r=nikomatsakis
resolve: Remove an incorrect assert

Fixes https://github.com/rust-lang/rust/issues/64803.
2019-10-10 12:02:47 +00:00
Aleksey Kladov
19bc0a8c67
Mark Path::join as must_use
I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?
2019-10-10 12:42:04 +03:00
ben
8569dd1db9 Preserve output of raw pointers in mir dump. 2019-10-10 22:01:55 +13:00
bors
8c7b921feb Auto merge of #65129 - andjo403:cargo_args, r=alexcrichton
make it possible to add args to cargo in x.py

eg. make it easier to test -Ztimings for rustc

cc https://github.com/rust-lang/rust/issues/65088
2019-10-10 08:10:49 +00:00
Matt Stavola
ee081145ac
Qualify LangItem 2019-10-09 23:10:35 -07:00
Matt Stavola
af3f8dec59
Delegate is_{freeze,copy,sized}_raw to is_item_raw 2019-10-09 22:56:13 -07:00
bors
8ee24f6ee0 Auto merge of #65077 - estebank:mut-trait-expected, r=nikomatsakis
Note when a mutable trait object is needed

Fix https://github.com/rust-lang/rust/issues/63619, fix https://github.com/rust-lang/rust/issues/37914. CC https://github.com/rust-lang/rust/issues/64068.
2019-10-10 04:07:02 +00: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
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
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
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
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