Commit Graph

100817 Commits

Author SHA1 Message Date
Nicholas Nethercote
1ce0347fd4 Use TokenStream::default() in more places. 2019-10-14 09:19:31 +11:00
Nicholas Nethercote
5c93492da9 Remove the Option in TokenStream.
It means an allocation is required to create an empty `TokenStream`, but
all other operations are simpler and marginally faster due to not having
to check for `None`. Overall it simplifies the code for a negligible
performance effect.

The commit also removes `TokenStream::empty` by implementing `Default`,
which is now possible.
2019-10-14 09:14:39 +11:00
Dylan MacKenzie
8fd16baa57 Remove special case for zero-sized arrays from indirectly mut locals 2019-10-13 14:39:57 -07:00
Dylan MacKenzie
061b906683 Return false from needs_drop for all zero-sized arrays 2019-10-13 14:39:57 -07:00
bors
36d4506cc6 Auto merge of #65342 - Mark-Simulacrum:revert-rustc-dev, r=pietroalbini
Revert "Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum"

This reverts commit 000d90b11f, reversing
changes made to 898f36c83c.

This turned out to break quite a few targets, cc https://github.com/rust-lang/rust/issues/65335
2019-10-13 21:35:39 +00:00
Mazdak Farrokhzad
07e946caf7 lowering: connect to parser via function pointer instead 2019-10-13 23:27:18 +02:00
Mazdak Farrokhzad
1899432867 lowering: don't rely on parser directly. 2019-10-13 22:51:18 +02:00
Matthew Jasper
a9752596d3 Add more tests for underscore imports 2019-10-13 21:37:26 +01:00
Guillaume Gomez
9f392c43dc Update ui tests 2019-10-13 22:10:03 +02:00
Guillaume Gomez
6a64e9ca49 Add long error explanation for E0574 2019-10-13 22:10:03 +02:00
Mazdak Farrokhzad
42f32f06d6 token: extract Nonterminal::to_tokenstream to parser. 2019-10-13 20:13:18 +02:00
bors
c27f7568bc Auto merge of #65388 - Centril:rollup-rhg0dvs, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #65214 (Split non-CAS atomic support off into target_has_atomic_load_store)
 - #65246 (vxWorks: implement get_path() and get_mode() for File fmt::Debug)
 - #65312 (improve performance of signed saturating_mul)
 - #65336 (Fix typo in task::Waker)
 - #65346 (nounwind tests and cleanup)
 - #65347 (Fix #[unwind(abort)] with Rust ABI)
 - #65366 (Implement Error::source on IntoStringError + Remove superfluous cause impls)
 - #65369 (Don't discard value names when using address or memory sanitizer)
 - #65370 (Add `dyn` to `Any` documentation)
 - #65373 (Fix typo in docs for `Rc`)

Failed merges:

r? @ghost
2019-10-13 17:18:56 +00:00
Mazdak Farrokhzad
92b36ce4a7
Rollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink
Fix typo in docs for `Rc`

r? @czipperz
2019-10-13 19:17:17 +02:00
Mazdak Farrokhzad
ecfcb4cf93
Rollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievink
Add `dyn` to `Any` documentation

I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.
2019-10-13 19:17:15 +02:00
Mazdak Farrokhzad
77f685390c
Rollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor
Don't discard value names when using address or memory sanitizer

The value names are used when reporting issues found by address
sanitizer or memory sanitizer. Avoid discarding names when those
sanitizers are enabled, unless explicitly requested to do otherwise.
2019-10-13 19:17:14 +02:00
Mazdak Farrokhzad
8f8954e671
Rollup merge of #65366 - faern:source-on-intostringerror, r=bluss
Implement Error::source on IntoStringError + Remove superfluous cause impls

IntoStringError only implemented `Error::cause`, which is deprecated. This implemements `Error::source` instead.
`Error::cause` will still work as before, thanks to the default implementation.

I think this was the only/last `Error` impl in the standard library to have a cause, but not a source.
2019-10-13 19:17:12 +02:00
Mazdak Farrokhzad
d3cbf576da
Rollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor
Fix #[unwind(abort)] with Rust ABI

