Commit Graph

88757 Commits

Author SHA1 Message Date
Yuki Okushi
a7623e70d5 Add error check 2019-01-15 06:56:21 +09:00
Yuki Okushi
efd111e502 Add test 2019-01-15 06:55:17 +09:00
Yuki Okushi
60a68bed7b Make UnsafeCode EarlyLintPass 2019-01-15 06:54:28 +09:00
Yuki Okushi
f18ae26840 Run lint for unsafe on the ast 2019-01-15 05:42:09 +09:00
Yuki Okushi
ea5197c664 Add PartialEq 2019-01-15 05:36:46 +09:00
timvisee
d808f938bc
Simplify 'product' factorial example 2019-01-14 21:20:01 +01:00
Mazdak Farrokhzad
8a62e393b8
Rollup merge of #57589 - scottmcm:vec-set_len-debug_assert, r=alexcrichton
Add a debug_assert to Vec::set_len

Following the precedent of https://github.com/rust-lang/rust/pull/52972, which found https://github.com/llogiq/bytecount/pull/42.

(This may well make a test fail; let's see what Travis says.)
2019-01-14 20:31:59 +01:00
Mazdak Farrokhzad
b03d414e3c
Rollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkov
Recover from item trailing semicolon

CC https://github.com/rust-lang/rfcs/pull/2479

r? @petrochenkov
2019-01-14 20:31:58 +01:00
Mazdak Farrokhzad
feb48f334d
Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkov
Unaccept `extern_in_paths`

Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing 32db83b16e.

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

r? @petrochenkov
2019-01-14 20:31:57 +01:00
Mazdak Farrokhzad
2e1094429d
Rollup merge of #57570 - Xanewok:querify-some, r=Zoxc
Querify local `plugin_registrar_fn` and `proc_macro_decls_static`

Instead of calculating them as part of the `Session`, we do that in the query system.
It's also nice that these queries are already defined for external crates - here, we provide the queries for the local crate.

r? @nikomatsakis
2019-01-14 20:31:56 +01:00
Mazdak Farrokhzad
2f7a226c4d
Rollup merge of #57540 - estebank:eval-more, r=petrochenkov
Modify some parser diagnostics to continue evaluating beyond the parser

Continue evaluating further errors after parser errors on:
 - trailing type argument attribute
 - lifetime in incorrect location
 - incorrect binary literal
 - missing `for` in `impl Trait for Foo`
 - type argument in `where` clause
 - incorrect float literal
 - incorrect `..` in pattern
 - associated types
 - incorrect discriminator value variant error

and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled.

These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors.

Each commit has an individual diagnostic change with their corresponding tests.

CC #48724.
2019-01-14 20:31:55 +01:00
Mazdak Farrokhzad
816e31b1c6
Rollup merge of #57481 - euclio:bool-cast-suggestion, r=estebank
provide suggestion for invalid boolean cast

Also, don't suggest comparing to zero for non-numeric expressions.
2019-01-14 20:31:53 +01:00
Mazdak Farrokhzad
8c001b12cc
Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoerister
Clean up and fix a bug in query plumbing

r? @michaelwoerister
2019-01-14 20:31:52 +01:00
Mazdak Farrokhzad
5bc95de47d
Rollup merge of #57043 - ssomers:master, r=alexcrichton
Fix poor worst case performance of set intersection

Specifically, intersection of asymmetrically sized sets when the large set is on the left. See also the [latest answer on stackoverflow](https://stackoverflow.com/questions/35439376/python-set-intersection-is-faster-then-rust-hashset-intersection).

Also applied to the union member, where the effect is much less but still measurable.

Formatted the changed code only, does not increase the error count reported by tidy check, and tried to adhere to the spirit of the unit tests.
2019-01-14 20:31:51 +01:00
bors
03acbd71c9 Auto merge of #57559 - ehuss:update-cargo, r=alexcrichton
Update cargo

13 commits in 34320d212dca8cd27d06ce93c16c6151f46fcf2e..2b4a5f1f0bb6e13759e88ea9512527b0beba154f
2019-01-03 19:12:38 +0000 to 2019-01-12 04:13:12 +0000
- Add test for publish with [patch] + cleanup. (rust-lang/cargo#6544)
- Fix clippy warning (rust-lang/cargo#6546)
- Revert "Workaround by using yesterday's nightly" (rust-lang/cargo#6540)
- Adding feature-flags to `cargo publish` and `cargo package` (rust-lang/cargo#6453)
- Fix the Travis CI badge (rust-lang/cargo#6530)
- Add helpful text for Windows exceptions like Unix (rust-lang/cargo#6532)
- Report fix bugs to Rust instead of Cargo (rust-lang/cargo#6531)
- --{example,bin,bench,test} with no argument now lists all available targets (rust-lang/cargo#6505)
- Rebuild on mid build file modification (rust-lang/cargo#6484)
- Derive Clone for TomlDependency (rust-lang/cargo#6527)
- publish: rework the crates.io detection logic. (rust-lang/cargo#6525)
- avoid duplicates in ignore files (rust-lang/cargo#6521)
- Rustflags in metadata (rust-lang/cargo#6503)

r? @alexcrichton
2019-01-14 18:25:46 +00:00
Alex Crichton
7616daabc7 rustc: Remove platform intrinsics crate
This was originally attempted in #57048 but it was realized that we
could fully remove the crate via the `"unadjusted"` ABI on intrinsics.
This means that all intrinsics in stdsimd are implemented directly
against LLVM rather than using the abstraction layer provided here. That
ends up meaning that this crate is no longer used at all.

This crate developed long ago to implement the SIMD intrinsics, but we
didn't end up using it in the long run. In that case let's remove it!
2019-01-14 09:54:23 -08:00
Alex Crichton
3638f0e477 Remove GCE cloud setting from AppVeyor config
AppVeyor has informed us that this may no longer be necessary after some
infrastructure upgrades on their side, so let's see how this goes!
2019-01-14 09:23:49 -08:00
Stjepan Glavina
3a1f0131a6 Add another feature(iter_once_with) 2019-01-14 17:36:34 +01:00
Stjepan Glavina
84718c1999 Add feature(iter_once_with) 2019-01-14 17:20:41 +01:00
Michael Bradshaw
f4ded5b559 Add a regression test for mutating a non-mut #[thread_local] 2019-01-14 08:02:33 -08:00
bors
d10680818b Auto merge of #57592 - Centril:rollup, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #57232 (Parallelize and optimize parts of HIR map creation)
 - #57418 (MetadataOnlyCodegenBackend: run the collector only once)
 - #57465 (Stabilize cfg_target_vendor)
 - #57477 (clarify resolve typo suggestion)
 - #57556 (privacy: Fix private-in-public check for existential types)
 - #57584 (Remove the `connect_timeout_unroutable` test.)

Failed merges:

r? @ghost
2019-01-14 13:03:24 +00:00
Stjepan Glavina
7c083a8fed Remove unnecessary mut 2019-01-14 12:23:50 +01:00
Mazdak Farrokhzad
47ccf2a7fc
Rollup merge of #57584 - nnethercote:rm-connect_timeout_unroutable, r=sfackler
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.

r? @sfackler
2019-01-14 11:31:55 +01:00
Mazdak Farrokhzad
4112aef5f7
Rollup merge of #57556 - petrochenkov:privexist, r=arielb1
privacy: Fix private-in-public check for existential types

Fixes https://github.com/rust-lang/rust/issues/53546 (regression from https://github.com/rust-lang/rust/pull/56878)

r? @arielb1
2019-01-14 11:31:54 +01:00
Mazdak Farrokhzad
0b7d8f99ed
Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavis
clarify resolve typo suggestion

Include the kind of the binding that we're suggesting, and use a
structured suggestion.

Fixes #53445.
2019-01-14 11:31:53 +01:00
Mazdak Farrokhzad
74cc0be8f6
Rollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, r=joshtriplett,Centril
Stabilize cfg_target_vendor

This stabilizes the use of `cfg(target_vendor = "...")` and removes the corresponding `cfg_target_vendor` feature. Other unstable cfgs remain behind their existing feature gates.

This functionality was added back in 2015 in #28612 to complete the coverage of target tuples (`<arch><sub>-<vendor>-<os>-<env>`). [RFC 131](https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md) governs the target specification, not including `target_vendor` seems to have just been an oversight. `target_os`, `target_family`, and `target_arch` are stable as of 1.0.0. `target_env` was also not mentioned in RFC 131, was added in #24777, never behind a feature_gate, and insta-stable at 1.1.0.

The functionality is tested in [test/run-pass/cfg/cfg-target-vendor.rs](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/cfg/cfg-target-vendor.rs).

Closes #29718
2019-01-14 11:31:52 +01:00
Mazdak Farrokhzad
36d68f5fb3
Rollup merge of #57418 - lqd:collector_query, r=michaelwoerister
MetadataOnlyCodegenBackend: run the collector only once

Use the `collect_and_partition_mono_items` query to avoid calling the collector directly twice.

Fixes #57406.
2019-01-14 11:31:50 +01:00
Mazdak Farrokhzad
0d883cb8f8
Rollup merge of #57232 - Zoxc:par-collector-misc, r=michaelwoerister
Parallelize and optimize parts of HIR map creation

r? @michaelwoerister
2019-01-14 11:31:49 +01:00
bors
1a3a3dfcdd Auto merge of #57322 - Centril:stabilize-identity, r=SimonSapin
Stabilize core::convert::identity

r? @SimonSapin

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

This is waiting for FCP to complete but in the interim it would be good to review.
2019-01-14 10:22:22 +00:00
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
Nicholas Nethercote
7285724401 Make TokenStream use Option.
Because that's the more typical way of representing an all-or-nothing
type.
2019-01-14 11:05:56 +11: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
Nicholas Nethercote
ba31d83adc Avoid some TokenTree-to-TokenStream conversions.
This avoids some allocations.
2019-01-14 09:10:26 +11:00
Nicholas Nethercote
ce0d9949b8 Remove ThinTokenStream.
`TokenStream` is now almost identical to `ThinTokenStream`. This commit
removes the latter, replacing it with the former.
2019-01-14 09:10:26 +11:00