Commit Graph

102199 Commits

Author SHA1 Message Date
Yuki Okushi
392ebad5c6
Rollup merge of #66123 - GuillaumeGomez:no-more-hidden-elements, r=Dylan-DPC
No more hidden elements

Fixes #66046.

Follow-up of #66082.

r? @kinnison
2019-11-08 13:42:19 +09:00
Yuki Okushi
996d94a9db
Rollup merge of #66056 - petrochenkov:metapriv, r=eddyb
rustc_metadata: Some reorganization of the module structure

The new structure of `rustc_metadata` (or rather its parts affected by the refactoring) is
```
├── lib.rs
└── rmeta
    ├── decoder
    │   └── cstore_impl.rs
    ├── decoder.rs
    ├── encoder.rs
    ├── mod.rs
    └── table.rs
```

(`schema` is renamed to `rmeta`.)

The code inside `rmeta` is pretty self-contained, so we can now privatize almost everything in this module instead of using `pub(crate)`  which was necessary when all these modules accessed their neighbors in the old flat structure.

`encoder` and `decoder` work with structures defined by `rmeta`.
`table` is a part of `rmeta`.
`cstore_impl` actively uses decoder methods and exposes their results through very few public methods (`provide` and `_untracked` methods).

r? @eddyb @spastorino
2019-11-08 13:42:17 +09:00
Yuki Okushi
9dc5d0ec81
Rollup merge of #66049 - RalfJung:missing-spans, r=alexcrichton
consistent handling of missing sysroot spans

Due to https://github.com/rust-lang/rust/issues/53081, sysroot spans (pointing to code in libcore/libstd/...) fails to print on some x86 runners. This consolidates the ignore directives for that and references the relevant issue.

I also did that for the generated derive-error-span tests -- but there the script and the tests were not entirely in sync any more since https://github.com/rust-lang/rust/pull/64151. Cc @estebank @varkor
2019-11-08 13:42:16 +09:00
Yuki Okushi
a00c777b75
Rollup merge of #65580 - SimonSapin:maybeuninit-array, r=Amanieu
Add `MaybeUninit` methods `uninit_array`, `slice_get_ref`, `slice_get_mut`

Eventually these will hopefully become the idiomatic way to work with partially-initialized stack buffers.

All methods are unstable. Note that `uninit_array` takes a type-level `const usize` parameter, so it is blocked (at least in its current form) on const generics.

Example:

```rust
use std::mem::MaybeUninit;

let input = b"Foo";
let f = u8::to_ascii_uppercase;

let mut buffer: [MaybeUninit<u8>; 32] = MaybeUninit::uninit_array();
let vec;
let output = if let Some(buffer) = buffer.get_mut(..input.len()) {
    buffer.iter_mut().zip(input).for_each(|(a, b)| { a.write(f(b)); });
    unsafe { MaybeUninit::slice_get_ref(buffer) }
} else {
    vec = input.iter().map(f).collect::<Vec<u8>>();
    &vec
};

assert_eq!(output, b"FOO");
```
2019-11-08 13:42:14 +09:00
Yuki Okushi
32aa327ba3
Rollup merge of #65554 - gliderkite:bufreader-doc-enhance, r=KodrAus
Enhance the documentation of BufReader for potential data loss

This is (IMO) and enhancement of the `std::io::BufReader` documentation, that aims to highlight how relatively easy is to end up with data loss when improperly using an instance of this class.

This is following the issue I had figuring out why my application was loosing data, because I focused my attention on the word *multiple instances* of `BufReader` in its `struct` documentation, even if I ever only had one instance.

Link to the issue: https://github.com/tokio-rs/tokio/issues/1662
2019-11-08 13:42:12 +09:00
bors
d2574403b3 Auto merge of #64882 - ehuss:stabilize-bare-extern, r=eddyb
Stabilize --extern flag without a path.

This stabilizes the `--extern` flag without a path, implemented in #54116.

This flag is used to add a crate that may be found in the search path to the extern prelude. The intent of stabilizing this now is to change Cargo to emit this flag for `proc_macro` when building a proc-macro crate. This will allow the ability to elide `extern crate proc_macro;` for proc-macros, one of the few places where it is still necessary.