Fixes #63883.
2019-10-13 19:17:11 +02:00
Mazdak Farrokhzad
4f8214cf2f
Rollup merge of #65346 - RalfJung:nounwind-tests, r=nagisa
nounwind tests and cleanup

This is a follow-up to @pnkfelix' https://github.com/rust-lang/rust/pull/65020. In particular it adds some tests as @nagisa  asked. It also does a cleanup that the original PR omitted to reduce backporting risks.

I hope I finally managed to write an uncontroversial PR in this area. ;) This should not change any behavior, just test it better.
2019-10-13 19:17:10 +02:00
Mazdak Farrokhzad
d10702b577
Rollup merge of #65336 - BO41:typo, r=petrochenkov
Fix typo in task::Waker

fixes  #65323

in `libstd/error.rs` there are a few mentions of `trait@Send` and `trait@Sync`. Are they wrong as well?
2019-10-13 19:17:08 +02:00
Mazdak Farrokhzad
f0f5e779bc
Rollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnay
improve performance of signed saturating_mul

Reciprocal throughput is improved from 2.3 to 1.7. https://godbolt.org/z/ROMiX6

Fixes #65309.
2019-10-13 19:17:07 +02:00
Mazdak Farrokhzad
2a9c791076
Rollup merge of #65246 - Wind-River:real_master_2, r=kennytm
vxWorks: implement get_path() and get_mode() for File fmt::Debug
2019-10-13 19:17:06 +02:00
Mazdak Farrokhzad
7c20a8ddb8
Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton
Split non-CAS atomic support off into target_has_atomic_load_store

This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s:

