]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRemove special case for zero-sized arrays from indirectly mut locals
Dylan MacKenzie [Sun, 13 Oct 2019 19:27:45 +0000 (12:27 -0700)]
Remove special case for zero-sized arrays from indirectly mut locals

4 years agoReturn `false` from `needs_drop` for all zero-sized arrays
Dylan MacKenzie [Sun, 13 Oct 2019 19:27:11 +0000 (12:27 -0700)]
Return `false` from `needs_drop` for all zero-sized arrays

4 years agoAuto merge of #65388 - Centril:rollup-rhg0dvs, r=Centril
bors [Sun, 13 Oct 2019 17:18:56 +0000 (17:18 +0000)]
Auto merge of #65388 - Centril:rollup-rhg0dvs, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #65214 (Split non-CAS atomic support off into target_has_atomic_load_store)
 - #65246 (vxWorks: implement get_path() and get_mode() for File fmt::Debug)
 - #65312 (improve performance of signed saturating_mul)
 - #65336 (Fix typo in task::Waker)
 - #65346 (nounwind tests and cleanup)
 - #65347 (Fix #[unwind(abort)] with Rust ABI)
 - #65366 (Implement Error::source on IntoStringError + Remove superfluous cause impls)
 - #65369 (Don't discard value names when using address or memory sanitizer)
 - #65370 (Add `dyn` to `Any` documentation)
 - #65373 (Fix typo in docs for `Rc`)

Failed merges:

r? @ghost

4 years agoRollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:17 +0000 (19:17 +0200)]
Rollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink

Fix typo in docs for `Rc`

r? @czipperz

4 years agoRollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:15 +0000 (19:17 +0200)]
Rollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievink

Add `dyn` to `Any` documentation

I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.

4 years agoRollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:14 +0000 (19:17 +0200)]
Rollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor

Don't discard value names when using address or memory sanitizer

The value names are used when reporting issues found by address
sanitizer or memory sanitizer. Avoid discarding names when those
sanitizers are enabled, unless explicitly requested to do otherwise.

4 years agoRollup merge of #65366 - faern:source-on-intostringerror, r=bluss
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:12 +0000 (19:17 +0200)]
Rollup merge of #65366 - faern:source-on-intostringerror, r=bluss

Implement Error::source on IntoStringError + Remove superfluous cause impls

IntoStringError only implemented `Error::cause`, which is deprecated. This implemements `Error::source` instead.
`Error::cause` will still work as before, thanks to the default implementation.

I think this was the only/last `Error` impl in the standard library to have a cause, but not a source.

4 years agoRollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:11 +0000 (19:17 +0200)]
Rollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor

Fix #[unwind(abort)] with Rust ABI

Fixes #63883.

4 years agoRollup merge of #65346 - RalfJung:nounwind-tests, r=nagisa
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:10 +0000 (19:17 +0200)]
Rollup merge of #65346 - RalfJung:nounwind-tests, r=nagisa

nounwind tests and cleanup

This is a follow-up to @pnkfelix' https://github.com/rust-lang/rust/pull/65020. In particular it adds some tests as @nagisa  asked. It also does a cleanup that the original PR omitted to reduce backporting risks.

I hope I finally managed to write an uncontroversial PR in this area. ;) This should not change any behavior, just test it better.

4 years agoRollup merge of #65336 - BO41:typo, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:08 +0000 (19:17 +0200)]
Rollup merge of #65336 - BO41:typo, r=petrochenkov

Fix typo in task::Waker

fixes  #65323

in `libstd/error.rs` there are a few mentions of `trait@Send` and `trait@Sync`. Are they wrong as well?

4 years agoRollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnay
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:07 +0000 (19:17 +0200)]
Rollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnay

improve performance of signed saturating_mul

Reciprocal throughput is improved from 2.3 to 1.7. https://godbolt.org/z/ROMiX6

Fixes #65309.

4 years agoRollup merge of #65246 - Wind-River:real_master_2, r=kennytm
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:06 +0000 (19:17 +0200)]
Rollup merge of #65246 - Wind-River:real_master_2, r=kennytm

vxWorks: implement get_path() and get_mode() for File fmt::Debug

