Commit Graph

92363 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
59e95ddfa8
Rollup merge of #59680 - DevQps:document-rustc-z-flag, r=cramertj
Document the -Z flag to the rustc book

# Description

Changes:
- Added new documentation on the `-Z` flag of rustc in the command-line arguments section of the rustc book.

If I need to rephrase anything or if you have any improvements, please let me know! I deliberately did not create an exhaustive list of all options since they are likely to change over time and per toolchain version.

closes #41142
2019-04-12 12:17:48 +02:00
bors
876a3bcb15 Auto merge of #59622 - GuillaumeGomez:improve-one-char-search, r=QuietMisdreavus
Ensure that exact matches come first in rustdoc search

Fixes #59287.

cc @scottmcm

r? @QuietMisdreavus
2019-04-12 08:59:03 +00:00
flip1995
136d66f011
Uplift get_def_path from Clippy
This uplifts `get_def_path` from Clippy. This is a follow up on the
implementation of internal lints: #59316

The internal lint implementation also copied the implementation of the
`AbsolutePathPrinter`. To get rid of this code duplication this also
uplifts the `get_def_path` function from Clippy.

This also renames `match_path` to `match_def_path`, as it was originally
named in Clippy.
2019-04-12 10:38:39 +02:00
Chris Gregory
e9c9d1c305 Add comment that field projectin also works with mutable fields 2019-04-12 01:29:30 -05:00
bors
2226c09699 Auto merge of #59536 - Zoxc:the-arena, r=eddyb
Introduce an arena type which may be used to allocate a list of types with destructors

You can also specify that you want deserializers for `&'tcx [T]` and `&'tcx T` for a type in the list, which will allocate those using the arena.

Based on https://github.com/rust-lang/rust/pull/59517 and https://github.com/rust-lang/rust/pull/59533. Look at the last commit for the interesting changes.

An alternative to https://github.com/rust-lang/rust/pull/56448. cc @michaelwoerister @eddyb

r? @oli-obk
2019-04-12 06:10:19 +00:00
Lzu Tao
2545867b41 Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in std 2019-04-12 05:18:36 +00:00
Chris Gregory
ac5e755164 Make BufWriter use get_mut instead of manipulating inner in Write implementation
get_mut allows us to abstract over the implementation detail of inner being
optional.
2019-04-11 23:57:29 -05:00
Esteban Küber
13a05a27e9 Continue evaluating after missing main 2019-04-11 20:01:19 -07:00
bors
0369e6c539 Auto merge of #59886 - mati865:musl_toolchain, r=alexcrichton
musl: do not compress debug section

This should be beta nominated.

Fixes https://github.com/rust-lang/rust/issues/59411 (this time for real).

Test with `DEPLOY=1 ./src/ci/docker/run.sh dist-x86_64-musl`, without `DEPLOY=1` libs are built without debuginfo.

r? @alexcrichton
2019-04-12 02:24:16 +00:00
Chris Gregory
94a5c3b2b2 Remove [mut] syntax in pin docs 2019-04-11 21:21:19 -05:00
Nicholas Nethercote
ca1ab3ed30 In -Zprint-type-size output, sort enum variants by size.
It's useful to see the biggest variants first.
2019-04-12 12:18:23 +10:00
Tyler Mandry
7c626a67ba Add discr_index to multi-variant layouts
We relax the assumption that the discriminant is always field 0, in
preparations for layouts like generators where this is not going to be
the case.
2019-04-11 17:44:43 -07:00
Tyler Mandry
b58624727c describe_enum_variant: Reduce code duplication 2019-04-11 17:44:43 -07:00
David Wood
5158063c3e
Switch to multipart suggestions.
This commit changes the suggestion so that it is split into multiple
parts in an effort to reduce the impact the applied suggestion could
have on formatting.
2019-04-12 01:54:33 +02:00
David Wood
137ffa1022
Improve robustness of nested check.
This commit removes the assumption that the start of a use statement
will always be on one line with a single space - which was silly in the
first place.
2019-04-12 01:54:33 +02:00
David Wood
7c955409e3
Handle edge cases.
This commit introduces more dirty span manipulation into the compiler
in order to handle the various edge cases in moving/renaming the macro
import so it is at the root of the import.
2019-04-12 01:54:33 +02:00
David Wood
d589cf9111
Handle renamed imports.
This commit extends the suggestion to handle imports that are aliased to
another name.
2019-04-12 01:54:32 +02:00
David Wood
d84907bbcc
Suggest macro import from crate root.
This commit suggests importing a macro from the root of a crate as the
intent may have been to import a macro from the definition location that
was annotated with `#[macro_export]`.
2019-04-12 01:54:32 +02:00
bors
cd8b437362 Auto merge of #59227 - Zoxc:fix-get, r=eddyb
Fix lifetime on LocalInternedString::get function