* `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations).
* ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS).

cc #32976

r? @alexcrichton
2019-10-13 19:17:04 +02:00
Mazdak Farrokhzad
9d766ed593 refactor session::config::build_session_options_and_crate_config 2019-10-13 18:49:15 +02:00
kalabukdima
e67fa776ee
Fix typo in docs for Rc 2019-10-13 15:46:28 +03:00
bjorn3
f0e2fc7623 Improve type safety 2019-10-13 14:43:58 +02:00
bjorn3
ea60335c28 Add top level provide/provide_extern to cg_ssa and cg_utils 2019-10-13 14:43:58 +02:00
bjorn3
bcb01bca86 Remove MiscMethods::instances 2019-10-13 14:43:57 +02:00
bjorn3
dad8ddbfdd Inline functions from cg_ssa::callee and remove the mod
Fixes #65271
2019-10-13 14:42:59 +02:00
bjorn3
f1ed3a8786 s/FuncId/Function 2019-10-13 14:35:14 +02:00
bjorn3
5f6ddb94a6 Move span_invalid_monomorphization_error from cg_llvm to cg_ssa
The associated long diagnostic didn't get registered before
2019-10-13 14:35:14 +02:00
bjorn3
5f203d5988 Move some provides from cg_llvm to rustc_interface 2019-10-13 14:35:14 +02:00
bjorn3
41d329c10d Remove unused method CodegenBackend::diagnostics 2019-10-13 14:35:14 +02:00
bjorn3
cf858a8ac0 Remove is_const_integral method from ConstMethods 2019-10-13 14:35:14 +02:00
bjorn3
4d1a5ade9b Introduce FuncId backend type 2019-10-13 14:35:14 +02:00
Mazdak Farrokhzad
4a0c487d1b syntax: consolidate function parsing in item.rs 2019-10-13 14:32:12 +02:00
Cerberuser
0510bbfb35
Added code element
Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
2019-10-13 19:03:21 +07:00
Cerberuser
cfda050c01
Add dyn to Any documentation
I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.
2019-10-13 18:48:07 +07:00
bors
aa2ae564d3 Auto merge of #65368 - Centril:rollup-lb7fe48, r=Centril
Rollup of 13 pull requests

Successful merges:

 - #65039 (Document missing deny by default lints)
 - #65069 (Implement Clone::clone_from for VecDeque)
 - #65165 (Improve docs on some char boolean methods)
 - #65248 (Suggest `if let` on `let` refutable binding)
 - #65250 (resolve: fix error title regarding private constructors)
 - #65295 (Move diagnostics code out of the critical path)
 - #65320 (Report `CONST_ERR` lint in external macros)
 - #65327 (replace the hand-written binary search with the library one)
 - #65339 (do not reference LLVM for our concurrency memory model)
 - #65357 (syntax: simplify maybe_annotate_with_ascription)
 - #65358 (simplify maybe_stage_features)
 - #65359 (simplify integer_lit)
 - #65360 (mbe: reduce panictry! uses.)

Failed merges:

r? @ghost
2019-10-13 11:36:52 +00:00
Mazdak Farrokhzad
b82859171c
Rollup merge of #65360 - Centril:mbrpt, r=petrochenkov
mbe: reduce panictry! uses.

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @petrochenkov
2019-10-13 13:34:44 +02:00
Mazdak Farrokhzad
af54a3e91d
Rollup merge of #65359 - Centril:sil, r=davidtwco
simplify integer_lit

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @davidtwco
2019-10-13 13:34:42 +02:00
Mazdak Farrokhzad
5af528a03a
Rollup merge of #65358 - Centril:smsf, r=davidtwco
simplify maybe_stage_features

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @estebank
2019-10-13 13:34:41 +02:00
Mazdak Farrokhzad
b143aa2b38
Rollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascription, r=davidtwco
syntax: simplify maybe_annotate_with_ascription

Split out from https://github.com/rust-lang/rust/pull/65324.

r? @estebank
2019-10-13 13:34:40 +02:00
Mazdak Farrokhzad
293d02de70
Rollup merge of #65339 - RalfJung:atomic-ordering, r=Centril
do not reference LLVM for our concurrency memory model

Fixes https://github.com/rust-lang/rust/issues/65282
2019-10-13 13:34:39 +02:00
Mazdak Farrokhzad
af8a6e5e6d
Rollup merge of #65327 - guanqun:remove-hand-binary-search, r=petrochenkov
replace the hand-written binary search with the library one
2019-10-13 13:34:37 +02:00
Mazdak Farrokhzad
643261aad4
Rollup merge of #65320 - memoryruins:const_err, r=oli-obk
Report `CONST_ERR` lint in external macros

fixes #65300
fixes #61058

r? @oli-obk
2019-10-13 13:34:36 +02:00
Mazdak Farrokhzad
433ea1a030
Rollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote
Move diagnostics code out of the critical path

Follow up to #65077.

r? @nnethercote
2019-10-13 13:34:34 +02:00
Mazdak Farrokhzad
540278c5ae
Rollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkov
resolve: fix error title regarding private constructors

One reason is that constructors can be private while their types can be
public.

Idea credit to @petrochenkov, discussed at #65153
2019-10-13 13:34:33 +02:00
Mazdak Farrokhzad
963e4bc756
Rollup merge of #65248 - estebank:mention-if-let, r=cramertj
Suggest `if let` on `let` refutable binding

Fix #58385.
2019-10-13 13:34:32 +02:00
Mazdak Farrokhzad
82fb193cdf
Rollup merge of #65165 - BO41:char_docs, r=varkor
Improve docs on some char boolean methods

simple revival of #61794
(also rustfmt on rest of file :)

Documentation for `is_xid_start()` and `is_xid_continue()` couldn't be improved since both methods got remove from this repository

r? @dtolnay
cc @JohnCSimon
2019-10-13 13:34:30 +02:00
Mazdak Farrokhzad
4dc0b8aa5b
Rollup merge of #65069 - crgl:clone-from-vec-deque, r=bluss
Implement Clone::clone_from for VecDeque

See #28481. For simple data types with the target much longer than the source, this implementation can be significantly slower than the default (probably due to the use of truncate). However, it should be substantially faster when cloning from nested data structures with similar shapes or when cloning from VecDeques with similar lengths, hopefully more common use cases for clone_from.
2019-10-13 13:34:29 +02:00