]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoBump stage0
Eric Huss [Fri, 4 Jan 2019 15:30:20 +0000 (07:30 -0800)]
Bump stage0

5 years agoAuto merge of #55986 - cjgillot:issue-45510, r=nikomatsakis
bors [Fri, 4 Jan 2019 11:51:30 +0000 (11:51 +0000)]
Auto merge of #55986 - cjgillot:issue-45510, r=nikomatsakis

Allow to dispatch fn traits depending on number of parameters

Hello,

By following @eddyb's advise on issue #45510, I managed to have the snippets of code in #45510 and #18952 passing without breaking older diagnostics.

EDIT: the codegen tests breakage I experienced is due to the poor quality of my laptop.

If any kind reviewer has any advice, you are very welcome.

5 years agoAuto merge of #57315 - ehuss:update-cargo, r=alexcrichton
bors [Fri, 4 Jan 2019 09:10:13 +0000 (09:10 +0000)]
Auto merge of #57315 - ehuss:update-cargo, r=alexcrichton

Update cargo

24 commits in 0d1f1bbeabd5b43a7f3ecfa16540af8e76d5efb4..34320d212dca8cd27d06ce93c16c6151f46fcf2e
2018-12-19 14:45:14 +0000 to 2019-01-03 19:12:38 +0000
- Display environment variables for rustc commands (rust-lang/cargo#6492)
- Fix a very minor race condition in `cargo fix`. (rust-lang/cargo#6515)
- Add a high-level overview of how `fix` works. (rust-lang/cargo#6516)
- Add dependency `registry` to `cargo metadata`. (rust-lang/cargo#6500)
- Fix fingerprint calculation for patched deps. (rust-lang/cargo#6493)
- serialize version directly (rust-lang/cargo#6512)
- use DYLD_FALLBACK_LIBRARY_PATH for dylib_path_envvar on macOS (rust-lang/cargo#6355)
- Fix error message when resolving dependencies (rust-lang/cargo#6510)
- use PathBuf in cargo metadata (rust-lang/cargo#6511)
- Fixed link to testsuite in CONTRIBUTING.md (rust-lang/cargo#6506)
- Update display of contents of Cargo.toml (rust-lang/cargo#6501)
- Update display of contents of Cargo.toml (rust-lang/cargo#6502)
- Fixup cargo install's help message (rust-lang/cargo#6495)
- testsuite: Require failing commands to check output. (rust-lang/cargo#6497)
- Delete unnecessary 'return' (rust-lang/cargo#6496)
- Fix new unused patch warning. (rust-lang/cargo#6494)
- Some minor documentation changes. (rust-lang/cargo#6481)
- Add `links` to `cargo metadata`. (rust-lang/cargo#6480)
- Salvaged semver work (rust-lang/cargo#6476)
- Warn on unused patches. (rust-lang/cargo#6470)
- don't write a an incorrect rustc version to the fingerprint file (rust-lang/cargo#6473)
- Rewrite `login` and registry cleanups. (rust-lang/cargo#6466)
- [issue#6461] Fix cargo commands list (rust-lang/cargo#6462)
- Restrict registry names to same style as package names. (rust-lang/cargo#6469)

5 years agoAuto merge of #56958 - alexcrichton:upgrade-docker, r=kennytm
bors [Fri, 4 Jan 2019 04:34:13 +0000 (04:34 +0000)]
Auto merge of #56958 - alexcrichton:upgrade-docker, r=kennytm

ci: Upgrade Travis to Xenial

In theory we shouldn't require trusty so long as docker continues to
work!

5 years agoUpdate cargo
Eric Huss [Thu, 3 Jan 2019 20:59:54 +0000 (12:59 -0800)]
Update cargo

5 years agoci: Upgrade Travis to Xenial
Alex Crichton [Tue, 18 Dec 2018 21:32:09 +0000 (13:32 -0800)]
ci: Upgrade Travis to Xenial

In theory we shouldn't require trusty so long as docker continues to
work!

5 years agoAuto merge of #55517 - nikomatsakis:universes, r=scalexm
bors [Thu, 3 Jan 2019 17:18:15 +0000 (17:18 +0000)]
Auto merge of #55517 - nikomatsakis:universes, r=scalexm

Universes

This PR transitions the compiler to use **universes** instead of the **leak-check**. It is marked as [WIP] for a few reasons:

- The diagnostics at present are terrible =)
- This changes the behavior of coherence, regressing some things that used to compile

The goals of this PR at present are:

- To start getting some eyes on the code
- To do a crater run
- To see the full travis results (due to https://github.com/rust-lang/rust/issues/52452, I am not able to run the full test suite locally anymore at present)

The first few commits in the PR are changing how `evaluate` treats regions. We now track whether region comparisons occurred, reverting the "staticized" query approach that @arielb1 put in. The problem with "staticized" queries is that it relied on the leak-check to get higher-ranked things correct, and we are removing the leak-check in this PR series, so that caused problems.

You can see at the end a collection of test updates. Mostly we behave the same but with atrocious diagnostics, but there are a number of cases where we used to error and now no longer do, as well as single case where we used to **not** error but we now do (the coherence-subtyping change).

(Note: it would be possible to do a version of leak-check that propagates universe information and recover the old behavior. I am reluctant to do so because I'd like to leave us room to get more precise -- e.g., I want to eventually handle things like `exists<'a> { for<'b> { if ('a: 'b) { 'a: 'b } } }` which presently the leak-check cannot cope with etc. Also because it seems more consistent to me: most folks I've talked to expect the new behavior and are surprised to learn that binding sites were so significant before when it comes to coherence. One question is, though, to what extent are people relying on this in the wild?)

5 years agoAuto merge of #56507 - nikomatsakis:polonius-integrate, r=MatthewJasper
bors [Thu, 3 Jan 2019 12:42:16 +0000 (12:42 +0000)]
Auto merge of #56507 - nikomatsakis:polonius-integrate, r=MatthewJasper

polonius tweaks

- bump polonius to 0.6.0
- fix 2-phase-borrow activations

r? @matthewjasper

5 years agoAuto merge of #57282 - matthewjasper:wellformed-return-ty, r=nikomatsakis
bors [Thu, 3 Jan 2019 03:48:12 +0000 (03:48 +0000)]
Auto merge of #57282 - matthewjasper:wellformed-return-ty, r=nikomatsakis

Wf-check the output type of a function in MIR-typeck

Closes #57265

cc @scalexm

5 years agorename `type_moves_by_default` to `type_is_copy_modulo_regions`
Niko Matsakis [Tue, 20 Nov 2018 16:59:06 +0000 (11:59 -0500)]
rename `type_moves_by_default` to `type_is_copy_modulo_regions`

5 years agotry to detect affected code and direct people to #56105
Niko Matsakis [Tue, 20 Nov 2018 16:20:05 +0000 (11:20 -0500)]
try to detect affected code and direct people to #56105

5 years agotrack if any region constraints involved placeholders
Niko Matsakis [Tue, 20 Nov 2018 15:24:38 +0000 (10:24 -0500)]
track if any region constraints involved placeholders

5 years agopacify the mercilous eddyb ;)
Niko Matsakis [Mon, 19 Nov 2018 16:57:22 +0000 (11:57 -0500)]
pacify the mercilous eddyb ;)

5 years agoadd some comments about lifetimes etc
Niko Matsakis [Mon, 19 Nov 2018 15:56:24 +0000 (10:56 -0500)]
add some comments about lifetimes etc

5 years agoaddress tmandry nits
Niko Matsakis [Mon, 19 Nov 2018 15:47:34 +0000 (10:47 -0500)]
address tmandry nits

5 years agopacify the mercilous tidy
Niko Matsakis [Mon, 19 Nov 2018 15:29:50 +0000 (10:29 -0500)]
pacify the mercilous tidy

5 years agoimprove handling for subtype
Niko Matsakis [Mon, 19 Nov 2018 15:26:04 +0000 (10:26 -0500)]
improve handling for subtype

Still not great, but good enough to land this PR.

5 years agosay "the lifetime" instead of "some lifetime" when it feels right
Niko Matsakis [Mon, 19 Nov 2018 00:13:37 +0000 (19:13 -0500)]
say "the lifetime" instead of "some lifetime" when it feels right

In particular, when we want to indicate that there is a connection
between the self type and the other types.

5 years agoapply the same logic to ConcreteFailure errors
Niko Matsakis [Mon, 19 Nov 2018 00:07:38 +0000 (19:07 -0500)]
apply the same logic to ConcreteFailure errors

5 years agorefactor highlighting to take any RegionKind, making it more general
Niko Matsakis [Sun, 18 Nov 2018 20:25:57 +0000 (15:25 -0500)]
refactor highlighting to take any RegionKind, making it more general

5 years agoapply the new placeholder errors even with just one placeholder
Niko Matsakis [Sun, 18 Nov 2018 18:25:53 +0000 (13:25 -0500)]
apply the new placeholder errors even with just one placeholder

5 years agointroduce placeholder-placeholder errors for trait matching
Niko Matsakis [Sat, 17 Nov 2018 13:18:37 +0000 (08:18 -0500)]
introduce placeholder-placeholder errors for trait matching

5 years agoadd the ability to highlight placeholders
Niko Matsakis [Sat, 17 Nov 2018 12:03:26 +0000 (07:03 -0500)]
add the ability to highlight placeholders

5 years agogeneralize region highlights into a struct
Niko Matsakis [Sat, 17 Nov 2018 11:27:44 +0000 (06:27 -0500)]
generalize region highlights into a struct

5 years agodump out the exact state in error reporting debugs
Niko Matsakis [Sat, 17 Nov 2018 11:10:30 +0000 (06:10 -0500)]
dump out the exact state in error reporting debugs

5 years agomake `get_highlight_region_for_regionvid` only affect re-vid
Niko Matsakis [Sat, 17 Nov 2018 00:13:55 +0000 (19:13 -0500)]
make `get_highlight_region_for_regionvid` only affect re-vid

In NLL, ReVid is all there is, but I might want to repurpose.

5 years agoremove outdated `rustc_driver` tests
Niko Matsakis [Wed, 31 Oct 2018 17:20:48 +0000 (13:20 -0400)]
remove outdated `rustc_driver` tests

they are subsumed by `hr-subtype/hr-subtype.rs` and other tests

5 years agoWIP other test changes
Niko Matsakis [Mon, 31 Dec 2018 18:45:48 +0000 (13:45 -0500)]
WIP other test changes

5 years agotests: cases where we now do the right thing but did not before
Niko Matsakis [Mon, 31 Dec 2018 18:45:40 +0000 (13:45 -0500)]
tests: cases where we now do the right thing but did not before

Fixes #33684

5 years agotests: worse diagnostics, but basically same errors
Niko Matsakis [Tue, 30 Oct 2018 20:57:52 +0000 (16:57 -0400)]
tests: worse diagnostics, but basically same errors

5 years agotests: move coherence-subtyping from run-pass to compile-fail
Niko Matsakis [Tue, 30 Oct 2018 20:39:29 +0000 (16:39 -0400)]
tests: move coherence-subtyping from run-pass to compile-fail

This is the pattern we no longer accept.

5 years agoadd tests exercising `exists<'a> { forall<'b> { .. } }` pattern
Niko Matsakis [Tue, 30 Oct 2018 20:38:50 +0000 (16:38 -0400)]
add tests exercising `exists<'a> { forall<'b> { .. } }` pattern

Amazingly, this scenario was not tested for trait matching.

5 years agouniverse transition
Niko Matsakis [Sat, 8 Sep 2018 00:11:23 +0000 (20:11 -0400)]
universe transition

Remove the leak-check and its associated machinery. Replace with
making the solver aware of universes.

5 years agoWIP: wfcheck ability to detect
Niko Matsakis [Thu, 27 Dec 2018 15:23:02 +0000 (10:23 -0500)]
WIP: wfcheck ability to detect

5 years agoselect.rs: unsizing coercion should use a subtype
Niko Matsakis [Thu, 27 Dec 2018 15:22:55 +0000 (10:22 -0500)]
select.rs: unsizing coercion should use a subtype

When we coerce `dyn Foo` to `dyn Bar`, that is OK as long as `Foo` is
usable in all contexts where `Bar` is usable (hence using the source
must be a subtype of the target).

This is needed for the universe-based code to handle
`old-lub-glb-object`; that test used to work sort of by accident
before with the old code.

5 years agointroduce ability to detect region constraints from snapshot
Niko Matsakis [Tue, 16 Oct 2018 09:42:18 +0000 (05:42 -0400)]
introduce ability to detect region constraints from snapshot

5 years agomake evaluation track whether outlives relationships mattered
Niko Matsakis [Thu, 20 Sep 2018 17:56:11 +0000 (13:56 -0400)]
make evaluation track whether outlives relationships mattered

Previously, evaluation ignored outlives relationships. Since we using
evaluation to skip the "normal" trait selection (which enforces
outlives relationships) this led to incorrect results in some cases.

5 years agoremove wrapper functions that had no purpose
Niko Matsakis [Mon, 15 Oct 2018 21:28:37 +0000 (17:28 -0400)]
remove wrapper functions that had no purpose

5 years agoremove `commit_if_ok` wrapper
Niko Matsakis [Mon, 15 Oct 2018 21:20:10 +0000 (17:20 -0400)]
remove `commit_if_ok` wrapper

5 years agoAdd missing 'static bound for the Machine trait
Matthew Jasper [Wed, 2 Jan 2019 21:28:08 +0000 (21:28 +0000)]
Add missing 'static bound for the Machine  trait

5 years agoWf-check the output type of a function in MIR-typeck
Matthew Jasper [Wed, 2 Jan 2019 20:00:56 +0000 (20:00 +0000)]
Wf-check the output type of a function in MIR-typeck

5 years agoadopt polonius-engine 0.6.2
Niko Matsakis [Wed, 2 Jan 2019 19:45:22 +0000 (14:45 -0500)]
adopt polonius-engine 0.6.2

Also datafrog 2.0.1, which works around a rustdoc bug

5 years agogenerate invalidations from 2-phase-borrow activations
Niko Matsakis [Tue, 4 Dec 2018 15:03:34 +0000 (10:03 -0500)]
generate invalidations from 2-phase-borrow activations

5 years agoAuto merge of #57243 - dingelish:master, r=sfackler
bors [Wed, 2 Jan 2019 15:09:41 +0000 (15:09 +0000)]
Auto merge of #57243 - dingelish:master, r=sfackler

Bound sgx target_env with fortanix as target_vendor

This PR adds `target_vendor` check, as discussed in issue [57231](https://github.com/rust-lang/rust/issues/57231)

Signed-off-by: Yu Ding <dingelish@gmail.com>
5 years agoAuto merge of #57250 - codeworm96:tyerr_msg, r=varkor
bors [Wed, 2 Jan 2019 11:59:15 +0000 (11:59 +0000)]
Auto merge of #57250 - codeworm96:tyerr_msg, r=varkor

Improve type mismatch error messages

Closes #56115.

Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.

TODO the book and clippy needs to be changed accordingly later.

r? @varkor

5 years agoAuto merge of #57251 - petrochenkov:reregr, r=varkor
bors [Wed, 2 Jan 2019 09:24:10 +0000 (09:24 +0000)]
Auto merge of #57251 - petrochenkov:reregr, r=varkor

syntax: Fix regression in diagnostics for patterns in trait method parameters

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

5 years agoAuto merge of #56827 - faern:eliminate-recv-timeout-panic, r=KodrAus
bors [Wed, 2 Jan 2019 02:03:15 +0000 (02:03 +0000)]
Auto merge of #56827 - faern:eliminate-recv-timeout-panic, r=KodrAus

Eliminate Receiver::recv_timeout panic

Fixes #54552.

This panic is because `recv_timeout` uses `Instant::now() + timeout` internally. This possible panic is not mentioned in the documentation for this method.

Very recently we merged (still unstable) support for checked addition (#56490) of `Instant + Duration`, so it's now finally possible to add these together without risking a panic.

5 years agoAuto merge of #57209 - estebank:suggest-raw-ident, r=petrochenkov
bors [Tue, 1 Jan 2019 23:30:34 +0000 (23:30 +0000)]
Auto merge of #57209 - estebank:suggest-raw-ident, r=petrochenkov

Suggest using raw identifiers in 2018 edition when using keywords

5 years agoMerge remote-tracking branch 'upstream/master'
Yu Ding [Tue, 1 Jan 2019 22:55:33 +0000 (14:55 -0800)]
Merge remote-tracking branch 'upstream/master'

5 years agosyntax: Fix regression in diagnostics for patterns in trait method parameters
Vadim Petrochenkov [Tue, 1 Jan 2019 16:14:00 +0000 (19:14 +0300)]
syntax: Fix regression in diagnostics for patterns in trait method parameters

5 years agoAuto merge of #57125 - doitian:inconsistent-clone-doc, r=bluss
bors [Tue, 1 Jan 2019 20:50:13 +0000 (20:50 +0000)]
Auto merge of #57125 - doitian:inconsistent-clone-doc, r=bluss

Fix inconsistent Clone documentation.

Now, arrays of any size Clone if the element type is Clone. So remove the
the document that uses this as an example.

refs #57123

5 years agoRemove min_const_unsafe_fn since it is stable
Yu Ding [Tue, 1 Jan 2019 19:49:54 +0000 (11:49 -0800)]
Remove min_const_unsafe_fn since it is stable

Signed-off-by: Yu Ding <dingelish@gmail.com>
5 years agoAuto merge of #55937 - davidtwco:issue-54943, r=pnkfelix
bors [Tue, 1 Jan 2019 15:26:12 +0000 (15:26 +0000)]
Auto merge of #55937 - davidtwco:issue-54943, r=pnkfelix

NLL: User type annotations refactor, associated constant patterns and ref bindings.

Fixes #55511 and Fixes #55401. Contributes to #54943.

This PR performs a large refactoring on user type annotations, checks user type annotations for associated constants in patterns and that user type annotations for `ref` bindings are respected.

r? @nikomatsakis

5 years agoAuto merge of #57203 - nagisa:readme, r=Mark-Simulacrum
bors [Tue, 1 Jan 2019 11:47:58 +0000 (11:47 +0000)]
Auto merge of #57203 - nagisa:readme, r=Mark-Simulacrum

Remove mention of required memory to build

Because it, obviously, changes all the time and 600MiB is way out-of-date now.

5 years agoAuto merge of #57210 - estebank:str-err, r=zackmdavis
bors [Tue, 1 Jan 2019 09:10:23 +0000 (09:10 +0000)]
Auto merge of #57210 - estebank:str-err, r=zackmdavis

Tweak unicode escape diagnostics

5 years agoAuto merge of #57194 - matthiaskrgr:copyright_headers, r=Centril
bors [Tue, 1 Jan 2019 06:34:11 +0000 (06:34 +0000)]
Auto merge of #57194 - matthiaskrgr:copyright_headers, r=Centril

remove more copyright headers

r? @Mark-Simulacrum

5 years agoAuto merge of #57199 - petrochenkov:ambig, r=estebank
bors [Tue, 1 Jan 2019 02:08:39 +0000 (02:08 +0000)]
Auto merge of #57199 - petrochenkov:ambig, r=estebank

resolve: Simplify treatment of ambiguity errors

If we have a glob conflict like this
```rust
mod m1 { struct S; }
mod m2 { struct S; }

use m1::*;
use m2::*;
```
we treat it as a special "ambiguity item" that's not an error by itself, but produces an error when actually used.
```rust
use m1::*; // primary
use m2::*; // secondary

=>

ambiguity S(m1::S, m2::S);
```

Ambiguity items were *sometimes* treated as their primary items for error recovery, but pretty irregularly.

After this PR they are always treated as their primary items, except that
- If an ambiguity item is marked as used, then it still produces an error.
- Ambiguity items are still filtered away when exported to other crates (which is also a use in some sense).

5 years agoImprove type mismatch error messages
Yuning Zhang [Tue, 1 Jan 2019 01:43:08 +0000 (20:43 -0500)]
Improve type mismatch error messages

Replace "integral variable" with "integer" and replace
"floating-point variable" with "floating-point number" to make the
message less confusing.

5 years agoBound sgx target_env with fortanix as target_vendor
Yu Ding [Mon, 31 Dec 2018 23:45:42 +0000 (15:45 -0800)]
Bound sgx target_env with fortanix as target_vendor

Signed-off-by: Yu Ding <dingelish@gmail.com>
5 years agoAuto merge of #56878 - petrochenkov:privdyn, r=arielb1
bors [Mon, 31 Dec 2018 23:30:57 +0000 (23:30 +0000)]
Auto merge of #56878 - petrochenkov:privdyn, r=arielb1

privacy: Use common `DefId` visiting infrastructure for all privacy visitors

One repeating pattern in privacy checking is going through a type, visiting all `DefId`s inside it and doing something with them.
This is the case because visibilities and reachabilities are attached to `DefId`s.

Previously various privacy visitors visited types slightly differently using their own methods, with most recently written `TypePrivacyVisitor` being the "gold standard".
This mostly worked okay, but differences could manifest in overly conservative reachability analysis, some errors being reported twice, some private-in-public lints (not errors) being wrongly reported or not reported.

This PR does something that I wanted to do since https://github.com/rust-lang/rust/pull/32674#discussion_r58291608 - factoring out the common visiting logic!
Now all the common logic is contained in `struct DefIdVisitorSkeleton`, with specific privacy visitors deciding only what to do with visited `DefId`s (via `trait DefIdVisitor`).

A bunch of cleanups is also applied in the process.
This area is somewhat tricky due to lots of easily miss-able details, but thankfully it's was well covered by tests in https://github.com/rust-lang/rust/pull/46083 and previous PRs, so I'm relatively sure in the refactoring correctness.

Fixes https://github.com/rust-lang/rust/pull/56837#discussion_r241962239 in particular.
Also this will help with implementing https://github.com/rust-lang/rust/issues/48054.

5 years agoAddress review comments
Vadim Petrochenkov [Mon, 31 Dec 2018 00:02:40 +0000 (03:02 +0300)]
Address review comments

Say "trait" instead of "type" in diagnostics for `dyn Trait`

5 years agoprivacy: Use common `DefId` visiting infra for all privacy visitors
Vadim Petrochenkov [Sun, 16 Dec 2018 13:18:45 +0000 (16:18 +0300)]
privacy: Use common `DefId` visiting infra for all privacy visitors

5 years agoAuto merge of #57047 - euclio:field-structured-suggestions, r=estebank
bors [Mon, 31 Dec 2018 20:56:19 +0000 (20:56 +0000)]
Auto merge of #57047 - euclio:field-structured-suggestions, r=estebank

use structured suggestions for nonexistent fields

r? @estebank

5 years agoDo not use unicode character in diagnostic help
Esteban Küber [Mon, 31 Dec 2018 17:44:54 +0000 (09:44 -0800)]
Do not use unicode character in diagnostic help

5 years agouse structured suggestions for nonexistent fields
Andy Russell [Thu, 20 Dec 2018 23:10:46 +0000 (18:10 -0500)]
use structured suggestions for nonexistent fields

5 years agoUse structured suggestion for braceless unicode escape squence
Esteban Küber [Thu, 27 Dec 2018 19:21:47 +0000 (11:21 -0800)]
Use structured suggestion for braceless unicode escape squence

5 years agoAccount for `\xFF` and `\u{FF}` sequences in string format errors
Esteban Küber [Thu, 27 Dec 2018 18:40:06 +0000 (10:40 -0800)]
Account for `\xFF` and `\u{FF}` sequences in string format errors

5 years agoUpdate tests after rebase
Esteban Küber [Mon, 31 Dec 2018 16:41:05 +0000 (08:41 -0800)]
Update tests after rebase

5 years agoAddress review comments
Esteban Küber [Sun, 30 Dec 2018 19:52:15 +0000 (11:52 -0800)]
Address review comments

- Suggest raw ident escaping in all editions
- Keep primary label in all cases

5 years agoSuggest using raw identifiers in 2018 edition when using keywords
Esteban Küber [Sun, 30 Dec 2018 01:19:22 +0000 (17:19 -0800)]
Suggest using raw identifiers in 2018 edition when using keywords

5 years agoAuto merge of #57220 - quark-zju:mcount, r=estebank
bors [Mon, 31 Dec 2018 14:30:17 +0000 (14:30 +0000)]
Auto merge of #57220 - quark-zju:mcount, r=estebank

Add `-Z instrument-mcount`

This flag inserts `mcount` function call to the beginning of every function
after inline processing. So tracing tools like uftrace [1] (or ftrace for
Linux kernel modules) have a chance to examine function calls.

It is similar to the `-pg` flag provided by gcc or clang, but without
generating a `__gmon_start__` function for executables. If a program
runs without being traced, no `gmon.out` will be written to disk.

Under the hood, it simply adds `"instrument-function-entry-inlined"="mcount"`
attribute to every function. The `post-inline-ee-instrument` LLVM pass does
the actual job.

[1]: https://github.com/namhyung/uftrace

5 years agoFix inconsistent Clone documentation.
ian [Wed, 26 Dec 2018 05:01:30 +0000 (13:01 +0800)]
Fix inconsistent Clone documentation.

Use function pointer as the example to demonstrate how to implement Clone for
Copy types.

refs #57123

5 years agoAuto merge of #57061 - Zoxc:graph-refactor, r=michaelwoerister
bors [Mon, 31 Dec 2018 10:55:46 +0000 (10:55 +0000)]
Auto merge of #57061 - Zoxc:graph-refactor, r=michaelwoerister

Group dep node data into a single structure

r? @michaelwoerister

5 years agoAddress comments
John Kåre Alsaker [Mon, 31 Dec 2018 08:14:09 +0000 (09:14 +0100)]
Address comments

5 years agoUse `entry` API to avoid double lookup when interning dep nodes
John Kåre Alsaker [Sun, 23 Dec 2018 04:54:10 +0000 (05:54 +0100)]
Use `entry` API to avoid double lookup when interning dep nodes

5 years agoGroup dep node data into a single structure
John Kåre Alsaker [Sat, 22 Dec 2018 11:40:23 +0000 (12:40 +0100)]
Group dep node data into a single structure

5 years agoAuto merge of #57208 - estebank:issue-57198, r=petrochenkov
bors [Mon, 31 Dec 2018 08:06:15 +0000 (08:06 +0000)]
Auto merge of #57208 - estebank:issue-57198, r=petrochenkov

Do not complain about missing crate named as a keyword

Fix #57198.

5 years agoAuto merge of #57044 - varkor:E0512-equal-type, r=matthewjasper
bors [Mon, 31 Dec 2018 04:06:14 +0000 (04:06 +0000)]
Auto merge of #57044 - varkor:E0512-equal-type, r=matthewjasper

Add specific diagnostic when attempting to transmute between equal generic types

Also clarifies the wording of E0512.

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

5 years agoAuto merge of #57035 - Zoxc:query-pref9, r=michaelwoerister
bors [Mon, 31 Dec 2018 01:18:19 +0000 (01:18 +0000)]
Auto merge of #57035 - Zoxc:query-pref9, r=michaelwoerister

Uninline some debugging code and use unlikely! macro

r? @michaelwoerister

5 years agoFix variable string size problem in transmute test
varkor [Sun, 30 Dec 2018 09:56:59 +0000 (09:56 +0000)]
Fix variable string size problem in transmute test

5 years agoAddress review comments: Remove new `PathResult` variant
Esteban Küber [Sun, 30 Dec 2018 20:19:16 +0000 (12:19 -0800)]
Address review comments: Remove new `PathResult` variant

5 years agoAdd `-Z instrument-mcount`
Jun Wu [Sun, 30 Dec 2018 19:59:03 +0000 (11:59 -0800)]
Add `-Z instrument-mcount`

This flag inserts `mcount` function call to the beginning of every function
after inline processing. So tracing tools like uftrace [1] (or ftrace for
Linux kernel modules) have a chance to examine function calls.

It is similar to the `-pg` flag provided by gcc or clang, but without
generating a `__gmon_start__` function for executables. If a program
runs without being traced, no `gmon.out` will be written to disk.

Under the hood, it simply adds `"instrument-function-entry-inlined"="mcount"`
attribute to every function. The `post-inline-ee-instrument` LLVM pass does
the actual job.

[1]: https://github.com/namhyung/uftrace

5 years agoAuto merge of #57213 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
bors [Sun, 30 Dec 2018 18:49:01 +0000 (18:49 +0000)]
Auto merge of #57213 - matthiaskrgr:clippy_submodule_upd, r=oli-obk

submodules: update clippy from f7bdf500 to 39bd8449

Fixes clippy toolstate

Changes:
````
UI test cleanup: Extract iter_skip_next from methods.rs
Update test output after rebase
Remove false negatives from known problems
Implement use_self for tuple structs
Document known problems
rustup https://github.com/rust-lang/rust/pull/56225/
Remove unnecessary `use` statements after `cargo fix`
Apply cargo fix --edition-idioms fixes
Use match ergonomics for booleans lint
Use match ergonomics for block_in_if_condition lint
Use match ergonomics for bit_mask lint
Use match ergonomics for attrs lint
Use match ergonomics for assign_ops lint
Use match ergonomics for artithmetic lint
Use match ergonomics for approx_const lint
Remove crate:: prefixes from crate paths
Support array indexing expressions in unused write to a constant
Mark writes to constants as side-effect-less
Update README local run command to remove syspath
Remove unsafe from consts clippy lints
Fix formatting
Merge new_without_default_derive into new_without_default
Only print out question_mark lint when it actually triggered
Add failing test
Reinserted commata
Recomend `.as_ref()?` in certain situations
Deduplicate some code?
````
r? @oli-obk or anyone else

5 years agosubmodules: update clippy from f7bdf500 to 39bd8449
Matthias Krüger [Sun, 30 Dec 2018 17:16:09 +0000 (18:16 +0100)]
submodules: update clippy from f7bdf500 to 39bd8449

Changes:
````
UI test cleanup: Extract iter_skip_next from methods.rs
Update test output after rebase
Remove false negatives from known problems
Implement use_self for tuple structs
Document known problems
rustup https://github.com/rust-lang/rust/pull/56225/
Remove unnecessary `use` statements after `cargo fix`
Apply cargo fix --edition-idioms fixes
Use match ergonomics for booleans lint
Use match ergonomics for block_in_if_condition lint
Use match ergonomics for bit_mask lint
Use match ergonomics for attrs lint
Use match ergonomics for assign_ops lint
Use match ergonomics for artithmetic lint
Use match ergonomics for approx_const lint
Remove crate:: prefixes from crate paths
Support array indexing expressions in unused write to a constant
Mark writes to constants as side-effect-less
Update README local run command to remove syspath
Remove unsafe from consts clippy lints
Fix formatting
Merge new_without_default_derive into new_without_default
Only print out question_mark lint when it actually triggered
Add failing test
Reinserted commata
Recomend `.as_ref()?` in certain situations
Deduplicate some code?
````

5 years agoAuto merge of #57205 - petrochenkov:extrecov, r=estebank
bors [Sun, 30 Dec 2018 16:06:30 +0000 (16:06 +0000)]
Auto merge of #57205 - petrochenkov:extrecov, r=estebank

Improve error recovery for some built-in macros

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

5 years agoChange return types and check return values in tests.
Camille GILLOT [Tue, 27 Nov 2018 14:15:27 +0000 (15:15 +0100)]
Change return types and check return values in tests.

This allows to verify that we handle
different types as return types,
and that we call the expected functions.

5 years agoAdd comment.
Camille GILLOT [Wed, 21 Nov 2018 09:10:35 +0000 (10:10 +0100)]
Add comment.

5 years agoFix failing diagnostic test.
Camille GILLOT [Wed, 21 Nov 2018 09:10:16 +0000 (10:10 +0100)]
Fix failing diagnostic test.

5 years agoMove tests to ui.
Camille GILLOT [Thu, 8 Nov 2018 09:39:46 +0000 (10:39 +0100)]
Move tests to ui.

5 years agorustc_typeck: Implement resolution advised in issue 45510.
Camille GILLOT [Sun, 4 Nov 2018 10:23:45 +0000 (11:23 +0100)]
rustc_typeck: Implement resolution advised in issue 45510.

When resolving Fn traits, the compiler failed to take into account
overloaded implementations.  To resolve this, we inform the trait dispatch
code that the arguments will becoming as a tuple of correct arity.

5 years agorustfmt: librust_typeck/check/callee.rs
Camille GILLOT [Sun, 4 Nov 2018 15:14:44 +0000 (16:14 +0100)]
rustfmt: librust_typeck/check/callee.rs

5 years agotest: Add test for issues 45510 and 18952.
Camille GILLOT [Sun, 4 Nov 2018 10:27:09 +0000 (11:27 +0100)]
test: Add test for issues 45510 and 18952.

Those tests are directly taken from the comments on the bug reports.

5 years agoGuarantee `rustc_dump_user_substs` error order.
David Wood [Sat, 22 Dec 2018 14:32:44 +0000 (15:32 +0100)]
Guarantee `rustc_dump_user_substs` error order.

This commit buffers the errors output by the `rustc_dump_user_substs`
attribute so that they can be output in order of span and would
therefore be consistent.

5 years agoStop duplicating projections of type annotation.
David Wood [Wed, 19 Dec 2018 15:47:06 +0000 (16:47 +0100)]
Stop duplicating projections of type annotation.

This commit changes how type annotations are handled in bindings during
MIR building.

Instead of building up a `PatternTypeProjections` with the
`CanonicalUserTypeAnnotation` and projections, the
`CanonicalUserTypeAnnotation` is stored in the
`canonical_user_type_annotations` map at the start and the (equivalent)
`UserTypeProjections` is built up with the new index and same projections.

This has the effect of deduplicating type annotations as instead of type
annotations being added to the `canonical_user_type_annotations` map
multiple times at the end after being duplicated (which happens in building
up `PatternTypeProjections`), it is instead added once.

5 years agoStop well-formedness checking unreachable code.
David Wood [Tue, 18 Dec 2018 20:27:22 +0000 (21:27 +0100)]
Stop well-formedness checking unreachable code.

This commit stops well-formedness checking applying to unreachable code
and therefore stops some of the ICEs that the intended solution taken by
this PR causes.

By disabling these checks, we can land the other fixes and larger
refactors that this PR includes.

5 years agoFix unresolved inference variable ICE.
David Wood [Sun, 9 Dec 2018 02:07:31 +0000 (03:07 +0100)]
Fix unresolved inference variable ICE.

This commit moves well-formedness check for the
`UserTypeAnnotation::Ty(..)` case from always running to only when the
code is reachable. This solves the ICE that resulted from
`src/test/ui/issue-54943-1.rs` (a minimal repro of `dropck-eyepatch`
run-pass tests that failed).

The main well-formedness check that was intended to be run despite
unreachable code still is, that being the
`UserTypeAnnotation::TypeOf(..)` case. Before this PR, the other case
wasn't being checked at all.

It is possible to fix this ICE while still always checking
well-formedness for the `UserTypeAnnotation::Ty(..)` case but that
solution will ICE in unreachable code for that case, the diff for
that change [can be found here](0).

[0]: https://gist.github.com/davidtwco/f9751ffd9c0508f7251c0f17adc3af53

5 years agoAdd explicit error annotations to test.
David Wood [Fri, 7 Dec 2018 23:50:35 +0000 (00:50 +0100)]
Add explicit error annotations to test.

This commit adds explicit error annotations to tests after rebasing
which is now required.

5 years agoSupport user type annotations in `ref` bindings.
David Wood [Sun, 25 Nov 2018 14:14:39 +0000 (15:14 +0100)]
Support user type annotations in `ref` bindings.

This commit adds support for user type annotations in variables declared
using `ref` bindings. When a variable declared using a `ref` binding,
then the `LocalDecl` has the type `&T` where the `&` was introduced by
the `ref` binding but the canonicalized type annotation has only a
`T` since the reference is implicit with the `ref` binding.

Therefore, to support type annotations, the canonicalized type
annotation either needs wrapped in a reference, or the `LocalDecl` type
must have a wrapped reference removed for comparison. It is easier to
remove the outer reference from the `LocalDecl` for the purpose of
comparison, so that is the approach this commit takes.

5 years agoAdd user type annotations to MIR dump.
David Wood [Sun, 25 Nov 2018 12:31:34 +0000 (13:31 +0100)]
Add user type annotations to MIR dump.

This commit writes the user type annotations to the MIR dump so that
they are visible again.

5 years agoType annotations in associated constant patterns.
David Wood [Sat, 24 Nov 2018 11:56:24 +0000 (12:56 +0100)]
Type annotations in associated constant patterns.

This commit adds support for respecting user type annotations with
associated constants in patterns.