]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoReport lint in external macros
memoryruins [Fri, 11 Oct 2019 20:36:50 +0000 (16:36 -0400)]
Report  lint in external macros

4 years agoAuto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapin
bors [Fri, 11 Oct 2019 12:45:20 +0000 (12:45 +0000)]
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

4 years agoAuto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum
bors [Thu, 10 Oct 2019 23:43:55 +0000 (23:43 +0000)]
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

4 years agoAuto merge of #65153 - da-x:issue-58017, r=petrochenkov
bors [Thu, 10 Oct 2019 19:40:48 +0000 (19:40 +0000)]
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
```

4 years agoAuto merge of #59546 - sfanxiang:interminable-ub, r=nagisa
bors [Thu, 10 Oct 2019 15:40:39 +0000 (15:40 +0000)]
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

4 years agoAuto merge of #65140 - petrochenkov:disapp, r=nikomatsakis
bors [Thu, 10 Oct 2019 12:02:47 +0000 (12:02 +0000)]
Auto merge of #65140 - petrochenkov:disapp, r=nikomatsakis

resolve: Remove an incorrect assert

Fixes https://github.com/rust-lang/rust/issues/64803.

4 years agoAuto merge of #65129 - andjo403:cargo_args, r=alexcrichton
bors [Thu, 10 Oct 2019 08:10:49 +0000 (08:10 +0000)]
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

4 years agoAuto merge of #65077 - estebank:mut-trait-expected, r=nikomatsakis
bors [Thu, 10 Oct 2019 04:07:02 +0000 (04:07 +0000)]
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.

4 years agoAuto merge of #64939 - nnethercote:snapshot-cleanups, r=nikomatsakis
bors [Thu, 10 Oct 2019 00:19:29 +0000 (00:19 +0000)]
Auto merge of #64939 - nnethercote:snapshot-cleanups, r=nikomatsakis

Snapshot clean-ups

Two minor clean-ups involving snapshots.

4 years agoAuto merge of #65249 - matthewjasper:revert-into-drop, r=nnethercote
bors [Wed, 9 Oct 2019 20:29:05 +0000 (20:29 +0000)]
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.

4 years agoRevert "Make `into` schedule drop for the destination"
Matthew Jasper [Wed, 9 Oct 2019 19:06:15 +0000 (20:06 +0100)]
Revert "Make `into` schedule drop for the destination"

This reverts commit 37026837a3f23486d3cf1009d9136927168ddb33.

4 years agoOnly suggest change mut if vars are resolved
Esteban Küber [Wed, 9 Oct 2019 18:42:29 +0000 (11:42 -0700)]
Only suggest change mut if vars are resolved

4 years agoreview comments
Esteban Küber [Mon, 7 Oct 2019 01:38:15 +0000 (18:38 -0700)]
review comments

4 years agoreview comments
Esteban Küber [Sat, 5 Oct 2019 18:37:21 +0000 (11:37 -0700)]
review comments

4 years agoObligation must apply modulo regions
Esteban Küber [Sat, 5 Oct 2019 17:41:24 +0000 (10:41 -0700)]
Obligation must apply modulo regions

4 years agoTweak wording
Esteban Küber [Fri, 4 Oct 2019 00:39:58 +0000 (17:39 -0700)]
Tweak wording

4 years agoNote when a mutable trait object is needed
Esteban Küber [Fri, 4 Oct 2019 00:10:37 +0000 (17:10 -0700)]
Note when a mutable trait object is needed

4 years agoAuto merge of #65228 - Wind-River:real_master, r=dtolnay
bors [Wed, 9 Oct 2019 16:31:49 +0000 (16:31 +0000)]
Auto merge of #65228 - Wind-River:real_master, r=dtolnay

vxworks: add checking (r == 0)

4 years agomake it possible to add args to cargo in x.py
Andreas Jonson [Wed, 9 Oct 2019 15:45:19 +0000 (17:45 +0200)]
make it possible to add args to cargo in x.py

eg. make it easier to test -Ztimings for rustc

4 years agoresolve: Use field spans for reporting the private constructor error
Vadim Petrochenkov [Wed, 9 Oct 2019 14:37:48 +0000 (17:37 +0300)]
resolve: Use field spans for reporting the private constructor error

4 years agoresolve: Keep field spans for diagnostics
Vadim Petrochenkov [Wed, 9 Oct 2019 14:37:28 +0000 (17:37 +0300)]
resolve: Keep field spans for diagnostics

4 years agoAuto merge of #65208 - michaelwoerister:sp-events-review-2, r=wesleywiser
bors [Wed, 9 Oct 2019 12:51:07 +0000 (12:51 +0000)]
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)

4 years agoself-profiling: Add events for everything except trait selection.
Michael Woerister [Tue, 8 Oct 2019 12:05:41 +0000 (14:05 +0200)]
self-profiling: Add events for everything except trait selection.

4 years agoAuto merge of #65198 - nnethercote:fix-65080, r=Mark-Simulacrum
bors [Wed, 9 Oct 2019 08:57:26 +0000 (08:57 +0000)]
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

4 years agoAuto merge of #65229 - Centril:rollup-wnr46vg, r=Centril
bors [Wed, 9 Oct 2019 03:32:21 +0000 (03:32 +0000)]
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

4 years agoRollup merge of #65175 - andjo403:partitioning, r=zackmdavis
Mazdak Farrokhzad [Wed, 9 Oct 2019 03:31:38 +0000 (05:31 +0200)]
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

4 years agoRollup merge of #65166 - csmoe:async-move, r=estebank
Mazdak Farrokhzad [Wed, 9 Oct 2019 03:31:36 +0000 (05:31 +0200)]
Rollup merge of #65166 - csmoe:async-move, r=estebank

Suggest to add `move` keyword for generator capture

 Closes #64382
r? @estebank

4 years agoRollup merge of #65037 - anp:track-caller, r=oli-obk
Mazdak Farrokhzad [Wed, 9 Oct 2019 03:31:35 +0000 (05:31 +0200)]
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.

4 years agoRollup merge of #64656 - passcod:map-entry-insert, r=Amanieu
Mazdak Farrokhzad [Wed, 9 Oct 2019 03:31:33 +0000 (05:31 +0200)]
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.)

4 years agoadd checking (r == 0)
Baoshan Pang [Mon, 7 Oct 2019 16:59:08 +0000 (09:59 -0700)]
add checking (r == 0)

4 years agoStabilize mem::take (mem_take)
Jon Gjengset [Mon, 23 Sep 2019 17:54:37 +0000 (13:54 -0400)]
Stabilize mem::take (mem_take)

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

4 years agoImplement (HashMap) Entry::insert as per #60142
Félix Saparelli [Sat, 21 Sep 2019 10:56:05 +0000 (22:56 +1200)]
Implement (HashMap) Entry::insert as per #60142

4 years agoAuto merge of #65223 - Centril:rollup-5sdvdni, r=Centril
bors [Tue, 8 Oct 2019 21:32:07 +0000 (21:32 +0000)]
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

4 years agoRollup merge of #65213 - estebank:peel-drop-temps, r=Centril
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:28 +0000 (23:31 +0200)]
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.

4 years agoRollup merge of #65194 - estebank:remove_str, r=petrochenkov
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:27 +0000 (23:31 +0200)]
Rollup merge of #65194 - estebank:remove_str, r=petrochenkov

Use structured suggestion for removal of `as_str()` call

Follow up to #64739.

4 years agoRollup merge of #65141 - BO41:code-of-conduct, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:25 +0000 (23:31 +0200)]
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

4 years agoRollup merge of #65135 - GuillaumeGomez:add-error-code-check, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:24 +0000 (23:31 +0200)]
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

4 years agoRollup merge of #65133 - davidtwco:issue-65035-static-with-generic-in-foreign-mod...
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:22 +0000 (23:31 +0200)]
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).

4 years agoRollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, r=michaelwoerister
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:20 +0000 (23:31 +0200)]
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).

4 years agoRollup merge of #64284 - Mark-Simulacrum:include-warn, r=petrochenkov
Mazdak Farrokhzad [Tue, 8 Oct 2019 21:31:19 +0000 (23:31 +0200)]
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

4 years agoresolve: prohibit foreign statics w/ generics
David Wood [Sat, 5 Oct 2019 15:55:58 +0000 (16:55 +0100)]
resolve: prohibit foreign statics w/ generics

This commit modifies resolve to disallow foreign statics that use
parent 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).

Signed-off-by: David Wood <david@davidtw.co>
4 years agoAuto merge of #65209 - Centril:rollup-tzc0j87, r=Centril
bors [Tue, 8 Oct 2019 17:31:35 +0000 (17:31 +0000)]
Auto merge of #65209 - Centril:rollup-tzc0j87, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #64404 (Add long error explanation for E0495)
 - #64918 (Add long error explanation for E0551)
 - #65102 (Disable stack probe when thread sanitizer is enabled)
 - #65120 (Correctly estimate the required space for string in `StyledBuffer::prepend`)
 - #65145 (When suggesting assoc function with type params, include turbofish)
 - #65162 (Remove loaded_from_cache map from DepGraph)
 - #65176 (Remove query-related macros)
 - #65179 (Add long error explanation for E0567)

Failed merges:

r? @ghost

4 years agoreview comments
Esteban Küber [Tue, 8 Oct 2019 16:46:57 +0000 (09:46 -0700)]
review comments

4 years agoCall `Expr::peel_drop_temps()` from more places for more accurate suggestions
Esteban Küber [Tue, 8 Oct 2019 15:42:26 +0000 (08:42 -0700)]
Call `Expr::peel_drop_temps()` from more places for more accurate suggestions

4 years agoIgnore `ExprKind::DropTemps` for some ref suggestions
Esteban Küber [Tue, 8 Oct 2019 15:26:42 +0000 (08:26 -0700)]
Ignore `ExprKind::DropTemps` for some ref suggestions

4 years agoRollup merge of #65179 - GuillaumeGomez:long-err-explanation-E0567, r=davidtwco
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:34 +0000 (15:45 +0200)]
Rollup merge of #65179 - GuillaumeGomez:long-err-explanation-E0567, r=davidtwco

Add long error explanation for E0567

Part of #61137.

4 years agoRollup merge of #65176 - nnethercote:rm-query-macros, r=michaelwoerister
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:32 +0000 (15:45 +0200)]
Rollup merge of #65176 - nnethercote:rm-query-macros, r=michaelwoerister

Remove query-related macros

The query system has a few macros that only have one or two call sites, and I find they hurt readability. This PR removes them.

r? @michaelwoerister

4 years agoRollup merge of #65162 - Mark-Simulacrum:no-cache-loading-map, r=michaelwoerister
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:31 +0000 (15:45 +0200)]
Rollup merge of #65162 - Mark-Simulacrum:no-cache-loading-map, r=michaelwoerister

Remove loaded_from_cache map from DepGraph

It's now unused, even with -Zquery-dep-graph

From https://github.com/rust-lang/rust/pull/63756/files#r316039379 -- it'll simplify that PR to get this landed separately so we can just remove some of the code that it touches.

r? @Zoxc or @michaelwoerister

4 years agoRollup merge of #65145 - estebank:turbofish-assoc-fn-call, r=varkor
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:29 +0000 (15:45 +0200)]
Rollup merge of #65145 - estebank:turbofish-assoc-fn-call, r=varkor

When suggesting assoc function with type params, include turbofish

Fix https://github.com/rust-lang/rust/issues/61412, fix https://github.com/rust-lang/rust/issues/61411.

4 years agoRollup merge of #65120 - AnthonyMikh:fix_65119, r=estebank
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:28 +0000 (15:45 +0200)]
Rollup merge of #65120 - AnthonyMikh:fix_65119, r=estebank

Correctly estimate the required space for string in `StyledBuffer::prepend`

Fix #65119

r? @estebank

4 years agoRollup merge of #65102 - tmiasko:tsan-probe-stack, r=alexcrichton
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:26 +0000 (15:45 +0200)]
Rollup merge of #65102 - tmiasko:tsan-probe-stack, r=alexcrichton

Disable stack probe when thread sanitizer is enabled

When thread sanitizer instrumentation is enabled during compilation of
stack probe function, the function will be miscompiled and trigger
segmentation fault at runtime. Disable stack probes when tsan is
enabled.

4 years agoRollup merge of #64918 - GuillaumeGomez:long-err-explanation-E0551, r=oli-obk
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:25 +0000 (15:45 +0200)]
Rollup merge of #64918 - GuillaumeGomez:long-err-explanation-E0551, r=oli-obk

Add long error explanation for E0551

Part of #61137

4 years agoRollup merge of #64404 - GuillaumeGomez:err-E0495, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 8 Oct 2019 13:45:23 +0000 (15:45 +0200)]
Rollup merge of #64404 - GuillaumeGomez:err-E0495, r=Dylan-DPC

Add long error explanation for E0495

Part of #61137.

4 years agoAuto merge of #65206 - mati865:clippyup, r=oli-obk
bors [Tue, 8 Oct 2019 13:41:12 +0000 (13:41 +0000)]
Auto merge of #65206 - mati865:clippyup, r=oli-obk

Update Clippy

I cannot test it locally but Clippy CI is green so it should work.

Fixes https://github.com/rust-lang/rust/issues/65096

4 years agoUpdate Clippy
Mateusz Mikuła [Tue, 8 Oct 2019 12:14:09 +0000 (14:14 +0200)]
Update Clippy

4 years agoUpdate ui tests
Guillaume Gomez [Mon, 7 Oct 2019 12:08:26 +0000 (14:08 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0567
Guillaume Gomez [Mon, 7 Oct 2019 10:59:39 +0000 (12:59 +0200)]
Add long error explanation for E0567

4 years agosuggest to add move keyword for generator
csmoe [Sun, 6 Oct 2019 13:58:32 +0000 (21:58 +0800)]
suggest to add move keyword for generator

4 years agoAuto merge of #64949 - nnethercote:avoid-SmallVec-collect, r=zackmdavis
bors [Tue, 8 Oct 2019 08:08:21 +0000 (08:08 +0000)]
Auto merge of #64949 - nnethercote:avoid-SmallVec-collect, r=zackmdavis

Avoid `SmallVec::collect`

We can get sizeable speed-ups by avoiding `SmallVec::collect` when the number of elements is small.

4 years agoOptimize `TokenStreamBuilder::push`.
Nicholas Nethercote [Tue, 8 Oct 2019 02:32:59 +0000 (13:32 +1100)]
Optimize `TokenStreamBuilder::push`.

Currently, when two tokens must be glued together, this function duplicates
large chunks of the existing streams. This can cause quadratic behaviour.

This commit changes the function so that it overwrites the last token with a
glued token, which avoids the quadratic behaviour. This removes the need for
`TokenStreamBuilder::push_all_but_{first,last}_tree`.

The commit also restructures `push` somewhat, by removing
`TokenStream::{first_tree_and_joint,last_tree_if_joint}` in favour of more
pattern matching and some comments. This makes the code shorter, and in my
opinion, more readable.

4 years agoOptimize `TokenStream::from_streams`.
Nicholas Nethercote [Mon, 7 Oct 2019 23:34:53 +0000 (10:34 +1100)]
Optimize `TokenStream::from_streams`.

Currently, this function creates a new empty stream, and then appends
the elements from each given stream onto that stream. This can cause
quadratic behaviour.

This commit changes the function so that it modifies the first stream
(which can be long) by extending it with the elements from the
subsequent streams (which are almost always short), which avoids the
quadratic behaviour.

4 years agoRemove `InferCtxt::in_snapshot()`.
Nicholas Nethercote [Mon, 30 Sep 2019 04:42:11 +0000 (14:42 +1000)]
Remove `InferCtxt::in_snapshot()`.

It's the same as `InferCtxt::commit_unconditionally()` except that it
is passed a snapshot and has a worse name.

The commit also changes `commit_unconditionally()` to receive a
snapshot, for consistency with `commit_if_ok()` and `probe()`.

4 years agoClarify a comment in `RegionConstraintCollector::leak_check`.
Nicholas Nethercote [Mon, 30 Sep 2019 04:03:53 +0000 (14:03 +1000)]
Clarify a comment in `RegionConstraintCollector::leak_check`.

4 years agoAuto merge of #65196 - Centril:rollup-q06lcxm, r=Centril
bors [Tue, 8 Oct 2019 04:35:03 +0000 (04:35 +0000)]
Auto merge of #65196 - Centril:rollup-q06lcxm, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #64726 (rewrite documentation for unimplemented! to clarify use)
 - #65040 (syntax: more cleanups in item and function signature parsing)
 - #65046 (Make `Cell::new` method come first in documentation)
 - #65098 (Add long error explanation for E0561)
 - #65150 (Suggest dereferencing boolean reference when used in 'if' or 'while')
 - #65154 (Fix const generic arguments not displaying in types mismatch diagnostic)
 - #65181 (fix bug in folding for constants)
 - #65187 (use 'invalid argument' for vxWorks)

Failed merges:

 - #65179 (Add long error explanation for E0567)

r? @ghost

4 years agoRollup merge of #65187 - Wind-River:master_before_merge, r=rkruppe
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:44 +0000 (05:02 +0200)]
Rollup merge of #65187 - Wind-River:master_before_merge, r=rkruppe

use 'invalid argument' for vxWorks

vxWorks is using "invalid argument" instead of "Invalid argument" in reporting invalid options

r? @rkruppe

4 years agoRollup merge of #65181 - nikomatsakis:lazy-norm-anon-const-push-1, r=varkor
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:43 +0000 (05:02 +0200)]
Rollup merge of #65181 - nikomatsakis:lazy-norm-anon-const-push-1, r=varkor

fix bug in folding for constants

These was a bug in the folding for constants that caused it to overlook bound regions. This branch includes some other little things that I did while trying to track the bug down.

r? @oli-obk

4 years agoRollup merge of #65154 - skinny121:const-arg-diagnostic, r=varkor
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:41 +0000 (05:02 +0200)]
Rollup merge of #65154 - skinny121:const-arg-diagnostic, r=varkor

Fix const generic arguments not displaying in types mismatch diagnostic

Fixes #61395

4 years agoRollup merge of #65150 - XiangQingW:master, r=estebank
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:39 +0000 (05:02 +0200)]
Rollup merge of #65150 - XiangQingW:master, r=estebank

Suggest dereferencing boolean reference when used in 'if' or 'while'

Implements #64557

4 years agoRollup merge of #65098 - GuillaumeGomez:long-err-explanation-E0561, r=Centril
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:38 +0000 (05:02 +0200)]
Rollup merge of #65098 - GuillaumeGomez:long-err-explanation-E0561, r=Centril

Add long error explanation for E0561

Part of #61137

4 years agoRollup merge of #65046 - sinkuu:cell_reorder, r=shepmaster
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:36 +0000 (05:02 +0200)]
Rollup merge of #65046 - sinkuu:cell_reorder, r=shepmaster

Make `Cell::new` method come first in documentation

Methods to create a thing usually comes first in `std` documentation, and `Cell` has been an exception. Also, `T: Copy` specialized methods should not be on top of the page. (This had led me to miss that most of its methods are not bounded by `Copy`...)

4 years agoRollup merge of #65040 - Centril:items-cleanup, r=estebank
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:35 +0000 (05:02 +0200)]
Rollup merge of #65040 - Centril:items-cleanup, r=estebank

syntax: more cleanups in item and function signature parsing

Follow up to https://github.com/rust-lang/rust/pull/64910.

Best read commit-by-commit.

r? @estebank

4 years agoRollup merge of #64726 - andrewbanchich:unimplemented, r=rkruppe
Mazdak Farrokhzad [Tue, 8 Oct 2019 03:02:33 +0000 (05:02 +0200)]
Rollup merge of #64726 - andrewbanchich:unimplemented, r=rkruppe

rewrite documentation for unimplemented! to clarify use

The current docs for `unimplemented!` seem to miss the point of this macro.

> This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them.

You could also return a `()` if you just want your code to type-check.

I think `unimplemented!` is useful for when you want your program to exit when it reaches an unimplemented area.

I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.

4 years agoAuto merge of #65186 - mati865:cargoup, r=alexcrichton
bors [Tue, 8 Oct 2019 01:05:08 +0000 (01:05 +0000)]
Auto merge of #65186 - mati865:cargoup, r=alexcrichton

Update Cargo

To pull rust-lang/cargo#7482

List of merged PRs:
- Fix wrong directories in PATH on Windows (rust-lang/cargo#7482)
- Update SPDX list to 3.6 (rust-lang/cargo#7481)
- Mark Emscripten's .wasm files auxiliary (rust-lang/cargo#7476)
- Update `curl-sys` dependency requirement (rust-lang/cargo#7464)
- add dependencies for `pkg-config` (rust-lang/cargo#7443)
- Removing hash from output files when using MSVC (rust-lang/cargo#7400)
- Disable preserving mtimes on archives (rust-lang/cargo#7465)
- Removed redundant borrow (rust-lang/cargo#7462)
- Public dependency refactor and re-allow backjumping (rust-lang/cargo#7361)
- unify the quote in Cargo.toml (rust-lang/cargo#7461)

4 years agoWarn if include macro fails to include entire file
Mark Rousskov [Sun, 8 Sep 2019 14:00:26 +0000 (10:00 -0400)]
Warn if include macro fails to include entire file

4 years agoUse structured suggestion for removal of `as_str()` call
Esteban Küber [Mon, 7 Oct 2019 23:18:02 +0000 (16:18 -0700)]
Use structured suggestion for removal of `as_str()` call

4 years agoAdd rustc-dev to nightly default and complete profiles
Josh Stone [Mon, 7 Oct 2019 22:49:51 +0000 (15:49 -0700)]
Add rustc-dev to nightly default and complete profiles

4 years agoAuto merge of #64358 - cuviper:rustc-rayon-1.2, r=nikomatsakis
bors [Mon, 7 Oct 2019 21:24:29 +0000 (21:24 +0000)]
Auto merge of #64358 - cuviper:rustc-rayon-1.2, r=nikomatsakis

Rebase rustc-rayon on rayon-1.2

See also https://github.com/rust-lang/rustc-rayon/pull/3

4 years agoOnly install rustc-dev by default on nightly
Josh Stone [Mon, 7 Oct 2019 16:31:51 +0000 (09:31 -0700)]
Only install rustc-dev by default on nightly

4 years agoadd rustc-dev to tools/build-manifest
Josh Stone [Thu, 3 Oct 2019 18:40:39 +0000 (11:40 -0700)]
add rustc-dev to tools/build-manifest

4 years agoadd dist::RustcDev for unstable compiler libraries
Josh Stone [Thu, 3 Oct 2019 17:57:19 +0000 (10:57 -0700)]
add dist::RustcDev for unstable compiler libraries

4 years agoUse builder.compiler_for() to find the libstd stamp
Josh Stone [Fri, 27 Sep 2019 19:31:00 +0000 (12:31 -0700)]
Use builder.compiler_for() to find the libstd stamp

4 years ago[WIP] minimize the rust-std component
Josh Stone [Thu, 26 Sep 2019 21:44:08 +0000 (14:44 -0700)]
[WIP] minimize the rust-std component

4 years agoUpdate other rayon uses to 1.2 too
Josh Stone [Mon, 7 Oct 2019 20:44:30 +0000 (13:44 -0700)]
Update other rayon uses to 1.2 too

4 years agoadd crossbeam-queue to the whitelist
Josh Stone [Mon, 7 Oct 2019 20:43:10 +0000 (13:43 -0700)]
add crossbeam-queue to the whitelist

4 years agoName the threads in rayon's pool
Josh Stone [Thu, 12 Sep 2019 19:34:43 +0000 (12:34 -0700)]
Name the threads in rayon's pool

4 years agoRebase rustc-rayon on rayon-1.2
Josh Stone [Tue, 10 Sep 2019 17:13:07 +0000 (10:13 -0700)]
Rebase rustc-rayon on rayon-1.2

See also https://github.com/rust-lang/rustc-rayon/pull/3

4 years agouse 'invalid argument' for vxWorks
BaoshanPang [Mon, 7 Oct 2019 18:52:30 +0000 (11:52 -0700)]
use 'invalid argument' for vxWorks

4 years agoUpdate Cargo
Mateusz Mikuła [Mon, 7 Oct 2019 18:33:13 +0000 (20:33 +0200)]
Update Cargo

4 years agoAuto merge of #61430 - matthewjasper:drop-on-into-panic, r=oli-obk
bors [Mon, 7 Oct 2019 17:47:10 +0000 (17:47 +0000)]
Auto merge of #61430 - matthewjasper:drop-on-into-panic, r=oli-obk

Make `into` schedule drop for the destination

closes #47949

4 years agoupdate ui tests
Guillaume Gomez [Thu, 12 Sep 2019 13:00:44 +0000 (15:00 +0200)]
update ui tests

4 years agoAdd long error explanation for E0495
Guillaume Gomez [Thu, 12 Sep 2019 12:32:50 +0000 (14:32 +0200)]
Add long error explanation for E0495

4 years agoFix syntax typo in error message.
Adam Perry [Mon, 7 Oct 2019 15:04:26 +0000 (08:04 -0700)]
Fix syntax typo in error message.

4 years agoClarify variable names when checking track_caller methods.
Adam Perry [Sat, 5 Oct 2019 15:28:38 +0000 (08:28 -0700)]
Clarify variable names when checking track_caller methods.

4 years agoProhibit #[track_caller] within trait impls as well as decls.
Adam Perry [Sat, 5 Oct 2019 15:21:30 +0000 (08:21 -0700)]
Prohibit #[track_caller] within trait impls as well as decls.

4 years agoUpdate expected error output.
Adam Perry [Sat, 5 Oct 2019 15:12:48 +0000 (08:12 -0700)]
Update expected error output.

4 years agoExpand E0738 to cover different cases.
Adam Perry [Fri, 4 Oct 2019 22:55:39 +0000 (15:55 -0700)]
Expand E0738 to cover different cases.

4 years agoE073[6-8] include failing code examples.
Adam Perry [Fri, 4 Oct 2019 21:19:05 +0000 (14:19 -0700)]
E073[6-8] include failing code examples.

4 years agoE0735 -> E0739
Adam Perry [Fri, 4 Oct 2019 01:49:35 +0000 (18:49 -0700)]
E0735 -> E0739

Prevents number collision with another approved PR.

4 years agotrack_caller tests account for incomplete feature warning.
Adam Perry [Thu, 3 Oct 2019 06:01:52 +0000 (23:01 -0700)]
track_caller tests account for incomplete feature warning.

4 years agotrack_caller error numbers and text.
Adam Perry [Thu, 3 Oct 2019 05:35:58 +0000 (22:35 -0700)]
track_caller error numbers and text.