Commit graph

88611 commits

Author SHA1 Message Date
Jethro Beekman
972bba7071 Stabilize cfg_target_vendor, #29718 2019-01-14 14:33:04 +05:30
Jethro Beekman
6080318883 Add additional human-readable cfg strings to rustdoc 2019-01-14 14:32:31 +05:30
Petr Hosek
c6632725c1 Support passing cflags/cxxflags/ldflags to LLVM build
This may be needed with some host compilers.
2019-01-13 22:40:29 -08:00
Scott McMurray
1fd971c3b9 Add a debug_assert to Vec::set_len 2019-01-13 22:40:25 -08:00
bors
1d029c67e2 Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obk
Use structured suggestions for nonstandard style lints

This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered.

Fixes #48103.
Fixes #52414.
2019-01-14 06:35:51 +00:00
Aaron Hill
f2dbdc4302
Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test
This ensures that the test passes, regardless of what the user has set
RUST_BACKTRACE to.
2019-01-14 01:16:27 -05:00
bors
0bc0015f20 Auto merge of #57381 - estebank:if-else-308, r=nikomatsakis
Tweak output of type mismatch between "then" and `else` `if` arms

```
error[E0308]: if and else have incompatible types
  --> $DIR/if-else-type-mismatch.rs:5:9
   |
LL |       let _ = if true {
   |  _____________-
LL | |         42i32
   | |         ----- expected because of this
LL | |     } else {
LL | |         42u32
   | |         ^^^^^ expected i32, found u32
LL | |     };
   | |_____- if and else have incompatible types
   |
   = note: expected type `i32`
              found type `u32`

error[E0308]: if and else have incompatible types
  --> file.rs:2:38
   |
LL |     let _ = if false { 3u8; } else { 3u8 };
   |                        ----          ^^^ expected (), found u8
   |                        |  |
   |                        |  help: consider removing this semicolon
   |                        expected because of this
   |
   = note: expected type `()`
              found type `u8`

error[E0308]: if and else have incompatible types
  --> file.rs:3:37
   |
LL |     let _ = if false { 3u8 } else { 3u8; };
   |                        ---          ^^^-
   |                        |            |  |
   |                        |            |  help: consider removing this semicolon
   |                        |            expected u8, found ()
   |                        expected because of this
   |
   = note: expected type `u8`
              found type `()`

error[E0308]: if and else have incompatible types
  --> file.rs:4:37
   |
LL |     let _ = if false { 3i8 } else { 3u8 };
   |                        ---          ^^^ expected i8, found u8
   |                        |
   |                        expected because of this
   |
   = note: expected type `i8`
              found type `u8`
```

Fix #57348.
2019-01-14 03:49:25 +00:00
John Kåre Alsaker
cbb5a00179 Parallelize and optimize parts of HIR map creation 2019-01-14 03:26:38 +01:00
Esteban Küber
9567544902 Suggest removal of semicolon when appropriate 2019-01-13 17:36:29 -08:00
Esteban Küber
7fc1685c47 Tweak output of type mismatch between "then" and else if arms 2019-01-13 17:35:59 -08:00
Esteban Küber
3874c7755f Recover from item trailing semicolon 2019-01-13 17:29:32 -08:00
bors
a16e1a781d Auto merge of #56954 - hug-dev:armv8m-main-ci, r=alexcrichton
Add dist builder for Armv8-M Mainline

This commit adds the Armv8-M Mainline target in the list of targets that
get their dist components built. It also update the build-manifest so
that this target gets also its dist components uploaded.

I took example on other pull requests doing the same thing for another target to make the changes. Please feel free to comment if things needs to be added or removed.

Doing `./x.py dist --target thumbv8m.main-none-eabi` worked locally so I assume that this will also work on the CI.
It will (I think) however need a new release of alexcrichton/cc-rs to include the pull request alexcrichton/cc-rs#363 @alexcrichton

