Commit Graph

107527 Commits

Author SHA1 Message Date
Matthias Krüger
31b9764a14 docs: note that find(f) is equivalent to filter(f).next() in the iterator docs. 2020-02-27 15:08:21 +01:00
Matthias Krüger
b6f0567450 librustc_typeck: remove loop that never actually loops 2020-02-27 15:01:56 +01:00
Matthias Krüger
7c84ba1124 use char instead of &str for single char patterns 2020-02-27 14:57:22 +01:00
Matthias Krüger
896a081442 use find(x) instead of filter(x).next() 2020-02-27 14:50:54 +01:00
Ralf Jung
8d3b3063f6 avoid a negation in is_nonoverlapping 2020-02-27 09:45:32 +01:00
Ralf Jung
d1d0de94db disable debug assertion in ptr::write for now 2020-02-27 09:43:33 +01:00
bors
a8437cf213 Auto merge of #69507 - JohnTitor:rollup-jqf1gmw, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #69324 (Backport only: avoid ICE on bad placeholder type)
 - #69439 (resolve: `lifetimes.rs` -> `late/lifetimes.rs`)
 - #69473 (update llvm to silence gcc 9 warnings)
 - #69479 (clarify operator precedence)
 - #69480 (Clean up E0373 explanation)
 - #69500 (Simplify the signature of par_for_each_in)
 - #69505 (Enable setting diagnostic labels)

Failed merges:

r? @ghost
2020-02-27 08:29:24 +00:00
Yuki Okushi
c384acec29
Rollup merge of #69505 - Mark-Simulacrum:triagebot-diag-labels, r=Centril
Enable setting diagnostic labels
2020-02-27 14:38:11 +09:00
Yuki Okushi
7824a9d47d
Rollup merge of #69500 - cuviper:par_for_each_in-item, r=Mark-Simulacrum
Simplify the signature of par_for_each_in

Given `T: IntoIterator`/`IntoParallelIterator`, `T::Item` is
unambiguous, so we don't need the explicit trait casting.
2020-02-27 14:38:09 +09:00
Yuki Okushi
6e66bfd4cc
Rollup merge of #69480 - GuillaumeGomez:clean-up-e0373, r=Dylan-DPC
Clean up E0373 explanation

r? @Dylan-DPC
2020-02-27 14:38:08 +09:00
Yuki Okushi
d4700a83ce
Rollup merge of #69479 - matthiaskrgr:op_pred, r=Dylan-DPC
clarify operator precedence
2020-02-27 14:38:06 +09:00
Yuki Okushi
4cc0295be5
Rollup merge of #69473 - contrun:update-llvm, r=nikomatsakis
update llvm to silence gcc 9 warnings

Closes https://github.com/rust-lang/rust/issues/69078
2020-02-27 14:38:05 +09:00
Yuki Okushi
0d66c7c34c
Rollup merge of #69439 - petrochenkov:latelife, r=matthewjasper
resolve: `lifetimes.rs` -> `late/lifetimes.rs`

Lifetime resolution should ideally be merged into the late resolution pass, at least for named lifetimes.
Let's move it closer to it for a start.
2020-02-27 14:38:03 +09:00
Yuki Okushi
add9338673
Rollup merge of #69324 - estebank:ice-break-backport-bad-placeholder-type, r=Centril
Backport only: avoid ICE on bad placeholder type

 #69148 has a proper fix, but it is too big to backport.
This change avoids the ICE by actually emitting an appropriate error. The
output will be duplicated in some cases, but that's better than the
avoidable ICE.

r? @Centril
2020-02-27 14:38:02 +09:00
bors
d28560e660 Auto merge of #67332 - matthewjasper:drop-in-place-cgus, r=michaelwoerister
Don't instantiate so many copies of drop_in_place

Split out from #66703.

r? @ghost
2020-02-27 04:51:34 +00:00
Mark Rousskov
2c7c4460bb Enable setting diagnostic labels 2020-02-26 20:54:13 -05:00
Michael Mc Donnell
290ed0297f Use assert_ne in hash tests
The hash tests were written before the assert_ne macro was added to the standard library. The assert_ne macro provides better output in case of a failure.
2020-02-26 17:34:56 -08:00
Tomasz Miąsko
34f83942f9 Revert "Mark attributes consumed by check_mod_attrs as normal"
This reverts commit d78b22f35e.

Those changes were incompatible with incremental compilation since the
effect `check_mod_attrs` has with respect to marking the attributes as
used is neither persisted nor recomputed.
2020-02-27 00:00:00 +00:00
Josh Stone
3d47ebeb0e Simplify the signature of par_for_each_in
Given `T: IntoIterator`/`IntoParallelIterator`, `T::Item` is
unambiguous, so we don't need the explicit trait casting.
2020-02-26 15:08:21 -08:00
Matthias Krüger
280e381b8d don't take redundant references to operands 2020-02-26 22:42:29 +01:00
bors
0c15adc530 Auto merge of #67742 - mark-i-m:describe-it, r=matthewjasper
Generalized article_and_description

