Commit Graph

100614 Commits

Author SHA1 Message Date
bors
aa2ae564d3 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
2019-10-13 11:36:52 +00:00
Mazdak Farrokhzad
b82859171c
Rollup merge of #65360 - Centril:mbrpt, r=petrochenkov
mbe: reduce panictry! uses.

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

r? @petrochenkov
2019-10-13 13:34:44 +02:00
Mazdak Farrokhzad
af54a3e91d
Rollup merge of #65359 - Centril:sil, r=davidtwco
simplify integer_lit

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

r? @davidtwco
2019-10-13 13:34:42 +02:00
Mazdak Farrokhzad
5af528a03a
Rollup merge of #65358 - Centril:smsf, r=davidtwco
simplify maybe_stage_features

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

r? @estebank
2019-10-13 13:34:41 +02:00
Mazdak Farrokhzad
b143aa2b38
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
2019-10-13 13:34:40 +02:00
Mazdak Farrokhzad
293d02de70
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
2019-10-13 13:34:39 +02:00
Mazdak Farrokhzad
af8a6e5e6d
Rollup merge of #65327 - guanqun:remove-hand-binary-search, r=petrochenkov
replace the hand-written binary search with the library one
2019-10-13 13:34:37 +02:00
Mazdak Farrokhzad
643261aad4
Rollup merge of #65320 - memoryruins:const_err, r=oli-obk
Report `CONST_ERR` lint in external macros

fixes #65300
fixes #61058

r? @oli-obk
2019-10-13 13:34:36 +02:00
Mazdak Farrokhzad
433ea1a030
Rollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote
Move diagnostics code out of the critical path

Follow up to #65077.

r? @nnethercote
2019-10-13 13:34:34 +02:00
Mazdak Farrokhzad
540278c5ae
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
2019-10-13 13:34:33 +02:00
Mazdak Farrokhzad
963e4bc756
Rollup merge of #65248 - estebank:mention-if-let, r=cramertj
Suggest `if let` on `let` refutable binding

Fix #58385.
2019-10-13 13:34:32 +02:00
Mazdak Farrokhzad
82fb193cdf
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
2019-10-13 13:34:30 +02:00
Mazdak Farrokhzad
4dc0b8aa5b
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.
2019-10-13 13:34:29 +02:00
Mazdak Farrokhzad
d0f8bd6e26
Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomez
Document missing deny by default lints
2019-10-13 13:34:27 +02:00
Linus Färnstrand
b8e7f76181 Remove Error::cause impls equal to deafult impl 2019-10-13 12:30:06 +02:00
BO41
37018e0f9b Fix typos in error.rs 2019-10-13 12:12:46 +02:00
Tomasz Miąsko
d488500812 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.
2019-10-13 12:10:35 +02:00
Linus Färnstrand
cd0e4c3263 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.
2019-10-13 11:43:26 +02:00
bors
29b6e0f0a1 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
2019-10-13 07:32:38 +00:00
Mazdak Farrokhzad
ab8105ee97 tokenstream: don't depend on pprust 2019-10-13 07:00:32 +02:00
Mazdak Farrokhzad
742ec4b9bf ast: remove implicit pprust dependency via Display.
Instead just use `pprust::path_to_string(..)` where needed.

This has two benefits:

a) The AST definition is now independent of printing it.
   (Therefore we get closer to extracting a data-crate.)

b) Debugging should be easier as program flow is clearer.
2019-10-13 06:58:51 +02:00
Mazdak Farrokhzad
d131abefc3 ast: don't use pprust in Debug 2019-10-13 06:53:55 +02:00
Mazdak Farrokhzad
94db37a4f5 mbe: reduce panictry! uses. 2019-10-13 06:23:20 +02:00
Mazdak Farrokhzad
7effe633b0 simplify integer_lit 2019-10-13 06:20:03 +02:00
Yuki Okushi
c6cc29d8cf Apply suggestion 2019-10-13 13:19:40 +09:00
Mazdak Farrokhzad
477a68b720 simplify maybe_stage_features 2019-10-13 06:16:40 +02:00
Mazdak Farrokhzad
9f09387f53 syntax: simplify maybe_annotate_with_ascription 2019-10-13 06:14:07 +02:00
bors
3da6836cc9 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
2019-10-13 03:37:25 +00:00
bors
80b861bed1 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
2019-10-12 23:47:27 +00:00
Adam Perry
19f26fafdd Remove the fn pointer #[track_caller] test.
The ICE stderr isn't normalizing correctly on some builders.
2019-10-12 14:25:47 -07:00
Ralf Jung
09d7be39fa make tests more robust 2019-10-12 23:08:57 +02:00
Ralf Jung
df9335120b test unwind(abort) with Rust ABI 2019-10-12 21:02:38 +02:00
Ralf Jung
a0106527c6 fix #[unwind(abort)] for Rust ABIs 2019-10-12 20:51:24 +02:00
Ralf Jung
79c623f146 some typography 2019-10-12 20:44:05 +02:00
Ralf Jung
63af27f9ea also (properly) test nounwind on function definitions 2019-10-12 20:40:03 +02:00
Ralf Jung
a1a8f33abb update test for nounwind on FFI imports 2019-10-12 20:39:27 +02:00
bors
1721c9685b Auto merge of #65328 - lzutao:bump-rls-rustfmt, r=Xanewok
Update rls and rustfmt

cc @Xanewok

Fixes #65084
Fixes #65085
Suppressed  #65311
2019-10-12 18:23:13 +00:00
Ralf Jung
d6ab45d264 fix link targets 2019-10-12 20:09:24 +02:00
Ralf Jung
9a0b9c6960 remove old branch of unwind logic 2019-10-12 19:46:03 +02:00
Mark Rousskov
fabba8f764 Revert "Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum"
This reverts commit 000d90b11f, reversing
changes made to 898f36c83c.
2019-10-12 12:00:34 -04:00
Ralf Jung
f36355070e it's C++20 2019-10-12 17:57:31 +02:00
Guanqun Lu
63cb2fa197 compress the function, remove the assert check. 2019-10-12 23:00:48 +08:00
Ralf Jung
a2b2362ce7 do not reference LLVM for our concurrency memory model 2019-10-12 16:23:39 +02:00
Ralf Jung
504cc20844 remove confusing and redundant subsection 2019-10-12 15:35:15 +02:00
BO41
e5daab8c80 Fix typo 2019-10-12 15:18:17 +02:00
BO41
d8c2956906 Improve docs on some char boolean methods 2019-10-12 15:06:20 +02:00
bors
152527f443 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
2019-10-12 11:39:20 +00:00
Ralf Jung
f727f8ae5e move Formatting Traits down 2019-10-12 13:31:58 +02:00
Ralf Jung
a14601e06c std::fmt: move format string grammar to the bottom 2019-10-12 13:26:31 +02:00
Lzu Tao
81d813dd67 Bump home crate 2019-10-12 08:29:27 +00:00