]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #68153 - petrochenkov:privdiag, r=estebank
Dylan DPC [Fri, 17 Jan 2020 05:46:36 +0000 (11:16 +0530)]
Rollup merge of #68153 - petrochenkov:privdiag, r=estebank

resolve: Point at the private item definitions in privacy errors

A basic version of https://github.com/rust-lang/rust/pull/67951.
r? @estebank

4 years agoRollup merge of #67956 - varkor:E0588-provide-context, r=estebank
Dylan DPC [Fri, 17 Jan 2020 05:46:32 +0000 (11:16 +0530)]
Rollup merge of #67956 - varkor:E0588-provide-context, r=estebank

Detail transitive containment in E0588 diagnostic

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

4 years agoAuto merge of #66716 - derekdreery:debug_non_exhaustive, r=dtolnay
bors [Fri, 17 Jan 2020 00:20:48 +0000 (00:20 +0000)]
Auto merge of #66716 - derekdreery:debug_non_exhaustive, r=dtolnay

Implement `DebugStruct::non_exhaustive`.

This patch adds a function (finish_non_exhaustive) to add ellipsis before the closing brace when formatting using `DebugStruct`.

 ## Example

 ```rust
 #![feature(debug_non_exhaustive)]
 use std::fmt;

 struct Bar {
     bar: i32,
     hidden: f32,
 }

 impl fmt::Debug for Bar {
     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt.debug_struct("Bar")
            .field("bar", &self.bar)
            .non_exhaustive(true) // Show that some other field(s) exist.
            .finish()
     }
 }

 assert_eq!(
     format!("{:?}", Bar { bar: 10, hidden: 1.0 }),
     "Bar { bar: 10, .. }",
 );
 ```

4 years agoAuto merge of #68287 - flip1995:clippyup, r=oli-obk
bors [Thu, 16 Jan 2020 20:59:57 +0000 (20:59 +0000)]
Auto merge of #68287 - flip1995:clippyup, r=oli-obk

Update Clippy

cc rust-lang/rust-clippy#5054

No issue were opened for this.

r? @Manishearth

4 years agoRust ./x.py fmt
Richard Dodd [Thu, 16 Jan 2020 20:11:16 +0000 (20:11 +0000)]
Rust ./x.py fmt

4 years agoIgnore some tests on platforms without libstd spans
Vadim Petrochenkov [Thu, 16 Jan 2020 19:19:55 +0000 (22:19 +0300)]
Ignore some tests on platforms without libstd spans

4 years agoresolve: Say "import" when reporting private imports
Vadim Petrochenkov [Sun, 12 Jan 2020 13:20:57 +0000 (16:20 +0300)]
resolve: Say "import" when reporting private imports

4 years agoresolve: Point at the private item definitions in privacy errors
Vadim Petrochenkov [Sun, 12 Jan 2020 13:04:03 +0000 (16:04 +0300)]
resolve: Point at the private item definitions in privacy errors

4 years agoresolve: Move privacy error reporting into a separate method
Vadim Petrochenkov [Sun, 12 Jan 2020 10:29:00 +0000 (13:29 +0300)]
resolve: Move privacy error reporting into a separate method

Give named fields to `struct PrivacyError`
Move `fn report_ambiguity_error` to `diagnostics.rs`

4 years agoAuto merge of #68286 - Dylan-DPC:rollup-x7ssgov, r=Dylan-DPC
bors [Thu, 16 Jan 2020 17:43:19 +0000 (17:43 +0000)]
Auto merge of #68286 - Dylan-DPC:rollup-x7ssgov, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #68033 (Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC)
 - #68244 (Enable leak sanitizer test case)
 - #68255 (Remove unused auxiliary file that was replaced with rust_test_helpers)
 - #68263 (rustdoc: HTML escape codeblocks which fail syntax highlighting)
 - #68274 (remove dead code)

Failed merges:

r? @ghost

4 years agoRollup merge of #68274 - matthiaskrgr:dead_code, r=Dylan-DPC
Dylan DPC [Thu, 16 Jan 2020 15:23:32 +0000 (20:53 +0530)]
Rollup merge of #68274 - matthiaskrgr:dead_code, r=Dylan-DPC

remove dead code

The condition
`if obligation.recursion_depth >= 0`
is always true since `recursion_depth` is `usize`.

The else branch is dead code and can be removed.

Found by Clippy.

Fixes #68251

4 years agoRollup merge of #68263 - ollie27:rustdoc_invalid_syntax_highlight_escape, r=Guillaume...
Dylan DPC [Thu, 16 Jan 2020 15:23:30 +0000 (20:53 +0530)]
Rollup merge of #68263 - ollie27:rustdoc_invalid_syntax_highlight_escape, r=GuillaumeGomez