I hope to do the HardFloat version (`thumbv8m.main-none-eabihf`) and Baseline (`thumbv8m.base-none-eabi`) later, as fixes need to be done on compiler-builtins first to support those.
2019-01-14 00:59:54 +00:00
Stjepan Glavina
e449f3d629 Fix failing test 2019-01-14 00:45:57 +01:00
Igor Matuszewski
707a9a08bf Retain original pass order
It shouldn't matter, but hey - better safe than sorry!
2019-01-13 23:55:47 +01:00
Igor Matuszewski
59d7d7d54b Querify local plugin_registrar_fn 2019-01-13 23:53:58 +01:00
Igor Matuszewski
fb6040096c Querify local proc_macro_decls_static 2019-01-13 23:52:00 +01:00
Nicholas Nethercote
24a9ac7d03 Remove the connect_timeout_unroutable test.
It requires an unreachable IP address, but there is no such thing, and
this has caused it to fail for multiple people.

Fixes #44698, fixes #50065.
2019-01-14 09:25:54 +11:00
bors
9aee7ed335 Auto merge of #57580 - Centril:rollup, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #56874 (Simplify foreign type rendering.)
 - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics)
 - #57366 (Point at match discriminant on type error in match arm pattern)
 - #57538 (librustc_mir: Fix ICE with slice patterns)

Failed merges:

 - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms)

r? @ghost
2019-01-13 22:20:43 +00:00
Stjepan Glavina
7915732714 Fix intradoc link and update issue number 2019-01-13 21:24:15 +01:00
Mazdak Farrokhzad
35af111232
Rollup merge of #57538 - dlrobertson:fix_57472, r=zackmdavis
librustc_mir: Fix ICE with slice patterns

If a match arm does not include all fields in a structure and a later
pattern includes a field that is an array, we will attempt to use the
array type from the prior arm. When calculating the field type, treat
a array of an unknown size as a `TyErr`.

Fixes: #57472
2019-01-13 21:18:13 +01:00
Mazdak Farrokhzad
d7c1e0d1bf
Rollup merge of #57366 - estebank:point-match-discrim, r=varkor
Point at match discriminant on type error in match arm pattern

```
error[E0308]: mismatched types
 --> src/main.rs:5:9
  |
4 |    let temp: usize = match a + b {
  |                            ----- this expression has type `usize`
5 |         Ok(num) => num,
  |         ^^^^^^^ expected usize, found enum `std::result::Result`
  |
  = note: expected type `usize`
             found type `std::result::Result<_, _>`
```
Fix #57279.
2019-01-13 21:18:12 +01:00
Mazdak Farrokhzad
45d357265a
Rollup merge of #57113 - Zoxc:query-perf10, r=michaelwoerister
Move diagnostics out from QueryJob and optimize for the case with no diagnostics

r? @michaelwoerister
2019-01-13 21:18:11 +01:00
Mazdak Farrokhzad
6d00124b85
Rollup merge of #56874 - JohnHeitmann:docs-spacing, r=GuillaumeGomez
Simplify foreign type rendering.

Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans.

Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too.

Known visual changes (happy to tweak based on feedback):
* The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it.
* There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly.
* "[src]" links are all sized at 17px. A few were 19px in the original.

I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing.

TODO:

- [x] Test on Chrome
- [x] Test on Firefox
- [ ] ~~Test on UC Android~~
- [x] Test on Edge
- [x] Test on iOS safari
- [x] Test on desktop safari
- [x] Update automated tests
- [x] Increase vertical margin
- [x] Fix "Important traits for" hover overlap
- [x] Wait for #55798 to land & merge it
2019-01-13 21:18:09 +01:00
Alexander Regueiro
2e30a3c4d8 Removed more copyright notices. 2019-01-13 19:47:02 +00:00
Alexander Regueiro
49143e095f Added check for copyright notices. 2019-01-13 19:47:02 +00:00
Alexander Regueiro
88336ea4c3 Cosmetic improvements 2019-01-13 19:47:02 +00:00
bors
2fadb0a16c Auto merge of #51487 - Zoxc:incr-passes, r=michaelwoerister
Make more passes incremental

