Commit Graph

88171 Commits

Author SHA1 Message Date
Oliver Scherer
48aa81911c what is going on? 2019-01-01 20:05:03 +01:00
Oliver Scherer
3d924a6252 Git is drunk 2019-01-01 20:05:03 +01:00
Oliver Scherer
cb933eff35 rebase fallout 2019-01-01 20:05:02 +01:00
Oliver Scherer
089c4039c6 Pacify tidy 2019-01-01 20:05:02 +01:00
Oliver Scherer
d96c4a9046 Undo a few - now unnecessary - changes 2019-01-01 20:05:02 +01:00
Oliver Scherer
17db209d4b Simplify bit inspection of a constant 2019-01-01 20:05:02 +01:00
Oliver Scherer
37a0df3e9d <&'tcx ty::Const as Deref>::deref 2019-01-01 20:05:02 +01:00
Oliver Scherer
bb9f717a80 const_to_op is now lazy_const_to_op 2019-01-01 20:05:02 +01:00
Oliver Scherer
f36c6559ea Add unwrap_usize to LazyConst, too 2019-01-01 20:05:02 +01:00
Oliver Scherer
135132891d Simplify and fix some diagnostics around arrays 2019-01-01 20:05:02 +01:00
Oliver Scherer
88df3a2c97 Mingw is special wrt type sizes 2019-01-01 20:05:02 +01:00
Oliver Scherer
b903cb9d60 Move the Unevaluated constant arm upwards in the type structure 2019-01-01 20:05:02 +01:00
Corey Farwell
d2c91a1a6d Fix broken links to second edition TRPL.
Fixes https://github.com/rust-lang/rust/issues/57104.
2019-01-01 12:53:07 -05:00
bors
cae164753f 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
2019-01-01 15:26:12 +00:00
bors
36500deb1a 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.
2019-01-01 11:47:58 +00:00
bors
7a2779a462 Auto merge of #57210 - estebank:str-err, r=zackmdavis
Tweak unicode escape diagnostics
2019-01-01 09:10:23 +00:00
bors
0432798fdb Auto merge of #57194 - matthiaskrgr:copyright_headers, r=Centril
remove more copyright headers

r? @Mark-Simulacrum
2019-01-01 06:34:11 +00:00
bors
d8371c61e6 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).
2019-01-01 02:08:39 +00:00
Yuning Zhang
710dcbd381 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.
2018-12-31 20:43:08 -05:00
Yu Ding
d04f5208ba Bound sgx target_env with fortanix as target_vendor
Signed-off-by: Yu Ding <dingelish@gmail.com>
2018-12-31 16:32:56 -08:00
bors
fe6a54d220 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.
2018-12-31 23:30:57 +00:00
Vadim Petrochenkov
60d1fa70bb Address review comments
Say "trait" instead of "type" in diagnostics for `dyn Trait`
2019-01-01 01:39:55 +03:00
Vadim Petrochenkov
8b1c424b6d privacy: Use common DefId visiting infra for all privacy visitors 2019-01-01 01:39:55 +03:00
John Kåre Alsaker
f4826abf6d Fix backtraces on Windows 2018-12-31 22:07:28 +01:00
bors
9eac386342 Auto merge of #57047 - euclio:field-structured-suggestions, r=estebank
use structured suggestions for nonexistent fields

r? @estebank
2018-12-31 20:56:19 +00:00
Esteban Küber
30961c958d Do not use unicode character in diagnostic help 2018-12-31 10:00:08 -08:00
Andy Russell
dfc326d0e2
use structured suggestions for nonexistent fields 2018-12-31 12:52:30 -05:00
Esteban Küber
b416f1398f Use structured suggestion for braceless unicode escape squence 2018-12-31 09:44:58 -08:00
Esteban Küber
7edc434b72 Account for \xFF and \u{FF} sequences in string format errors 2018-12-31 09:44:58 -08:00
Esteban Küber
18e0bdae54 Update tests after rebase 2018-12-31 08:41:05 -08:00
Esteban Küber
2cd0d14eb1 Address review comments
- Suggest raw ident escaping in all editions
- Keep primary label in all cases
2018-12-31 08:24:00 -08:00
Esteban Küber
833f12ebd7 Suggest using raw identifiers in 2018 edition when using keywords 2018-12-31 08:24:00 -08:00
John Kåre Alsaker
584a52096e Clean up and optimize OpenTask / read_index 2018-12-31 16:24:22 +01:00
bors
6efaef6189 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
2018-12-31 14:30:17 +00:00
ian
bbc8c932fb Fix inconsistent Clone documentation.
Use function pointer as the example to demonstrate how to implement Clone for
Copy types.

refs #57123
2018-12-31 21:22:50 +08:00
Mika Lehtinen
794b81ea5e Rename and fix nolink-with-link-args test
There are three problems with the nolink-with-link-args test:

* The test fails when using MSVC. It's caused by the `linker-flavor=ld` flag which was added in #46291.
* In its comment, this test tests that "link_args are indeed passed when nolink is specified", but the `nolink` attribute has been removed [a long time ago](https://github.com/rust-lang/rust/pull/12826).
* Pattern has a small typo.

At first I was going to completely remove this test, but there is [a closed pull request for that](https://github.com/rust-lang/rust/pull/21090).

So:

* rename the file as suggested in the closed PR
* adjust the comment
* fix typo in the pattern
* add `ignore-msvc`.
2018-12-31 13:51:40 +02:00
bors
433ef826f0 Auto merge of #57061 - Zoxc:graph-refactor, r=michaelwoerister
Group dep node data into a single structure

r? @michaelwoerister
2018-12-31 10:55:46 +00:00
John Kåre Alsaker
2738f2c891 Address comments 2018-12-31 09:16:06 +01:00
John Kåre Alsaker
18d6b37f2c Use entry API to avoid double lookup when interning dep nodes 2018-12-31 09:16:02 +01:00
John Kåre Alsaker
a426d47f58 Group dep node data into a single structure 2018-12-31 09:15:58 +01:00
bors
aeed63bf38 Auto merge of #57208 - estebank:issue-57198, r=petrochenkov
Do not complain about missing crate named as a keyword

Fix #57198.
2018-12-31 08:06:15 +00:00
Esteban Küber
5d086c3282 Tweak E0308 error for clarity 2018-12-30 21:59:27 -08:00
bors
f39bd9b9cb 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.
2018-12-31 04:06:14 +00:00
bors
2cf7f55662 Auto merge of #57035 - Zoxc:query-pref9, r=michaelwoerister
Uninline some debugging code and use unlikely! macro

r? @michaelwoerister
2018-12-31 01:18:19 +00:00
varkor
7d5f6ceef0 Fix variable string size problem in transmute test 2018-12-30 23:45:58 +00:00
Esteban Küber
f62f540b4e Point at function name span 2018-12-30 15:41:19 -08:00
Esteban Küber
1f65dc0770 Point at the return type span on type mismatch due to missing return
Do not point at the entire block span on fn return type mismatches
caused by missing return.
2018-12-30 13:55:00 -08:00
Matthew Jasper
afb7c06834 Remove unused nll debug flags 2018-12-30 20:44:44 +00:00
Esteban Küber
cef919e971 Address review comments: Remove new PathResult variant 2018-12-30 12:19:16 -08:00
Jun Wu
31a5066e0b 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
2018-12-30 11:59:03 -08:00