4 years agoRollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:04 +0000 (19:17 +0200)]
Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton

Split non-CAS atomic support off into target_has_atomic_load_store

This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s:

* `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations).
* ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS).

cc #32976

r? @alexcrichton

4 years agoFix typo in docs for `Rc`
kalabukdima [Sun, 13 Oct 2019 12:46:28 +0000 (15:46 +0300)]
Fix typo in docs for `Rc`

4 years agoAdded code element
Cerberuser [Sun, 13 Oct 2019 12:03:21 +0000 (19:03 +0700)]
Added code element

Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
4 years agoAdd `dyn` to `Any` documentation
Cerberuser [Sun, 13 Oct 2019 11:48:07 +0000 (18:48 +0700)]
Add `dyn` to `Any` documentation

I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.

4 years agoAuto merge of #65368 - Centril:rollup-lb7fe48, r=Centril
bors [Sun, 13 Oct 2019 11:36:52 +0000 (11:36 +0000)]
Auto merge of #65368 - Centril:rollup-lb7fe48, r=Centril

Rollup of 13 pull requests

Successful merges:

 - #65039 (Document missing deny by default lints)
 - #65069 (Implement Clone::clone_from for VecDeque)
 - #65165 (Improve docs on some char boolean methods)
 - #65248 (Suggest `if let` on `let` refutable binding)
 - #65250 (resolve: fix error title regarding private constructors)
 - #65295 (Move diagnostics code out of the critical path)
 - #65320 (Report `CONST_ERR` lint in external macros)
 - #65327 (replace the hand-written binary search with the library one)
 - #65339 (do not reference LLVM for our concurrency memory model)
 - #65357 (syntax: simplify maybe_annotate_with_ascription)
 - #65358 (simplify maybe_stage_features)
 - #65359 (simplify integer_lit)
 - #65360 (mbe: reduce panictry! uses.)

Failed merges:

r? @ghost

4 years agoRollup merge of #65360 - Centril:mbrpt, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:44 +0000 (13:34 +0200)]
Rollup merge of #65360 - Centril:mbrpt, r=petrochenkov

mbe: reduce panictry! uses.

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @petrochenkov

4 years agoRollup merge of #65359 - Centril:sil, r=davidtwco
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:42 +0000 (13:34 +0200)]
Rollup merge of #65359 - Centril:sil, r=davidtwco

simplify integer_lit

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @davidtwco

4 years agoRollup merge of #65358 - Centril:smsf, r=davidtwco
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:41 +0000 (13:34 +0200)]
Rollup merge of #65358 - Centril:smsf, r=davidtwco

simplify maybe_stage_features

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @estebank

4 years agoRollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascription, r=davidtwco
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:40 +0000 (13:34 +0200)]
Rollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascription, r=davidtwco

syntax: simplify maybe_annotate_with_ascription

Split out from https://github.com/rust-lang/rust/pull/65324.

r? @estebank

4 years agoRollup merge of #65339 - RalfJung:atomic-ordering, r=Centril
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:39 +0000 (13:34 +0200)]
Rollup merge of #65339 - RalfJung:atomic-ordering, r=Centril

do not reference LLVM for our concurrency memory model

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

4 years agoRollup merge of #65327 - guanqun:remove-hand-binary-search, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:37 +0000 (13:34 +0200)]
Rollup merge of #65327 - guanqun:remove-hand-binary-search, r=petrochenkov

replace the hand-written binary search with the library one

4 years agoRollup merge of #65320 - memoryruins:const_err, r=oli-obk
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:36 +0000 (13:34 +0200)]
Rollup merge of #65320 - memoryruins:const_err, r=oli-obk

Report `CONST_ERR` lint in external macros

fixes #65300
fixes #61058

r? @oli-obk

4 years agoRollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:34 +0000 (13:34 +0200)]
Rollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote

Move diagnostics code out of the critical path

Follow up to #65077.

r? @nnethercote

4 years agoRollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:33 +0000 (13:34 +0200)]
Rollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkov

resolve: fix error title regarding private constructors

One reason is that constructors can be private while their types can be
public.

Idea credit to @petrochenkov, discussed at #65153

4 years agoRollup merge of #65248 - estebank:mention-if-let, r=cramertj
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:32 +0000 (13:34 +0200)]
Rollup merge of #65248 - estebank:mention-if-let, r=cramertj

Suggest `if let` on `let` refutable binding

Fix #58385.

4 years agoRollup merge of #65165 - BO41:char_docs, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:30 +0000 (13:34 +0200)]
Rollup merge of #65165 - BO41:char_docs, r=varkor

Improve docs on some char boolean methods

simple revival of #61794
(also rustfmt on rest of file :)

Documentation for `is_xid_start()` and `is_xid_continue()` couldn't be improved since both methods got remove from this repository

r? @dtolnay
cc @JohnCSimon

4 years agoRollup merge of #65069 - crgl:clone-from-vec-deque, r=bluss
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:29 +0000 (13:34 +0200)]
Rollup merge of #65069 - crgl:clone-from-vec-deque, r=bluss

Implement Clone::clone_from for VecDeque

See #28481. For simple data types with the target much longer than the source, this implementation can be significantly slower than the default (probably due to the use of truncate). However, it should be substantially faster when cloning from nested data structures with similar shapes or when cloning from VecDeques with similar lengths, hopefully more common use cases for clone_from.

4 years agoRollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomez
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:27 +0000 (13:34 +0200)]
Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomez

Document missing deny by default lints

4 years agoRemove Error::cause impls equal to deafult impl
Linus Färnstrand [Sun, 13 Oct 2019 10:26:45 +0000 (12:26 +0200)]
Remove Error::cause impls equal to deafult impl

4 years agoFix typos in error.rs
BO41 [Sun, 13 Oct 2019 10:12:46 +0000 (12:12 +0200)]
Fix typos in error.rs

4 years agoDon't discard value names when using address or memory sanitizer
Tomasz Miąsko [Sun, 13 Oct 2019 00:00:00 +0000 (00:00 +0000)]
Don't discard value names when using address or memory sanitizer

The value names are used when reporting issues found by address
sanitizer or memory sanitizer. Avoid discarding names when those
sanitizers are enabled, unless explicitly requested to do otherwise.

4 years agoImplement Error::source on IntoStringError
Linus Färnstrand [Sun, 13 Oct 2019 09:43:26 +0000 (11:43 +0200)]
Implement Error::source on IntoStringError

IntoStringError only implemented Error::cause, which is
deprecated. This implemements Error::source instead.
Error::cause will still work as before, thanks to the default
implementation.

4 years agoAuto merge of #65182 - anp:reify-shim, r=eddyb
bors [Sun, 13 Oct 2019 07:32:38 +0000 (07:32 +0000)]
Auto merge of #65182 - anp:reify-shim, r=eddyb

Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N)

Supercedes: https://github.com/rust-lang/rust/pull/65082
Depends on: https://github.com/rust-lang/rust/pull/65037
Tracking issue: https://github.com/rust-lang/rust/issues/47809
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)

steps taken:

* [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183)
* [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers
* [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function

4 years agombe: reduce panictry! uses.
Mazdak Farrokhzad [Tue, 8 Oct 2019 10:21:01 +0000 (12:21 +0200)]
mbe: reduce panictry! uses.

4 years agosimplify integer_lit
Mazdak Farrokhzad [Tue, 8 Oct 2019 08:59:05 +0000 (10:59 +0200)]
simplify integer_lit

4 years agosimplify maybe_stage_features
Mazdak Farrokhzad [Tue, 8 Oct 2019 08:46:41 +0000 (10:46 +0200)]
simplify maybe_stage_features

4 years agosyntax: simplify maybe_annotate_with_ascription
Mazdak Farrokhzad [Tue, 8 Oct 2019 08:46:08 +0000 (10:46 +0200)]
syntax: simplify maybe_annotate_with_ascription

4 years agoAuto merge of #65099 - pnkfelix:issue-63154-needed-more-normalize, r=nagisa
bors [Sun, 13 Oct 2019 03:37:25 +0000 (03:37 +0000)]
Auto merge of #65099 - pnkfelix:issue-63154-needed-more-normalize, r=nagisa

MIR typeck needed more normalize

Add some missing normalization calls (@nagisa [was right](https://github.com/rust-lang/rust/issues/63154#issuecomment-517305589)).

Fix #63154

4 years agoAuto merge of #64873 - popzxc:prettify-test-time, r=wesleywiser
bors [Sat, 12 Oct 2019 23:47:27 +0000 (23:47 +0000)]
Auto merge of #64873 - popzxc:prettify-test-time, r=wesleywiser

Enhance report-time option

## Short overview

This PR is a follow-up to a previously closed #64714 PR.

## Changes introduced by this PR

* `libtest` now retrieves the type of the test within `TestDesc` (available types are: `UnitTest`, `IntegrationTest`, `DocTest`, `Unknown`).
* `--report-time` subcommand of the `libtest` now supports colored output (disabled by default).
* Colorized output depends on the threshold values. Default values (proposed by @wesleywiser):
  - For unit-tests: 50ms warn/100ms critical,
  - For integration-tests: 500ms warn/1000ms critical,
  - For doctests: same as for integration tests,
  - For unknown tests: `TEST_WARN_TIMEOUT_S` warn/ `TEST_WARN_TIMEOUT_S * 2` critical (it will only applied single-threaded mode, because otherwise test will be interrupted after reaching `TEST_WARN_TIMEOUT_S`).
  - These values can be overrided by setting environment variables (since those thresholds are somewhat constant for every project, it's more flexible to use environment variables than command line arguments).
* New optional flag `--ensure-test-time` for `libtest`. With this flag applied, exectuion time limit excesss will cause test failure.

## What have not been done

There was a comment that it would be nice to have an entry in the Cargo book about it.

However, changes introduced by this PR (and #64663 in which `report-time` flag was added) aren't related directly to `cargo`, it's more about `libtest` itself.
I'm considering that [The Unstable Book](https://doc.rust-lang.org/unstable-book/) is more appropriate place, but not sure if I'm right (and if so, how exactly it should be described).

As one possible option, this PR may be merged without denoting it in the documentation, and in the next PR adding support of this feature to the `cargo` itself, I'll add a note in the Cargo book.

## Scope of this PR

Logical scope of this PR is `libtest` only. However, to get test types, I had to modify also `libsyntax_ext` and `librustdoc` for them to provide information about test type.

## Rationale

Rationale for colored output was submitted in #64714

Providing the information about kind of test was also proposed in #64714, and as an additional benefit this information may be useful for the tools using `libtest` (e.g. `cargo`).

Adding flag to treat time limits excess seems logical to me, so projects that do care about test execution time won't have to invent a wheel.

## Backward compatibility

All the changes are completely backward compatible.

## Demo

![rustc_enhanced_time](https://user-images.githubusercontent.com/12111581/65818381-c04f6800-e219-11e9-9875-322463abe24f.gif)

r? @wesleywiser

4 years agoRemove the fn pointer #[track_caller] test.
Adam Perry [Sat, 12 Oct 2019 21:25:34 +0000 (14:25 -0700)]
Remove the fn pointer #[track_caller] test.

The ICE stderr isn't normalizing correctly on some builders.

4 years agomake tests more robust
Ralf Jung [Sat, 12 Oct 2019 21:08:57 +0000 (23:08 +0200)]
make tests more robust

4 years agotest unwind(abort) with Rust ABI
Ralf Jung [Sat, 12 Oct 2019 19:02:38 +0000 (21:02 +0200)]
test unwind(abort) with Rust ABI

4 years agofix #[unwind(abort)] for Rust ABIs
Ralf Jung [Sat, 12 Oct 2019 18:48:19 +0000 (20:48 +0200)]
fix #[unwind(abort)] for Rust ABIs

4 years agosome typography
Ralf Jung [Sat, 12 Oct 2019 18:40:10 +0000 (20:40 +0200)]
some typography

4 years agoalso (properly) test nounwind on function definitions
Ralf Jung [Sat, 12 Oct 2019 18:40:03 +0000 (20:40 +0200)]
also (properly) test nounwind on function definitions

4 years agoupdate test for nounwind on FFI imports
Ralf Jung [Sat, 12 Oct 2019 17:48:58 +0000 (19:48 +0200)]
update test for nounwind on FFI imports

4 years agoAuto merge of #65328 - lzutao:bump-rls-rustfmt, r=Xanewok
bors [Sat, 12 Oct 2019 18:23:13 +0000 (18:23 +0000)]
Auto merge of #65328 - lzutao:bump-rls-rustfmt, r=Xanewok

Update rls and rustfmt

cc @Xanewok

Fixes #65084
Fixes #65085
Suppressed  #65311

4 years agofix link targets
Ralf Jung [Sat, 12 Oct 2019 18:09:24 +0000 (20:09 +0200)]
fix link targets

4 years agoremove old branch of unwind logic
Ralf Jung [Sat, 12 Oct 2019 17:46:03 +0000 (19:46 +0200)]
remove old branch of unwind logic

4 years agoit's C++20
Ralf Jung [Sat, 12 Oct 2019 15:57:31 +0000 (17:57 +0200)]
it's C++20

4 years agocompress the function, remove the assert check.
Guanqun Lu [Sat, 12 Oct 2019 14:47:17 +0000 (22:47 +0800)]
compress the function, remove the assert check.

4 years agodo not reference LLVM for our concurrency memory model
Ralf Jung [Sat, 12 Oct 2019 14:22:41 +0000 (16:22 +0200)]
do not reference LLVM for our concurrency memory model

4 years agoFix typo
BO41 [Sat, 12 Oct 2019 13:18:17 +0000 (15:18 +0200)]
Fix typo

4 years agoImprove docs on some char boolean methods
BO41 [Sun, 6 Oct 2019 13:59:49 +0000 (15:59 +0200)]
Improve docs on some char boolean methods

4 years agoAuto merge of #65190 - GuillaumeGomez:dont-pass-doctest-feature-by-default, r=Mark...
bors [Sat, 12 Oct 2019 11:39:20 +0000 (11:39 +0000)]
Auto merge of #65190 - GuillaumeGomez:dont-pass-doctest-feature-by-default, r=Mark-Simulacrum

Don't pass doctest feature by default

As asked in https://github.com/rust-lang/rust/pull/63803#issuecomment-539064434.

r? @QuietMisdreavus

4 years agoBump home crate
Lzu Tao [Sat, 12 Oct 2019 08:29:27 +0000 (08:29 +0000)]
Bump home crate

4 years agoUpdate RLS and Rustfmt
Igor Matuszewski [Fri, 11 Oct 2019 14:28:02 +0000 (16:28 +0200)]
Update RLS and Rustfmt

This also bumps rustc-ap-* crates and fixes the relevant toolstate.

4 years agoreplace the hand-written binary search with the library one
Guanqun Lu [Sat, 12 Oct 2019 04:45:28 +0000 (12:45 +0800)]
replace the hand-written binary search with the library one

4 years agoAuto merge of #65322 - tmandry:rollup-frr651r, r=tmandry
bors [Sat, 12 Oct 2019 06:25:03 +0000 (06:25 +0000)]
Auto merge of #65322 - tmandry:rollup-frr651r, r=tmandry

Rollup of 15 pull requests

Successful merges:

 - #64337 (libstd: Fix typos in doc)
 - #64986 (Function pointers as const generic arguments)
 - #65048 (Added doc about behavior of extend on HashMap)
 - #65191 (Add some regression tests)
 - #65200 (Add ?Sized bound to a supertrait listing in E0038 error documentation)
 - #65205 (Add long error explanation for E0568)
 - #65220 (Update LLVM for Emscripten exception handling support)
 - #65263 (Deduplicate is_{freeze,copy,sized}_raw)
 - #65266 (Mark Path::join as must_use)
 - #65276 (Don't cc rust-lang/compiler for toolstate changes)
 - #65277 (Query generator kind for error reporting)
 - #65283 (stability: Do not use `buffer_lint` after lowering to HIR)
 - #65289 (Fix suggested bound addition diagnostic)
 - #65310 (deriving: avoid dummy Span on an artificial `type_ident` path)
 - #65321 (Remove painful test that is not pulling its weight)

Failed merges:

r? @ghost

4 years agoAuto merge of #65020 - pnkfelix:targetted-fix-for-always-marking-rust-abi-unwind...
bors [Sat, 12 Oct 2019 02:31:03 +0000 (02:31 +0000)]
Auto merge of #65020 - pnkfelix:targetted-fix-for-always-marking-rust-abi-unwind-issue-64655, r=alexcrichton

Always mark rust and rust-call abi's as unwind

PR #63909 identified a bug that had been injected by PR #55982. As discussed on https://github.com/rust-lang/rust/issues/64655#issuecomment-537517428 , we started marking extern items as nounwind, *even* extern items that said they were using "Rust" or "rust-call" ABI.

This is a more targeted variant of PR #63909 that fixes the above bug.

Fix #64655

----

I personally suspect we will want PR #63909 to land in the long-term

But:
 *  it is not certain that PR #63909 *will* land,
 * more importantly, PR #63909 almost certainly will not be backported to beta/stable.

The identified bug was more severe than I think anyone realized (apart from perhaps @gnzlbg, as noted [here](https://github.com/rust-lang/rust/pull/63909#issuecomment-524818838)).

Thus, I was motivated to write this PR, which fixes *just* the issue with extern rust/rust-call functions, and deliberately avoids injecting further deviation from current behavior (you can see further notes on this in the comments of the code added here).

4 years agoRollup merge of #65321 - Mark-Simulacrum:remove-linker-no-utf8-test, r=nikomatsakis
Tyler Mandry [Fri, 11 Oct 2019 22:10:01 +0000 (15:10 -0700)]
Rollup merge of #65321 - Mark-Simulacrum:remove-linker-no-utf8-test, r=nikomatsakis

Remove painful test that is not pulling its weight

Research suggests that we are not properly testing this case anyway, and
even if we were, it is unlikely that we will regress here -- or, perhaps
more accurately, if we do, I am uncertain that we care too much. It
definitely seems like an edge case, and one that is particularly
unlikely to occur as time goes on.

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

4 years agoRollup merge of #65310 - da-x:issue-56195, r=petrochenkov
Tyler Mandry [Fri, 11 Oct 2019 22:10:00 +0000 (15:10 -0700)]
Rollup merge of #65310 - da-x:issue-56195, r=petrochenkov

deriving: avoid dummy Span on an artificial `type_ident` path

The dummy Span pointed to the beginning of the source file instead to where the `#[derive]` is located. Later, it tripped the `in_derive_expansion(span)` check at `src/librustc/middle/stability.rs`, causing a span-less deprecation warning to be emitted.

