]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #63949 - JohnTitor:fix-quick-build, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:59 +0000 (13:17 +0200)]
Rollup merge of #63949 - JohnTitor:fix-quick-build, r=Mark-Simulacrum

Fix build src/libtest

Fixes #63928

r? @Mark-Simulacrum

4 years agoRollup merge of #63941 - Keruspe:warnings, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:57 +0000 (13:17 +0200)]
Rollup merge of #63941 - Keruspe:warnings, r=Mark-Simulacrum

rustbuild: allow disabling deny(warnings) for bootstrap

When deny-warnings is not specified or set to true, the behaviour is the same as before.
When deny-warnings is set to false, warnings are now allowed

Fixes #63911

4 years agoRollup merge of #63914 - hvenev:repr-fields, r=eddyb
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:55 +0000 (13:17 +0200)]
Rollup merge of #63914 - hvenev:repr-fields, r=eddyb

ty: use Align for ReprOptions pack and align.

4 years agoRollup merge of #63880 - RalfJung:miri-meta, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:53 +0000 (13:17 +0200)]
Rollup merge of #63880 - RalfJung:miri-meta, r=oli-obk

Validation: check raw wide pointer metadata

While I was at it, I also added a missing check for slices not to be too big.

r? @oli-obk
Fixes https://github.com/rust-lang/miri/issues/918

4 years agoRollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasper
Mazdak Farrokhzad [Thu, 29 Aug 2019 11:17:52 +0000 (13:17 +0200)]
Rollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasper

resolve: Block expansion of a derive container until all its derives are resolved

So, it turns out there's one more reason to block expansion of a `#[derive]` container until all the derives inside it are resolved, beside `Copy` (https://github.com/rust-lang/rust/pull/63248).

The set of derive helper attributes registered by derives in the container also has to be known before the derives themselves are expanded, otherwise it may be too late (see https://github.com/rust-lang/rust/pull/63468#issuecomment-524550872 and the `#[stable_hasher]`-related test failures in https://github.com/rust-lang/rust/pull/63468).

So, we stop our attempts to unblock the container earlier, as soon as the `Copy` status is known, and just block until all its derives are resolved.
After all the derives are resolved we immediately go and process their helper attributes in the item, without delaying it until expansion of the individual derives.

Unblocks https://github.com/rust-lang/rust/pull/63468
r? @matthewjasper (as a reviewer of https://github.com/rust-lang/rust/pull/63248)
cc @c410-f3r

4 years agoAuto merge of #63990 - Centril:rollup-q1nt0b0, r=Centril
bors [Thu, 29 Aug 2019 05:05:17 +0000 (05:05 +0000)]
Auto merge of #63990 - Centril:rollup-q1nt0b0, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #63811 (Correctly suggest adding bounds to `impl Trait` argument)
 - #63933 (Resolve some small issues related to #63580)
 - #63938 (or-pattern: fix typo in error message)
 - #63945 (Recover `mut $pat` and other improvements)
 - #63958 (const_prop: only call error_to_const_error if we are actually showing something)
 - #63961 (Add Option<Span> to `require_lang_item`)
 - #63963 (remove the reference to __cxa_thread_atexit_impl)
 - #63965 (Prevent syntax error in LD linker version script)
 - #63968 (rustc_apfloat: make the crate #![no_std] explicitly.)
 - #63970 (Notify me (flip1995) when Clippy toolstate changes)
 - #63980 (add missing `#[repr(C)]` on the Slices union)

Failed merges:

 - #63989 (Add Yaah to clippy toolstain notification list)

r? @ghost

4 years agoRollup merge of #63980 - DutchGhost:master, r=cramertj
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:58 +0000 (05:32 +0200)]
Rollup merge of #63980 - DutchGhost:master, r=cramertj

add missing `#[repr(C)]` on the Slices union

Adds the `#[repr(C)]` attribute to the `Slices` union used to convert an `&str` into a `&[u8]`.
Without the attribute, the union has an unspecified layout: https://doc.rust-lang.org/reference/types/union.html, so performing the 'transmute' is unsound without the attribute (as far as I understand).

The `Repr` union, used for converting a raw ptr + len to a slice has this attribute as well:
https://github.com/rust-lang/rust/blob/master/src/libcore/ptr/mod.rs#L211-#L216

4 years agoRollup merge of #63970 - flip1995:notify_clippy, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:57 +0000 (05:32 +0200)]
Rollup merge of #63970 - flip1995:notify_clippy, r=oli-obk

Notify me (flip1995) when Clippy toolstate changes

I want in on the fun :tada:

Also friendly ping @llogiq @mcarton: Since you two aren't _that_ active on the Clippy repo anymore, do you still want to get pinged on Clippy toolstate changes?

r? @oli-obk

4 years agoRollup merge of #63968 - eddyb:apfloat-nostd, r=matthewjasper
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:56 +0000 (05:32 +0200)]
Rollup merge of #63968 - eddyb:apfloat-nostd, r=matthewjasper

