Commit Graph

106390 Commits

Author SHA1 Message Date
Tyler Lanphear
d8cf95010f unused-parens: implement for const/static items 2020-02-05 21:01:23 -05:00
bors
ed853b8619 Auto merge of #68861 - Dylan-DPC:rollup-0m09hsg, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #68762 (Strip unnecessary subexpression)
 - #68790 (Improve `merge_from_succ`)
 - #68809 (Make more arithmetic functions unstably const)
 - #68832 (Clean up E0264, E0267 and E0268 explanations)
 - #68840 (On suggesting `#![recursion_limit = "X"]`, note current crate name)
 - #68846 (doc fix on doc attribute)
 - #68851 (Fix issue number of `capacity` method)
 - #68858 (Merge item id stable hashing functions)

Failed merges:

r? @ghost
2020-02-06 01:46:46 +00:00
Nicholas Nethercote
6ad725e9f0 Remove RefCell usage from ObligationForest.
It's not needed.
2020-02-06 12:00:50 +11:00
Tomasz Miąsko
80adde2e33 Add CodegenFnAttrFlags::NO_SANITIZE_ANY 2020-02-06 00:00:00 +00:00
bors
a25d58b41b Auto merge of #68461 - cjgillot:split_infer_prelude, r=matthewjasper
Move datatypes definitions in specific modules inside rustc::{traits, infer}

Prelude to #67953

Some data types inside `rustc::traits` and `rustc::infer` are used in other parts of `librustc`. These cannot go to a separate crate `librustc_infer`.

This PR moves those data types to `traits::types` and `infer::types` modules, from where everything is reexported.

Note for review: some imports feature the `crate -> rustc` substitution. This is cruft from the splitting out of #67953. This can be reverted, but are bound to be put back by #67953.

r? @Centril
cc @Zoxc
2020-02-05 22:41:54 +00:00
Tomasz Miąsko
1caa8755e5 Apply LLVM sanitize attributes to generated entry wrapper 2020-02-05 23:30:38 +01:00
Tomasz Miąsko
b846b42c8d Selectively disable sanitizer instrumentation
Add `no_sanitize` attribute that allows to opt out from sanitizer
instrumentation in an annotated function.
2020-02-05 23:30:38 +01:00
Guillaume Gomez
c182461a20 clean E0271 explanation 2020-02-05 23:03:03 +01:00
bors
58b834344f Auto merge of #67429 - mati865:mingw-ultimate-fix, r=alexcrichton
windows-gnu: prefer system crt libraries if they are available

The origin of the issue is the fact Rust ships mingw-w64 libraries but no headers and prefers own libraries over the system ones.
This leads to situation when headers aren't compatible with libraries (mingw-w64 doesn't provide any forward compatibility and AFAIK backwards compatibility is guaranteed only within major release series).

It's easier to understand how this PR works when looking at the linker invocation before and with this PR: https://www.diffchecker.com/GEuYFmzo
It adds system libraries path before Rust libraries so the linker will prefer them.
It has potential issue when system has files with the same names as Rust but that could be avoided by moving Rust shipped mingw-w64 libraries from `lib/rustlib/x86_64-pc-windows-gnu/lib` to say `lib/rustlib/x86_64-pc-windows-gnu/lib/mingw`. Then adding linker paths in this order: Rust libraries, system libraries, Rust shipped mingw-w64 libraries.