It is intended that Cargo may also use this flag for other cases in the future as part of the [std-aware work](https://github.com/rust-lang/wg-cargo-std-aware/). There will likely be some kind of syntax where users may declare dependencies on other crates (such as `alloc`), and Cargo will use this flag so that they may be used like any other crate. At this time there are no short-term plans to use it for anything other than proc-macro.

This will not help for non-proc-macro crates that use `proc_macro`, which I believe is not too common?

An alternate approach for proc-macro is to use the `meta` crate, but from my inquiries there doesn't appear to be anyone interested in pushing that forward. The `meta` crate also doesn't help with things like `alloc` or `test`.

cc #57288
2019-11-08 01:15:50 +00:00
bors
e8f43b72eb Auto merge of #66189 - Centril:rollup-3bsf45s, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #63793 (Have tidy ensure that we document all `unsafe` blocks in libcore)
 - #64696 ([rustdoc] add sub settings)
 - #65916 (syntax: move stuff around)
 - #66087 (Update some build-pass ui tests to use check-pass where applicable)
 - #66182 (invalid_value lint: fix help text)

Failed merges:

r? @ghost
2019-11-07 22:02:41 +00:00
Alex Crichton
a7b0beac6d Attempt to fix *.yml confguration on Azure
Currently the `RUST_CONFIGURE_ARGS` variable apparently has a trailing
newline at the end of it due to the way it's configured in yaml. This
causes issues with MSVC's `install-clang.sh` step where the way the bash
syntax works out means that we drop the arg we're trying to add and it
doesn't actually get added!

The hopeful fix here is to tweak how we specify the yaml syntax to not
have a trailing newline, we'll see what CI says about this...
2019-11-07 13:06:56 -08:00
Alex Crichton
1e4c2ae622 Update clang to build LLVM to 9.0.0
This also ensure that we're using the same clang version for all our
major platforms instead of 8.0 on Linux and 7.0 on OSX/Windows.
2019-11-07 13:06:56 -08:00
Vadim Petrochenkov
5eb1cf1619 rustc_metadata: Rename schema to rmeta
And change `rmeta.rs` to `rmeta/mod.rs`
2019-11-07 21:06:48 +03:00
Vadim Petrochenkov
2b75147451 rustc_metadata: Privatize more entities 2019-11-07 21:06:47 +03:00
Vadim Petrochenkov
166d5f8b2f rustc_metadata: Privatize everything in decoder 2019-11-07 21:06:47 +03:00
Vadim Petrochenkov
0c9d4246b0 rustc_metadata: Move cstore_impl into mod decoder 2019-11-07 21:06:12 +03:00
Vadim Petrochenkov
8e1ae56bc6 rustc_metadata: Privatize everything in schema and schema/table 2019-11-07 21:06:12 +03:00
Vadim Petrochenkov
8590b16d9b rustc_metadata: Move decoder/encoder/table into mod schema 2019-11-07 21:04:42 +03:00
Eduard-Mihai Burtescu
ccde510c95 rustc_target: inline abi::FloatTy into abi::Primitive. 2019-11-07 16:54:25 +02:00
Eric Huss
ee459c6200 Update for unstable option refactoring. 2019-11-07 06:43:07 -08:00
Eric Huss
845ec5df7a Remove docs on --extern metadata precedence. 2019-11-07 06:43:07 -08:00
Eric Huss
f9e4f0f494 Add test for --extern alloc=librustc.rlib 2019-11-07 06:43:07 -08:00
Eric Huss
41e051dfcc Update src/test/ui-fulldeps/pathless-extern-unstable.rs
Add ERROR

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-07 06:43:07 -08:00
Eric Huss
b54e8ecc2e Update extern linking documentation. 2019-11-07 06:43:07 -08:00
Ohad Ravid
3e0759dc05
Push re_rebalance_coherence to 1.41
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-07 15:20:56 +01:00
Eric Huss
4bf411ea6d Update built-in help for --extern. 2019-11-07 05:51:17 -08:00
Eric Huss
e0058ce994 Add more --extern tests. 2019-11-07 05:51:17 -08:00
Eric Huss
b47e3d8fe4 Stabilize --extern flag without a path. 2019-11-07 05:51:17 -08:00
Mazdak Farrokhzad
333899a736
Rollup merge of #66182 - RalfJung:invalid-value, r=Centril
invalid_value lint: fix help text

Now that we also warn about `MaybUninit::uninit().assume_init()`, just telling people "use `MaybeUninit`" isn't always sufficient. And anyway this seems like an important enough point to mention it here.
2019-11-07 14:27:26 +01:00
Mazdak Farrokhzad
a96811ee9c
Rollup merge of #66087 - tmiasko:ui-mode, r=Centril
Update some build-pass ui tests to use check-pass where applicable

Helps with issue https://github.com/rust-lang/rust/issues/62277.
2019-11-07 14:27:24 +01:00
Mazdak Farrokhzad
28c1136970
Rollup merge of #65916 - Centril:split-syntax-3, r=davidtwco
syntax: move stuff around

Part of https://github.com/rust-lang/rust/pull/65324.

r? @davidtwco
cc @estebank @petrochenkov
2019-11-07 14:27:23 +01:00
Mazdak Farrokhzad
59e79ff137
Rollup merge of #64696 - GuillaumeGomez:rustdoc-sub-settings, r=kinnison
[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
2019-11-07 14:27:21 +01:00
Mazdak Farrokhzad
379b19c17f
Rollup merge of #63793 - oli-obk:🧹, r=dtolnay
Have tidy ensure that we document all `unsafe` blocks in libcore

cc @rust-lang/libs

I documented a few and added ignore flags on the other files. We can incrementally document the files, but won't regress any files this way.
2019-11-07 14:27:20 +01:00
Mazdak Farrokhzad
cc9c139694 move syntax::{parse::literal -> util::literal} 2019-11-07 13:59:13 +01:00
Mazdak Farrokhzad
27f97aa468 move syntax::parse::lexer::comments -> syntax::util::comments 2019-11-07 13:59:13 +01:00
Mazdak Farrokhzad
a1571b6855 syntax::attr: remove usage of lexer 2019-11-07 13:59:13 +01:00
Mazdak Farrokhzad
255b12a8d3 move parse::classify -> util::classify 2019-11-07 13:59:13 +01:00
Mazdak Farrokhzad
3667e6248e move PResult to librustc_errors 2019-11-07 13:58:36 +01:00
Mazdak Farrokhzad
9d6768a478 syntax::parser::token -> syntax::token 2019-11-07 13:50:12 +01:00
Mazdak Farrokhzad
53a50d4e4f move unescape_error_reporting to lexer/ 2019-11-07 13:50:12 +01:00
Mazdak Farrokhzad
8fa8e02c28 syntax: simplify imports 2019-11-07 13:50:12 +01:00
Mazdak Farrokhzad
da116223c7 move parse/parser.rs -> parse/parser/mod.rs 2019-11-07 13:50:12 +01:00
Guillaume Gomez
ffc1c5a04d Update ui tests 2019-11-07 13:02:34 +01:00
Guillaume Gomez
b7c0e464d5 Add long error explanation for E0623 2019-11-07 13:01:53 +01:00
Simon Sapin
639c4f779c MaybeUninit::uninit_array docs: better example 2019-11-07 12:05:01 +01:00
Simon Sapin
05c14bcc31 Apply docs suggestions from review
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-07 12:05:01 +01:00
Simon Sapin
1906c6f714 Add MaybeUninit methods uninit_array, slice_get_ref, slice_get_mut 2019-11-07 12:05:00 +01:00
Guillaume Gomez
d4527b7e00 Only call onHashChange instead of both functions 2019-11-07 10:39:53 +01:00
Ralf Jung
a5be03654c invalid_value lint: fix help text 2019-11-07 10:22:50 +01:00
Guillaume Gomez
24e093c5c3 Remove old isHidden function 2019-11-07 10:13:44 +01:00
bors
50f8aadd74 Auto merge of #66180 - Centril:rollup-c1ji943, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #59789 (Revert two unapproved changes to rustc_typeck.)
 - #65752 (Use structured suggestions for missing associated items)
 - #65884 (syntax: ABI-oblivious grammar)
 - #65974 (A scheme for more macro-matcher friendly pre-expansion gating)
 - #66017 (Add future incompatibility lint for `array.into_iter()`)

Failed merges:

 - #66056 (rustc_metadata: Some reorganization of the module structure)

r? @ghost
2019-11-07 07:55:39 +00:00
Mazdak Farrokhzad
c9eae9ea63
Rollup merge of #66017 - LukasKalbertodt:array-into-iter-lint, r=matthewjasper
Add future incompatibility lint for `array.into_iter()`

This is for #65819. This lint warns when calling `into_iter` on an array directly. That's because today the method call resolves to `<&[T] as IntoIterator>::into_iter` but that would change when adding `IntoIterator` impls for arrays. This problem is discussed in detail in #65819.

We still haven't decided how to proceed exactly, but it seems like adding a lint is a good idea regardless?

Also: this is the first time I implement a lint, so there are probably a lot of things I can improve. I used a different strategy than @scottmcm describes [here](https://github.com/rust-lang/rust/pull/65819#issuecomment-548667847) since I already started implementing this before they commented.

### TODO

- [x] Decide if we want this lint -> apparently [we want](https://github.com/rust-lang/rust/pull/65819#issuecomment-548964818)
- [x] Open a lint-tracking-issue and add the correct issue number in the code -> https://github.com/rust-lang/rust/issues/66145
2019-11-07 08:51:58 +01:00
Mazdak Farrokhzad
e19cb40fda
Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkov
A scheme for more macro-matcher friendly pre-expansion gating

Pre-expansion gating will now avoid gating macro matchers that did not result in `Success(...)`. That is, the following is now OK despite `box 42` being a valid `expr` and that form being pre-expansion gated:

```rust
macro_rules! m {
    ($e:expr) => { 0 }; // This fails on the input below due to `, foo`.
    (box $e:expr, foo) => { 1 }; // Successful matcher, we should get `2`.
}

fn main() {
    assert_eq!(1, m!(box 42, foo));
}
```

Closes https://github.com/rust-lang/rust/issues/65846.

r? @petrochenkov
cc @Mark-Simulacrum
2019-11-07 08:51:57 +01:00