rustc_apfloat: make the crate #![no_std] explicitly.

We only need allocation, and even that could be made optional.

4 years agoRollup merge of #63965 - loganwendholt:linker-script-fix, r=michaelwoerister
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:54 +0000 (05:32 +0200)]
Rollup merge of #63965 - loganwendholt:linker-script-fix, r=michaelwoerister

Prevent syntax error in LD linker version script

As discussed in #63925, there is an edge case in which an invalid LD version script is generated when building a `cdylib` with no exported symbols. This PR makes a slight modification to the  LD version script generation by first checking to see if any symbols need to be exported. If not, the `global` section of the linker script is simply omitted, and the syntax error is averted.

4 years agoRollup merge of #63963 - Wind-River:master_003, r=alexcrichton
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:53 +0000 (05:32 +0200)]
Rollup merge of #63963 - Wind-River:master_003, r=alexcrichton

remove the reference to __cxa_thread_atexit_impl

r? @alexcrichton

cc @n-salim

4 years agoRollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebank
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:51 +0000 (05:32 +0200)]
Rollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebank

Add Option<Span> to `require_lang_item`

Fixes #63954

I'm not sure where to take `Some(span)` or something so I use `None` in many places.
r? @estebank

4 years agoRollup merge of #63958 - RalfJung:silence-const-prop, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:50 +0000 (05:32 +0200)]
Rollup merge of #63958 - RalfJung:silence-const-prop, r=oli-obk

const_prop: only call error_to_const_error if we are actually showing something

This makes `RUSTC_CTFE_BACKTRACE` useful again.

r? @oli-obk

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

4 years agoRollup merge of #63945 - Centril:recover-mut-pat, r=estebank
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:48 +0000 (05:32 +0200)]
Rollup merge of #63945 - Centril:recover-mut-pat, r=estebank

Recover `mut $pat` and other improvements

- Recover on e.g. `mut Foo(x, y)` and suggest `Foo(mut x, mut y)`. Fixes https://github.com/rust-lang/rust/issues/63764.
- Recover on e.g. `let mut mut x;`
- Recover on e.g. `let keyword` and `let keyword(...)`.
- Cleanups in `token.rs` with `fn is_non_raw_ident_where` and friends.

4 years agoRollup merge of #63938 - tshepang:typo, r=Centril
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:46 +0000 (05:32 +0200)]
Rollup merge of #63938 - tshepang:typo, r=Centril

or-pattern: fix typo in error message

cc https://github.com/rust-lang/rust/issues/54883.

4 years agoRollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obk
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:45 +0000 (05:32 +0200)]
Rollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obk

Resolve some small issues related to #63580

This resolves some feedback left on #63580 after it was merged:

- Adds documentation to `mir::Static` and `mir::StaticKind`
- Simplifies `maybe_get_optimized_mir()` and `maybe_get_promoted_mir()`

cc @bjorn3 @RalfJung

4 years agoRollup merge of #63811 - estebank:impl-trait-arg, r=cramertj
Mazdak Farrokhzad [Thu, 29 Aug 2019 03:32:43 +0000 (05:32 +0200)]
Rollup merge of #63811 - estebank:impl-trait-arg, r=cramertj

Correctly suggest adding bounds to `impl Trait` argument

Fix #63706.

4 years agoAuto merge of #62855 - Aaron1011:feature/rustdoc-reexport-final, r=petrochenkov
bors [Thu, 29 Aug 2019 01:22:11 +0000 (01:22 +0000)]
Auto merge of #62855 - Aaron1011:feature/rustdoc-reexport-final, r=petrochenkov

Improve Rustdoc's handling of procedural macros

Fixes #58700
Fixes #58696
Fixes #49553
Fixes #52210

This commit removes the special rustdoc handling for proc macros, as we can now
retrieve their span and attributes just like any other item.

A new command-line option is added to rustdoc: `--crate-type`. This takes the same options as rustc's `--crate-type` option. However, all values other than `proc-macro` are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate.

In compiletest, a new 'rustdoc-flags' option is added. This allows us to
pass in the '--proc-macro-crate' flag in the absence of Cargo.

I've opened [an additional PR to Cargo](https://github.com/rust-lang/cargo/pull/7159) to support passing in this flag.
These two PRS can be merged in any order - the Cargo changes will not
take effect until the 'cargo' submodule is updated in this repository.

4 years agoAllow running rustdoc on proc-macro crates without specifying '--crate-type proc...
Aaron Hill [Wed, 28 Aug 2019 22:00:36 +0000 (18:00 -0400)]
Allow running rustdoc on proc-macro crates without specifying '--crate-type proc-macro'

Add a test to make sure that this works

4 years agoAuto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrum
bors [Wed, 28 Aug 2019 21:42:52 +0000 (21:42 +0000)]
Auto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrum

Save crate filtering on rustdoc

Fixes #62929.

I added a hashmap and a hash encoding for the current crate list in case you have multiple crates handling on a same website (who talked about docs.rs?!). Like that, for each context, you have the filter crate selected.

r? @QuietMisdreavus

4 years agoAuto merge of #63875 - philipc:issue-57822, r=michaelwoerister
bors [Wed, 28 Aug 2019 17:49:37 +0000 (17:49 +0000)]
Auto merge of #63875 - philipc:issue-57822, r=michaelwoerister

debuginfo: give unique names to closure and generator types

Closure types have been moved to the namespace where they
are defined, and both closure and generator type names now
include the disambiguator.

This fixes an exception when lldb prints nested closures.

Fixes #57822

I haven't included the `DW_AT_artificial` changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now:
```
(lldb) p g
(issue_57822::main::closure-1) $1 = closure-1(closure(1))
```
but adding `DW_AT_artificial` changes this to:
```
(lldb) p g
(issue_57822::main::closure-1) $0 = closure-1 {

}
```

Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though.

r? @michaelwoerister

4 years agoadd missing `#[repr(C)]` on a union
Dodo [Wed, 28 Aug 2019 15:38:24 +0000 (17:38 +0200)]
add missing `#[repr(C)]` on a union

4 years agoAuto merge of #63853 - matthewjasper:test-ast-serialization, r=estebank
bors [Wed, 28 Aug 2019 13:43:05 +0000 (13:43 +0000)]
Auto merge of #63853 - matthewjasper:test-ast-serialization, r=estebank

Add default serialization for `Ident`s

Also add tests for `-Zast-json` and `-Zast-json-noexpand`

closes #63728

4 years agoNotify me (flip1995) when Clippy toolstate changes
flip1995 [Wed, 28 Aug 2019 11:23:00 +0000 (13:23 +0200)]
Notify me (flip1995) when Clippy toolstate changes

4 years agoExtract `Decoder::entry_unless_proc_macro()`
Wesley Wiser [Wed, 28 Aug 2019 01:24:57 +0000 (21:24 -0400)]
Extract `Decoder::entry_unless_proc_macro()`