Fixes #47048
Fixes #49078
Fixes #53454
Fixes #60912
2020-02-05 19:11:04 +00:00
Esteban Küber
609a37407f Fix test 2020-02-05 10:59:14 -08:00
Esteban Küber
96bbb0d67e Account for impl Trait
Address #49287
2020-02-05 10:32:01 -08:00
Esteban Küber
1beac2b774 Move code to diagnostics.rs 2020-02-05 10:32:01 -08:00
Esteban Küber
49f9bf897b review comments 2020-02-05 10:32:01 -08:00
Esteban Küber
30d927874a review comments: wording 2020-02-05 10:32:01 -08:00
Esteban Küber
92505df338 Account for fn() types in lifetime suggestions 2020-02-05 10:32:01 -08:00
Esteban Küber
ba3b44c508 Account for '_ in suggestions 2020-02-05 10:32:01 -08:00
Esteban Küber
2100b31535 review comments 2020-02-05 10:32:01 -08:00
Esteban Küber
fa4594196d Suggest 'r instead of 'lifetime 2020-02-05 10:32:01 -08:00
Esteban Küber
7e1464336a When suggesting lifetimes, propose adding the new lifetime to all arguments 2020-02-05 10:32:01 -08:00
Esteban Küber
70dbf5526d Use spans for input borrowed types unrelated to return type 2020-02-05 10:32:01 -08:00
Esteban Küber
183dfac1f3 Account for HKTB when suggesting introduction of named lifetime 2020-02-05 10:32:01 -08:00
Dylan DPC
b37f968632
Rollup merge of #68858 - ljedrz:collapse_stable_hash_foos, r=michaelwoerister
Merge item id stable hashing functions

Supersedes https://github.com/rust-lang/rust/pull/67999 splitting out the pure cleanup bits, i.e. merging `hash_item_id`, `hash_impl_item_id` and `hash_trait_item_id` into a common `hash_reference_to_item`.

r? @michaelwoerister
2020-02-05 13:14:37 +01:00
Dylan DPC
cf32b7118d
Rollup merge of #68851 - JohnTitor:fix-issue-number, r=Centril
Fix issue number of `capacity` method

Follow-up of https://github.com/rust-lang/rust/pull/68558#issuecomment-582117131

r? @alexcrichton
2020-02-05 13:14:34 +01:00
Dylan DPC
c0fbac58db
Rollup merge of #68846 - king6cong:doc-fix, r=GuillaumeGomez
doc fix on doc attribute

None
2020-02-05 13:14:33 +01:00
Dylan DPC
3096e1317a
Rollup merge of #68840 - Centril:rec-lim-curr-crate, r=estebank
On suggesting `#![recursion_limit = "X"]`, note current crate name

This would have saved me much confusion e.g. when reading the log output in https://github.com/rust-lang/rust/pull/68788#issuecomment-581852191.

r? @estebank
2020-02-05 13:14:31 +01:00
Dylan DPC
ae0bb2489a
Rollup merge of #68832 - GuillaumeGomez:clean-up-3-err-codes, r=estebank
Clean up E0264, E0267 and E0268 explanations

r? @Dylan-DPC
2020-02-05 13:14:30 +01:00
Dylan DPC
16555ac861
Rollup merge of #68809 - ecstatic-morse:const-int-functions, r=oli-obk
Make more arithmetic functions unstably const

This is a smaller version of #66884 (thanks @9999years) that constifies many of the arithmetic functions on integer primitives from #53718 that were blocked on #49146.

This makes the following things unstably const.

- `feature = const_int_unchecked_arith`
  - `intrinsics::unchecked_add`
  - `intrinsics::unchecked_sub`
  - `intrinsics::unchecked_mul`
  - `intrinsics::unchecked_div`
  - `intrinsics::unchecked_rem`

- `feature = const_checked_int_methods`
  - `checked_add`
  - `checked_sub`
  - `checked_mul`
  - `checked_div` (Uses `intrinsics::unchecked_div` internally)
  - `checked_rem` (Uses `intrinsics::unchecked_rem` internally)
  - `checked_neg`
  - `checked_shl`
  - `checked_shr`
  - `checked_abs`

- `feature = const_saturating_int_methods`
  - `saturating_mul`
  - `saturating_neg`  (Uses `intrinsics::unchecked_sub` internally)
  - `saturating_abs` (Uses `intrinsics::unchecked_sub` internally)

- `feature = const_wrapping_int_methods`
  - `wrapping_div`
  - `wrapping_rem`