r? @matthewjasper

The logic of finding the right word and article to print seems to be repeated elsewhere... this is an experimental method to unify this logic...
2020-02-26 20:50:56 +00:00
XAMPPRocky
526280a853
Merge branch 'master' into relnotes-1.42.0 2020-02-26 21:39:30 +01:00
Matthew Jasper
b944531146 Update codegen-units tests 2020-02-26 19:45:46 +00:00
Vadim Petrochenkov
6ce5ab6a7e rustc_span: Add Symbol::to_ident_string for use in diagnostic messages 2020-02-26 22:02:43 +03:00
Mazdak Farrokhzad
6672a04718 instantiate_value_path: .impl_self_ty -> .type_of 2020-02-26 19:25:48 +01:00
bors
abc3073c92 Auto merge of #69484 - Dylan-DPC:rollup-j6ripxy, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #68712 (Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference)
 - #69209 (Miscellaneous cleanup to formatting)
 - #69381 (Allow getting `no_std` from the config file)
 - #69434 (rustc_metadata: Use binary search from standard library)
 - #69447 (Minor refactoring of statement parsing)

Failed merges:

r? @ghost
2020-02-26 16:01:21 +00:00
Dylan DPC
ae383e2af8
Rollup merge of #69447 - Centril:minor-stmt-refactor, r=estebank
Minor refactoring of statement parsing

Extracted out of https://github.com/rust-lang/rust/pull/69445.

r? @estebank
2020-02-26 15:34:35 +01:00
Dylan DPC
c0760279b3
Rollup merge of #69434 - petrochenkov:metabs, r=Mark-Simulacrum
rustc_metadata: Use binary search from standard library

instead of a hand rolled one.

Noticed while reviewing https://github.com/rust-lang/rust/pull/68941.
2020-02-26 15:34:33 +01:00
Dylan DPC
d799f2deb1
Rollup merge of #69381 - QuiltOS:no-std-from-config, r=Mark-Simulacrum
Allow getting `no_std` from the config file

Currently, it is only set correctly in the sanity checking implicit
default fallback code. Having a config file at all will for force
`no_std = false`.
2020-02-26 15:34:32 +01:00
Dylan DPC
e028f26e1d
Rollup merge of #69209 - Mark-Simulacrum:strip-unsafe, r=dtolnay
Miscellaneous cleanup to formatting

Each commit stands alone.

This pull request will also resolve #58320.
2020-02-26 15:34:30 +01:00
Dylan DPC
86b9377dd6
Rollup merge of #68712 - HeroicKatora:finalize-ref-cell, r=dtolnay
Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference

Usually, references to the interior are only created by the `Deref` and
`DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell`
already has to cope with leaks of such guards which, when it occurs,
effectively makes it impossible to ever acquire a mutable guard or any
guard for `Ref` and `RefMut` respectively. It is already safe to use
this to create a reference to the inner of the ref cell that lives as
long as the reference to the `RefCell` itself, e.g.

```rust
fn leak(r: &RefCell<usize>) -> Option<&usize> {
    let guard = r.try_borrow().ok()?;
    let leaked = Box::leak(Box::new(guard));
    Some(&*leaked)
}
```

The newly added methods allow the same reference conversion without an
indirection over a leaked allocation. It's placed on the `Ref`/`RefMut` to
compose with both borrow and try_borrow directly.
2020-02-26 15:34:29 +01:00
bors
892cb143e5 Auto merge of #67290 - jonas-schievink:leak-audit, r=KodrAus
Audit liballoc for leaks in `Drop` impls when user destructor panics

Inspired by https://github.com/rust-lang/rust/pull/67243 and https://github.com/rust-lang/rust/pull/67235, this audits and hopefully fixes the remaining `Drop` impls in liballoc for resource leaks in the presence of panics in destructors called by the affected `Drop` impl.

This does not touch `Hash{Map,Set}` since they live in hashbrown. They have similar issues though.

r? @KodrAus
2020-02-26 12:48:53 +00:00
Guillaume Gomez
129ac011b5 Clean up E0373 explanation 2020-02-26 12:56:30 +01:00
Matthias Krüger
1a6b930eeb clarify operator precedence 2020-02-26 12:43:37 +01:00
bors
3a0d106109 Auto merge of #61812 - jonas-schievink:assoc-ty-defaults, r=nikomatsakis
Implement RFC 2532 – Associated Type Defaults

This is a partial implementation that is still missing the changes to object types, since I ran into some trouble while implementing that. I'm opening this part already to get feedback on the implementation and the unexpected test fallout (see my comments below). The remaining changes can be done in a later PR.

