Commit Graph

81791 Commits

Author SHA1 Message Date
Pietro Albini
714fd37b8b
Rollup merge of #52778 - ljedrz:readable_serialize, r=kennytm
Improve readability of serialize.rs
2018-08-01 10:12:40 +02:00
Pietro Albini
06b91a4901
Rollup merge of #52771 - matklad:patch-1, r=kennytm
Clarify thread::park semantics

It took me quite some time to realize that the example is not actually racy, so let's clarify it? :-)
2018-08-01 10:12:38 +02:00
Pietro Albini
dafe33524a
Rollup merge of #52745 - commandline:master, r=oli-obk
Update clippy to latest master

r? @oli-obk

There is a regression in the version in current nightly that falsely lints `println!` and `writeln!` that use named arguments, thinking all rhs values for the argument expressions are literals even when they are not. This update includes the fix for that.
2018-08-01 10:12:37 +02:00
Pietro Albini
acff794b68
Rollup merge of #52732 - SimonSapin:spring, r=Mark-Simulacrum
Remove unstable and deprecated APIs
2018-08-01 10:12:36 +02:00
Pietro Albini
03df573c57
Rollup merge of #52628 - Mark-Simulacrum:rustdoc-cleanup-1, r=QuietMisdreavus
Cleanup some rustdoc code

Commits are mostly individual though some do depend on others.
2018-08-01 10:12:35 +02:00
Pietro Albini
b7ee110ea2
Rollup merge of #52340 - cypher:document-from-trait-in-ffi, r=steveklabnik
Document From trait implementations for OsStr, OsString, CString, and CStr

As part of issue #51430 (cc @skade).

The allocation and copy claims should be double-checked.

r? @steveklabnik
2018-08-01 10:12:32 +02:00
bors
c63bb1d6a7 Auto merge of #52756 - alexcrichton:cap-applicable, r=oli-obk
rustc: Disallow machine applicability in foreign macros

Recent changes to lints disallowed lints from being emitted against code located
in foreign macros, except for future-incompatible lints. For a future
incompatible lint, however, the automatic suggestions may not be applicable!

This commit updates this code path to force all applicability suggestions made
to foreign macros to never be `MachineApplicable`. This should avoid rustfix
actually attempting fixing these suggestions, causing non-compiling code to be
produced.

Closes rust-lang/cargo#5799
2018-08-01 06:44:09 +00:00
Ralf Jung
222dd17944 add comment 2018-08-01 08:39:30 +02:00
Colin Pronovost
3da7c65e92 Make sure we prepare for thin LTO whenever we are emitting bitcode
Emitting LLVM bitcode uses ThinLTOBuffers, so we need to prepare for
thin LTO or we will likely cause errors in LLVM.
2018-08-01 00:27:25 -04:00
Colin Pronovost
02190f397e Make globals with private linkage unnamed. Fixes #50862. 2018-07-31 23:45:18 -04:00
Eduard-Mihai Burtescu
dbc0cd94b9 rustc_resolve: record single-segment extern crate import resolutions. 2018-08-01 04:31:34 +03:00
Ryan Scheel
bcab7e28b4
Update compatibility note for 1.28.0 to be correct 2018-07-31 18:31:15 -07:00
Mark Rousskov
0f680b38d0 Fixup test case 2018-07-31 17:55:12 -06:00
Mark Rousskov
4cd004775c Add dyn to Write 2018-07-31 17:55:12 -06:00
Mark Rousskov
8e65a46268 Cleanup highlighting code
Removes some unused code and de-publicizes structs
2018-07-31 17:55:12 -06:00
Mark Rousskov
7bea518d3a Remove global derive_id and reset_ids functions
Previously these functions relied on TLS but we can instead thread the
relevant state through explicitly.
2018-07-31 17:55:12 -06:00
Ralf Jung
5ce5f310cc check_const: use the same ParamEnv as codegen for statics 2018-08-01 00:25:46 +02:00
John Renner
549f0fd9f7 Address code review 2018-07-31 15:00:45 -07:00
Esteban Küber
75ff0ddb43 Use suggestions for shell format arguments 2018-07-31 14:16:36 -07:00
Pietro Albini
6b138f5167
Backport 1.27.2 release notes 2018-07-31 23:13:41 +02:00
Felix S. Klock II
779792ff38 address review feedback (sort_by_key is so much cleaner here than sort_by!). 2018-07-31 23:00:01 +02:00
bors
e94df4acb4 Auto merge of #52234 - petrochenkov:macuse2, r=Mark-Simulacrum
resolve: Modularize crate-local `#[macro_export] macro_rules`