- `feature = const_overflowing_int_methods`
  - `overflowing_div`
  - `overflowing_rem`

- `feature = const_euclidean_int_methods`
  - `checked_div_euclid`
  - `checked_rem_euclid`
  - `wrapping_div_euclid`
  - `wrapping_rem_euclid`
  - `overflowing_div_euclid`
  - `overflowing_rem_euclid`

Exponentiation and operations on the `NonZero` types are left to a later PR.

r? @oli-obk
cc @rust-lang/wg-const-eval @rust-lang/libs
2020-02-05 13:14:28 +01:00
Dylan DPC
c1779412fa
Rollup merge of #68790 - nnethercote:improve-merge_from_succ, r=nikomatsakis
Improve `merge_from_succ`

A couple of small performance wins.

r? @nikomatsakis
2020-02-05 13:14:25 +01:00
Dylan DPC
d694f22521
Rollup merge of #68762 - ForNeVeR:patch-1, r=alexcrichton
Strip unnecessary subexpression

It became unnecessary since a06baa56b9 reformatted the file. The comment is currently a bit misleading.
2020-02-05 13:14:22 +01:00
Camille GILLOT
735d664e74 Move EvaluationCache::clear. 2020-02-05 12:43:01 +01:00
Camille GILLOT
551cc5ebe6 Move ExpectedFound::new to ty::error. 2020-02-05 12:42:00 +01:00
Camille GILLOT
c851db9495 Move specialization_graph definition in traits::types. 2020-02-05 12:41:02 +01:00
Camille GILLOT
9444975e96 Split traits::structural_impls in two. 2020-02-05 12:40:47 +01:00
Mazdak Farrokhzad
9a4eac3944 ast_validation: fix visiting bug. 2020-02-05 12:27:45 +01:00
bors
eda1a7adfc Auto merge of #68755 - Tyg13:update_stdarch, r=alexcrichton
Update `rust-lang/stdarch` submodule

Update submodule [rust-lang/stdarch](https://github.com/rust-lang/stdarch/)
2020-02-05 10:39:01 +00:00
ljedrz
e8b72f44b0 move item reference comment 2020-02-05 11:29:07 +01:00
ljedrz
28b0ed020a merge item id stable hashing functions 2020-02-05 11:11:34 +01:00
Camille GILLOT
b3f13b00f5 Move implementation of UnifyKey to unify_key.rs. 2020-02-05 08:48:09 +01:00
Camille GILLOT
005f14d518 Move infer::canonical datatypes to infer::types. 2020-02-05 08:47:08 +01:00
Camille GILLOT
9c07dad725 Move infer::region_constraints::MemberConstraint to infer::types module. 2020-02-05 08:46:09 +01:00
Camille GILLOT
4e42f388c3 Move traits::query datatypes to traits::types. 2020-02-05 08:45:09 +01:00
Camille GILLOT
a77da35ed4 Move traits::select datatypes to traits::types. 2020-02-05 08:44:07 +01:00
Camille GILLOT
a2cd0715fd Move traits::Reveal to traits::types. 2020-02-05 08:42:49 +01:00
Camille GILLOT
369f360159 Move rustc::traits datatypes to module traits::types. 2020-02-05 08:38:08 +01:00
Yuki Okushi
df7d9f3838 Fix issue number of capacity method 2020-02-05 15:34:33 +09:00
king6cong
9713b5696b doc fix on doc attribute 2020-02-05 12:56:24 +08:00
Dylan MacKenzie
78f8ad3640 Implement remaining unchecked arithmetic intrinsics 2020-02-04 20:36:18 -08:00
Dylan MacKenzie
040d9873aa Fix test 2020-02-04 20:36:18 -08:00
Dylan MacKenzie
09160d1b84 Use consistent feature naming 2020-02-04 20:36:18 -08:00
David Renshaw
9ac68e128b stop using BytePos for computing spans in librustc_parse/parser/mod.rs 2020-02-04 23:04:29 -05:00