4 years agoSimplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`
Wesley Wiser [Tue, 27 Aug 2019 01:58:16 +0000 (21:58 -0400)]
Simplify `maybe_get_optimized_mir` and `maybe_get_promoted_mir`

Since both functions are always unwrapped, don't wrap the return value
in an `Option`.

4 years agoAdd some comments to `mir::Static` and `mir::StaticKind`
Wesley Wiser [Tue, 27 Aug 2019 01:07:58 +0000 (21:07 -0400)]
Add some comments to `mir::Static` and `mir::StaticKind`

4 years agoSave crate filtering on rustdoc
Guillaume Gomez [Wed, 24 Jul 2019 15:50:48 +0000 (17:50 +0200)]
Save crate filtering on rustdoc

4 years agorustc_apfloat: make the crate #![no_std] explicitly.
Eduard-Mihai Burtescu [Wed, 28 Aug 2019 08:23:41 +0000 (11:23 +0300)]
rustc_apfloat: make the crate #![no_std] explicitly.

4 years agoAuto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakis
bors [Wed, 28 Aug 2019 07:29:07 +0000 (07:29 +0000)]
Auto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakis

Simplify eager normalization of constants

r? @nikomatsakis

4 years agoAuto merge of #63127 - kper:pr, r=nikomatsakis
bors [Wed, 28 Aug 2019 03:42:00 +0000 (03:42 +0000)]
Auto merge of #63127 - kper:pr, r=nikomatsakis

Cleanup: Consistently use `Param` instead of `Arg` #62426

Fixes #62426

4 years agoPrevent syntax error in ld linker version script
Logan Wendholt [Wed, 28 Aug 2019 00:35:33 +0000 (20:35 -0400)]
Prevent syntax error in ld linker version script

4 years agoor-pattern: fix typo in error message
Tshepang Lekhonkhobe [Wed, 28 Aug 2019 00:23:58 +0000 (02:23 +0200)]
or-pattern: fix typo in error message

4 years agoAuto merge of #63960 - ehuss:update-cargo, r=alexcrichton
bors [Tue, 27 Aug 2019 23:57:05 +0000 (23:57 +0000)]
Auto merge of #63960 - ehuss:update-cargo, r=alexcrichton

Update cargo

Update cargo

10 commits in 3f700ec43ce72305eb5315cfc710681f3469d4b4..22f7dd0495cd72ce2082d318d5a9b4dccb9c5b8c
2019-08-19 22:43:12 +0000 to 2019-08-27 16:10:51 +0000
- Update and improve zsh completion (rust-lang/cargo#7296)
- Document that `package` can be used in `[patch]` (rust-lang/cargo#7263)
- Fix `error:`/`warning:` coloring inconsistency with rustc (rust-lang/cargo#7294)
- Tests: Import rustc_plugin from its new location (rust-lang/cargo#7287)
- Update README azure badge. (rust-lang/cargo#7293)
- Update home dependencies to v0.5 (rust-lang/cargo#7277)
- Fix typo (rust-lang/cargo#7279)
- Update libgit2 dependencies (rust-lang/cargo#7275)
- Fix old lockfile encoding wrt newlines (rust-lang/cargo#7262)
- Fix dSYM uplifting when symlink is broken (rust-lang/cargo#7268)

4 years agoRemove `sized` spans
Yuki Okushi [Tue, 27 Aug 2019 22:32:25 +0000 (07:32 +0900)]
Remove `sized` spans

4 years agoApply review comments
Yuki Okushi [Tue, 27 Aug 2019 22:10:47 +0000 (07:10 +0900)]
Apply review comments

4 years agoAdd Option<Span> to `require_lang_item`
Yuki Okushi [Tue, 27 Aug 2019 21:17:58 +0000 (06:17 +0900)]
Add Option<Span> to `require_lang_item`

4 years agoMerge pull request #9 from Wind-River/V7LIBC-948
Baoshan [Tue, 27 Aug 2019 22:06:16 +0000 (15:06 -0700)]
Merge pull request #9 from Wind-River/V7LIBC-948

remove the reference to __cxa_thread_atexit_impl

4 years agoAdd default serialization for `Ident`s
Matthew Jasper [Sat, 24 Aug 2019 15:25:55 +0000 (16:25 +0100)]
Add default serialization for `Ident`s

Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.

4 years agoImprove 'mut ' diagnostic.
Mazdak Farrokhzad [Tue, 27 Aug 2019 21:44:44 +0000 (23:44 +0200)]
Improve 'mut ' diagnostic.

4 years agoUpdate cargo
Eric Huss [Tue, 27 Aug 2019 21:03:32 +0000 (14:03 -0700)]
Update cargo

4 years agoconst_prop: only call error_to_const_error if we are actually showing something
Ralf Jung [Tue, 27 Aug 2019 20:18:25 +0000 (22:18 +0200)]
const_prop: only call error_to_const_error if we are actually showing something

4 years agoEnsure 'let mut ;' where ':pat' is banned.
Mazdak Farrokhzad [Tue, 27 Aug 2019 17:51:21 +0000 (19:51 +0200)]
Ensure 'let mut ;' where ':pat' is banned.

4 years agoremove the reference to __cxa_thread_atexit_impl
Baoshan Pang [Tue, 27 Aug 2019 17:13:59 +0000 (10:13 -0700)]
remove the reference to __cxa_thread_atexit_impl

4 years agoAuto merge of #63922 - RalfJung:miri, r=nikomatsakis
bors [Tue, 27 Aug 2019 16:23:59 +0000 (16:23 +0000)]
Auto merge of #63922 - RalfJung:miri, r=nikomatsakis

update miri

Cc @oli-obk

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

4 years agoFix build src/libtest
Yuki Okushi [Tue, 27 Aug 2019 15:32:21 +0000 (00:32 +0900)]
Fix build src/libtest

4 years agoChanging error messages and renaming tests #63127
Kevin Per [Tue, 27 Aug 2019 13:47:41 +0000 (15:47 +0200)]
Changing error messages and renaming tests #63127

`async-await/no-args-non-move-async-closure`
`generator/no-arguments-on-generators`

4 years agorustbuild: allow disabling deny(warnings) for bootstrap
Marc-Antoine Perennou [Tue, 27 Aug 2019 07:37:51 +0000 (09:37 +0200)]
rustbuild: allow disabling deny(warnings) for bootstrap

When deny-warnings is not specified or set to true, the behaviour is the same as before.
When deny-warnings is set to false, warnings are now allowed

Fixes #63911

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
4 years agoupdate miri
Ralf Jung [Tue, 27 Aug 2019 13:49:47 +0000 (15:49 +0200)]
update miri

4 years agoAuto merge of #63639 - Mark-Simulacrum:rustdoc-clean-3, r=GuillaumeGomez
bors [Tue, 27 Aug 2019 12:45:16 +0000 (12:45 +0000)]
Auto merge of #63639 - Mark-Simulacrum:rustdoc-clean-3, r=GuillaumeGomez

rustdoc: general cleanup

4 years agoCleanup: Consistently use `Param` instead of `Arg` #62426
Kevin Per [Tue, 27 Aug 2019 11:24:32 +0000 (13:24 +0200)]
Cleanup: Consistently use `Param` instead of `Arg` #62426

4 years agorecover on 'mut ' and improve recovery for keywords.
Mazdak Farrokhzad [Tue, 27 Aug 2019 11:04:48 +0000 (13:04 +0200)]
recover on 'mut ' and improve recovery for keywords.

4 years agoSimplify with Symbol/Token::is_book_lit.
Mazdak Farrokhzad [Tue, 27 Aug 2019 08:21:41 +0000 (10:21 +0200)]
Simplify with Symbol/Token::is_book_lit.

4 years agotoken: refactor with is_non_raw_ident_where.
Mazdak Farrokhzad [Tue, 27 Aug 2019 08:14:07 +0000 (10:14 +0200)]
token: refactor with is_non_raw_ident_where.

4 years agoAuto merge of #63940 - Centril:rollup-47qe9gn, r=Centril
bors [Tue, 27 Aug 2019 06:18:24 +0000 (06:18 +0000)]
Auto merge of #63940 - Centril:rollup-47qe9gn, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #62600 (libtest: add --show-output flag to print stdout of successful tests)
 - #63698 (Fixed floating point issue with asinh function)
 - #63761 (Propagate spans and attributes from proc macro definitions)
 - #63917 (Error when generator trait is not found)

Failed merges:

r? @ghost

4 years agoRollup merge of #63917 - lzutao:langitem_gen_63912, r=centril,cramert
Mazdak Farrokhzad [Tue, 27 Aug 2019 06:17:52 +0000 (08:17 +0200)]
Rollup merge of #63917 - lzutao:langitem_gen_63912, r=centril,cramert

Error when generator trait is not found

Closes #63912

4 years agoRollup merge of #63761 - petrochenkov:procattrs, r=eddyb
Mazdak Farrokhzad [Tue, 27 Aug 2019 06:17:51 +0000 (08:17 +0200)]
Rollup merge of #63761 - petrochenkov:procattrs, r=eddyb

Propagate spans and attributes from proc macro definitions

Thanks to https://github.com/rust-lang/rust/pull/63269 we now have spans and attributes from proc macro definitions available in metadata.

However, that PR didn't actually put them into use! This PR finishes that work.

Attributes `rustc_macro_transparency`, `allow_internal_unstable`, `allow_internal_unsafe`, `local_inner_macros`, `rustc_builtin_macro`, `stable`, `unstable`, `rustc_deprecated`, `deprecated` now have effect when applied to proc macro definition functions.
From those attributes only `deprecated` is both stable and supposed to be used in new code.
(`#![staged_api]` still cannot be used in proc macro crates for unrelated reasons though.)