Fixes #56195, Fixes #55417.

4 years agoRollup merge of #65289 - varkor:issue-65284, r=estebank
Tyler Mandry [Fri, 11 Oct 2019 22:09:58 +0000 (15:09 -0700)]
Rollup merge of #65289 - varkor:issue-65284, r=estebank

Fix suggested bound addition diagnostic

Fixes #65284.

4 years agoRollup merge of #65283 - petrochenkov:softstab2, r=estebank
Tyler Mandry [Fri, 11 Oct 2019 22:09:57 +0000 (15:09 -0700)]
Rollup merge of #65283 - petrochenkov:softstab2, r=estebank

stability: Do not use `buffer_lint` after lowering to HIR

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

4 years agoRollup merge of #65277 - csmoe:fix-move, r=estebank
Tyler Mandry [Fri, 11 Oct 2019 22:09:56 +0000 (15:09 -0700)]
Rollup merge of #65277 - csmoe:fix-move, r=estebank

Query generator kind for error reporting

Fixes https://github.com/rust-lang/rust/pull/65166#discussion_r333114545
r? @estebank
cc @cramertj

4 years agoRollup merge of #65276 - varkor:toolstate-no-ping, r=Mark-Simulacrum
Tyler Mandry [Fri, 11 Oct 2019 22:09:54 +0000 (15:09 -0700)]
Rollup merge of #65276 - varkor:toolstate-no-ping, r=Mark-Simulacrum