rustdoc: HTML escape codeblocks which fail syntax highlighting

r? @GuillaumeGomez

4 years agoRollup merge of #68255 - tmiasko:unused-aux, r=Dylan-DPC
Dylan DPC [Thu, 16 Jan 2020 15:23:29 +0000 (20:53 +0530)]
Rollup merge of #68255 - tmiasko:unused-aux, r=Dylan-DPC

Remove unused auxiliary file that was replaced with rust_test_helpers

4 years agoRollup merge of #68244 - tmiasko:leak, r=Centril
Dylan DPC [Thu, 16 Jan 2020 15:23:27 +0000 (20:53 +0530)]
Rollup merge of #68244 - tmiasko:leak, r=Centril

Enable leak sanitizer test case

* Use `black_box` to avoid memory leak removal during optimization.
* Leak multiple objects to make test case more robust.

4 years agoRollup merge of #68033 - ollie27:win_f32, r=dtolnay
Dylan DPC [Thu, 16 Jan 2020 15:23:26 +0000 (20:53 +0530)]
Rollup merge of #68033 - ollie27:win_f32, r=dtolnay

Don't use f64 shims for f32 cmath functions on non 32-bit x86 MSVC

These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.

4 years agoUpdate Clippy
flip1995 [Thu, 16 Jan 2020 15:07:54 +0000 (16:07 +0100)]
Update Clippy

4 years agoAuto merge of #68258 - RalfJung:miri, r=RalfJung
bors [Thu, 16 Jan 2020 14:16:54 +0000 (14:16 +0000)]
Auto merge of #68258 - RalfJung:miri, r=RalfJung

update miri

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

r? @ghost Cc @oli-obk

4 years agoremove dead code
Matthias Krüger [Thu, 16 Jan 2020 07:27:41 +0000 (08:27 +0100)]
remove dead code

The condition
if obligation.recursion_depth >= 0
is always true since recursion_depth is usize.

The else branch is dead code and can be removed.

Found by Clippy.

Fixes #68251

4 years agoAuto merge of #68272 - Dylan-DPC:rollup-vrb90gu, r=Dylan-DPC
bors [Thu, 16 Jan 2020 07:20:52 +0000 (07:20 +0000)]
Auto merge of #68272 - Dylan-DPC:rollup-vrb90gu, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #67780 (Move some queries from rustc::ty to librustc_ty.)
 - #68096 (Clean up some diagnostics by making them more consistent)
 - #68223 (Use 3.6 instead of 3.5 in float fract() documentation)
 - #68265 (Fix some issue numbers of unstable features)
 - #68266 (Changed docs for f32 and f64.)

Failed merges:

 - #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`)

r? @ghost

4 years agoRollup merge of #68266 - Stromberg90:patch-2, r=Dylan-DPC
Dylan DPC [Thu, 16 Jan 2020 06:28:07 +0000 (11:58 +0530)]
Rollup merge of #68266 - Stromberg90:patch-2, r=Dylan-DPC

Changed docs for f32 and f64.

4 years agoRollup merge of #68265 - JohnTitor:fix-issue-number, r=Dylan-DPC
Dylan DPC [Thu, 16 Jan 2020 06:28:05 +0000 (11:58 +0530)]
Rollup merge of #68265 - JohnTitor:fix-issue-number, r=Dylan-DPC

Fix some issue numbers of unstable features

Looking into the unstable book, some issue numbers are outdated.

4 years agoRollup merge of #68223 - SOF3:float-fract-doc, r=varkor
Dylan DPC [Thu, 16 Jan 2020 06:28:04 +0000 (11:58 +0530)]
Rollup merge of #68223 - SOF3:float-fract-doc, r=varkor

Use 3.6 instead of 3.5 in float fract() documentation

It is not self-explanatory whether the fract() function inverts the fractional part of negative numbers. This change clarifies this possible question (so that it is `.6` not `.4`)

4 years agoRollup merge of #68096 - varkor:diagnostic-cleanup, r=Centril
Dylan DPC [Thu, 16 Jan 2020 06:28:02 +0000 (11:58 +0530)]
Rollup merge of #68096 - varkor:diagnostic-cleanup, r=Centril

Clean up some diagnostics by making them more consistent

In general:

- Diagnostic should start with a lowercase letter.
- Diagnostics should not end with a full stop.
- Ellipses contain three dots.
- Backticks should encode Rust code.

I also reworded a couple of messages to make them read more clearly.

It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics.

r? @Centril

4 years agoRollup merge of #67780 - cjgillot:passes-ty, r=Zoxc
Dylan DPC [Thu, 16 Jan 2020 06:28:00 +0000 (11:58 +0530)]
Rollup merge of #67780 - cjgillot:passes-ty, r=Zoxc

Move some queries from rustc::ty to librustc_ty.

