about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-01-17Auto merge of #67731 - matthewjasper:drop-in-place-reclimit, r=eddybbors-13/+24
Handle recursive instantiation of drop shims The compiler used to hang because the recursion limit was never hit.
2020-01-17Auto merge of #66716 - derekdreery:debug_non_exhaustive, r=dtolnaybors-0/+142
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, .. }", ); ```
2020-01-16Auto merge of #68287 - flip1995:clippyup, r=oli-obkbors-9/+7
Update Clippy cc rust-lang/rust-clippy#5054 No issue were opened for this. r? @Manishearth
2020-01-16Rust ./x.py fmtRichard Dodd-12/+14
2020-01-16Auto merge of #68286 - Dylan-DPC:rollup-x7ssgov, r=Dylan-DPCbors-80/+38
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
2020-01-16Rollup merge of #68274 - matthiaskrgr:dead_code, r=Dylan-DPCDylan DPC-10/+6
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
2020-01-16Rollup merge of #68263 - ollie27:rustdoc_invalid_syntax_highlight_escape, ↵Dylan DPC-1/+9
r=GuillaumeGomez rustdoc: HTML escape codeblocks which fail syntax highlighting r? @GuillaumeGomez
2020-01-16Rollup merge of #68255 - tmiasko:unused-aux, r=Dylan-DPCDylan DPC-5/+0
Remove unused auxiliary file that was replaced with rust_test_helpers
2020-01-16Rollup merge of #68244 - tmiasko:leak, r=CentrilDylan DPC-7/+10
Enable leak sanitizer test case * Use `black_box` to avoid memory leak removal during optimization. * Leak multiple objects to make test case more robust.
2020-01-16Rollup merge of #68033 - ollie27:win_f32, r=dtolnayDylan DPC-57/+13
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.
2020-01-16Update Clippyflip1995-9/+7
2020-01-16Auto merge of #68258 - RalfJung:miri, r=RalfJungbors-8/+6
update miri Fixes https://github.com/rust-lang/rust/issues/68081 r? @ghost Cc @oli-obk
2020-01-16remove dead codeMatthias Krüger-10/+6
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
2020-01-16Rollup merge of #68266 - Stromberg90:patch-2, r=Dylan-DPCDylan DPC-4/+4
Changed docs for f32 and f64.
2020-01-16Rollup merge of #68265 - JohnTitor:fix-issue-number, r=Dylan-DPCDylan DPC-10/+10
Fix some issue numbers of unstable features Looking into the unstable book, some issue numbers are outdated.
2020-01-16Rollup merge of #68223 - SOF3:float-fract-doc, r=varkorDylan DPC-8/+8
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`)
2020-01-16Rollup merge of #68096 - varkor:diagnostic-cleanup, r=CentrilDylan DPC-292/+294
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
2020-01-16Rollup merge of #67780 - cjgillot:passes-ty, r=ZoxcDylan DPC-354/+414
Move some queries from rustc::ty to librustc_ty. cc #65031
2020-01-16Fix issue number of `infer_static_outlives_requirements`Yuki Okushi-2/+2
2020-01-16Fix issue number of `repr128`Yuki Okushi-5/+5
2020-01-16Update f32.rsStrømberg-1/+1
2020-01-16Update f64.rsStrømberg-2/+2
2020-01-16Update f32.rsStrømberg-1/+1
2020-01-16Fix issue number of `member_constraints`Yuki Okushi-3/+3
2020-01-16Auto merge of #67339 - CAD97:rc-provenance, r=sfacklerbors-4/+24
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.
2020-01-15rustdoc: HTML escape codeblocks which fail syntax highlightingOliver Middleton-1/+9
2020-01-15Auto merge of #68254 - Dylan-DPC:rollup-9vhc59u, r=Dylan-DPCbors-3286/+3884
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
2020-01-15update miriRalf Jung-8/+6
2020-01-15Use 3.6 instead of 3.5 in float fract() documentationSOFe-8/+8
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>
2020-01-15Enable leak sanitizer test caseTomasz Miąsko-7/+10
* Use `black_box` to avoid memory leak removal during optimization. * Leak multiple objects to make test case more robust.
2020-01-15Remove unused auxiliary file that was replaced with rust_test_helpersTomasz Miąsko-5/+0
2020-01-15Rollup merge of #68252 - matthiaskrgr:redundant_clones, r=oli-obkDylan DPC-7/+5
remove redundant clones, found by clippy
2020-01-15Rollup merge of #68237 - estebank:bad-bad-ice, r=petrochenkovDylan DPC-45/+86
Account for `Path`s in `is_suggestable_infer_ty` Fix #68162.
2020-01-15Rollup merge of #68236 - JohnTitor:ice-tests, r=CentrilDylan DPC-0/+79
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
2020-01-15Rollup merge of #68232 - Mark-Simulacrum:unicode-tables, r=joshtriplettDylan DPC-3194/+2947
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
2020-01-15Rollup merge of #68212 - csmoe:temp, r=estebankDylan DPC-16/+60
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
2020-01-15Rollup merge of #68123 - crlf0710:linked_list_cursor, r=AmanieuDylan DPC-24/+707
Implement Cursor for linked lists. (RFC 2570). cc. #58533 cc. @Gankra r? @Amanieu
2020-01-15Auto merge of #67603 - oli-obk:no_mut_static_ref_from_const, r=RalfJungbors-21/+55
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
2020-01-15Set mir-opt-level to 3 to prevent regressionsYuki Okushi-0/+1
2020-01-15Add test for issue-66473Yuki Okushi-0/+0
2020-01-15Add test for issue-65918Yuki Okushi-0/+49
2020-01-15Add test for issue-64848Yuki Okushi-0/+29
2020-01-15remove redundant clones, found by clippyMatthias Krüger-7/+5
2020-01-15Auto merge of #68248 - JohnTitor:rollup-x0kml5f, r=JohnTitorbors-301/+292
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
2020-01-15Rollup merge of #68231 - danielframpton:windows-crosscompile, r=alexcrichtonYuki Okushi-4/+8
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.
2020-01-15Rollup merge of #68226 - Aaron1011:fix/opaque-trace, r=matthewjasperYuki Okushi-1/+1
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
2020-01-15Rollup merge of #68222 - alexcrichton:update-wasi-libc, r=kennytmYuki Okushi-1/+1
Update the wasi-libc bundled with libstd
2020-01-15Rollup merge of #68219 - oli-obk:fix_miri, r=RalfJung,wesleywiserYuki Okushi-15/+37
Untangle ZST validation from integer validation and generalize it to all zsts cc @RalfJung r? @wesleywiser
2020-01-15Rollup merge of #68211 - GuillaumeGomez:add-failing-example-e0170, r=Dylan-DPCYuki Okushi-0/+21
Add failing example for E0170 explanation r? @Dylan-DPC
2020-01-15Rollup merge of #68141 - euclio:replace-bindings-with-winapi, r=alexcrichtonYuki Okushi-263/+88
use winapi for non-stdlib Windows bindings