Don't cc rust-lang/compiler for toolstate changes

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

4 years agoRollup merge of #65266 - rust-lang:must-use-join, r=dtolnay
Tyler Mandry [Fri, 11 Oct 2019 22:09:53 +0000 (15:09 -0700)]
Rollup merge of #65266 - rust-lang:must-use-join, r=dtolnay

Mark Path::join as must_use

I've accidentally did `mut_path_buf.jon(a_path);`, expecting this to be an in-place modification. Seems like we can easily warn in such cases?

4 years agoRollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=Centril
Tyler Mandry [Fri, 11 Oct 2019 22:09:51 +0000 (15:09 -0700)]
Rollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=Centril

Deduplicate is_{freeze,copy,sized}_raw

Fixes #65259

Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.

4 years agoRollup merge of #65220 - tlively:update-llvm-for-emscripten-exceptions, r=nikic
Tyler Mandry [Fri, 11 Oct 2019 22:09:50 +0000 (15:09 -0700)]
Rollup merge of #65220 - tlively:update-llvm-for-emscripten-exceptions, r=nikic

Update LLVM for Emscripten exception handling support

Updates LLVM to pick up the cherry-picked support for correctly
handling exception handling with aggregates passed by value. This will
be necessary to continue to support Emscripten's exception handling
once we switch using Emscripten's LLVM backend. See #63649.