cc #65031

4 years agoFix issue number of `infer_static_outlives_requirements`
Yuki Okushi [Thu, 16 Jan 2020 02:59:04 +0000 (11:59 +0900)]
Fix issue number of `infer_static_outlives_requirements`

4 years agoFix issue number of `repr128`
Yuki Okushi [Thu, 16 Jan 2020 02:58:28 +0000 (11:58 +0900)]
Fix issue number of `repr128`

4 years agoUpdate f32.rs
Strømberg [Thu, 16 Jan 2020 02:35:31 +0000 (03:35 +0100)]
Update f32.rs

4 years agoUpdate f64.rs
Strømberg [Thu, 16 Jan 2020 02:34:23 +0000 (03:34 +0100)]
Update f64.rs

4 years agoUpdate f32.rs
Strømberg [Thu, 16 Jan 2020 02:30:27 +0000 (03:30 +0100)]
Update f32.rs

4 years agoFix issue number of `member_constraints`
Yuki Okushi [Thu, 16 Jan 2020 01:55:29 +0000 (10:55 +0900)]
Fix issue number of `member_constraints`

4 years agoAuto merge of #67339 - CAD97:rc-provenance, r=sfackler
bors [Thu, 16 Jan 2020 00:47:45 +0000 (00:47 +0000)]
Auto merge of #67339 - CAD97:rc-provenance, r=sfackler

Use pointer offset instead of deref for A/Rc::into_raw

Internals thread: https://internals.rust-lang.org/t/rc-and-internal-mutability/11463/2?u=cad97

The current implementation of (`A`)`Rc::into_raw` uses the `Deref::deref` implementation to get the pointer-to-data that is returned. This is problematic in the proposed Stacked Borrow rules, as this only gets shared provenance over the data location. (Note that the strong/weak counts are `UnsafeCell` (`Cell`/`Atomic`) so shared provenance can still mutate them, but the data itself is not.) When promoted back to a real reference counted pointer, the restored pointer can be used for mutation through `::get_mut` (if it is the only surviving reference). However, this mutates through a pointer ultimately derived from a `&T` borrow, violating the Stacked Borrow rules.

There are three known potential solutions to this issue:

- Stacked Borrows is wrong, liballoc is correct.
- Fully admit (`A`)`Rc` as an "internal mutability" type and store the data payload in an `UnsafeCell` like the strong/weak counts are. (Note: this is not needed generally since the `RcBox`/`ArcInner` is stored behind a shared `NonNull` which maintains shared write provenance as a raw pointer.)
- Adjust `into_raw` to do direct manipulation of the pointer (like `from_raw`) so that it maintains write provenance and doesn't derive the pointer from a reference.

This PR implements the third option, as recommended by @RalfJung.