Based on https://github.com/rust-lang/rust/pull/50911, cc https://github.com/rust-lang/rust/pull/50911#issuecomment-401151270

`#[macro_export] macro_rules` items are collected from the whole crate and are planted into the root module as items, so the external view of the crate is symmetric with its internal view and something like `$crate::my_macro` where `my_macro` is `#[macro_export] macro_rules` works both locally and from other crates.

Closes https://github.com/rust-lang/rust/issues/52726
2018-07-31 20:52:14 +00:00
John Kåre Alsaker
0babbf11e6 Don't count MIR locals as borrowed after StorageDead when finding locals live across a yield terminator 2018-07-31 22:39:33 +02:00
Matthew Jasper
84dc48522d Allow borrow conflicts for promoted length 0 arrays 2018-07-31 21:35:22 +01:00
John Renner
7947c58d2d Allow unnameable tests 2018-07-31 13:17:44 -07:00
Simonas Kazlauskas
40a60464d4 Only run the sparc-abi test on sparc
It is not required for LLVM to have SPARC target support, so it is
necessary to only run this test when LLVM does support SPARC. Sadly, it
isn’t possible to specify exactly this constraint. Instead, we specify
that this test should run on SPARC host only (it surely is sane
assumption to make that compiler running on a SPARC can generate
SPARC, right?)

Since you cannot specify multiple `only-*` to have it run on both 32-bit
and 64-bit SPARC we pick 64-bit SPARC, because it is exactly what is
being tested by this test.

Fixes #52881
2018-07-31 22:47:12 +03:00
Guillaume Gomez
d94bdf8c66 Put back original field discovery 2018-07-31 21:43:29 +02:00
Laurentiu Nicola
38e311e448 Use SetLenOnDrop in Vec::truncate()
This avoids a redundant length check in some cases when calling
`Vec::truncate` or `Vec::clear`.

Fixes #51802
2018-07-31 20:53:53 +03:00
Alex Crichton
f0bceba669 rustc: Handle linker diagnostic from LLVM
Previously linker diagnostic were being hidden when two modules were linked
together but failed to link. This commit fixes the situation by ensuring that we
have a diagnostic handler installed and also adds support for handling linker
diagnostics.
2018-07-31 10:47:27 -07:00
Mark Rousskov
2216db9de7 Format code for easier editing 2018-07-31 11:39:04 -06:00
Mark Rousskov
01d95558e6 Further extract error code switch
Removes dependency on UnstableFeatures from markdown rendering
2018-07-31 11:39:02 -06:00
Mark Rousskov
03e34f8f81 Remove dependency on error handling from find_testable_code 2018-07-31 11:37:21 -06:00
Mark Rousskov
de5cebdba5 Provide test configuration through struct
This is far more sound than passing many different arguments of the same
type.
2018-07-31 11:37:21 -06:00
Mark Rousskov
ad40e4517f Provide warnings for invalid code blocks in markdown files
Previously we would only warn on Rust code but we can also do so when
testing markdown (the diag::Handler is available).
2018-07-31 11:37:21 -06:00
Mark Rousskov
0af5a6be05 Pull out nightly checking to edges
Parsing the code block's LangString (```foo) previously checked itself
to see if we were on nightly; that isn't the right place to do so. Move
that check slightly outwards to better abstract LangString.