4 years agoRollup merge of #65205 - GuillaumeGomez:long-err-explanation-E0568, r=estebank
Tyler Mandry [Fri, 11 Oct 2019 22:09:48 +0000 (15:09 -0700)]
Rollup merge of #65205 - GuillaumeGomez:long-err-explanation-E0568, r=estebank

Add long error explanation for E0568

Part of #61137.

4 years agoRollup merge of #65200 - xfix:patch-20, r=GuillaumeGomez
Tyler Mandry [Fri, 11 Oct 2019 22:09:47 +0000 (15:09 -0700)]
Rollup merge of #65200 - xfix:patch-20, r=GuillaumeGomez

Add ?Sized bound to a supertrait listing in E0038 error documentation

This example failed to compile because of implicit `Sized` bound for `A` parameter that wasn't required by `Trait`.

4 years agoRollup merge of #65191 - varkor:const-generics-test-cases, r=nikomatsakis
Tyler Mandry [Fri, 11 Oct 2019 22:09:45 +0000 (15:09 -0700)]
Rollup merge of #65191 - varkor:const-generics-test-cases, r=nikomatsakis

Add some regression tests

- Add a test for #62187.
- Clean up the directory structure in `src/test/ui/const-generics`
- Closes #64792.
- Closes #57399.
- Closes #57271.