`Span::def_site` from the proc macro API now returns the correct location of the proc macro definition.

Also, I made a mistake in https://github.com/rust-lang/rust/pull/63269#discussion_r312702919, loaded proc macros didn't actually use the resolver cache.
This PR fixes the caching issue, now proc macros go through the `Resolver::macro_map` cache as well.

(Also, the first commit turns `proc_macro::quote` into a regular built-in macro to reduce the number of places where `SyntaxExtension`s need to be manually created.)

4 years agoRollup merge of #63698 - Phosphorus15:master, r=nagisa
Mazdak Farrokhzad [Tue, 27 Aug 2019 06:17:49 +0000 (08:17 +0200)]
Rollup merge of #63698 - Phosphorus15:master, r=nagisa

Fixed floating point issue with asinh function

This should fixes #63271 , in which `asinh(-0.0)` returns `0.0` instead of `-0.0`.
according to @nagisa
>
>
> IEEE-754 (2008), section 9.2.1:
>
> > For the functions expm1, exp2m1, exp10m1, logp1, log2p1, log10p1, sin, tan, sinPi, atanPi, asin, atan, sinh, tanh, asinh, and atanh, f(+0) is +0 and f(−0) is −0 with no exception.
>
> and
>
> > sinh(±∞) and asinh(±∞) are ±∞ with no exception.

After ensuring that the function `asinh` is the only function affected (functions like `sin`, `sinh` are all based on `cmath` library or `llvm` intrinsics), and that `atanh` always gives the correct result. The only function to modify is `asinh`.

4 years agoRollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbg
Mazdak Farrokhzad [Tue, 27 Aug 2019 06:17:48 +0000 (08:17 +0200)]
Rollup merge of #62600 - emmericp:libtest-add-show-output, r=gnzlbg

libtest: add --show-output flag to print stdout of successful tests

This pull request adds a new flag `--show-output` for tests to show the output of successful tests. For most formatters this was already supported just not exposed via the CLI (apparently only used by `librustdoc`). I've also added support for this option in the JSON formatter.

This kind of fixes https://github.com/rust-lang/rust/issues/54669 which wants `--format json` to work with `--nocapture`, which is... well, impossible. What this issue really calls for is `--show-output` as implemented here.

4 years agodebuginfo: always include disambiguator in type names
Philip Craig [Tue, 27 Aug 2019 00:34:28 +0000 (10:34 +1000)]
debuginfo: always include disambiguator in type names

4 years agoShorten line during rendering instead of in markdown
Mark Rousskov [Mon, 12 Aug 2019 20:49:22 +0000 (16:49 -0400)]
Shorten line during rendering instead of in markdown

