]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoClean up E0192 explanation
Guillaume Gomez [Mon, 13 Jan 2020 12:34:55 +0000 (13:34 +0100)]
Clean up E0192 explanation

4 years agoClean up E0191 explanation
Guillaume Gomez [Mon, 13 Jan 2020 12:32:32 +0000 (13:32 +0100)]
Clean up E0191 explanation

4 years agoAuto merge of #67961 - ehuss:update-cargo, r=alexcrichton
bors [Tue, 7 Jan 2020 08:11:07 +0000 (08:11 +0000)]
Auto merge of #67961 - ehuss:update-cargo, r=alexcrichton

Update cargo

9 commits in 86134e7666a088682f20b76278c3ee096a315218..6e1ca924a67dd1ac89c33f294ef26b5c43b89168
2019-12-23 16:08:07 +0000 to 2020-01-06 19:11:37 +0000
- Fix dynamic linking for Windows UWP MSVC targets (rust-lang/cargo#7758)
- Fix CARGO_TARGET_triple_LINKER environment variable. (rust-lang/cargo#7763)
- Remove metadata dep_kinds duplicates. (rust-lang/cargo#7756)
- Check for a source defined multiple times. (rust-lang/cargo#7751)
- Fix typo. (rust-lang/cargo#7735)
- Fix config env vars that are prefix of another with underscore. (rust-lang/cargo#7748)
- Add test for `cargo pkgid` (rust-lang/cargo#7741)
- Add a note to the error message for using --feature / --no-default-features in a virtual workspace (rust-lang/cargo#7742)
- Fix debug message. (rust-lang/cargo#7749)

4 years agoAuto merge of #67964 - JohnTitor:rollup-pu5kosl, r=JohnTitor
bors [Tue, 7 Jan 2020 04:54:02 +0000 (04:54 +0000)]
Auto merge of #67964 - JohnTitor:rollup-pu5kosl, r=JohnTitor

Rollup of 13 pull requests

Successful merges:

 - #67566 (Add an unstable conversion from thread ID to u64)
 - #67671 (Account for `type X = impl Trait;` in lifetime suggestion)
 - #67727 (Stabilise vec::remove_item)
 - #67877 (Omit underscore constants from rustdoc)
 - #67880 (Handle multiple error fix suggestions carefuly)
 - #67898 (Improve hygiene of `newtype_index`)
 - #67908 (rustdoc: HTML escape const values)
 - #67909 (Fix ICE in const pretty printing and resolve FIXME)
 - #67929 (Formatting an example for method Vec.retain)
 - #67934 (Clean up E0178 explanation)
 - #67936 (fire "non_camel_case_types" for associated types)
 - #67943 (Missing module std in example.)
 - #67962 (Update books)

Failed merges:

r? @ghost

4 years agoRollup merge of #67962 - ehuss:update-books, r=ehuss
Yuki Okushi [Tue, 7 Jan 2020 04:46:16 +0000 (13:46 +0900)]
Rollup merge of #67962 - ehuss:update-books, r=ehuss

Update books

## nomicon

1 commits in 8be35b201f9cf0a4c3fcc96c83ac21671dcf3112..3e6e1001dc6e095dbd5c88005e80969f60e384e1
2019-12-01 13:02:12 -0500 to 2019-12-14 22:08:52 +0000
- Remove mention of contravariance possibly getting scrapped (rust-lang-nursery/nomicon#177)

## reference

4 commits in d8dfe1b005c03584cd7adc4bfb72b005e7e84744..e1157538e86d83df0cf95d5e33bd943f80d0248f
2019-12-14 21:04:58 +0100 to 2019-12-22 13:13:14 +0100
- Fix typo in macros-by-example.md (rust-lang-nursery/reference#733)
- Remove `extern` from exception list (rust-lang-nursery/reference#732)
- Added clearification that closures are refered to lambdas (rust-lang-nursery/reference#731)
- abi.md: clarify #[used] and linking (rust-lang-nursery/reference#712)

## book

2 commits in ef8bb568035ded8ddfa30a9309026638cc3c8136..5c5cfd2e94cd42632798d9bd3d1116133e128ac9
2019-11-28 11:00:04 -0600 to 2019-12-16 09:27:21 -0600
- document new --show-output option in ch 11-2 (Rust >= 1.39) (rust-lang/book#2065)
- Fix sentence in ch07 (rust-lang/book#2183)

## rust-by-example

3 commits in b7ac1bc76b7d02a43c83b3a931d226f708aa1ff4..1d59403cb5269c190cc52a95584ecc280345495a
2019-12-02 11:38:43 -0300 to 2019-12-27 08:27:05 -0300
- Enable section-folding of table of content (rust-lang/rust-by-example#1290)
- Remove unnecessary lifetime annotation (rust-lang/rust-by-example#1300)
- eliminate the warnings (rust-lang/rust-by-example#1301)

## edition-guide

1 commits in 6601cab4666596494a569f94aa63b7b3230e9769..1a2390247ad6d08160e0dd74f40a01a9578659c2
2019-11-22 12:08:58 -0500 to 2019-12-29 10:40:55 -0800
- Updated install and uninstall instructions (rust-lang-nursery/edition-guide#194)

## embedded-book

1 commits in c26234930282210849256e4ecab925f0f2daf3be..9493b7d4dc97eda439bd8780f05ad7b234cd1cd7
2019-12-07 17:25:11 +0000 to 2019-12-27 20:05:00 +0000
- fixed typo in Interrupts.md  (rust-embedded/book#218)

4 years agoRollup merge of #67943 - Stromberg90:patch-1, r=jonas-schievink
Yuki Okushi [Tue, 7 Jan 2020 04:46:15 +0000 (13:46 +0900)]
Rollup merge of #67943 - Stromberg90:patch-1, r=jonas-schievink

Missing module std in example.

4 years agoRollup merge of #67936 - euclio:assoc-type-bad-style, r=Centril
Yuki Okushi [Tue, 7 Jan 2020 04:46:13 +0000 (13:46 +0900)]
Rollup merge of #67936 - euclio:assoc-type-bad-style, r=Centril

fire "non_camel_case_types" for associated types

Fixes #67920.

4 years agoRollup merge of #67934 - GuillaumeGomez:clean-up-e0178, r=Dylan-DPC
Yuki Okushi [Tue, 7 Jan 2020 04:46:12 +0000 (13:46 +0900)]
Rollup merge of #67934 - GuillaumeGomez:clean-up-e0178, r=Dylan-DPC

Clean up E0178 explanation

r? @Dylan-DPC

4 years agoRollup merge of #67929 - mgrachev:patch-1, r=jonas-schievink
Yuki Okushi [Tue, 7 Jan 2020 04:46:10 +0000 (13:46 +0900)]
Rollup merge of #67929 - mgrachev:patch-1, r=jonas-schievink

Formatting an example for method Vec.retain

4 years agoRollup merge of #67909 - varkor:obsolete-const-print, r=davidtwco
Yuki Okushi [Tue, 7 Jan 2020 04:46:08 +0000 (13:46 +0900)]
Rollup merge of #67909 - varkor:obsolete-const-print, r=davidtwco

Fix ICE in const pretty printing and resolve FIXME

Consts now have a `fmt::Display` impl, so we can just use that to pretty-print.

This resolves an ICE in https://github.com/rust-lang/rust/issues/61936, though it hits more ICEs afterwards. I couldn't find a test case that was resolved by this that didn't hit errors later on.

4 years agoRollup merge of #67908 - ollie27:rustdoc_const_html_escape, r=GuillaumeGomez
Yuki Okushi [Tue, 7 Jan 2020 04:46:07 +0000 (13:46 +0900)]
Rollup merge of #67908 - ollie27:rustdoc_const_html_escape, r=GuillaumeGomez

rustdoc: HTML escape const values

r? @GuillaumeGomez

4 years agoRollup merge of #67898 - matthewjasper:newtype-index-hygiene, r=Centril
Yuki Okushi [Tue, 7 Jan 2020 04:46:05 +0000 (13:46 +0900)]
Rollup merge of #67898 - matthewjasper:newtype-index-hygiene, r=Centril

Improve hygiene of `newtype_index`

`newtype_index` no longer needs `rustc_index::vec::Idx` to be in scope.

r? @Centril

4 years agoRollup merge of #67880 - lbonn:fix/multi-substs, r=petrochenkov
Yuki Okushi [Tue, 7 Jan 2020 04:46:04 +0000 (13:46 +0900)]
Rollup merge of #67880 - lbonn:fix/multi-substs, r=petrochenkov

Handle multiple error fix suggestions carefuly

The existing code seems to assume that substitutions spans are disjoint,
which is not always the case.

In the example:

    pub trait AAAA {}
    pub trait B {}
    pub trait C {}
    pub type T<P: AAAA + B + C> = P;

, we get three substituions starting from ':' and ending respectively at
the end of each trait token.

With the former offset calculation, this would cause `underline_start` to
eventually become negative before being converted to `usize`...

The new version may report erroneous results for non perfectly overlapping
substitutions but I don't know if such examples exist. Alternatively, we
could detect these cases and trim out overlapping substitutions.

Fixes #67690

4 years agoRollup merge of #67877 - dtolnay:const-_, r=nagisa
Yuki Okushi [Tue, 7 Jan 2020 04:46:02 +0000 (13:46 +0900)]
Rollup merge of #67877 - dtolnay:const-_, r=nagisa

Omit underscore constants from rustdoc

Underscore constants from https://github.com/rust-lang/rfcs/pull/2526 / https://github.com/rust-lang/rust/issues/54912 do not correspond to a nameable item and so are never useful in documentation.
<br>

#### Before:

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/1940490/71771409-0427cc80-2eef-11ea-8b7d-d9c74a873e7e.png" width="60%">

#### After:

> Not that.

4 years agoRollup merge of #67727 - Dylan-DPC:stabilise/remove_item, r=alexcrichton
Yuki Okushi [Tue, 7 Jan 2020 04:46:01 +0000 (13:46 +0900)]
Rollup merge of #67727 - Dylan-DPC:stabilise/remove_item, r=alexcrichton

Stabilise vec::remove_item

Closes #40062

r? @alexcrichton

4 years agoRollup merge of #67671 - estebank:type-impl-trait, r=davidtwco
Yuki Okushi [Tue, 7 Jan 2020 04:45:59 +0000 (13:45 +0900)]
Rollup merge of #67671 - estebank:type-impl-trait, r=davidtwco

Account for `type X = impl Trait;` in lifetime suggestion

Fix #67619.

4 years agoRollup merge of #67566 - Mark-Simulacrum:thread-id-u64, r=alexcrichton
Yuki Okushi [Tue, 7 Jan 2020 04:45:58 +0000 (13:45 +0900)]
Rollup merge of #67566 - Mark-Simulacrum:thread-id-u64, r=alexcrichton

Add an unstable conversion from thread ID to u64

We see multiple cases inside rustc and ecosystem code where ThreadId is
transmuted to u64, exploiting the underlying detail. This is suboptimal
(can break unexpectedly if we change things in std).

It is unlikely that ThreadId will ever need to be larger than u64 --
creating even 2^32 threads over the course of a program is quite hard,
2^64 is even harder. As such, we do not choose to return a larger sized
type (e.g. u128). If we choose to shrink ThreadId in the future, or
otherwise change its internals, it is likely that a mapping to u64 will
still be applicable (though may become more complex).

I will file a tracking issue as soon as this is loosely approved.

4 years agoUpdate books
Eric Huss [Tue, 7 Jan 2020 03:07:18 +0000 (19:07 -0800)]
Update books

4 years agoUpdate cargo
Eric Huss [Tue, 7 Jan 2020 03:02:16 +0000 (19:02 -0800)]
Update cargo

4 years agoAuto merge of #67950 - JohnTitor:clippyup, r=JohnTitor
bors [Tue, 7 Jan 2020 01:34:37 +0000 (01:34 +0000)]
Auto merge of #67950 - JohnTitor:clippyup, r=JohnTitor

Update Clippy

Fixes #67941

r? @ghost

4 years agoAccount for `type X = impl Trait;` in lifetime suggestion
Esteban Küber [Sat, 28 Dec 2019 04:09:33 +0000 (20:09 -0800)]
Account for `type X = impl Trait;` in lifetime suggestion

4 years agoImprove hygiene of `newtype_index`
Matthew Jasper [Sun, 5 Jan 2020 15:01:00 +0000 (15:01 +0000)]
Improve hygiene of `newtype_index`

Also add unit tests

4 years agoUpdate Clippy
Yuki Okushi [Mon, 6 Jan 2020 19:39:35 +0000 (04:39 +0900)]
Update Clippy

4 years agoAuto merge of #66899 - msizanoen1:riscv-std, r=alexcrichton
bors [Mon, 6 Jan 2020 19:07:42 +0000 (19:07 +0000)]
Auto merge of #66899 - msizanoen1:riscv-std, r=alexcrichton

Standard library support for riscv64gc-unknown-linux-gnu

Add std support for RISC-V 64-bit GNU/Linux and update libc for RISC-V support.

r? @alexcrichton

4 years agooh the one that was left behind
dylan_DPC [Mon, 6 Jan 2020 17:58:47 +0000 (23:28 +0530)]
oh the one that was left behind

4 years agoRemoved module usage.
Strømberg [Mon, 6 Jan 2020 16:38:41 +0000 (17:38 +0100)]
Removed module usage.

4 years agoMissing module std in example.
Strømberg [Mon, 6 Jan 2020 16:25:17 +0000 (17:25 +0100)]
Missing module std in example.

4 years agoAdd an unstable conversion from thread ID to u64
Mark Rousskov [Mon, 23 Dec 2019 17:54:54 +0000 (12:54 -0500)]
Add an unstable conversion from thread ID to u64

We see multiple cases inside rustc and ecosystem code where ThreadId is
transmuted to u64, exploiting the underlying detail. This is suboptimal
(can break unexpectedly if we change things in std).

It is unlikely that ThreadId will ever need to be larger than u64 --
creating even 2^32 threads over the course of a program is quite hard,
2^64 is even harder. As such, we do not choose to return a larger sized
type (e.g. u128). If we choose to shrink ThreadId in the future, or
otherwise change its internals, it is likely that a mapping to u64 will
still be applicable (though may become more complex).

4 years agoUpdate cc crate
msizanoen1 [Mon, 6 Jan 2020 15:44:57 +0000 (22:44 +0700)]
Update cc crate

4 years agostabilise it
dylan_DPC [Mon, 6 Jan 2020 15:07:49 +0000 (20:37 +0530)]
stabilise it

4 years agofire "non_camel_case_types" for associated types
Andy Russell [Mon, 6 Jan 2020 14:51:23 +0000 (09:51 -0500)]
fire "non_camel_case_types" for associated types

4 years agoClean up E0178 explanation
Guillaume Gomez [Mon, 6 Jan 2020 14:28:12 +0000 (15:28 +0100)]
Clean up E0178 explanation

4 years agoremove usage of feature gate
dylan_DPC [Mon, 30 Dec 2019 12:27:00 +0000 (17:57 +0530)]
remove usage of feature gate

4 years agostabilise remove_item
dylan_DPC [Mon, 30 Dec 2019 11:59:03 +0000 (17:29 +0530)]
stabilise remove_item

4 years agoAuto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisa
bors [Mon, 6 Jan 2020 12:55:40 +0000 (12:55 +0000)]
Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisa

Nix `rustc_hir` reexports in rustc::hir

r? @Zoxc cc @Mark-Simulacrum

4 years agoFormatting an example for method Vec.retain
Grachev Mikhail [Mon, 6 Jan 2020 12:18:03 +0000 (15:18 +0300)]
Formatting an example for method Vec.retain

4 years agoAuto merge of #67917 - Dylan-DPC:rollup-id05y91, r=Dylan-DPC
bors [Mon, 6 Jan 2020 09:31:27 +0000 (09:31 +0000)]
Auto merge of #67917 - Dylan-DPC:rollup-id05y91, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #67800 (Fix ICE involving calling `Instance.ty` during const evaluation)
 - #67873 (change remove to have a PartialEq bound)
 - #67897 (Use `as_deref()` to replace `as_ref().map(...)`)
 - #67906 (Silence `TooGeneric` error)
 - #67912 (macros: typo fix)
 - #67915 (Use Self instead of $type)

Failed merges:

r? @ghost

4 years agoRollup merge of #67915 - lzutao:Self, r=Centril
Dylan DPC [Mon, 6 Jan 2020 06:30:23 +0000 (12:00 +0530)]
Rollup merge of #67915 - lzutao:Self, r=Centril

Use Self instead of $type

r? @Dylan-DPC

4 years agoRollup merge of #67912 - LPardue:patch-1, r=Centril
Dylan DPC [Mon, 6 Jan 2020 06:30:22 +0000 (12:00 +0530)]
Rollup merge of #67912 - LPardue:patch-1, r=Centril

macros: typo fix

spotted while reviewing the todo!macro docs

4 years agoRollup merge of #67906 - varkor:silence-toogeneric, r=nagisa
Dylan DPC [Mon, 6 Jan 2020 06:30:20 +0000 (12:00 +0530)]
Rollup merge of #67906 - varkor:silence-toogeneric, r=nagisa

Silence `TooGeneric` error

This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later.

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

r? @eddyb

4 years agoRollup merge of #67897 - pickfire:patch-1, r=Dylan-DPC
Dylan DPC [Mon, 6 Jan 2020 06:30:19 +0000 (12:00 +0530)]
Rollup merge of #67897 - pickfire:patch-1, r=Dylan-DPC

Use `as_deref()` to replace `as_ref().map(...)`

Suggested by @lzutao

4 years agoRollup merge of #67873 - Dylan-DPC:feature/change-remove-to-partial, r=Amanieu
Dylan DPC [Mon, 6 Jan 2020 06:30:17 +0000 (12:00 +0530)]
Rollup merge of #67873 - Dylan-DPC:feature/change-remove-to-partial, r=Amanieu

change remove to have a PartialEq bound

Addresses [comment](https://github.com/rust-lang/rust/pull/67727#issuecomment-570660301).

References #40062

r? @Amanieu

4 years agoRollup merge of #67800 - Aaron1011:fix/mir-generic-instance, r=oli-obk
Dylan DPC [Mon, 6 Jan 2020 06:30:16 +0000 (12:00 +0530)]
Rollup merge of #67800 - Aaron1011:fix/mir-generic-instance, r=oli-obk

Fix ICE involving calling `Instance.ty` during const evaluation

Fixes #67639

`Instance.ty` assumes that we are in a fully monomorphic context (e.g.
codegen), and can therefore use an empty `ParamEnv` when performing
normalization. Howver, the MIR constant evaluator code ends up calling
`Instance.ty` as a result of us attemptign to 'speculatively'
const-evaluate generic functions during const propagation.

As a result,
we may end up with projections involving type parameters
(e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize.
Normalization expects us to have proper predicates in the `ParamEnv` for
such projections, and will ICE if we don't.

This commit adds a new method `Instance.ty_env`, which takes a
`ParamEnv` for use during normalization. The MIR const-evaluator code is
changed to use this method, passing in the proper `ParamEnv` for the
context at hand.

4 years agoUse Self instead of $type
Lzu Tao [Mon, 6 Jan 2020 04:33:31 +0000 (04:33 +0000)]
Use Self instead of $type

4 years agomacros: typo fix
Lucas Pardue [Mon, 6 Jan 2020 01:55:24 +0000 (01:55 +0000)]
macros: typo fix

spotted while reviewing the todo!macro docs

4 years agoFix ICE in const pretty printing and resolve FIXME
varkor [Mon, 6 Jan 2020 00:11:27 +0000 (00:11 +0000)]
Fix ICE in const pretty printing and resolve FIXME

Consts now have a `fmt::Display` impl, so we can just use that to pretty-print.

4 years agoAuto merge of #67563 - euclio:rustdoc-buffer-lexer, r=GuillaumeGomez
bors [Mon, 6 Jan 2020 00:09:14 +0000 (00:09 +0000)]
Auto merge of #67563 - euclio:rustdoc-buffer-lexer, r=GuillaumeGomez

buffer lexer errors in rustdoc syntax checking

The code isn't ideal (I really would like to display the errors inline), but this at least gets us to where we were before #63017.

4 years agorustdoc: HTML escape const values
Oliver Middleton [Sun, 5 Jan 2020 23:19:42 +0000 (23:19 +0000)]
rustdoc: HTML escape const values

4 years agoUse Instance.ty_env instead of Instance.monomorphic_ty in interpreter
Aaron Hill [Sun, 5 Jan 2020 23:09:57 +0000 (18:09 -0500)]
Use Instance.ty_env instead of Instance.monomorphic_ty in interpreter

4 years agoSilence `TooGeneric` error
varkor [Sun, 5 Jan 2020 23:00:47 +0000 (23:00 +0000)]
Silence `TooGeneric` error

This error may be produced during intermediate failed attempts at evaluation of a generic const, which may nevertheless succeed later.

4 years agoAuto merge of #67821 - matthiaskrgr:submodule_upd, r=Xanewok
bors [Sun, 5 Jan 2020 20:56:03 +0000 (20:56 +0000)]
Auto merge of #67821 - matthiaskrgr:submodule_upd, r=Xanewok

submodules: update rls from fed7a31 to 7010eee

Changes:
````
Update Clippy
Update cargo.
Correct two links to the json-error-emitter
````

Fixes #67708

4 years agoFix typo
Aaron Hill [Sun, 5 Jan 2020 20:00:55 +0000 (15:00 -0500)]
Fix typo

4 years agoRename Instance.ty to Instance.monomorphic_ty
Aaron Hill [Sun, 5 Jan 2020 19:59:40 +0000 (14:59 -0500)]
Rename Instance.ty to Instance.monomorphic_ty

4 years agos/projections/params/
Aaron Hill [Fri, 3 Jan 2020 04:03:05 +0000 (23:03 -0500)]
s/projections/params/

4 years agoRun rustfmt
Aaron Hill [Fri, 3 Jan 2020 03:27:26 +0000 (22:27 -0500)]
Run rustfmt

4 years agoChange 'panic!' to 'bug!'
Aaron Hill [Fri, 3 Jan 2020 01:38:54 +0000 (20:38 -0500)]
Change 'panic!' to 'bug!'

Co-Authored-By: Wesley Wiser <wwiser@gmail.com>
4 years agoFix ICE involving calling `Instance.ty` during const evaluation
Aaron Hill [Thu, 2 Jan 2020 05:42:31 +0000 (00:42 -0500)]
Fix ICE involving calling `Instance.ty` during const evaluation

Fixes #67639

`Instance.ty` assumes that we are in a fully monomorphic context (e.g.
codegen), and can therefore use an empty `ParamEnv` when performing
normalization. Howver, the MIR constant evaluator code ends up calling
`Instance.ty` as a result of us attemptign to 'speculatively'
const-evaluate generic functions during const propagation.

As a result,
we may end up with projections involving type parameters
(e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize.
Normalization expects us to have proper predicates in the `ParamEnv` for
such projections, and will ICE if we don't.

This commit adds a new method `Instance.ty_env`, which takes a
`ParamEnv` for use during normalization. The MIR const-evaluator code is
changed to use this method, passing in the proper `ParamEnv` for the
context at hand.

4 years agoAuto merge of #67903 - Dylan-DPC:rollup-k9djyrf, r=Dylan-DPC
bors [Sun, 5 Jan 2020 17:31:32 +0000 (17:31 +0000)]
Auto merge of #67903 - Dylan-DPC:rollup-k9djyrf, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #67818 (rustdoc: Avoid panic when parsing codeblocks for playground links)
 - #67845 (Also remove const-hack for abs)
 - #67879 (Remove negative number check from float sqrt)
 - #67881 (Add backticks to various diagnostics)
 - #67882 (remove bespoke flock bindings)

Failed merges:

r? @ghost

4 years agoRollup merge of #67882 - euclio:flock, r=rkruppe
Dylan DPC [Sun, 5 Jan 2020 17:14:34 +0000 (22:44 +0530)]
Rollup merge of #67882 - euclio:flock, r=rkruppe

remove bespoke flock bindings

Replaces some `struct flock` definitions with the definition from `libc`.

4 years agoRollup merge of #67881 - varkor:scattering-of-backticks, r=Centril
Dylan DPC [Sun, 5 Jan 2020 17:14:33 +0000 (22:44 +0530)]
Rollup merge of #67881 - varkor:scattering-of-backticks, r=Centril

Add backticks to various diagnostics

4 years agoRollup merge of #67879 - ollie27:float_sqrt_neg, r=rkruppe
Dylan DPC [Sun, 5 Jan 2020 17:14:32 +0000 (22:44 +0530)]
Rollup merge of #67879 - ollie27:float_sqrt_neg, r=rkruppe

Remove negative number check from float sqrt

It hasn't been UB to pass negative numbers to sqrt since https://reviews.llvm.org/D28797 which was included in LLVM 5.

4 years agoRollup merge of #67845 - jumbatm:also-unconst-hack-abs, r=oli-obk
Dylan DPC [Sun, 5 Jan 2020 17:14:30 +0000 (22:44 +0530)]
Rollup merge of #67845 - jumbatm:also-unconst-hack-abs, r=oli-obk

Also remove const-hack for abs

Closes #67842.

r? @oli-obk

4 years agoRollup merge of #67818 - ollie27:rustdoc_playground_syntax_error, r=GuillaumeGomez
Dylan DPC [Sun, 5 Jan 2020 17:14:29 +0000 (22:44 +0530)]
Rollup merge of #67818 - ollie27:rustdoc_playground_syntax_error, r=GuillaumeGomez

rustdoc: Avoid panic when parsing codeblocks for playground links

`make_test` is also called when parsing codeblocks for the playground links so it should handle unwinds from the parser internally.

Fixes #63016

r? @GuillaumeGomez

4 years agoUse `as_deref()` to replace `as_ref().map(...)`
Ivan Tham [Sun, 5 Jan 2020 15:10:30 +0000 (23:10 +0800)]
Use `as_deref()` to replace `as_ref().map(...)`

Suggested by @lzutao

4 years agoAuto merge of #67895 - JohnTitor:clippy-up, r=oli-obk
bors [Sun, 5 Jan 2020 14:24:55 +0000 (14:24 +0000)]
Auto merge of #67895 - JohnTitor:clippy-up, r=oli-obk

Update Clippy

Fixes #67859

r? @oli-obk

4 years agoHandle multiple error fix suggestions carefuly
Laurent Bonnans [Sat, 4 Jan 2020 23:58:41 +0000 (00:58 +0100)]
Handle multiple error fix suggestions carefuly

The existing code seems to assume that substitutions spans are disjoint,
which is not always the case.

In the example:

    pub trait AAAA {}
    pub trait B {}
    pub trait C {}
    pub type T<P: AAAA + B + C> = P;

, we get three substituions starting from ':' and ending respectively at
the end of each trait token.

With the former offset calculation, this would cause `underline_start` to
eventually become negative before being converted to `usize`...

The new version may report erroneous results for non perfectly overlapping
substitutions but I don't know if such examples exist. Alternatively, we
could detect these cases and trim out overlapping substitutions.

4 years agofix ui-fulldeps fallout
Mazdak Farrokhzad [Sun, 5 Jan 2020 04:35:51 +0000 (05:35 +0100)]
fix ui-fulldeps fallout

4 years agoRemove rustc_hir reexports in rustc::hir.
Mazdak Farrokhzad [Sun, 5 Jan 2020 01:37:57 +0000 (02:37 +0100)]
Remove rustc_hir reexports in rustc::hir.

4 years agolibrustc/hir.rs -> librustc/hir/mod.rs
Mazdak Farrokhzad [Sun, 5 Jan 2020 00:52:30 +0000 (01:52 +0100)]
librustc/hir.rs -> librustc/hir/mod.rs

4 years agosimplify reexports in rustc::hir
Mazdak Farrokhzad [Sun, 5 Jan 2020 00:50:05 +0000 (01:50 +0100)]
simplify reexports in rustc::hir

4 years agoUpdate Clippy
Yuki Okushi [Sun, 5 Jan 2020 11:15:04 +0000 (20:15 +0900)]
Update Clippy

4 years agoadd feature gate
dylan_DPC [Sun, 5 Jan 2020 10:12:35 +0000 (15:42 +0530)]
add feature gate

4 years agoAuto merge of #67777 - Zoxc:time-refactor, r=wesleywiser
bors [Sun, 5 Jan 2020 07:54:23 +0000 (07:54 +0000)]
Auto merge of #67777 - Zoxc:time-refactor, r=wesleywiser

Use self profile infrastructure for -Z time and -Z time-passes

There's no longer indentation for -Z time and -Z time-passes and duplicate timers between self profiling and -Z time-passes have been removed.

r? @wesleywiser

4 years agoUse self profile infrastructure for -Z time and -Z time-passes
John Kåre Alsaker [Wed, 1 Jan 2020 01:24:05 +0000 (02:24 +0100)]
Use self profile infrastructure for -Z time and -Z time-passes

4 years agoAuto merge of #67808 - Marwes:projection_normalization_recurse, r=nikomatsakis
bors [Sun, 5 Jan 2020 01:18:57 +0000 (01:18 +0000)]
Auto merge of #67808 - Marwes:projection_normalization_recurse, r=nikomatsakis

perf: Don't recurse into types that do not need normalizing

A bit speculative at this stage but profiling shows that type folding
takes up a substantial amount of time during normalization which may
indicate that many types may be folded despite there being nothing to
normalize

4 years agoremove bespoke flock bindings
Andy Russell [Sat, 4 Jan 2020 23:11:56 +0000 (18:11 -0500)]
remove bespoke flock bindings

4 years agobuffer lexer errors in rustdoc syntax checking
Andy Russell [Thu, 12 Dec 2019 21:28:26 +0000 (16:28 -0500)]
buffer lexer errors in rustdoc syntax checking

4 years agoAdd backticks to various diagnostics
varkor [Sun, 5 Jan 2020 00:17:46 +0000 (00:17 +0000)]
Add backticks to various diagnostics

4 years agoRemove negative number check from float sqrt
Oliver Middleton [Sat, 4 Jan 2020 23:44:19 +0000 (23:44 +0000)]
Remove negative number check from float sqrt

It hasn't been UB to pass negative numbers to sqrt since https://reviews.llvm.org/D28797 which was included in LLVM 5.

4 years agoRe-add comment about behaviour of inline.
jumbatm [Sat, 4 Jan 2020 06:43:31 +0000 (16:43 +1000)]
Re-add comment about behaviour of inline.

4 years agoAuto merge of #67803 - Centril:librustc_hir, r=Zoxc
bors [Sat, 4 Jan 2020 21:50:12 +0000 (21:50 +0000)]
Auto merge of #67803 - Centril:librustc_hir, r=Zoxc

Extract `rustc_hir` out of `rustc`

The new crate contains:
```rust
pub mod def;
pub mod def_id;
mod hir;
pub mod hir_id;
pub mod itemlikevisit;
pub mod pat_util;
pub mod print;
mod stable_hash_impls;

pub use hir::*;
pub use hir_id::*;
pub use stable_hash_impls::HashStableContext;
```

Remains to be done in follow-up PRs:

- Move `rustc::hir::map` into `rustc_hir_map` -- this has to be a separate crate due to the `dep_graph` (blocked on https://github.com/rust-lang/rust/pull/67761).

- Move references to `rustc::hir` to `rustc_hir` where possible.

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

r? @Zoxc

4 years agoOmit underscore constants from rustdoc
David Tolnay [Sat, 4 Jan 2020 20:35:23 +0000 (12:35 -0800)]
Omit underscore constants from rustdoc

4 years agosubmodules: update rls from fed7a31 to 7c0489c
Matthias Krüger [Sat, 4 Jan 2020 19:22:19 +0000 (20:22 +0100)]
submodules: update rls from fed7a31 to 7c0489c

Changes:
````
rustup https://github.com/rust-lang/rust/pull/67853
deps: update clippy
Update Clippy
Update cargo.
Correct two links to the json-error-emitter
````

Fixes #67708

4 years agorustdoc: Avoid panic when parsing codeblocks for playground links
Oliver Middleton [Thu, 2 Jan 2020 23:34:00 +0000 (23:34 +0000)]
rustdoc: Avoid panic when parsing codeblocks for playground links

`make_test` is also called when parsing codeblocks for the playground links so it should handle unwinds from the parser internally.

4 years agoAuto merge of #67874 - Dylan-DPC:rollup-xy6bkoe, r=Dylan-DPC
bors [Sat, 4 Jan 2020 18:39:14 +0000 (18:39 +0000)]
Auto merge of #67874 - Dylan-DPC:rollup-xy6bkoe, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #67137 (libstd uses `core::panic::Location` where possible.)
 - #67709 (Introduce an option for disabling deduplication of diagnostics)
 - #67775 (Make "use $crate" a hard error)
 - #67812 (Tweak and extend internal BTreeMap documentation, including debug asserts.)

Failed merges:

r? @ghost

4 years agoremoved blank line
dylan_DPC [Sat, 4 Jan 2020 18:30:40 +0000 (00:00 +0530)]
removed blank line

4 years agoef em ti ... :P
dylan_DPC [Sat, 4 Jan 2020 18:27:34 +0000 (23:57 +0530)]
ef em ti ... :P

4 years agoRollup merge of #67812 - ssomers:btreemap_internal_doc, r=rkruppe
Dylan DPC [Sat, 4 Jan 2020 18:22:51 +0000 (23:52 +0530)]
Rollup merge of #67812 - ssomers:btreemap_internal_doc, r=rkruppe

Tweak and extend internal BTreeMap documentation, including debug asserts.

Gathered from work on various other pull requests (e.g. #67725, #67686).

4 years agoRollup merge of #67775 - mental32:master, r=Dylan-DPC
Dylan DPC [Sat, 4 Jan 2020 18:22:50 +0000 (23:52 +0530)]
Rollup merge of #67775 - mental32:master, r=Dylan-DPC

Make "use $crate" a hard error

Closes #37390

4 years agoRollup merge of #67709 - petrochenkov:nodedup2, r=Centril
Dylan DPC [Sat, 4 Jan 2020 18:22:48 +0000 (23:52 +0530)]
Rollup merge of #67709 - petrochenkov:nodedup2, r=Centril

Introduce an option for disabling deduplication of diagnostics

With the intent of using it in UI tests (https://github.com/rust-lang/rust/pull/67122).

The option is boolean (`-Z deduplicate-diagnostics=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z deduplicate-diagnostics=no -Z deduplicate-diagnostics=yes` == `-Z deduplicate-diagnostics=yes`), so it can be set in a hierarchical way, e.g. UI testing infra may disable the deduplication by default with specific tests being able to enable it back.

4 years agoRollup merge of #67137 - anp:tracked-panic-internals, r=eddyb
Dylan DPC [Sat, 4 Jan 2020 18:22:44 +0000 (23:52 +0530)]
Rollup merge of #67137 - anp:tracked-panic-internals, r=eddyb

libstd uses `core::panic::Location` where possible.

cc @eddyb

4 years agoadd tests
dylan_DPC [Sat, 4 Jan 2020 18:11:17 +0000 (23:41 +0530)]
add tests

4 years agopacify the parallel compiler
Mazdak Farrokhzad [Thu, 2 Jan 2020 08:53:15 +0000 (09:53 +0100)]
pacify the parallel compiler

4 years agocleanup librustc_hir/Cargo.toml
Mazdak Farrokhzad [Thu, 2 Jan 2020 07:51:53 +0000 (08:51 +0100)]
cleanup librustc_hir/Cargo.toml

4 years agohir::{hir,def,itemlikevisit,pat_util,print} -> rustc_hir
Mazdak Farrokhzad [Thu, 2 Jan 2020 04:18:45 +0000 (05:18 +0100)]
hir::{hir,def,itemlikevisit,pat_util,print} -> rustc_hir

Also fix fallout wrt. HashStable.

4 years agoextract Export, ExportMap from hir::def
Mazdak Farrokhzad [Thu, 2 Jan 2020 03:53:12 +0000 (04:53 +0100)]
extract Export, ExportMap from hir::def

4 years agosimplify self::Namespace::* import
Mazdak Farrokhzad [Thu, 2 Jan 2020 03:24:17 +0000 (04:24 +0100)]
simplify self::Namespace::* import

4 years agomove {Par}DeepVisitor to intravisit
Mazdak Farrokhzad [Thu, 2 Jan 2020 03:18:51 +0000 (04:18 +0100)]
move {Par}DeepVisitor to  intravisit

4 years agohir::hir: simplify some imports
Mazdak Farrokhzad [Thu, 2 Jan 2020 02:48:12 +0000 (03:48 +0100)]
hir::hir: simplify some imports

4 years agosplit hir/mod.rs -> hir.rs & hir/hir.rs
Mazdak Farrokhzad [Thu, 2 Jan 2020 02:39:11 +0000 (03:39 +0100)]
split hir/mod.rs -> hir.rs & hir/hir.rs