4 years agoRollup merge of #65048 - Kixunil:patch-1, r=KodrAus
Tyler Mandry [Fri, 11 Oct 2019 22:09:44 +0000 (15:09 -0700)]
Rollup merge of #65048 - Kixunil:patch-1, r=KodrAus

Added doc about behavior of extend on HashMap

It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.

4 years agoRollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkor
Tyler Mandry [Fri, 11 Oct 2019 22:09:42 +0000 (15:09 -0700)]
Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkor

Function pointers as const generic arguments

Makes function pointers as const generic arguments usable.

Fixes #62395

r? @varkor

4 years agoRollup merge of #64337 - rick68:patch-17, r=Dylan-DPC
Tyler Mandry [Fri, 11 Oct 2019 22:09:41 +0000 (15:09 -0700)]
Rollup merge of #64337 - rick68:patch-17, r=Dylan-DPC

libstd: Fix typos in doc

4 years agoRemove painful test that is not pulling its weight
Mark Rousskov [Fri, 11 Oct 2019 21:41:55 +0000 (17:41 -0400)]
Remove painful test that is not pulling its weight

Research suggests that we are not properly testing this case anyway, and
even if we were, it is unlikely that we will regress here -- or, perhaps
more accurately, if we do, I am uncertain that we care too much. It
definitely seems like an edge case, and one that is particularly
unlikely to occur as time goes on.