cc @eddyb @nnethercote
2019-04-11 23:36:13 +00:00
Esteban Küber
fd4c6e903b Remove duplicated redundant spans 2019-04-11 16:15:48 -07:00
Igor Matuszewski
bcd263e1f1 save-analysis: Simplify match arm for type node def 2019-04-11 23:53:59 +02:00
Esteban Küber
9b6b3d618c review comments 2019-04-11 14:45:23 -07:00
Igor Matuszewski
1ced262653 save-analysis: use qpath_def for associated types 2019-04-11 23:37:05 +02:00
Esteban Küber
66ed5d9cb0 Fix ui-fulldeps test 2019-04-11 14:21:13 -07:00
Josh Stone
90d9727919
Fix the link to sort_by_cached_key
It's a primitive slice method, not a standalone function.
2019-04-11 14:04:52 -07:00
Andrew Banchich
aefc1581b1
Update diagnostics.rs
Add `a` and other minor text improvements
2019-04-11 16:12:04 -04:00
Mark Mansi
e149dc02a4 remove warn 2019-04-11 15:09:43 -05:00
Esteban Küber
146d040f0b Reword tracking issue note 2019-04-11 11:42:06 -07:00
Mateusz Mikuła
7276eb5a43 musl: do not compress debug section
Old linkers are unable to decompress them and fail to link binaries
2019-04-11 18:58:14 +02:00
bors
3de0106789 Auto merge of #59780 - RalfJung:miri-unsized, r=oli-obk
Miri: unsized locals and by-value dyn traits

r? @oli-obk
Cc @eddyb

Fixes https://github.com/rust-lang/miri/issues/449
2019-04-11 15:44:22 +00:00
Ryan Levick
8678164483 Impl RawFd converstion traits for TcpListener, TcpStream and UdpSocket 2019-04-11 17:35:36 +02:00
rchaser53
199b0bad3c improve error messages 2019-04-12 00:27:46 +09:00
Oliver Middleton
ae2a68bcf5 Fix broken links on std::boxed doc page 2019-04-11 15:27:35 +01:00
Scott Olson
f54df44907 Remove note about transmute for float bitpatterns. 2019-04-11 07:56:35 -06:00
Michael Woerister
7b1df42acc Clean up handling of -Zpgo-gen commandline option. 2019-04-11 14:50:32 +02:00
bors
850912704e Auto merge of #59211 - nox:refcell-borrow-state, r=KodrAus
Introduce RefCell::try_borrow_unguarded

*Come sit next to the fireplace with me, this is going to be a long story.*

So, you may already be aware that Servo has weird design constraints that forces us developers working on it to do weird things. The thing that interests us today is that we do layout on a separate thread with its own thread pool to do some things in parallel, whereas the data it uses comes from the script thread, which implements the entire DOM and related pieces, with `!Sync` data types such as `RefCell<T>`.

The invariant we maintain is that script does not do anything ever with the DOM data as long as layout is doing its job. That's all nice and all, but one thing we don't ensure is that we don't actually know if script was currently mutably borrowing some `RefCell<T>` prior to starting layout, which may lead to aliasing mutable memory and obviously undefined behaviour.