4 years agoInline recurse into only callsite
Mark Rousskov [Mon, 12 Aug 2019 20:43:26 +0000 (16:43 -0400)]
Inline recurse into only callsite

4 years agoTransition a few fmt::Display impls to functions
Mark Rousskov [Mon, 12 Aug 2019 18:36:09 +0000 (14:36 -0400)]
Transition a few fmt::Display impls to functions

This introduces a WithFormatter abstraction that permits one-time
fmt::Display on an arbitrary closure, created via `display_fn`. This
allows us to prevent allocation while still using functions instead of
structs, which are a bit unwieldy to thread arguments through as they
can't easily call each other (and are generally a bit opaque).

The eventual goal here is likely to move us off of the formatting
infrastructure entirely in favor of something more structured, but this
is a good step to move us in that direction as it makes, for example,
passing a context describing current state to the formatting impl much
easier.

4 years agoAuto merge of #63926 - Centril:rollup-6kckn9n, r=Centril
bors [Tue, 27 Aug 2019 00:07:38 +0000 (00:07 +0000)]
Auto merge of #63926 - Centril:rollup-6kckn9n, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #63317 (Do not complain about unused code when used in `impl` `Self` type)
 - #63693 (Fully implement or-pattern parsing)
 - #63836 (VxWorks does not provide a way to set the task name except at creation time)
 - #63845 (Removed a confusing FnOnce example)
 - #63855 (Refactor feature gates)
 - #63921 (add link to FileCheck docs)

Failed merges:

r? @ghost

4 years agoInline RawMutableSpace
Mark Rousskov [Mon, 12 Aug 2019 16:57:48 +0000 (12:57 -0400)]
Inline RawMutableSpace

4 years agoStore only the current depth
Mark Rousskov [Mon, 12 Aug 2019 16:53:45 +0000 (12:53 -0400)]
Store only the current depth

Previously we stored the entire current path which is a bit expensive
and only ever accessed its length. This stores the length directly.

4 years agoRemove support for printing HRef in alternate mode
Mark Rousskov [Mon, 12 Aug 2019 15:18:25 +0000 (11:18 -0400)]
Remove support for printing HRef in alternate mode

The alternate mode merely prints out the passed in text which is largely
useless (as the text can simply be directly printed).

4 years agoRemove dead tracking of external param names
Mark Rousskov [Mon, 12 Aug 2019 11:32:38 +0000 (07:32 -0400)]
Remove dead tracking of external param names

4 years agoMutate DocContext from LibEmbargoVisitor and RustdocVisitor
Mark Rousskov [Mon, 12 Aug 2019 11:21:04 +0000 (07:21 -0400)]
Mutate DocContext from LibEmbargoVisitor and RustdocVisitor

We have &mut access, so remove the RefCell borrowing

4 years agoMove top-level Clean impl to function
Mark Rousskov [Mon, 12 Aug 2019 11:10:55 +0000 (07:10 -0400)]
Move top-level Clean impl to function

This allows us to pass it a `&mut DocContext` which will allow removal
of RefCells, etc. in the following commits. It's also somewhat a unique
Clean impl in that it previously ignored `self` (re-retriveing
hir::Crate), which it no longer needs to do.

4 years agoMove source HTML generation to own module
Mark Rousskov [Sun, 11 Aug 2019 20:11:53 +0000 (16:11 -0400)]
Move source HTML generation to own module

4 years agoproc_macro: Update `Span::def_site` to use the proc macro definition location
Vadim Petrochenkov [Tue, 20 Aug 2019 20:35:03 +0000 (23:35 +0300)]
proc_macro: Update `Span::def_site` to use the proc macro definition location

Which is no longer dummy and is available from metadata now.

4 years agometadata: Eliminate `FullProcMacro`
Vadim Petrochenkov [Tue, 20 Aug 2019 20:18:55 +0000 (23:18 +0300)]
metadata: Eliminate `FullProcMacro`

Fix caching of loaded proc macros

4 years agoRespect attributes on proc macro definitions
Vadim Petrochenkov [Tue, 20 Aug 2019 18:22:32 +0000 (21:22 +0300)]
Respect attributes on proc macro definitions

4 years agoRollup merge of #63921 - RalfJung:file-check, r=alexcrichton
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:51 +0000 (23:55 +0200)]
Rollup merge of #63921 - RalfJung:file-check, r=alexcrichton

add link to FileCheck docs

Thanks @gnzlbg for pointing me to those docs.

4 years agoRollup merge of #63855 - killercup:refactor/feature-gates, r=Centril
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:49 +0000 (23:55 +0200)]
Rollup merge of #63855 - killercup:refactor/feature-gates, r=Centril

Refactor feature gates

After #63824, this goes a few steps further by

- parsing doc comments in the macros to extract descriptions for feature gates, and
- introducing a common `Feature` type to replace the tuples used previously to improve readability.