Blockers before this can land:
* [x] Resolve unsoundness around interaction with specialization (https://github.com/rust-lang/rust/pull/61812#discussion_r300504010) - #64564

cc https://github.com/rust-lang/rust/issues/29661
Fixes #53907
Fixes #54182
Fixes #62211
Fixes #41868
Fixes #63593
Fixes #47385
Fixes #43924
Fixes #32350
Fixes #26681
Fixes https://github.com/rust-lang/rust/issues/67187
2020-02-26 09:27:06 +00:00
YI
6a1790524a update llvm to silence gcc 9 warnings
Closes https://github.com/rust-lang/rust/issues/69078
2020-02-26 10:27:01 +08:00
bors
46f5aa93d4 Auto merge of #69474 - Dylan-DPC:rollup-ciotplu, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #67637 (Add primitive module to libcore)
 - #69387 (Deduplicate identifier printing a bit)
 - #69412 (Mark attributes consumed by `check_mod_attrs` as normal)
 - #69423 (syntax: Remove `Nt(Impl,Trait,Foreign)Item`)
 - #69429 (remove redundant clones and import)
 - #69457 (Clean up e0370 e0371)
 - #69468 ([master] Backport release notes of 1.41.1)

Failed merges:

r? @ghost
2020-02-26 01:48:27 +00:00
Dylan DPC
83818628b2
Rollup merge of #69468 - pietroalbini:master-1.41.1-notes, r=Mark-Simulacrum
[master] Backport release notes of 1.41.1

r? @Mark-Simulacrum
2020-02-26 02:07:18 +01:00
Dylan DPC
35ae48c735
Rollup merge of #69457 - GuillaumeGomez:clean-up-e0370-e0371, r=Dylan-DPC
Clean up e0370 e0371

r? @Dylan-DPC
2020-02-26 02:07:17 +01:00
Dylan DPC
ab3fb8b05a
Rollup merge of #69429 - matthiaskrgr:clippy_, r=estebank
remove redundant clones and import
2020-02-26 02:07:15 +01:00
Dylan DPC
7603c2cfba
Rollup merge of #69423 - petrochenkov:nont, r=Centril
syntax: Remove `Nt(Impl,Trait,Foreign)Item`

Follow-up to https://github.com/rust-lang/rust/pull/69366.
r? @Centril
2020-02-26 02:07:14 +01:00
Dylan DPC
d050b00759
Rollup merge of #69412 - tmiasko:checked-unused, r=petrochenkov
Mark attributes consumed by `check_mod_attrs` as normal

Take advantage of the fact that `check_mod_attrs` marks attributes as
used and change their type to normal, so that any remaining uses will be
warned about by the unused attribute lint.
2020-02-26 02:07:12 +01:00
Dylan DPC
41bf200073
Rollup merge of #69387 - petrochenkov:idprint, r=Mark-Simulacrum
Deduplicate identifier printing a bit

https://github.com/rust-lang/rust/pull/67010 introduced a couple more subtly different ways to print an identifier.
This PR attempts to restore the order.

The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required.

r? @Mark-Simulacrum
2020-02-26 02:07:11 +01:00
Dylan DPC
0860f5aebd
Rollup merge of #67637 - Mark-Simulacrum:primitive-mod, r=dtolnay
Add primitive module to libcore

This re-exports the primitive types from libcore at `core::primitive` to allow
macro authors to have a reliable location to use them from.

Fixes #44865
2020-02-26 02:07:05 +01:00
bors
55a777cd92 Auto merge of #69450 - cuviper:llvm-scev-no-wrap, r=nikic
Cherry-pick the LLVM fix for #69225

An additional reproducer was provided in #69225 -- the new testcase here -- which still crashes even after #69241 reverted #67174. Now this pull request updates LLVM with the cherry-picked reversion of its own. This is also going to stable in #69444.

I have not tried to reapply #67174 yet -- cc @kraai @shahn
2020-02-25 22:13:27 +00:00
Pietro Albini
9d84f1f684
backport release notes of 1.41.1 2020-02-25 20:19:46 +01:00
bors
6fd8798f4d Auto merge of #69421 - flip1995:clippyup, r=Dylan-DPC
Update Clippy from 8fbb23f to fc5d0cc

Fixes #69419

```
Fix false positive in `missing_const_for_fn`
Rustup to rust-lang/rust#69366
Add new lint [`wildcard imports`]. Add suggestion to [`enum_glob_use`]
Add new lint `lossy_float_literal` to detect lossy whole number float literals
```
2020-02-25 15:08:50 +00:00
Guillaume Gomez
d6f83c541d Clean up E0371 explanation 2020-02-25 13:28:47 +01:00
Guillaume Gomez
f56042fb3c Clean up E0370 explanation 2020-02-25 13:28:40 +01:00
bors
e3a277943e Auto merge of #69440 - Dylan-DPC:rollup-hj4bo9l, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #69220 (Add documentation for the `-Zself-profile` flag)
 - #69391 (Add rustdoc aliases to `ptr::copy` and `ptr::copy_nonoverlapping`)
 - #69427 (Cleanup e0368 e0369)
 - #69433 (don't explicitly compare against true or false)
 - #69435 (Replace uses of Cell::get + Cell::set with Cell::replace.)
 - #69437 (no more codegen for miri_start_panic)

Failed merges:

r? @ghost
2020-02-25 11:56:56 +00:00