]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #57840 - tromey:fix-issue-57762, r=nikic
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:20:00 +0000 (00:20 +0100)]
Rollup merge of #57840 - tromey:fix-issue-57762, r=nikic

Fix issue 57762

against a stock LLVM 7.  LLVM 7 was released without a necessary fix
for a bug in the DWARF discriminant code.

This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.

Closes #57762

5 years agoRollup merge of #57836 - oli-obk:existential_crisis, r=estebank
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:59 +0000 (00:19 +0100)]
Rollup merge of #57836 - oli-obk:existential_crisis, r=estebank

Fix some cross crate existential type ICEs

fixes #53443

5 years agoRollup merge of #57834 - SimonSapin:type_id, r=Centril
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:58 +0000 (00:19 +0100)]
Rollup merge of #57834 - SimonSapin:type_id, r=Centril

Stabilize Any::get_type_id and rename to type_id

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749

Closes https://github.com/rust-lang/rust/issues/27745.

5 years agoRollup merge of #57817 - davidtwco:issue-54521, r=estebank
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:57 +0000 (00:19 +0100)]
Rollup merge of #57817 - davidtwco:issue-54521, r=estebank

Add error for trailing angle brackets.

Fixes #54521.

This PR adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.

r? @estebank

5 years agoRollup merge of #57795 - estebank:did-you-mean, r=zackmdavis
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:55 +0000 (00:19 +0100)]
Rollup merge of #57795 - estebank:did-you-mean, r=zackmdavis

Use structured suggestion in stead of notes

5 years agoRollup merge of #57793 - estebank:impl-trait-resolve, r=oli-obk
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:54 +0000 (00:19 +0100)]
Rollup merge of #57793 - estebank:impl-trait-resolve, r=oli-obk

Explain type mismatch cause pointing to return type when it is `impl Trait`

Fix #57743.

5 years agoRollup merge of #57779 - estebank:recover-struct-fields, r=davidtwco
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:53 +0000 (00:19 +0100)]
Rollup merge of #57779 - estebank:recover-struct-fields, r=davidtwco

Recover from parse errors in literal struct fields and incorrect float literals

Fix #52496.

5 years agoRollup merge of #57730 - Zoxc:combined-ast-validator, r=cramertj
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:52 +0000 (00:19 +0100)]
Rollup merge of #57730 - Zoxc:combined-ast-validator, r=cramertj

Merge visitors in AST validation

Cuts runtime for AST validation on `syntex_syntax` from 31.5 ms to 17 ms.

5 years agoRollup merge of #57179 - Xaeroxe:patch-1, r=QuietMisdreavus
Mazdak Farrokhzad [Wed, 23 Jan 2019 23:19:50 +0000 (00:19 +0100)]
Rollup merge of #57179 - Xaeroxe:patch-1, r=QuietMisdreavus

Update std/lib.rs docs to reflect Rust 2018 usage

Fixes #56544

This paragraph was written for Rust 2015.  Since 2018 has been stable for a while I think we can update it.

5 years agoAuto merge of #57857 - pietroalbini:fix-android-ci, r=aidanhs
bors [Wed, 23 Jan 2019 15:53:23 +0000 (15:53 +0000)]
Auto merge of #57857 - pietroalbini:fix-android-ci, r=aidanhs

Fix Android CI failing to download SDKs