4 years agoAdd regression test for CONST_ERR lints in extern macros
memoryruins [Fri, 11 Oct 2019 21:13:38 +0000 (17:13 -0400)]
Add regression test for CONST_ERR lints in extern macros

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 agoresolve: shorten wording on private constructor error
Dan Aloni [Fri, 11 Oct 2019 19:00:15 +0000 (22:00 +0300)]
resolve: shorten wording on private constructor error

4 years agoAuto merge of #64877 - lzutao:stabilize-repeat_generic_slice, r=SimonSapin
bors [Fri, 11 Oct 2019 18:03:20 +0000 (18:03 +0000)]
Auto merge of #64877 - lzutao:stabilize-repeat_generic_slice, r=SimonSapin

Stabilize `slice::repeat` (feature `repeat_generic_slice`)

Closes #48784
r? @SimonSapin

4 years agoimprove performance of signed saturating_mul
Trevor Spiteri [Fri, 11 Oct 2019 15:13:19 +0000 (17:13 +0200)]
improve performance of signed saturating_mul

Reciprocal throughput is improved from 2.3 to 1.7.
https://godbolt.org/z/ROMiX6

4 years agoresolve: fix error title regarding private constructors
Dan Aloni [Fri, 11 Oct 2019 14:38:20 +0000 (17:38 +0300)]
resolve: fix error title regarding private constructors