(This is also an optimization as we avoid the costly environment
variable load of RUSTC_BOOTSTRAP).
2018-07-31 11:37:21 -06:00
Felix S. Klock II
a5a3f765eb NLL: On "cannot move out of type" error, print original source before rewrite.
* Arguably this change is sometimes injecting noise into the output
   (namely in the cases where the suggested rewrite is inline with the
   suggestion and we end up highlighting the original source code).
   I would not be opposed to something more aggressive/dynamic, like
   revising the suggestion code to automatically print the original
   source when necessary (e.g. when the error does not have a span
   that includes the span of the suggestion).

 * Also, as another note on this change: The doc comment for `Diagnostic::span_suggestion`
   says:
    /// The message
    ///
    /// * should not end in any punctuation (a `:` is added automatically)
    /// * should not be a question
    /// * should not contain any parts like "the following", "as shown"

   but the `:` is *not* added when the emitted line appears
   out-of-line relative to the suggestion. I find that to be an
   unfortunate UI experience.

----

As a drive-by fix, also changed code to combine multiple suggestions
for a pattern into a single multipart suggestion (which vastly
improves user experience IMO).

----

Includes the updates to expected NLL diagnostics.
2018-07-31 17:27:29 +02:00
Ralf Jung
872395a38c enable jemalloc assertions when configured to do so 2018-07-31 17:01:39 +02:00
bors
f89817997a Auto merge of #52461 - irinagpopa:safe-llvm, r=nikomatsakis
rustc_codegen_llvm: use safe references for LLVM FFI types.

Part of #45274.
2018-07-31 13:32:32 +00:00
pravic
830ac8c87f
Fix a typo in unsize.rs
RfC -> RFC
2018-07-31 16:28:50 +03:00
dragan.mladjenovic
f985e6cfd4 tests/ui: Add missing mips{64} ignores 2018-07-31 15:22:14 +02:00
Felix S. Klock II
faf841a9f6 Update the .nll.stderr files under new sorted-by-span scheme. 2018-07-31 14:51:36 +02:00
Felix S. Klock II
26776858cf Update tests that use -Z borrowck=compare or #[feature(nll)] to accmmodate diagnostic change. 2018-07-31 14:36:50 +02:00
Irina Popa
baff67d51f rustc_llvm: fix linking on mingw. 2018-07-31 15:36:38 +03:00
Felix S. Klock II
6787e25c29 Blindly update the #[rustc_region] tests which got touched by the NLL diagnostic change. 2018-07-31 14:35:43 +02:00
Felix S. Klock II
e8c29959cd Sort NLL error diagnostics by span in an attempt to make them match source order
(and thus, hopefully, more closely match user expectation).
2018-07-31 14:30:46 +02:00
ljedrz
ca52648264 Benchmarks for SmallVec 2018-07-31 14:11:04 +02:00
bors
ed8d14db99 Auto merge of #50267 - humanenginuity:master, r=alexcrichton
Implement inner deref for Option and Result

tracking issue: #50264
2018-07-31 11:20:16 +00:00
Ralf Jung
fb7d8a12db hopefully make test pass on windows 2018-07-31 11:17:26 +02:00
bors
8961132010 Auto merge of #52850 - SimonSapin:unstablize, r=alexcrichton
Revert "Stabilize to_bytes and from_bytes for integers."

This reverts commit c8f9b84b39 / PR https://github.com/rust-lang/rust/pull/51835, and reopens the tracking issue https://github.com/rust-lang/rust/issues/49792.

These methods were stabilized in Rust 1.29, which is still in Nightly as of this writing. So my understanding is that it is still time to change our minds. Given the ongoing discussion in https://github.com/rust-lang/rust/pull/51919 about possibly renaming these APIs and since 1.29 goes to beta soon, I’d like to revert this stabilization for now until a decision is made in that PR. It’s possible that a decision will be made in time for 1.29, but there is no urgency. At most I expect this functionality to make it into 1.30.
2018-07-31 09:08:33 +00:00
Ralf Jung
50773991d3 make sure that the no-panic test tests what it is supposed to test 2018-07-31 10:33:32 +02:00