Potential future work: provide `as_raw` and `clone_raw` associated functions to allow the [`&T` -> (`A`)`Rc<T>` pattern](https://internals.rust-lang.org/t/rc-and-internal-mutability/11463/2?u=cad97) to be used soundly without creating (`A`)`Rc` from references.

4 years agorustdoc: HTML escape codeblocks which fail syntax highlighting
Oliver Middleton [Wed, 15 Jan 2020 22:42:04 +0000 (22:42 +0000)]
rustdoc: HTML escape codeblocks which fail syntax highlighting

4 years agoAuto merge of #68254 - Dylan-DPC:rollup-9vhc59u, r=Dylan-DPC
bors [Wed, 15 Jan 2020 19:40:45 +0000 (19:40 +0000)]
Auto merge of #68254 - Dylan-DPC:rollup-9vhc59u, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #68123 (Implement Cursor for linked lists. (RFC 2570).)
 - #68212 (Suggest to shorten temporary lifetime during method call inside generator)
 - #68232 (Optimize size/speed of Unicode datasets)
 - #68236 (Add some regression tests)
 - #68237 (Account for `Path`s in `is_suggestable_infer_ty`)
 - #68252 (remove redundant clones, found by clippy)

Failed merges:

r? @ghost

4 years agoupdate miri
Ralf Jung [Wed, 15 Jan 2020 19:03:22 +0000 (20:03 +0100)]
update miri

4 years agoUse 3.6 instead of 3.5 in float fract() documentation
SOFe [Tue, 14 Jan 2020 18:07:39 +0000 (02:07 +0800)]
Use 3.6 instead of 3.5 in float fract() documentation

It is not self-explanatory whether the fract() function inverts the fractional part of negative numbers.

Co-Authored-By: Mateusz Mikuła <mati865@users.noreply.github.com>
4 years agoEnable leak sanitizer test case
Tomasz Miąsko [Wed, 15 Jan 2020 00:00:00 +0000 (00:00 +0000)]
Enable leak sanitizer test case

* Use `black_box` to avoid memory leak removal during optimization.
* Leak multiple objects to make test case more robust.

4 years agoRemove unused auxiliary file that was replaced with rust_test_helpers
Tomasz Miąsko [Wed, 15 Jan 2020 00:00:00 +0000 (00:00 +0000)]
Remove unused auxiliary file that was replaced with rust_test_helpers

4 years agoRollup merge of #68252 - matthiaskrgr:redundant_clones, r=oli-obk
Dylan DPC [Wed, 15 Jan 2020 17:19:32 +0000 (22:49 +0530)]
Rollup merge of #68252 - matthiaskrgr:redundant_clones, r=oli-obk

remove redundant clones, found by clippy

4 years agoRollup merge of #68237 - estebank:bad-bad-ice, r=petrochenkov
Dylan DPC [Wed, 15 Jan 2020 17:19:30 +0000 (22:49 +0530)]
Rollup merge of #68237 - estebank:bad-bad-ice, r=petrochenkov

Account for `Path`s in `is_suggestable_infer_ty`

Fix #68162.

4 years agoRollup merge of #68236 - JohnTitor:ice-tests, r=Centril
Dylan DPC [Wed, 15 Jan 2020 17:19:28 +0000 (22:49 +0530)]
Rollup merge of #68236 - JohnTitor:ice-tests, r=Centril

Add some regression tests

Closes #64848 (fixed by #67631)
Closes #65918 (ICE is hidden by #67000, no longer ICE)
Closes #66473 (fixed by #68084)
Closes #67550 (set mir-opt-level to 3)

r? @Centril

4 years agoRollup merge of #68232 - Mark-Simulacrum:unicode-tables, r=joshtriplett
Dylan DPC [Wed, 15 Jan 2020 17:19:27 +0000 (22:49 +0530)]
Rollup merge of #68232 - Mark-Simulacrum:unicode-tables, r=joshtriplett

Optimize size/speed of Unicode datasets

The overall implementation has the same general idea as the prior approach,
which was based on a compressed trie structure, but modified to use less space
(and, coincidentally, be an overall performance improvement).

Sizes | Old | New | New/current
-- | -- | -- | --
Alphabetic | 4616 | 2982 | 64.60%
Case_Ignorable | 3144 | 2112 | 67.18%
Cased | 2376 | 934 | 39.31%
Cc | 19 | 43 | 226.32%
Grapheme_Extend | 3072 | 1734 | 56.45%
Lowercase | 2328 | 985 | 42.31%
N | 2648 | 1239 | 46.79%
Uppercase | 1978 | 934 | 47.22%
White_Space | 241 | 140 | 58.09%
  |   |   |
Total | 20422 | 11103 | 54.37%

This table shows the size of the old and new tables in bytes. The most important
of these tables is "Grapheme_Extend", as it is present in essentially all Rust
programs due to being called from `str`'s Debug impl (`char::escape_debug`). In
a representative case given by this [blog post] for the embedded world, the
shrinking in this PR shrinks the final binary by 1,604 bytes, from 14,440 to
12,836.

The performance of these new tables, based on the (rough) benchmark of linearly
scanning the entire valid set of chars, querying for each `is_*`, is roughly
~50% better, though in some cases is either on par or slightly (3-5%) worse. In
practice, I believe the size benefits of this PR are the main concern. The new
implementation has been tested to be equivalent to the current nightly in terms
of returned values on the set of valid chars.

A (relatively) high-level explanation of the specific compression scheme used
can be found [in the generator].

This is split into three commits -- the first adds the generator which produces
the Rust code for the tables, the second adds support code for the lookup, and
the third actually swaps the current implementation out for the new one.

[blog post]: https://jamesmunns.com/blog/fmt-unreasonably-expensive/
[in the generator]: https://github.com/Mark-Simulacrum/rust/blob/unicode-tables/src/tools/unicode-table-generator/src/raw_emitter.rs

4 years agoRollup merge of #68212 - csmoe:temp, r=estebank
Dylan DPC [Wed, 15 Jan 2020 17:19:26 +0000 (22:49 +0530)]
Rollup merge of #68212 - csmoe:temp, r=estebank

Suggest to shorten temporary lifetime during method call inside generator

Closes https://github.com/rust-lang/rust/issues/67376
![image](https://user-images.githubusercontent.com/35686186/72364752-f6b1e400-3731-11ea-8ec9-8297ba4c6c77.png)

r? @estebank
cc @tmandry @nikomatsakis

4 years agoRollup merge of #68123 - crlf0710:linked_list_cursor, r=Amanieu
Dylan DPC [Wed, 15 Jan 2020 17:19:24 +0000 (22:49 +0530)]
Rollup merge of #68123 - crlf0710:linked_list_cursor, r=Amanieu

Implement Cursor for linked lists. (RFC 2570).

cc. #58533 cc. @Gankra

r? @Amanieu

4 years agoAuto merge of #67603 - oli-obk:no_mut_static_ref_from_const, r=RalfJung
bors [Wed, 15 Jan 2020 16:28:06 +0000 (16:28 +0000)]
Auto merge of #67603 - oli-obk:no_mut_static_ref_from_const, r=RalfJung

Promoteds can contain raw pointers, but these must still only point to immutable allocations

fixes #67601

r? @RalfJung

cc @wesleywiser in order to not change behaviour in this PR, const prop uses the constant rules for interning, but at least there's an explicit mode for it now that we can think about this in the future

4 years agoSet mir-opt-level to 3 to prevent regressions
Yuki Okushi [Tue, 14 Jan 2020 23:35:44 +0000 (08:35 +0900)]
Set mir-opt-level to 3 to prevent regressions

4 years agoAdd test for issue-66473
Yuki Okushi [Tue, 14 Jan 2020 23:34:51 +0000 (08:34 +0900)]
Add test for issue-66473

4 years agoAdd test for issue-65918
Yuki Okushi [Tue, 14 Jan 2020 23:34:33 +0000 (08:34 +0900)]
Add test for issue-65918

4 years agoAdd test for issue-64848
Yuki Okushi [Tue, 14 Jan 2020 23:34:20 +0000 (08:34 +0900)]
Add test for issue-64848

4 years agoremove redundant clones, found by clippy
Matthias Krüger [Wed, 15 Jan 2020 14:00:25 +0000 (15:00 +0100)]
remove redundant clones, found by clippy

4 years agoAuto merge of #68248 - JohnTitor:rollup-x0kml5f, r=JohnTitor
bors [Wed, 15 Jan 2020 13:00:43 +0000 (13:00 +0000)]
Auto merge of #68248 - JohnTitor:rollup-x0kml5f, r=JohnTitor

Rollup of 12 pull requests

Successful merges:

 - #67784 (Reset Formatter flags on exit from pad_integral)
 - #67914 (Don't run const propagation on items with inconsistent bounds)
 - #68141 (use winapi for non-stdlib Windows bindings)
 - #68211 (Add failing example for E0170 explanation)
 - #68219 (Untangle ZST validation from integer validation and generalize it to all zsts)
 - #68222 (Update the wasi-libc bundled with libstd)
 - #68226 (Avoid calling tcx.hir().get() on CRATE_HIR_ID)
 - #68227 (Update to a version of cmake with windows arm64 support)
 - #68229 (Update iovec to a version with no winapi dependency)
 - #68230 (Update libssh2-sys to a version that can build for aarch64-pc-windows…)
 - #68231 (Better support for cross compilation on Windows.)
 - #68233 (Update compiler_builtins with changes to fix 128 bit integer remainder for aarch64 windows.)

Failed merges:

r? @ghost

4 years agoRollup merge of #68233 - danielframpton:update-compiler-builtins, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:59 +0000 (21:51 +0900)]
Rollup merge of #68233 - danielframpton:update-compiler-builtins, r=alexcrichton

Update compiler_builtins with changes to fix 128 bit integer remainder for aarch64 windows.

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68231 - danielframpton:windows-crosscompile, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:58 +0000 (21:51 +0900)]
Rollup merge of #68231 - danielframpton:windows-crosscompile, r=alexcrichton

Better support for cross compilation on Windows.

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

Without the libpath changes we were trying to link a mix of amd64 and arm64 binaries.

Without the cmake system name change, the llvm build was trying to run an arm64 build tool on the x86_64 build machine.

That said, I haven't tested all different combinations here and am very open to resolving this a different way.

4 years agoRollup merge of #68230 - danielframpton:update-libssh2-sys, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:57 +0000 (21:51 +0900)]
Rollup merge of #68230 - danielframpton:update-libssh2-sys, r=alexcrichton

Update libssh2-sys to a version that can build for aarch64-pc-windows…

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68229 - danielframpton:update-iovec, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:55 +0000 (21:51 +0900)]
Rollup merge of #68229 - danielframpton:update-iovec, r=alexcrichton