A component of the Android SDK now requires an additional license ([full license text](https://gist.github.com/pietroalbini/28b46a6fed0921d129de58e7aef29f11)) to be accepted before it's possible to use it. The license is dated January 16th 2019, so it's recent.

The weird thing about the license is that it doesn't prompt you to accept it during `sdkmanager --licenses` like all the other ones, but during `sdkmanager platform-tools emulator ...`, and we didn't pipe `yes` to it before this PR.

The PR changes the SDK installation script to accept all the licenses even on the `sdkmanager platform-tools emulator` command.

5 years agoRemove unused feature gates
Oliver Scherer [Wed, 23 Jan 2019 10:34:58 +0000 (11:34 +0100)]
Remove unused feature gates

5 years agomake sure to accept all android licenses
Pietro Albini [Wed, 23 Jan 2019 10:21:24 +0000 (11:21 +0100)]
make sure to accept all android licenses

5 years agoAuto merge of #57835 - pnkfelix:issue-57673-remove-leaky-nested-probe, r=arielb1
bors [Tue, 22 Jan 2019 23:02:38 +0000 (23:02 +0000)]
Auto merge of #57835 - pnkfelix:issue-57673-remove-leaky-nested-probe, r=arielb1

typeck: remove leaky nested probe during trait object method resolution

addresses #57673  (but not marking with f-x because thats now afflicting beta channel).

Fix #57216

5 years agoAuto merge of #57805 - matthiaskrgr:rls, r=Xanewok
bors [Tue, 22 Jan 2019 20:04:13 +0000 (20:04 +0000)]
Auto merge of #57805 - matthiaskrgr:rls, r=Xanewok

submodules: update rls and clippy

Changes:
````
Remove state.analysis due to Rust PR #57476
Improve missing nightly readme info
Bump languageserver-types to v0.54.0 and renam crate name to lsp-types
Delete bors.toml
Fix tests
Fix https://github.com/rust-lang/rls/issues/1231
Implement asynchronous message reading
Use typed requests
Implement Tokio-based test LSP client
Update README.md to account for Travis url change
Simplify wait_for_all recv calls
Update dependencies
Revert NLL bug workaround
Remove old test_data entry in .gitignore
Reorganize some tests
Don't test RLS binary target directly
Move tooltip tests to integration tests
Simplify tooltip test harness
Only use FIXTURES_DIR to determine fixtures
Remove src/test/mod.rs
Centralise FIXTURES_DIR across unit and integration tests
Move lens test to tests/
Suppress unused warnings in tests/*
Beautify main.rs and lib.rs
WIP: Move tests
Move src/test/harness to tests/support/harness
Split RLS into bin/lib
Update Clippy
Change all mentions of `rls-preview` to `rls`
Make config mutex borrow scope explicit
Fallback to racer definition
````

Fixes rls build.

5 years agoSimplify the version check
Tom Tromey [Tue, 22 Jan 2019 18:44:23 +0000 (11:44 -0700)]
Simplify the version check

Address the review comments by simplifying the version check to
just "< 8".

5 years agoFix issue 57762
Tom Tromey [Tue, 22 Jan 2019 18:13:53 +0000 (11:13 -0700)]
Fix issue 57762

Issue 57762 points out a compiler crash when the compiler was built
using a stock LLVM 7.  LLVM 7 was released without a necessary fix for
a bug in the DWARF discriminant code.

This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7.

Closes #57762

5 years agosubmodules: update clippy from 1838bfe5 to 280069dd
Matthias Krüger [Tue, 22 Jan 2019 17:03:40 +0000 (18:03 +0100)]
submodules: update clippy from 1838bfe5 to 280069dd

Changes:
````
Rustfmt all the things
Don't make decisions on values that don't represent the decision
Rustup
Actually check for constants.
formatting fix
Update clippy_lints/src/needless_bool.rs
formatting fix
needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
Remove negative integer literal checks.
Fix `implicit_return` false positives.
````

5 years agosubmodules: update rls from ae0d89a to c9d25b6
Matthias Krüger [Mon, 21 Jan 2019 15:32:43 +0000 (16:32 +0100)]
submodules: update rls from ae0d89a to c9d25b6

Changes:
````
Remove state.analysis due to Rust PR #57476
Improve missing nightly readme info
Bump languageserver-types to v0.54.0 and renam crate name to lsp-types
Delete bors.toml
Fix tests
Fix https://github.com/rust-lang/rls/issues/1231
Implement asynchronous message reading
Use typed requests
Implement Tokio-based test LSP client
Update README.md to account for Travis url change
Simplify wait_for_all recv calls
Update dependencies
Revert NLL bug workaround
Remove old test_data entry in .gitignore
Reorganize some tests
Don't test RLS binary target directly
Move tooltip tests to integration tests
Simplify tooltip test harness
Only use FIXTURES_DIR to determine fixtures
Remove src/test/mod.rs
Centralise FIXTURES_DIR across unit and integration tests
Move lens test to tests/
Suppress unused warnings in tests/*
Beautify main.rs and lib.rs
WIP: Move tests
Move src/test/harness to tests/support/harness
Split RLS into bin/lib
Update Clippy
Change all mentions of `rls-preview` to `rls`
Make config mutex borrow scope explicit
Fallback to racer definition
````

Fixes rls build.

5 years agoRemove unused links
Jacob Kiesel [Tue, 22 Jan 2019 16:39:19 +0000 (09:39 -0700)]
Remove unused links

5 years agoAuto merge of #57647 - cuviper:gdb-version, r=tromey
bors [Tue, 22 Jan 2019 16:14:42 +0000 (16:14 +0000)]
Auto merge of #57647 - cuviper:gdb-version, r=tromey

[rust-gdb] relax the GDB version regex

The pretty-printer script is checking `gdb.VERSION` to see if it's at
least 8.1 for some features. With `re.match`, it will only find the
version at the beginning of that string, but in Fedora the string is
something like "Fedora 8.2-5.fc29". Using `re.search` instead will find
the first location that matches anywhere, so it will find my 8.2.

5 years agoFix some cross crate existential type ICEs
Oliver Scherer [Tue, 22 Jan 2019 14:08:31 +0000 (15:08 +0100)]
Fix some cross crate existential type ICEs

5 years agounit test for issue 57673.
Felix S. Klock II [Tue, 22 Jan 2019 13:49:18 +0000 (14:49 +0100)]
unit test for issue 57673.

5 years agoDo not initiate nested probe within `assemble_probe`.
Felix S. Klock II [Tue, 22 Jan 2019 12:51:30 +0000 (13:51 +0100)]
Do not initiate nested probe within `assemble_probe`.

In particular, the table entries (associated with type-variables
created during the probe) must persist as long as the candidates
assembled during the probe. If you make a nested probe without
creating a nested `ProbeContext`, the table entries are popped at the
end of the nested probe, while the type-variables would leak out via
the assembled candidates attached to `self` (the outer
`ProbeContext`). This causes an ICE (*if you are lucky*)!

5 years agoAuto merge of #57830 - Centril:rollup, r=Centril
bors [Tue, 22 Jan 2019 13:40:01 +0000 (13:40 +0000)]
Auto merge of #57830 - Centril:rollup, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #57537 (Small perf improvement for fmt)
 - #57552 (Default images)
 - #57604 (Make `str` indexing generic on `SliceIndex`.)
 - #57667 (Fix memory leak in P::filter_map)
 - #57677 (const_eval: Predetermine the layout of all locals when pushing a stack frame)
 - #57791 (Add regression test for #54582)
 - #57798 (Corrected spelling inconsistency)
 - #57809 (Add powerpc64-unknown-freebsd)
 - #57813 (fix validation range printing when encountering undef)

Failed merges:

r? @ghost

5 years agoStabilize Any::get_type_id and rename to type_id
Simon Sapin [Tue, 22 Jan 2019 13:25:27 +0000 (14:25 +0100)]
Stabilize Any::get_type_id and rename to type_id

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749

5 years agoRollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obk
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:36 +0000 (12:20 +0100)]
Rollup merge of #57813 - RalfJung:validation-range-printing, r=oli-obk

fix validation range printing when encountering undef

5 years agoRollup merge of #57809 - MikaelUrankar:powerpc64-unknown-freebsd, r=nagisa
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:34 +0000 (12:20 +0100)]
Rollup merge of #57809 - MikaelUrankar:powerpc64-unknown-freebsd, r=nagisa

Add powerpc64-unknown-freebsd

FreeBSD review: https://reviews.freebsd.org/D18367

5 years agoRollup merge of #57798 - hellow554:master, r=davidtwco
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:33 +0000 (12:20 +0100)]
Rollup merge of #57798 - hellow554:master, r=davidtwco

Corrected spelling inconsistency

resolves #57773

5 years agoRollup merge of #57791 - estebank:issue-54582, r=zackmdavis
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:32 +0000 (12:20 +0100)]
Rollup merge of #57791 - estebank:issue-54582, r=zackmdavis

Add regression test for #54582

Fix #54582.

5 years agoRollup merge of #57677 - dotdash:locals, r=michaelwoerister
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:31 +0000 (12:20 +0100)]
Rollup merge of #57677 - dotdash:locals, r=michaelwoerister

const_eval: Predetermine the layout of all locals when pushing a stack frame

Usually the layout of any locals is required at least three times, once
when it becomes live, once when it is written to, and once it is read
from. By adding a cache for them, we can reduce the number of layout
queries speeding up code that is heavy on const_eval.

5 years agoRollup merge of #57667 - ishitatsuyuki:p-leak, r=nnethercote
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:29 +0000 (12:20 +0100)]
Rollup merge of #57667 - ishitatsuyuki:p-leak, r=nnethercote

Fix memory leak in P::filter_map

Probably this function isn't widely used, but anyway this wasn't working as intended.

r? @eddyb

Do not rollup if you want to see if max-rss change in perf.

5 years agoRollup merge of #57604 - alercah:str-index, r=sfackler
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:28 +0000 (12:20 +0100)]
Rollup merge of #57604 - alercah:str-index, r=sfackler

Make `str` indexing generic on `SliceIndex`.

Fixes #55603

5 years agoRollup merge of #57552 - GuillaumeGomez:default-images, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:27 +0000 (12:20 +0100)]
Rollup merge of #57552 - GuillaumeGomez:default-images, r=QuietMisdreavus

Default images

Add default rust logo (the image at the top of the sidebar) and default favicon. No more missing image or inexistent icon on the documentation tabs!

r? @QuietMisdreavus

5 years agoRollup merge of #57537 - sinkuu:fmt_perf, r=alexcrichton
Mazdak Farrokhzad [Tue, 22 Jan 2019 11:20:23 +0000 (12:20 +0100)]
Rollup merge of #57537 - sinkuu:fmt_perf, r=alexcrichton

Small perf improvement for fmt

Added benchmark is based on #10761

5 years agoAuto merge of #56221 - estebank:remove-dummy-checks, r=varkor
bors [Tue, 22 Jan 2019 10:59:09 +0000 (10:59 +0000)]
Auto merge of #56221 - estebank:remove-dummy-checks, r=varkor

Remove unnecessary dummy span checks

The emitter already verifies wether a given span note or span label
can be emitted to the output. If it can't, because it is a dummy
span, it will be either elided for labels or emitted as an unspanned
note/help when applicable.

5 years agoAuto merge of #57821 - RalfJung:miri, r=oli-obk
bors [Tue, 22 Jan 2019 08:24:58 +0000 (08:24 +0000)]
Auto merge of #57821 - RalfJung:miri, r=oli-obk

update miri

r? @oli-obk

5 years agoCorrected spelling inconsistency
Marcel Hellwig [Mon, 21 Jan 2019 07:09:56 +0000 (08:09 +0100)]
Corrected spelling inconsistency

resolves #57773

5 years agoAuto merge of #57475 - SimonSapin:signed, r=estebank
bors [Tue, 22 Jan 2019 05:42:11 +0000 (05:42 +0000)]
Auto merge of #57475 - SimonSapin:signed, r=estebank

Add signed num::NonZeroI* types

Multiple people have asked for them in https://github.com/rust-lang/rust/issues/49137. Given that the unsigned ones already exist, they are very easy to add and not an additional maintenance burden.

5 years agoFix typo
varkor [Mon, 21 Jan 2019 23:53:56 +0000 (15:53 -0800)]
Fix typo

Co-Authored-By: estebank <estebank@users.noreply.github.com>
5 years agoFix typo
varkor [Mon, 21 Jan 2019 23:53:45 +0000 (15:53 -0800)]
Fix typo

Co-Authored-By: estebank <estebank@users.noreply.github.com>
5 years agoAccept more invalid code that is close to correct fields
Esteban Küber [Mon, 21 Jan 2019 23:28:51 +0000 (15:28 -0800)]
Accept more invalid code that is close to correct fields

5 years agoExtend trailing `>` detection for paths.
David Wood [Mon, 21 Jan 2019 23:35:31 +0000 (00:35 +0100)]
Extend trailing `>` detection for paths.

This commit extends the trailing `>` detection to also work for paths
such as `Foo::<Bar>>:Baz`.

This involves making the existing check take the token that is expected
to follow the path being checked as a parameter.

Care is taken to ensure that this only happens on the construction of a
whole path segment and not a partial path segment (during recursion).

Through this enhancement, it was also observed that the ordering of
right shift token and greater than tokens was overfitted to the examples
being tested.

In practice, given a sequence of `>` characters: `>>>>>>>>>`
..then they will be split into `>>` eagerly: `>> >> >> >> >`.
..but when a `<` is prepended, then the first `>>` is split:
`<T> > >> >> >> >`
..and then when another `<` is prepended, a right shift is first again:
`Vec<<T>> >> >> >> >`

In the previous commits, a example that had two `<<` characters was
always used and therefore it was incorrectly assumed that `>>` would
always be first - but when there is a single `<`, this is not the case.

5 years agoMove logic to its own method
Esteban Küber [Mon, 21 Jan 2019 23:13:59 +0000 (15:13 -0800)]
Move logic to its own method

5 years agoAuto merge of #55009 - oli-obk:const_safety, r=RalfJung
bors [Mon, 21 Jan 2019 23:10:11 +0000 (23:10 +0000)]
Auto merge of #55009 - oli-obk:const_safety, r=RalfJung

Make raw ptr ops unsafe in const contexts

r? @RalfJung

cc @Centril

5 years agoPluralize error messages.
David Wood [Mon, 21 Jan 2019 20:16:46 +0000 (21:16 +0100)]
Pluralize error messages.

This commit pluralizes error messages when more than a single trailing
`>` character is present.

5 years agoAdd error for trailing angle brackets.
David Wood [Mon, 21 Jan 2019 18:42:06 +0000 (19:42 +0100)]
Add error for trailing angle brackets.

This commit adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.

5 years agoupdate miri
Ralf Jung [Mon, 21 Jan 2019 21:25:02 +0000 (22:25 +0100)]
update miri

5 years agofix validation range printing when encountering undef
Ralf Jung [Mon, 21 Jan 2019 14:48:07 +0000 (14:48 +0000)]
fix validation range printing when encountering undef

5 years agoAdd powerpc64-unknown-freebsd
Your Name [Mon, 21 Jan 2019 17:50:54 +0000 (18:50 +0100)]
Add powerpc64-unknown-freebsd

5 years agoFix some non-determinism in help messages for E0277 errors.
Simon Sapin [Mon, 21 Jan 2019 15:55:32 +0000 (16:55 +0100)]
Fix some non-determinism in help messages for E0277 errors.

The diagnostic for this error prints `the following implementations
were found` followed by the first N relevant impls, sorted.

This commit makes the sort happen before slicing,
so that the set of impls being printed is deterministic
when the input is not.

5 years agoDeclare some unconst operations as unsafe in const fn
Oliver Scherer [Fri, 7 Dec 2018 17:26:46 +0000 (18:26 +0100)]
Declare some unconst operations as unsafe in const fn

5 years agoAuto merge of #55045 - kleimkuhler:add-std-is_sorted, r=KodrAus
bors [Mon, 21 Jan 2019 13:55:45 +0000 (13:55 +0000)]
Auto merge of #55045 - kleimkuhler:add-std-is_sorted, r=KodrAus

Add `is_sorted` to `Iterator` and `[T]`

This is an initial implementation for the first step of [RFC 2351](https://github.com/rust-lang/rfcs/blob/master/text/2351-is-sorted.md)

Tracking issue: https://github.com/rust-lang/rust/issues/53485

5 years agoAuto merge of #57756 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
bors [Mon, 21 Jan 2019 11:07:29 +0000 (11:07 +0000)]
Auto merge of #57756 - matthiaskrgr:clippy_submodule_upd, r=oli-obk

submodules: update clippy from 1b89724b to e648adf0

Fixes clippy toolstate

Changes:
````
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup https://github.com/rust-lang/rust/pull/57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````

r? @oli-obk

5 years agoDifferentiate between closure and function bodies
Oliver Scherer [Fri, 7 Dec 2018 17:25:55 +0000 (18:25 +0100)]
Differentiate between closure and function bodies

5 years agoAuto merge of #57792 - Centril:rollup, r=Centril
bors [Mon, 21 Jan 2019 08:32:19 +0000 (08:32 +0000)]
Auto merge of #57792 - Centril:rollup, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #56796 (Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`)
 - #57768 (Continue parsing after parent type args and suggest using angle brackets)
 - #57769 (Suggest correct cast for struct fields with shorthand syntax)
 - #57783 (Add "dereference boxed value" suggestion.)
 - #57784 (Add span for bad doc comment)

Failed merges:

r? @ghost

5 years agoUse structured suggestion in stead of notes
Esteban Küber [Mon, 21 Jan 2019 03:37:38 +0000 (19:37 -0800)]
Use structured suggestion in stead of notes

5 years agoAuto merge of #57708 - nbigaouette:pr-53774-fix-missing-rust-gdbui-install, r=Mark...
bors [Mon, 21 Jan 2019 03:12:26 +0000 (03:12 +0000)]
Auto merge of #57708 - nbigaouette:pr-53774-fix-missing-rust-gdbui-install, r=Mark-Simulacrum

Install missing 'rust-gdbui''

PR #53774 added `rust-gdbui` as wrapper to launch [gdbui](https://gdbgui.com/), similar to `rust-gdb`.

Unfortunately I've never seen the script in my local installation (from rustup, using rust 1.31.1). @tromey on the PR [suggested it might be missing](https://github.com/rust-lang/rust/pull/53774#issuecomment-419704939) from the installation process.

This PR simply adds a line for `rust-gdbui` too.

5 years agoExplain type mismatch cause pointing to return type when it is `impl Trait`
Esteban Küber [Mon, 21 Jan 2019 02:42:10 +0000 (18:42 -0800)]
Explain type mismatch cause pointing to return type when it is `impl Trait`

5 years agosubmodules: update clippy from 1b89724b to 1838bfe5
Matthias Krüger [Mon, 21 Jan 2019 01:58:57 +0000 (02:58 +0100)]
submodules: update clippy from 1b89724b to 1838bfe5

Changes:
````
Fixing typo in CONTRIBUTING.md
Fix breakage due to rust-lang/rust#57651
Run rustfmt
Fixed breakage due to rust-lang/rust#57489
Fix breakage due to rust-lang/rust#57755
Catch up with `format_args` change
Fix bad `while_let_on_iterator` suggestion.
rustup https://github.com/rust-lang/rust/pull/57747
Fixing issues pointed out by dogfood tests.
Update to collect all the files then throw the error.
Adding a test for checking if test files are missing.
Remove bors.toml
add applicability to lint name suggestion
````

5 years agoRollup merge of #57784 - JohnTitor:improve-error-message, r=estebank
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:58 +0000 (02:21 +0100)]
Rollup merge of #57784 - JohnTitor:improve-error-message, r=estebank

Add span for bad doc comment

Fixes #57382

r? @estebank

5 years agoRollup merge of #57783 - davidtwco:issue-57741, r=estebank
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:57 +0000 (02:21 +0100)]
Rollup merge of #57783 - davidtwco:issue-57741, r=estebank

Add "dereference boxed value" suggestion.

Contributes to #57741.

This PR adds a `help: consider dereferencing the boxed value` suggestion to discriminants of match statements when the match arms have type `T` and the discriminant has type `Box<T>`.

r? @estebank

5 years agoRollup merge of #57769 - estebank:cast-suggestion-struct-field, r=matthewjasper
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:56 +0000 (02:21 +0100)]
Rollup merge of #57769 - estebank:cast-suggestion-struct-field, r=matthewjasper

Suggest correct cast for struct fields with shorthand syntax

```
error[E0308]: mismatched types
  --> $DIR/type-mismatch-struct-field-shorthand.rs:8:19
   |
LL |     let _ = RGB { r, g, b };
   |                   ^ expected f64, found f32
help: you can cast an `f32` to `f64` in a lossless way
   |
LL |     let _ = RGB { r: r.into(), g, b };
   |                   ^^^^^^^^^^^
```

Fix #52497.

5 years agoRollup merge of #57768 - estebank:type-args-sugg, r=zackmdavis
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:55 +0000 (02:21 +0100)]
Rollup merge of #57768 - estebank:type-args-sugg, r=zackmdavis

Continue parsing after parent type args and suggest using angle brackets

```
error[E0214]: parenthesized parameters may only be used with a trait
--> $DIR/E0214.rs:2:15
   |
LL |     let v: Vec(&str) = vec!["foo"];
   |               ^^^^^^
   |               |
   |               only traits may use parentheses
   |               help: use angle brackets instead: `<&str>`
```

r? @zackmdavis

5 years agoRollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmaster
Mazdak Farrokhzad [Mon, 21 Jan 2019 01:21:53 +0000 (02:21 +0100)]
Rollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmaster

Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`

This is from this [comment](https://github.com/rust-lang/rust/issues/33417#issuecomment-447111156) I made.

This will expand the impls available for `TryFrom` and `TryInto`, without losing anything in the process.

5 years agoAdd regression test for #54582
Esteban Küber [Mon, 21 Jan 2019 01:14:15 +0000 (17:14 -0800)]
Add regression test for #54582

5 years agoAuto merge of #57789 - ehuss:update-cargo, r=Mark-Simulacrum
bors [Mon, 21 Jan 2019 00:29:31 +0000 (00:29 +0000)]
Auto merge of #57789 - ehuss:update-cargo, r=Mark-Simulacrum

Update cargo

Pull in fix for #57774.

6 commits in ffe65875fd05018599ad07e7389e99050c7915be..907c0febe7045fa02dff2a35c5e36d3bd59ea50d
2019-01-17 23:57:50 +0000 to 2019-01-20 22:31:07 +0000
- Put mtime-on-use behind a feature flag. (rust-lang/cargo#6573)
- Fix a typo in the unstable docs (rust-lang/cargo#6569)
- Perhaps you meant: foo, bar or foobar (rust-lang/cargo#6550)
- Refactor: Create uninstall submodule (rust-lang/cargo#6557)
- Fix spurious Windows errors with switch_features_rerun. (rust-lang/cargo#6561)
- Stop building on master on Travis. (rust-lang/cargo#6562)

r? @Mark-Simulacrum

5 years agoUpdate cargo
Eric Huss [Sun, 20 Jan 2019 23:31:43 +0000 (15:31 -0800)]
Update cargo

5 years agoTweak field parse error recovery
Esteban Küber [Sun, 20 Jan 2019 23:16:36 +0000 (15:16 -0800)]
Tweak field parse error recovery

5 years agoExtend incorrect float literal recovery to account for suffixes
Esteban Küber [Sun, 20 Jan 2019 22:25:53 +0000 (14:25 -0800)]
Extend incorrect float literal recovery to account for suffixes

5 years agoReword message for incorrect float literal
Esteban Küber [Sun, 20 Jan 2019 21:59:35 +0000 (13:59 -0800)]
Reword message for incorrect float literal

5 years agoUse is_dummy instead of comparing against DUMMY_SP
Esteban Küber [Sun, 20 Jan 2019 21:53:13 +0000 (13:53 -0800)]
Use is_dummy instead of comparing against DUMMY_SP

5 years agoAuto merge of #57704 - lenoil98:patch-2, r=alexcrichton
bors [Sun, 20 Jan 2019 21:49:24 +0000 (21:49 +0000)]
Auto merge of #57704 - lenoil98:patch-2, r=alexcrichton

Update bootstrap.py

Add PowerPC64 support on FreeBSD

5 years agoRemove unnecessary dummy span checks
Esteban Küber [Sun, 25 Nov 2018 21:05:06 +0000 (13:05 -0800)]
Remove unnecessary dummy span checks

The emitter already verifies wether a given span note or span label
can be emitted to the output. If it can't, because it is a dummy
span, it will be either elided for labels or emitted as an unspanned
note/help when applicable.

5 years agoAdd "dereference boxed value" suggestion.
David Wood [Sun, 20 Jan 2019 19:26:46 +0000 (20:26 +0100)]
Add "dereference boxed value" suggestion.

This commit adds a `help: consider dereferencing the boxed value`
suggestion to discriminants of match statements when the match arms have
type `T` and the discriminant has type `Box<T>`.

5 years agoAdd default favicon for documentation
Guillaume Gomez [Sat, 12 Jan 2019 21:27:09 +0000 (22:27 +0100)]
Add default favicon for documentation

5 years agoFix tests
Yuki Okushi [Sun, 20 Jan 2019 19:52:30 +0000 (04:52 +0900)]
Fix tests

5 years agoAdd span for bad doc comment
Yuki Okushi [Sun, 20 Jan 2019 19:52:16 +0000 (04:52 +0900)]
Add span for bad doc comment

5 years agoAuto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavus
bors [Sun, 20 Jan 2019 19:01:38 +0000 (19:01 +0000)]
Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavus

rustdoc: overhaul code block lexing errors

Fixes #53919.

This PR moves the reporting of code block lexing errors from rendering time to an early pass, so we can use the compiler's error reporting mechanisms. This dramatically improves the diagnostics in this situation: we now de-emphasize the lexing errors as a note under a warning that has a span and suggestion instead of just emitting errors at the top level.

Additionally, this PR generalizes the markdown -> source span calculation function, which should allow other rustdoc warnings to use better spans in the future.

Last, the PR makes sure that the code block is always emitted in the docs, even if it fails to highlight correctly.

Of note:
- The new pass unfortunately adds another pass over the docs to gather the doc blocks for syntax-checking. I wonder if this could be combined with the pass that looks for testable blocks? I'm not familiar with that code, so I don't know how feasible that is.
- `pulldown_cmark` doesn't make it easy to find the spans of the code blocks, so the code that calculates the spans is a little nasty. It works for all the test cases I threw at it, but I wouldn't be surprised if an edge case would break it. Should have a thorough review.
- This PR worsens the state of #56885, since those certain fatal lexing errors are now emitted before docs get generated at all.

5 years agoconst_eval: Predetermine the layout of all locals when pushing a stack frame
Björn Steinbrink [Wed, 16 Jan 2019 19:45:53 +0000 (20:45 +0100)]
const_eval: Predetermine the layout of all locals when pushing a stack frame

Usually the layout of any locals is required at least three times, once
when it becomes live, once when it is written to, and once it is read
from. By adding a cache for them, we can reduce the number of layout
queries speeding up code that is heavy on const_eval.

5 years agoAdd default rust logo for documentation
Guillaume Gomez [Sat, 12 Jan 2019 21:25:29 +0000 (22:25 +0100)]
Add default rust logo for documentation

5 years agoreview comment
Esteban Küber [Sun, 20 Jan 2019 17:11:42 +0000 (09:11 -0800)]
review comment

5 years agoAuto merge of #57697 - dotdash:fast_lex_reg_resol_item_bodies, r=nagisa
bors [Sun, 20 Jan 2019 16:24:27 +0000 (16:24 +0000)]
Auto merge of #57697 - dotdash:fast_lex_reg_resol_item_bodies, r=nagisa

Use a faster early exit during region expansion

Turns out that the equality check for regions is rather expensive, and
the current early exit check works in such a way, that the comparison is
even done twice. As we only really care about the case of equal scopes,
we can perform a faster, more specialized check and move it up one
level, so we can eventually skip the additional full comparison as well.

5 years agoAuto merge of #57680 - cuviper:codegen-rebuild, r=Mark-Simulacrum
bors [Sun, 20 Jan 2019 13:46:03 +0000 (13:46 +0000)]
Auto merge of #57680 - cuviper:codegen-rebuild, r=Mark-Simulacrum

[rustbuild] Rebuild std after changes to codegen backends

Use `clear_if_dirty` on std for backend changes, just as we do for
changes to rustc itself, so new codegen is correctly applied to all
later compiler stages.

Fixes #48298.

5 years agoAuto merge of #57655 - mtak-:fix-tls-dtors-macos, r=alexcrichton
bors [Sun, 20 Jan 2019 11:08:37 +0000 (11:08 +0000)]
Auto merge of #57655 - mtak-:fix-tls-dtors-macos, r=alexcrichton

OSX: fix #57534 registering thread dtors while running thread dtors

r? @alexcrichton

- "fast" `thread_local` destructors get run even on the main thread
- "fast" `thread_local` dtors, can initialize other `thread_local`'s

One corner case where this fix doesn't work, is when a C++ `thread_local` triggers the initialization of a rust `thread_local`.

I did not add any std::thread specific flag to indicate that the thread is currently exiting, which would be checked before registering a new dtor (I didn't really know where to stick that). I think this does the trick tho!

Let me know if anything needs tweaking/fixing/etc.

resolves this for macos: https://github.com/rust-lang/rust/issues/28129
fixes: https://github.com/rust-lang/rust/issues/57534

5 years agoDo not suggest angle brackets when there are no type arguments
Esteban Küber [Sun, 20 Jan 2019 10:45:38 +0000 (02:45 -0800)]
Do not suggest angle brackets when there are no type arguments

5 years agoRecover with suggestion from writing `.42` instead of `0.42`
Esteban Küber [Sun, 20 Jan 2019 09:49:04 +0000 (01:49 -0800)]
Recover with suggestion from writing `.42` instead of `0.42`

5 years agoRecover from parse errors in struct literal fields
Esteban Küber [Sun, 20 Jan 2019 08:37:06 +0000 (00:37 -0800)]
Recover from parse errors in struct literal fields

Attempt to recover from parse errors while parsing a struct's literal fields
by skipping tokens until a comma or the closing brace is found. This allows
errors in other fields to be reported.

5 years agoAuto merge of #57651 - JohnTitor:give-char-type, r=estebank
bors [Sun, 20 Jan 2019 08:26:12 +0000 (08:26 +0000)]
Auto merge of #57651 - JohnTitor:give-char-type, r=estebank

Implement new literal type `Err`

Fixes #57384

I removed `return Ok`, otherwise, two errors occur. Any solutions?

r? @estebank

5 years agoRemove whitespace
Yuki Okushi [Sun, 20 Jan 2019 05:59:10 +0000 (14:59 +0900)]
Remove whitespace

5 years agoFix tests
Yuki Okushi [Sun, 20 Jan 2019 05:53:28 +0000 (14:53 +0900)]
Fix tests

5 years agoRevert change
Yuki Okushi [Sun, 20 Jan 2019 05:53:16 +0000 (14:53 +0900)]
Revert change

5 years agoMark incorrect recovered `char` literals as `TyErr` to avoid type errors
Yuki Okushi [Sun, 20 Jan 2019 05:51:54 +0000 (14:51 +0900)]
Mark incorrect recovered `char` literals as `TyErr` to avoid type errors

5 years agoSuggest correct cast for struct fields with shorthand syntax
Esteban Küber [Sun, 20 Jan 2019 04:18:56 +0000 (20:18 -0800)]
Suggest correct cast for struct fields with shorthand syntax

5 years agoAuto merge of #57602 - alexcrichton:test-appveyor, r=alexcrichton
bors [Sun, 20 Jan 2019 04:16:42 +0000 (04:16 +0000)]
Auto merge of #57602 - alexcrichton:test-appveyor, r=alexcrichton

Remove GCE cloud setting from AppVeyor config

AppVeyor has informed us that this may no longer be necessary after some
infrastructure upgrades on their side, so let's see how this goes!

5 years agoSuggest usage of angle brackets
Esteban Küber [Sun, 20 Jan 2019 03:25:28 +0000 (19:25 -0800)]
Suggest usage of angle brackets

5 years agoAccept parenthesized type args for error recovery
Esteban Küber [Sun, 20 Jan 2019 02:44:20 +0000 (18:44 -0800)]
Accept parenthesized type args for error recovery

5 years agoContinune parsing after encountering Trait with paren args
Esteban Küber [Sat, 19 Jan 2019 22:48:43 +0000 (14:48 -0800)]
Continune parsing after encountering Trait with paren args

5 years agoAuto merge of #57761 - Centril:rollup, r=Centril
bors [Sat, 19 Jan 2019 21:21:12 +0000 (21:21 +0000)]
Auto merge of #57761 - Centril:rollup, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #57452 (Improve docs for Formatter)
 - #57689 (Redo `hir::Stmt`)
 - #57723 (Point at cause for expectation in return type type error)
 - #57736 (Remove delay_span_bug from qualify_min_const_fn)

Failed merges:

r? @ghost

5 years ago[WIP] Fix tests
Yuki Okushi [Sat, 19 Jan 2019 19:37:58 +0000 (04:37 +0900)]
[WIP] Fix tests

5 years ago[WIP] Improve error behavior
Yuki Okushi [Sat, 19 Jan 2019 19:37:29 +0000 (04:37 +0900)]
[WIP] Improve error behavior