r? @michaelwoerister
2019-01-13 19:43:46 +00:00
Ariel Ben-Yehuda
de6566ce39 forbid manually impl'ing one of an object type's marker traits
This shouldn't break compatibility for crates that do not use
`feature(optin_builtin_traits)`, because as the test shows, it is
only possible to impl a marker trait for a trait object in the crate the
marker trait is defined in, which must define
`feature(optin_builtin_traits)`.

Fixes #56934
2019-01-13 19:44:28 +02:00
bors
2cf736f765 Auto merge of #57577 - Centril:rollup, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #57004 (Make `TokenStream` less recursive.)
 - #57102 (NLL: Add union justifications to conflicting borrows.)
 - #57337 (rustc: Place wasm linker args first instead of last)
 - #57549 (Add #[must_use] message to Iterator and Future)

Failed merges:

r? @ghost
2019-01-13 17:08:24 +00:00
Mazdak Farrokhzad
e2311b31c6
Rollup merge of #57549 - taiki-e:must_use, r=estebank
Add #[must_use] message to Iterator and Future

~~Iterator's message is based on current iterator adaptor's #[must_use] message (added in #15561) and https://github.com/rust-lang/rust/pull/56677/files#r241236020~~
Future's message is the same as those used in [futures-rs](https://github.com/rust-lang-nursery/futures-rs/search?q=must_use&unscoped_q=must_use) and [tokio](https://github.com/tokio-rs/tokio/search?q=must_use&unscoped_q=must_use).

r? @Centril
2019-01-13 17:21:43 +01:00
Mazdak Farrokhzad
a53a79fea2
Rollup merge of #57337 - alexcrichton:prioritize-another, r=fitzgen
rustc: Place wasm linker args first instead of last

This ensures that arguments passed via `-C link-arg` can override the
first ones on the command line, for example allowing configuring of the
stack size.
2019-01-13 17:21:42 +01:00
Mazdak Farrokhzad
ca1e379090
Rollup merge of #57102 - davidtwco:issue-57100, r=nikomatsakis
NLL: Add union justifications to conflicting borrows.

Fixes #57100.

This PR adds justifications to error messages for conflicting borrows of union fields.

Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.

r? @pnkfelix
2019-01-13 17:21:40 +01:00
Mazdak Farrokhzad
b1200a29b0
Rollup merge of #57004 - nnethercote:TS-change-Stream, r=petrochenkov
Make `TokenStream` less recursive.

`TokenStream` is currently recursive in *two* ways:

- the `TokenTree` variant contains a `ThinTokenStream`, which can
  contain a `TokenStream`;

- the `TokenStream` variant contains a `Vec<TokenStream>`.