Update iovec to a version with no winapi dependency

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68227 - danielframpton:update-cmake, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:54 +0000 (21:51 +0900)]
Rollup merge of #68227 - danielframpton:update-cmake, r=alexcrichton

Update to a version of cmake with windows arm64 support

I have been investigating enabling panic=unwind for aarch64-pc-windows-msvc (see #65313) and building rustc and cargo hosted on aarch64-pc-windows-msvc.

4 years agoRollup merge of #68226 - Aaron1011:fix/opaque-trace, r=matthewjasper
Yuki Okushi [Wed, 15 Jan 2020 12:51:52 +0000 (21:51 +0900)]
Rollup merge of #68226 - Aaron1011:fix/opaque-trace, r=matthewjasper

Avoid calling tcx.hir().get() on CRATE_HIR_ID

This was causing an ICE when enabling trace logging for an unrelated
module, since the arguments to `trace!` ended up getting evaluated

4 years agoRollup merge of #68222 - alexcrichton:update-wasi-libc, r=kennytm
Yuki Okushi [Wed, 15 Jan 2020 12:51:51 +0000 (21:51 +0900)]
Rollup merge of #68222 - alexcrichton:update-wasi-libc, r=kennytm

Update the wasi-libc bundled with libstd

4 years agoRollup merge of #68219 - oli-obk:fix_miri, r=RalfJung,wesleywiser
Yuki Okushi [Wed, 15 Jan 2020 12:51:50 +0000 (21:51 +0900)]
Rollup merge of #68219 - oli-obk:fix_miri, r=RalfJung,wesleywiser

Untangle ZST validation from integer validation and generalize it to all zsts

cc @RalfJung

r? @wesleywiser

4 years agoRollup merge of #68211 - GuillaumeGomez:add-failing-example-e0170, r=Dylan-DPC
Yuki Okushi [Wed, 15 Jan 2020 12:51:48 +0000 (21:51 +0900)]
Rollup merge of #68211 - GuillaumeGomez:add-failing-example-e0170, r=Dylan-DPC

Add failing example for E0170 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichton
Yuki Okushi [Wed, 15 Jan 2020 12:51:45 +0000 (21:51 +0900)]
Rollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichton

use winapi for non-stdlib Windows bindings

4 years agoRollup merge of #67914 - Aaron1011:fix/const-prop-impossible, r=matthewjasper,oli-obk
Yuki Okushi [Wed, 15 Jan 2020 12:51:43 +0000 (21:51 +0900)]
Rollup merge of #67914 - Aaron1011:fix/const-prop-impossible, r=matthewjasper,oli-obk

Don't run const propagation on items with inconsistent bounds

Fixes #67696

Using `#![feature(trivial_bounds)]`, it's possible to write functions
with unsatisfiable 'where' clauses, making them uncallable. However, the
user can act as if these 'where' clauses are true inside the body of the
function, leading to code that would normally be impossible to write.

Since const propgation can run even without any user-written calls to a
function, we need to explcitly check for these uncallable functions.

4 years agoRollup merge of #67784 - Mark-Simulacrum:residual-pad-integral, r=dtolnay
Yuki Okushi [Wed, 15 Jan 2020 12:51:42 +0000 (21:51 +0900)]
Rollup merge of #67784 - Mark-Simulacrum:residual-pad-integral, r=dtolnay

Reset Formatter flags on exit from pad_integral

This fixes a bug where after calling pad_integral with appropriate flags, the
fill and alignment flags would be set to '0' and 'Right' and left as such even
after exiting pad_integral, which meant that future calls on the same Formatter
would get incorrect flags reported.

This is quite difficult to observe in practice, as almost all formatting
implementations in practice don't call `Display::fmt` directly, but rather use
`write!` or a similar macro, which means that they cannot observe the effects of
the wrong flags (as `write!` creates a fresh Formatter instance). However, we
include a test case.

A manual check leads me to believe this is the only case where we failed to reset the flags appropriately, but I could have missed something.

4 years agoAddress review comments
Oliver Scherer [Wed, 15 Jan 2020 10:36:06 +0000 (11:36 +0100)]
Address review comments

4 years agoTypo
Oliver Scherer [Wed, 15 Jan 2020 10:33:49 +0000 (11:33 +0100)]
Typo

4 years agoUndo a change not neceesary for this bugfix
Oliver Scherer [Sat, 11 Jan 2020 14:01:58 +0000 (15:01 +0100)]
Undo a change not neceesary for this bugfix

4 years agoUpdate src/librustc_mir/interpret/intern.rs
Oliver Scherer [Sat, 11 Jan 2020 13:45:00 +0000 (14:45 +0100)]
Update src/librustc_mir/interpret/intern.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoClean up comment
Oliver Scherer [Thu, 9 Jan 2020 16:14:54 +0000 (17:14 +0100)]
Clean up comment

4 years agoElaborate on the details in some comments
Oliver Scherer [Wed, 8 Jan 2020 09:16:47 +0000 (10:16 +0100)]
Elaborate on the details in some comments

4 years agoElaborate on comments
Oliver Scherer [Wed, 25 Dec 2019 23:30:02 +0000 (00:30 +0100)]
Elaborate on comments

4 years agoPromoteds can contain raw pointers, but these must still only point to immutable...
Oliver Scherer [Wed, 25 Dec 2019 12:58:02 +0000 (13:58 +0100)]
Promoteds can contain raw pointers, but these must still only point to immutable allocations

4 years agoAuto merge of #68221 - ehuss:update-cargo-rls, r=alexcrichton
bors [Wed, 15 Jan 2020 09:34:49 +0000 (09:34 +0000)]
Auto merge of #68221 - ehuss:update-cargo-rls, r=alexcrichton

Update cargo rls

## cargo

12 commits in 6e1ca924a67dd1ac89c33f294ef26b5c43b89168..ad3dbe10e1e654fb1f032a5dd9481d7cbaa00d65
2020-01-06 19:11:37 +0000 to 2020-01-13 21:37:15 +0000
- Add named config profiles. (rust-lang/cargo#7750)
- Make cargo-rustc crate-type-aware (rust-lang/cargo#7755)
- Rename `Kind` (rust-lang/cargo#7791)
- Update bash completion (rust-lang/cargo#7789)
- Add another curl spurious network error (rust-lang/cargo#7788)
- Some small tweaks around error in configuration (rust-lang/cargo#7783)
- Fix tests with `url` crate update (rust-lang/cargo#7787)
- Fix .gitignore of Cargo.lock in a subdirectory. (rust-lang/cargo#7779)
- Bump crates-io (rust-lang/cargo#7778)
- Migrate from the `failure` crate to `anyhow` (rust-lang/cargo#7776)
- Fix several needless_borrow clippy lints. (rust-lang/cargo#7771)
- Fix some links (rust-lang/cargo#7770)

## rls

2 commits in 7c0489c5ff4f5c594e65a3b22efd9ce373deab9b..b27e1173969639448cd2e486b1c5f0fcb1b3b17c
2020-01-04 20:15:37 +0100 to 2020-01-13 11:40:20 +0100
- Update Cargo (rust-lang-nursery/rls#1613)
- Rustup to rust-lang/rust#68024 (rust-lang-nursery/rls#1612)

4 years agoAdd tests
Oliver Scherer [Wed, 15 Jan 2020 09:30:26 +0000 (10:30 +0100)]
Add tests

4 years agowrap expr id into GeneratorInteriorTypeCause
csmoe [Wed, 15 Jan 2020 07:13:51 +0000 (15:13 +0800)]
wrap expr id into GeneratorInteriorTypeCause

4 years agoUpdate E0170.md
Dylan DPC [Wed, 15 Jan 2020 06:22:21 +0000 (11:52 +0530)]
Update E0170.md

4 years agoAuto merge of #66329 - ktrianta:mir-opt-unreachable-propagation, r=oli-obk
bors [Wed, 15 Jan 2020 05:01:10 +0000 (05:01 +0000)]
Auto merge of #66329 - ktrianta:mir-opt-unreachable-propagation, r=oli-obk

Add unreachable propagation mir optimization pass

@oli-obk suggested we create a MIR pass that optimizes away basic blocks that lead only to basic blocks with terminator kind **unreachable**. This is a first take on this, which we started with @gilescope at RustFest Impl Days.

The test currently fails when the compiled program runs (undefined behaviour). Is there a way to avoid running the compiled program?

4 years agoAuto merge of #68118 - skinny121:eager_lit_eval, r=varkor
bors [Wed, 15 Jan 2020 00:56:53 +0000 (00:56 +0000)]
Auto merge of #68118 - skinny121:eager_lit_eval, r=varkor

perf: Eagerly convert literals to consts

Previousely even literal constants were being converted to an `Unevaluted` constant for evaluation later. This seems unecessary as no more information is needed to be able to convert the literal to a mir constant.

Hopefully this will also minimise the performance impact of #67717, as far less constant evaluations are needed.

4 years agoAccount for `Path`s on `is_suggestable_infer_ty`
Esteban Küber [Wed, 15 Jan 2020 00:18:21 +0000 (16:18 -0800)]
Account for `Path`s on `is_suggestable_infer_ty`

Fix #68162.

4 years agoReplace old tables with new unicode data
Mark Rousskov [Mon, 13 Jan 2020 21:59:33 +0000 (16:59 -0500)]
Replace old tables with new unicode data

4 years agoAdd support code for new unicode_data module
Mark Rousskov [Mon, 13 Jan 2020 21:58:50 +0000 (16:58 -0500)]
Add support code for new unicode_data module

4 years agoAdd unicode table generator
Mark Rousskov [Mon, 13 Jan 2020 21:40:19 +0000 (16:40 -0500)]
Add unicode table generator

4 years agoAvoid calling tcx.hir().get() on CRATE_HIR_ID
Aaron Hill [Tue, 14 Jan 2020 19:26:35 +0000 (14:26 -0500)]
Avoid calling tcx.hir().get() on CRATE_HIR_ID

This was causing an ICE when enabling trace logging for an unrelated
module, since the arguments to `trace!` ended up getting evaluated

4 years agoUpdate to a version of compiler_builtins with changes for fixes remainder for aarch64...
Daniel Frampton [Tue, 14 Jan 2020 21:32:26 +0000 (13:32 -0800)]
Update to a version of compiler_builtins with changes for fixes remainder for aarch64 windows

4 years agoBetter support for cross compilation on Windows.
Daniel Frampton [Fri, 10 Jan 2020 17:11:32 +0000 (09:11 -0800)]
Better support for cross compilation on Windows.

4 years agoUpdate to a version of cmake with windows arm64 support
Daniel Frampton [Tue, 14 Jan 2020 19:56:51 +0000 (11:56 -0800)]
Update to a version of cmake with windows arm64 support

4 years agoUpdate iovec to a version with no winapi dependency
Daniel Frampton [Tue, 14 Jan 2020 19:52:46 +0000 (11:52 -0800)]
Update iovec to a version with no winapi dependency

4 years agoUpdate libssh2-sys to a version that can build for aarch64-pc-windows-msvc
Daniel Frampton [Tue, 14 Jan 2020 19:26:03 +0000 (11:26 -0800)]
Update libssh2-sys to a version that can build for aarch64-pc-windows-msvc

4 years agoUpdate the wasi-libc bundled with libstd
Alex Crichton [Tue, 14 Jan 2020 17:59:46 +0000 (09:59 -0800)]
Update the wasi-libc bundled with libstd

4 years agoFix normalizing 32bit symbol hash.
Ben Lewis [Tue, 14 Jan 2020 17:59:26 +0000 (06:59 +1300)]
Fix normalizing 32bit symbol hash.

4 years agoUpdate rustfix in compiletest.
Eric Huss [Tue, 14 Jan 2020 17:50:55 +0000 (09:50 -0800)]
Update rustfix in compiletest.

4 years agoUpdate cargo, rls
Eric Huss [Tue, 14 Jan 2020 17:47:04 +0000 (09:47 -0800)]
Update cargo, rls

4 years agoImplement `finish_non_exhaustive` for `DebugStruct`.
Richard Dodd [Sun, 24 Nov 2019 20:44:19 +0000 (20:44 +0000)]
Implement `finish_non_exhaustive` for `DebugStruct`.

4 years agoupdate async-await send/sync test
csmoe [Tue, 14 Jan 2020 13:22:43 +0000 (21:22 +0800)]
update async-await send/sync test

4 years agoUntangle ZST validation from integer validation and generalize it to all zsts
Oliver Scherer [Mon, 13 Jan 2020 16:58:37 +0000 (17:58 +0100)]
Untangle ZST validation from integer validation and generalize it to all zsts

4 years agoAuto merge of #67711 - Amanieu:fix_unwind_leak, r=alexcrichton
bors [Tue, 14 Jan 2020 15:29:43 +0000 (15:29 +0000)]
Auto merge of #67711 - Amanieu:fix_unwind_leak, r=alexcrichton

Fix memory leak if C++ catches a Rust panic and discards it

If C++ catches a Rust panic using `catch (...)` and then chooses not to rethrow it, the `Box<dyn Any>` in the exception may be leaked. This PR fixes this by adding the necessary destructors to the exception object.

r? @Mark-Simulacrum

4 years agosuggest to limit lifetime of temporary borrow with let
csmoe [Tue, 14 Jan 2020 13:22:19 +0000 (21:22 +0800)]
suggest to limit lifetime of temporary borrow with let

4 years agorecord generoator interior exprs in typecktable
csmoe [Tue, 14 Jan 2020 13:21:14 +0000 (21:21 +0800)]
record generoator interior exprs in typecktable

4 years agoAdd failing example for E0170 explanation
Guillaume Gomez [Tue, 14 Jan 2020 13:04:03 +0000 (14:04 +0100)]
Add failing example for E0170 explanation

4 years agoUpdate APIs according to RFC change suggestions.
Charles Lew [Tue, 14 Jan 2020 12:02:27 +0000 (20:02 +0800)]
Update APIs according to RFC change suggestions.

4 years agoAuto merge of #67076 - mbrubeck:condvar, r=dtolnay
bors [Tue, 14 Jan 2020 10:34:43 +0000 (10:34 +0000)]
Auto merge of #67076 - mbrubeck:condvar, r=dtolnay

Stabilize Condvar::wait_while and wait_timeout_while (previously wait_until, wait_timeout_until)

Closes #47960.

4 years agoNormalize symbol hash in ui test for legacy symbol mangling, as it's dependent on the
Ben Lewis [Tue, 14 Jan 2020 07:41:14 +0000 (20:41 +1300)]
Normalize symbol hash in ui test for legacy symbol mangling, as it's dependent on the
number of bits within consts.