The constructor is private, not the type.

Idea credit to @petrochenkov, discussed at #65153

4 years agoClarify comment about purpose of ReifyShim.
Adam Perry [Fri, 11 Oct 2019 14:45:59 +0000 (07:45 -0700)]
Clarify comment about purpose of ReifyShim.

4 years agoresolve_for_fn_ptr checks that the instance is an Item before returning shim.
Adam Perry [Fri, 11 Oct 2019 14:44:01 +0000 (07:44 -0700)]
resolve_for_fn_ptr checks that the instance is an Item before returning shim.

4 years agotest: extend derive_on_deprecated to include more derivations
Dan Aloni [Fri, 11 Oct 2019 13:20:04 +0000 (16:20 +0300)]
test: extend derive_on_deprecated to include more derivations

4 years agoderiving: avoid dummy Span on an artificial `type_ident` path
Dan Aloni [Fri, 11 Oct 2019 12:14:23 +0000 (15:14 +0300)]
deriving: avoid dummy Span on an artificial `type_ident` path

The dummy Span pointed to the beginning of the source file instead to
where the `#[derive]` is located. Later, it tripped the
`in_derive_expansion(span)` check at `src/librustc/middle/stability.rs`,
causing a span-less deprecation warning to be emitted.

Fixes #56195, #55417.

4 years agoemcscripten: ignore another thread-using test
Ralf Jung [Fri, 11 Oct 2019 12:58:05 +0000 (14:58 +0200)]
emcscripten: ignore another thread-using test

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 agoignore-emcscripten as it does not support threads
Ralf Jung [Fri, 11 Oct 2019 07:57:44 +0000 (09:57 +0200)]
ignore-emcscripten as it does not support threads

4 years agoOverride nth for VecDeque Iter and IterMut
Charles Gleason [Fri, 4 Oct 2019 23:07:13 +0000 (19:07 -0400)]
Override nth for VecDeque Iter and IterMut

4 years agoAdd tests for VecDeque clone_from
Charles Gleason [Thu, 3 Oct 2019 19:04:35 +0000 (15:04 -0400)]
Add tests for VecDeque clone_from

4 years agoImplement Clone::clone_from for VecDeque
Charles Gleason [Thu, 3 Oct 2019 19:03:59 +0000 (15:03 -0400)]
Implement Clone::clone_from for VecDeque

4 years agoMove diagnostics code out of the critical path
Esteban Küber [Fri, 11 Oct 2019 02:34:56 +0000 (19:34 -0700)]
Move diagnostics code out of the critical path

4 years agoFix issue 65284
varkor [Thu, 10 Oct 2019 23:51:36 +0000 (00:51 +0100)]
Fix issue 65284

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 agostability: Do not use `buffer_lint` after lowering to HIR
Vadim Petrochenkov [Thu, 10 Oct 2019 20:37:41 +0000 (23:37 +0300)]
stability: Do not use `buffer_lint` after lowering to HIR

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 agoquery generator kind for error reporting
csmoe [Thu, 10 Oct 2019 14:20:57 +0000 (22:20 +0800)]
query generator kind for error reporting