88211 Commits

Author SHA1 Message Date
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
Mazdak Farrokhzad
14be8a7f14 const-stabilize Ipv4Addr::new 2018-12-31 16:36:39 +01:00
John Kåre Alsaker
584a52096e Clean up and optimize OpenTask / read_index 2018-12-31 16:24:22 +01:00
Mazdak Farrokhzad
2760f87e3a const-stabilize const_int_ops + reverse_bits 2018-12-31 16:11:03 +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
Mazdak Farrokhzad
50152d24ca now that some intrisics are safe, use that fact. 2018-12-31 04:11:46 +01:00
Mazdak Farrokhzad
fedfb61f26 make some intrinsics safe. 2018-12-31 04:11:17 +01:00
Mazdak Farrokhzad
e4c47f9c60 qualify_min_const_fn: improve note. 2018-12-31 03:36:46 +01:00
Mazdak Farrokhzad
35d77fc176 unchecked_{shl,shr}: extend const tests. 2018-12-31 03:36:46 +01:00
Mazdak Farrokhzad
d85ec4a9fc const stabilizations: adjust run-pass tests. 2018-12-31 03:36:46 +01:00
Mazdak Farrokhzad
eb0597ae83 stabilize const_int_sign 2018-12-31 03:36:46 +01:00
Mazdak Farrokhzad
e258489eae stabilize const_int_rotate 2018-12-31 03:36:46 +01:00
Mazdak Farrokhzad
7e7c337aef stabilize const_int_wrapping. 2018-12-31 03:36:46 +01: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
bors
a2b0f247bf 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
2018-12-30 18:49:01 +00:00
Matthias Krüger
9a1383edba 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?
````
2018-12-30 18:16:09 +01:00
bors
953a9cf10d 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
2018-12-30 16:06:30 +00:00
Camille GILLOT
91c155bcd7 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.
2018-12-30 14:47:12 +01:00
Camille GILLOT
2530ce9fa6 Add comment. 2018-12-30 14:47:12 +01:00
Camille GILLOT
2f42a188d9 Fix failing diagnostic test. 2018-12-30 14:47:12 +01:00
Camille GILLOT
f518cf9ba9 Move tests to ui. 2018-12-30 14:47:11 +01:00
Camille GILLOT
1827d52a3f 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.
2018-12-30 14:47:11 +01:00
Camille GILLOT
6de9c13830 rustfmt: librust_typeck/check/callee.rs 2018-12-30 14:47:09 +01:00
Camille GILLOT
4e77c3a9b1 test: Add test for issues 45510 and 18952.
Those tests are directly taken from the comments on the bug reports.
2018-12-30 14:40:00 +01:00
David Wood
c20ba65a0b
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.
2018-12-30 14:30:59 +01:00
David Wood
0bfe184b1a
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.
2018-12-30 14:30:59 +01:00