Rollup merge of #64284 - Mark-Simulacrum:include-warn, r=petrochenkov
Warn if include macro fails to include entire file
This currently introduces an error, mainly because that was just simpler, and I'm not entirely certain if we can introduce a lint without an RFC and such.
This is primarily to get feedback on the approach and overall aim -- in particular, do we think this is helpful? If so, we probably will need lang-team sign off and decide if it should be an error (as currently introduced by this PR), a lint, or a warning.
bors [Tue, 8 Oct 2019 17:31:35 +0000 (17:31 +0000)]
Auto merge of #65209 - Centril:rollup-tzc0j87, r=Centril
Rollup of 8 pull requests
Successful merges:
- #64404 (Add long error explanation for E0495)
- #64918 (Add long error explanation for E0551)
- #65102 (Disable stack probe when thread sanitizer is enabled)
- #65120 (Correctly estimate the required space for string in `StyledBuffer::prepend`)
- #65145 (When suggesting assoc function with type params, include turbofish)
- #65162 (Remove loaded_from_cache map from DepGraph)
- #65176 (Remove query-related macros)
- #65179 (Add long error explanation for E0567)
Rollup merge of #65162 - Mark-Simulacrum:no-cache-loading-map, r=michaelwoerister
Remove loaded_from_cache map from DepGraph
It's now unused, even with -Zquery-dep-graph
From https://github.com/rust-lang/rust/pull/63756/files#r316039379 -- it'll simplify that PR to get this landed separately so we can just remove some of the code that it touches.
Rollup merge of #65102 - tmiasko:tsan-probe-stack, r=alexcrichton
Disable stack probe when thread sanitizer is enabled
When thread sanitizer instrumentation is enabled during compilation of
stack probe function, the function will be miscompiled and trigger
segmentation fault at runtime. Disable stack probes when tsan is
enabled.
bors [Tue, 8 Oct 2019 04:35:03 +0000 (04:35 +0000)]
Auto merge of #65196 - Centril:rollup-q06lcxm, r=Centril
Rollup of 8 pull requests
Successful merges:
- #64726 (rewrite documentation for unimplemented! to clarify use)
- #65040 (syntax: more cleanups in item and function signature parsing)
- #65046 (Make `Cell::new` method come first in documentation)
- #65098 (Add long error explanation for E0561)
- #65150 (Suggest dereferencing boolean reference when used in 'if' or 'while')
- #65154 (Fix const generic arguments not displaying in types mismatch diagnostic)
- #65181 (fix bug in folding for constants)
- #65187 (use 'invalid argument' for vxWorks)
Rollup merge of #65181 - nikomatsakis:lazy-norm-anon-const-push-1, r=varkor
fix bug in folding for constants
These was a bug in the folding for constants that caused it to overlook bound regions. This branch includes some other little things that I did while trying to track the bug down.
Rollup merge of #65046 - sinkuu:cell_reorder, r=shepmaster
Make `Cell::new` method come first in documentation
Methods to create a thing usually comes first in `std` documentation, and `Cell` has been an exception. Also, `T: Copy` specialized methods should not be on top of the page. (This had led me to miss that most of its methods are not bounded by `Copy`...)
Rollup merge of #64726 - andrewbanchich:unimplemented, r=rkruppe
rewrite documentation for unimplemented! to clarify use
The current docs for `unimplemented!` seem to miss the point of this macro.
> This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them.
You could also return a `()` if you just want your code to type-check.
I think `unimplemented!` is useful for when you want your program to exit when it reaches an unimplemented area.
I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.
bors [Tue, 8 Oct 2019 01:05:08 +0000 (01:05 +0000)]
Auto merge of #65186 - mati865:cargoup, r=alexcrichton
Update Cargo
To pull rust-lang/cargo#7482
List of merged PRs:
- Fix wrong directories in PATH on Windows (rust-lang/cargo#7482)
- Update SPDX list to 3.6 (rust-lang/cargo#7481)
- Mark Emscripten's .wasm files auxiliary (rust-lang/cargo#7476)
- Update `curl-sys` dependency requirement (rust-lang/cargo#7464)
- add dependencies for `pkg-config` (rust-lang/cargo#7443)
- Removing hash from output files when using MSVC (rust-lang/cargo#7400)
- Disable preserving mtimes on archives (rust-lang/cargo#7465)
- Removed redundant borrow (rust-lang/cargo#7462)
- Public dependency refactor and re-allow backjumping (rust-lang/cargo#7361)
- unify the quote in Cargo.toml (rust-lang/cargo#7461)
bors [Mon, 7 Oct 2019 13:23:00 +0000 (13:23 +0000)]
Auto merge of #64780 - choller:master, r=michaelwoerister
Only add sanitizer runtimes when linking an executable (#64629).
This change modifies the code to only add sanitizer runtimes if we are linking an executable, as those runtimes should never be part of libraries. I successfully compiled `mozilla-central` with ASan using this patch.
Rollup merge of #63948 - crlf0710:path_to_raw_dylib, r=Centril
Add feature gate for raw_dylib.
This PR adds the feature gate for RFC 2627 (https://github.com/rust-lang/rust/issues/58713). It doesn't contain the actual functionality.
Add I'm not sure whether i did it correctly, since this is the first time i did this.
bors [Mon, 7 Oct 2019 00:12:12 +0000 (00:12 +0000)]
Auto merge of #64906 - Aaron1011:feature/extern-const-fn, r=Centril
Add support for `const unsafe? extern fn`
This works just as you might expect - an `const extern fn` is a `const fn` that is callable from foreign code.
Currently, panicking is not allowed in `const`s. When https://github.com/rust-lang/rfcs/pull/2345 (https://github.com/rust-lang/rust/issues/51999) is stabilized, then panicking in an `const extern fn` will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime.
Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary.
This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well.
Tyler Mandry [Sun, 6 Oct 2019 18:41:59 +0000 (11:41 -0700)]
Rollup merge of #65155 - Avi-D-coder:fix-lints, r=Mark-Simulacrum
Use shorthand initialization in rustdoc
This just fixes a few lints I rust-analyzer was showing. Is this sort of PR useful? Should the lints be fixed as apart of the otherwise unrelated PR I was working on?
bors [Sun, 6 Oct 2019 16:32:46 +0000 (16:32 +0000)]
Auto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakis
Deny specializing items not in the parent impl
Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of?
This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness).
One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method).
Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.
See #65042 for a long-term strategy to detect this kind of issue
bors [Sun, 6 Oct 2019 04:59:16 +0000 (04:59 +0000)]
Auto merge of #65152 - tmandry:rollup-btn4a01, r=tmandry
Rollup of 18 pull requests
This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts.
Successful merges:
- #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
- #64728 (Stabilize UdpSocket::peer_addr)
- #64765 (std: Reduce checks for `feature = "backtrace"`)
- #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
- #65011 (Do not ICE when dereferencing non-Copy raw pointer)
- #65064 (permit asyncawait-ondeck to be added by anyone)
- #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
- #65100 (Replace GeneratorSubsts with SubstsRef)
- #65105 (Split out some passes from librustc)
- #65106 (Allow unused attributes to avoid incremental bug)
- #65113 (Fix lonely backtick)
- #65116 (Remove unneeded visit_statement definition)
- #65118 (Update the documented default of -Z mutable-noalias)
- #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
- #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
- #65126 (Fix typo on `now()` comments)
- #65130 (lint: extern non-exhaustive types are improper)
- #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend")
Tyler Mandry [Sun, 6 Oct 2019 04:55:13 +0000 (21:55 -0700)]
Rollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandry
Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend"
This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes.
Tyler Mandry [Sun, 6 Oct 2019 04:55:11 +0000 (21:55 -0700)]
Rollup merge of #65130 - davidtwco:rfc-2008-improper-ctypes, r=petrochenkov
lint: extern non-exhaustive types are improper
This PR makes the `improper_ctype` lint trigger for non-exhaustive types when those types aren't defined in the current crate, as per [this comment](https://github.com/rust-lang/rust/issues/44109#issuecomment-537583344).
Tyler Mandry [Sun, 6 Oct 2019 04:55:00 +0000 (21:55 -0700)]
Rollup merge of #65105 - Mark-Simulacrum:split-librustc, r=nikomatsakis
Split out some passes from librustc
This is just moving them out to librustc_passes -- I've not measured compile time or run time. I don't expect any significant impact, but this seems prudent regardless.