This PR reinstates `RefCell::borrow_state` so that [this method](https://github.com/servo/servo/blob/master/components/script/dom/bindings/cell.rs#L23-L30) can make use of it and return `None` if the cell was mutably borrowed.

Cc @SimonSapin
2019-04-11 12:49:49 +00:00
Carol (Nichols || Goulding)
023487867c
Update TRPL to use mdbook 0.2 2019-04-11 07:56:25 -04:00
bors
ee1474acc4 Auto merge of #58972 - QuietMisdreavus:intra-doc-link-imports, r=GuillaumeGomez
rustdoc: don't process `Crate::external_traits` when collecting intra-doc links

Part of https://github.com/rust-lang/rust/issues/58745, closes https://github.com/rust-lang/rust/pull/58917

The `collect-intra-doc-links` pass keeps track of the modules it recurses through as it processes items. This is used to know what module to give the resolver when looking up links. When looking through the regular items of the crate, this works fine, but the `DocFolder` trait as written doesn't just process the main crate hierarchy - it also processes the trait items in the `external_traits` map. This is useful for other passes (so they can strip out `#[doc(hidden)]` items, for example), but here it creates a situation where we're processing items "outside" the regular module hierarchy. Since everything in `external_traits` is defined outside the current crate, we can't fall back to finding its module scope like we do with local items.

Skipping this collection saves us from emitting some spurious warnings. We don't even lose anything by skipping it, either - the docs loaded from here are only ever rendered through `html::render::document_short` which strips any links out, so the fact that the links haven't been loaded doesn't matter. Hopefully this removes most of the remaining spurious resolution warnings from intra-doc links.

r? @GuillaumeGomez
2019-04-11 08:48:26 +00:00
bors
d21bebe18d Auto merge of #59799 - Zoxc:vs2019, r=alexcrichton
Update cmake, cc and compiler_builtins for VS 2019 support

r? @alexcrichton
2019-04-11 05:56:11 +00:00
Mark Mansi
6fd3f5acaf forgot one 2019-04-10 21:32:46 -05:00
Mark Mansi
d7f5c50a33 make duplicate matcher bindings a hard error 2019-04-10 21:29:17 -05:00
Kampfkarren
1156ce6f54 Feedback 2019-04-10 19:22:43 -07:00
Esteban Küber
3ab97062cf Tweak unstable diagnostic output 2019-04-10 18:10:30 -07:00
Esteban Küber
ac037c1359 Recover from missing semicolon based on the found token
When encountering one of a few keywords when a semicolon was
expected, suggest the semicolon and recover:

```
error: expected one of `.`, `;`, `?`, or an operator, found `let`
  --> $DIR/recover-missing-semi.rs:4:5
   |
LL |     let _: usize = ()
   |                      - help: missing semicolon here
LL |
LL |     let _ = 3;
   |     ^^^

error[E0308]: mismatched types
  --> $DIR/recover-missing-semi.rs:2:20
   |
LL |     let _: usize = ()
   |                    ^^ expected usize, found ()
   |
   = note: expected type `usize`
              found type `()`
```
2019-04-10 18:07:52 -07:00
David Wood
16592f691b
Suggest removing ? to resolve type errors.
This commit adds a suggestion to remove the `?` from expressions if
removing the `?` would resolve a type error.
2019-04-10 23:52:01 +02:00
Kampfkarren
4af7cf37d4 Fix tests, I think 2019-04-10 14:39:51 -07:00
Jethro Beekman
e2d1d667e2 SGX target: fix cfg(test) build 2019-04-10 14:08:54 -07:00
Albin Stjerna
c440c0a0fd update polonius-engine 2019-04-10 22:44:07 +02:00
Guillaume Gomez
825a11ea3b Fix attributes position in type declaration 2019-04-10 22:31:42 +02:00
Alex Crichton
acf3ddb5ad std: Add {read,write}_vectored for more types
This commit implements the `{read,write}_vectored` methods on more types
in the standard library, namely:

* `std::fs::File`
* `std::process::ChildStd{in,out,err}`
* `std::io::Std{in,out,err}`
* `std::io::Std{in,out,err}Lock`
* `std::io::Std{in,out,err}Raw`

Where supported the OS implementations hook up to native support,
otherwise it falls back to the already-defaulted implementation.
2019-04-10 12:51:25 -07:00