The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`.

This reduces complexity significantly. In particular, `StreamCursor` is
eliminated, and `Cursor` becomes much simpler, consisting now of just a
`TokenStream` and an index.

The commit also removes the `Extend` impl for `TokenStream`, because it
is only used in tests. (The commit also removes those tests.)

Overall, the commit reduces the number of lines of code by almost 200.
2019-01-13 17:21:39 +01:00
Stjepan Glavina
04c74f46f0 Add core::iter::once_with 2019-01-13 16:58:08 +01:00
bors
1c561d9b55 Auto merge of #57567 - Centril:stabilize-transpose, r=alexreg
Stabilize `transpose_result` in 1.33

fixes https://github.com/rust-lang/rust/issues/47338.

FCP completed: https://github.com/rust-lang/rust/issues/47338#issuecomment-453762236

r? @alexreg
2019-01-13 14:35:40 +00:00
Dan Robertson
d6c19191b0
librustc_mir: Fix ICE with slice patterns
If a match arm does not include all fields in a structure and a later
pattern includes a field that is an array, we will attempt to use the
array type from the prior arm. When calculating the field type, treat
a array of an unknown size as a TyErr.
2019-01-13 14:23:32 +00:00
Mazdak Farrokhzad
c4f6ef25d2 remove extern_in_paths. 2019-01-13 14:18:00 +01:00
Vadim Petrochenkov
d3411d3ee8 Address review comments 2019-01-13 15:02:18 +03:00
bors
d45bef9db6 Auto merge of #57568 - Centril:rollup, r=Centril
Rollup of 16 pull requests

Successful merges:

 - #57351 (Don't actually create a full MIR stack frame when not needed)
 - #57353 (Optimise floating point `is_finite` (2x) and `is_infinite` (1.6x).)
 - #57412 (Improve the wording)
 - #57436 (save-analysis: use a fallback when access levels couldn't be computed)
 - #57453 (lldb_batchmode.py: try `import _thread` for Python 3)
 - #57454 (Some cleanups for core::fmt)
 - #57461 (Change `String` to `&'static str` in `ParseResult::Failure`.)
 - #57473 (std: Render large exit codes as hex on Windows)
 - #57474 (save-analysis: Get path def from parent in case there's no def for the path itself.)
 - #57494 (Speed up item_bodies for large match statements involving regions)
 - #57496 (re-do docs for core::cmp)
 - #57508 (rustdoc: Allow inlining of reexported crates and crate items)
 - #57547 (Use `ptr::eq` where applicable)
 - #57557 (resolve: Mark extern crate items as used in more cases)
 - #57560 (hygiene: Do not treat `Self` ctor as a local variable)
 - #57564 (Update the const fn tracking issue to the new metabug)

Failed merges:

r? @ghost
2019-01-13 11:54:02 +00:00
Vadim Petrochenkov
41c65992c5 Implement basic input validation for built-in attributes 2019-01-13 14:17:19 +03:00
Igor Matuszewski
b1b64bd196 Use building RLS branch without make_glob 2019-01-13 10:44:04 +01:00
Igor Matuszewski
cc19a78ee8 Account for 2 removed lines in src/librustdoc/test.rs 2019-01-13 10:42:59 +01:00
Igor Matuszewski
df9df19507 Always calculate glob map but only for glob uses
Previously calculating glob map was *opt-in*, however it did record
node id -> ident use for every use directive. This aims to see if we
can unconditionally calculate the glob map and not regress performance.
2019-01-13 10:42:59 +01:00
bors
5012d7fb53 Auto merge of #57566 - Centril:const-stabilize-overflowing, r=alexreg
Const-stabilize `const_int_overflowing`

Fixes https://github.com/rust-lang/rust/issues/57237.

r? @alexreg
2019-01-13 09:12:51 +00:00
Vardhan Thigle
99fbd1bf11 Fix breakage from #56988 and workaround for #57569 2019-01-13 13:07:45 +05:30
Vardhan Thigle
4a957b320d Adding Build automation for x86_64-fortanix-unknown-sgx 2019-01-13 13:07:45 +05:30
Taiki Endo
da933cca1a Change #[must_use] message of Iterator in documentation 2019-01-13 15:17:57 +09:00
Taiki Endo
a6535d78dc Change #[must_use] message of Iterator 2019-01-13 14:46:42 +09:00
Mazdak Farrokhzad
6d7a4a6e4c stabilize transpose_result in 1.33 2019-01-13 06:15:44 +01:00
Mazdak Farrokhzad
3e2dcf95ce
Rollup merge of #57564 - varkor:update-const_fn-tracking-issue, r=Centril
Update the const fn tracking issue to the new metabug

The new `const fn` tracking issue is #57563. We don't want to point to a closed issue in the diagnostics (or FIXMEs), so these have been updated (from the old issue, #24111).

r? @Centril
2019-01-13 05:27:01 +01:00