The descriptions are not yet used, but I felt like this PR is a useful enough refactoring on its own.

r? @Centril

4 years agoRollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakis
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:47 +0000 (23:55 +0200)]
Rollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakis

Removed a confusing FnOnce example

# Description
See #47091 for a discussion.

## Changes
- Removed an example that might suggest readers that square_x is (only) FnOnce.

closes #47091

4 years agoRollup merge of #63836 - Wind-River:master_003, r=alexcrichton
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:46 +0000 (23:55 +0200)]
Rollup merge of #63836 - Wind-River:master_003, r=alexcrichton

VxWorks does not provide a way to set the task name except at creation time

Make set_name do thing as VxWorks does not provide a way to set the task name except at creation time.

r? @alexcrichton

cc @n-salim

4 years agoRollup merge of #63693 - Centril:polish-parse-or-pats, r=estebank
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:44 +0000 (23:55 +0200)]
Rollup merge of #63693 - Centril:polish-parse-or-pats, r=estebank

Fully implement or-pattern parsing

Builds upon the initial parsing in https://github.com/rust-lang/rust/pull/61708 to fully implement or-pattern (`p | q`) parsing as specified in [the grammar section of RFC 2535](https://github.com/rust-lang/rfcs/blob/master/text/2535-or-patterns.md#grammar).

Noteworthy:

- We allow or-patterns in `[p | q, ...]`.
- We allow or-patterns in `let` statements and `for` expressions including with leading `|`.
- We improve recovery for `p || q` (+ tests for that in `multiple-pattern-typo.rs`).
- We improve recovery for `| p | q` in inner patterns (tests in `or-patterns-syntactic-fail.rs`).
- We rigorously test or-pattern parsing (in `or-patterns-syntactic-{pass,fail}.rs`).
- We harden the feature gating tests.
- We do **_not_** change `ast.rs`. That is, `ExprKind::Let.0` and `Arm.pats` still accept `Vec<P<Pat>>`.
   I was starting work on that but it would be cleaner to do this in a separate PR so this one has a narrower scope.

cc @dlrobertson
cc the tracking issue https://github.com/rust-lang/rust/issues/54883.

r? @estebank

4 years agoRollup merge of #63317 - estebank:dead-code, r=matthewjasper
Mazdak Farrokhzad [Mon, 26 Aug 2019 21:55:42 +0000 (23:55 +0200)]
Rollup merge of #63317 - estebank:dead-code, r=matthewjasper

Do not complain about unused code when used in `impl` `Self` type

Fix https://github.com/rust-lang/rust/issues/18290.

4 years agoproc_macro: Turn `quote` into a regular built-in macro
Vadim Petrochenkov [Mon, 19 Aug 2019 23:26:40 +0000 (02:26 +0300)]
proc_macro: Turn `quote` into a regular built-in macro

Previously in was implemented using a special hack in the metadata loader

4 years agoresolve: Block expansion of a derive container until all its derives are resolved
Vadim Petrochenkov [Sat, 24 Aug 2019 18:12:13 +0000 (21:12 +0300)]
resolve: Block expansion of a derive container until all its derives are resolved

Also mark derive helpers as known as a part of the derive container's expansion instead of expansion of the derives themselves which may happen too late.

4 years agoreview comment
Esteban Küber [Mon, 26 Aug 2019 20:25:27 +0000 (13:25 -0700)]
review comment

4 years agoadjust tests
Ralf Jung [Mon, 26 Aug 2019 20:19:47 +0000 (22:19 +0200)]
adjust tests

4 years agoparser: fix span for leading vert.
Mazdak Farrokhzad [Mon, 26 Aug 2019 20:14:31 +0000 (22:14 +0200)]
parser: fix span for leading vert.

4 years agoadd link to FileCheck docs
Ralf Jung [Mon, 26 Aug 2019 18:40:30 +0000 (20:40 +0200)]
add link to FileCheck docs

4 years agoraw slices do not have to comply to the size limit
Ralf Jung [Mon, 26 Aug 2019 17:48:56 +0000 (19:48 +0200)]
raw slices do not have to comply to the size limit

4 years agoError when generator trait is not found
Lzu Tao [Mon, 26 Aug 2019 17:51:52 +0000 (17:51 +0000)]
Error when generator trait is not found

4 years agoAuto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavis
bors [Mon, 26 Aug 2019 17:33:50 +0000 (17:33 +0000)]
Auto merge of #63901 - estebank:unknown-receiver-type, r=zackmdavis

Point at method call on missing annotation error

Make it clearer where the type name that couldn't be inferred comes from.

Before:

```
error[E0282]: type annotations needed
 --> src/test/ui/span/type-annotations-needed-expr.rs:2:13
  |
2 |     let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `S`
  |
  = note: type must be known at this point
```
after
```
error[E0282]: type annotations needed
 --> src/test/ui/span/type-annotations-needed-expr.rs:2:39
  |
2 |     let _ = (vec![1,2,3]).into_iter().sum() as f64; //~ ERROR E0282
  |                                       ^^^ cannot infer type for `S`
  |
  = note: type must be known at this point
```

CC #63852.

4 years agoAuto merge of #63897 - petrochenkov:prettycomma, r=estebank
bors [Mon, 26 Aug 2019 13:45:18 +0000 (13:45 +0000)]
Auto merge of #63897 - petrochenkov:prettycomma, r=estebank

pprust: Do not print spaces before some tokens

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

r? @Mark-Simulacrum

4 years agoty: use Align for ReprOptions pack and align.
Hristo Venev [Mon, 26 Aug 2019 13:14:30 +0000 (13:14 +0000)]
ty: use Align for ReprOptions pack and align.

4 years agoAuto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obk
bors [Mon, 26 Aug 2019 07:48:24 +0000 (07:48 +0000)]
Auto merge of #63580 - wesleywiser:move_promoted_out, r=oli-obk

Move promoted MIR out of `mir::Body`

r? @oli-obk

4 years agoAuto merge of #62891 - vext01:improve-black-box-docs, r=RalfJung,Centril,gnzlbg
bors [Mon, 26 Aug 2019 04:10:54 +0000 (04:10 +0000)]
Auto merge of #62891 - vext01:improve-black-box-docs, r=RalfJung,Centril,gnzlbg

Improve the documentation for std::hint::black_box.

The other day a colleague was reviewing some of my code which was using `black_box` to block constant propogation. There was a little confusion because the documentation kind of implies that `black_box` is only useful for dead code elimination, and only in benchmarking scenarios.

The docs currently say:

> A function that is opaque to the optimizer, to allow benchmarks to pretend to use outputs to assist in avoiding dead-code elimination.

Here is our discussion, in which I show (using godbolt) that a black box can also block constant propagation:
https://github.com/softdevteam/yk/pull/21#discussion_r302985038

This change makes the docstring for `black_box` a little more general, and while we are here, I've added an example (the same one from our discussion).

![image](https://user-images.githubusercontent.com/604955/61701322-ddf1e400-ad35-11e9-878c-b5b44a20770c.png)

OK to go in?

4 years agoAuto merge of #62603 - cuviper:no-unwind-abort, r=joshtriplett
bors [Mon, 26 Aug 2019 00:27:17 +0000 (00:27 +0000)]
Auto merge of #62603 - cuviper:no-unwind-abort, r=joshtriplett

Permit unwinding through FFI by default

This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like [RFC 2699](https://github.com/rust-lang/rfcs/pull/2699), as long as progress is being made to that end.

r? @joshtriplett

4 years agoPoint at method call on missing annotation error
Esteban Küber [Sun, 25 Aug 2019 20:34:57 +0000 (13:34 -0700)]
Point at method call on missing annotation error

Make it clearer where the type name that couldn't be infered comes from.

4 years agoAuto merge of #61613 - sinkuu:impl_trait_inline, r=ollie27
bors [Sun, 25 Aug 2019 19:20:20 +0000 (19:20 +0000)]
Auto merge of #61613 - sinkuu:impl_trait_inline, r=ollie27

Support `impl Trait` in inlined documentation

`impl Trait` in argument position was not properly rendered when inlined from other crates. ([a live example on docs.rs](https://docs.rs/libp2p/0.8.1/libp2p/floodsub/struct.Floodsub.html#method.unsubscribe))

![old](https://user-images.githubusercontent.com/7091080/59089838-14ba9900-8946-11e9-830b-53b317bdecb4.png)

![new](https://user-images.githubusercontent.com/7091080/59089844-16845c80-8946-11e9-9fe3-8998af9d73ce.png)

4 years agoRefactor feature gate checking code
Pascal Hertleif [Sat, 24 Aug 2019 15:50:21 +0000 (17:50 +0200)]
Refactor feature gate checking code

Tries to clarify the filtering of active features and make the code more
expressive.

4 years agopprust: Do not print spaces before some tokens
Vadim Petrochenkov [Sun, 25 Aug 2019 17:41:52 +0000 (20:41 +0300)]
pprust: Do not print spaces before some tokens

4 years agoForce #[unwind(aborts)] in test/codegen/c-variadic.rs
Josh Stone [Fri, 10 May 2019 22:10:15 +0000 (15:10 -0700)]
Force #[unwind(aborts)] in test/codegen/c-variadic.rs

4 years agoRevert "Allow a dirty MirBuilt for make_extern and make_method_extern"
Josh Stone [Tue, 2 Apr 2019 21:53:57 +0000 (14:53 -0700)]
Revert "Allow a dirty MirBuilt for make_extern and make_method_extern"

This reverts commit b4a6f597934f16f89e27058a32a514c9572f148f.