Commit graph

100557 commits

Author SHA1 Message Date
Tyler Mandry
6d28ed1ae6
Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov
Remove `Option` from `TokenStream`

A code simplification.

r? @petrochenkov
2019-10-14 17:52:35 -07:00
Tyler Mandry
a9a4d4033d
Rollup merge of #65260 - nnethercote:optimize-LexicalResolve-expansion, r=nikomatsakis
Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis
2019-10-14 17:52:33 -07:00
Tyler Mandry
d2f87e384f
Rollup merge of #65170 - petrochenkov:cload, r=eddyb
rustc_metadata: Privatize private code and remove dead code

Also some minor cleanup and documentation improvements.

r? @eddyb
2019-10-14 17:52:32 -07:00
bors
e413dc36a8 Auto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb
Compute the layout of uninhabited structs

fixes #64506

r? @eddyb
2019-10-14 15:52:51 +00:00
Vadim Petrochenkov
f5baad2b5e rustc_metadata: Remove resolutions for extern crate items from CStore
Use a more traditional scheme with providing them as a resolver output
2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
e843d867e6 rustc_metadata: Crate loader is immutable 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
2805553dd8 rustc_metadata: Improve documentation of CrateMetadata 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
b476f2fa4e rustc_metadata: Use CrateSource where appropriate 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
e8c28e24b9 rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
bors
446e5e57b6 Auto merge of #65399 - Centril:rollup-6lzj0w5, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #65215 (Add long error explanation for E0697)
 - #65292 (Print lifetimes with backticks)
 - #65362 (syntax: consolidate function parsing in item.rs)
 - #65363 (Remove implicit dependencies on syntax::pprust)
 - #65379 (refactor session::config::build_session_options_and_crate_config)
 - #65392 (Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering)
 - #65395 (Add some tests for fixed ICEs)

Failed merges:

r? @ghost
2019-10-14 10:00:51 +00:00
Mazdak Farrokhzad
a73e0731f4
Rollup merge of #65395 - JohnTitor:add-tests, r=Centril
Add some tests for fixed ICEs

Fixes #44153 (from 1.23.0)
Fixes #47486 (from 1.36.0)
Fixes #48010 (from 1.38.0)
Fixes #48027 (from nightly)
Fixes #48638 (from nightly)
2019-10-14 07:37:01 +02:00
Mazdak Farrokhzad
28d08f3986
Rollup merge of #65392 - Centril:nt-to-tt, r=Mark-Simulacrum
Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering

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

r? @petrochenkov
2019-10-14 07:36:59 +02:00
Mazdak Farrokhzad
e29a6fcfa2
Rollup merge of #65379 - Centril:refactor-bso_and_cc, r=petrochenkov
refactor session::config::build_session_options_and_crate_config

I'm not exactly sure what happened in https://github.com/rust-lang/rust/pull/65361#issuecomment-541420179 so in an effort to bisect the error I'm extracting out the first commit so it can hopefully land (I suspect the error is in the 2nd-3rd commits.)

r? @petrochenkov

(I'll r=you when the PR builder is happy)
2019-10-14 07:36:58 +02:00
Mazdak Farrokhzad
2800bc240e
Rollup merge of #65363 - Centril:less-pprust, r=Mark-Simulacrum
Remove implicit dependencies on syntax::pprust

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

The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer.

r? @estebank
2019-10-14 07:36:57 +02:00
Mazdak Farrokhzad
66e428824b
Rollup merge of #65362 - Centril:extract_fun, r=petrochenkov
syntax: consolidate function parsing in item.rs

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

r? @estebank
2019-10-14 07:36:55 +02:00
Mazdak Farrokhzad
c2ae4ded4d
Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril
Print lifetimes with backticks

Fixes #65287

r? @varkor
2019-10-14 07:36:54 +02:00
Mazdak Farrokhzad
1ac00287af
Rollup merge of #65215 - JohnTitor:long-explanation-e0697, r=GuillaumeGomez
Add long error explanation for E0697

Part of #61137

r? @GuillaumeGomez
2019-10-14 07:36:52 +02:00
Yuki Okushi
f6e01e8d40 Add test for issue-48638 2019-10-14 11:56:30 +09:00
Yuki Okushi
88a495cdcf Add test for issue-48027 2019-10-14 10:47:14 +09:00
Yuki Okushi
f653db92d6 Add test for issue-48010 2019-10-14 10:46:58 +09:00
Yuki Okushi
6323180b4a Add test for issue-47486 2019-10-14 10:45:56 +09:00
bors
d28a9c38fe Auto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrum
self-profiling: Add events for metadata loading (plus a small dep-tracking optimization)

This PR
- adds self-profiling events related to loading things from crate metadata
- makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over.

The commits are best reviewed in isolation.

Self-profiling tracking issue: https://github.com/rust-lang/rust/issues/58967

r? @Mark-Simulacrum
cc @wesleywiser
2019-10-14 01:45:26 +00:00
Yuki Okushi
5c8fdc1954 Add test for issue-44153 2019-10-14 10:45:25 +09:00
Nicholas Nethercote
18b48bf4b9 Lazify some mac_placeholder() calls.
This avoids some unnecessary creation of empty token streams.
2019-10-14 09:19:40 +11:00
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
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
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
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