]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoStabilize proc macros generating `macro_rules` items
Vadim Petrochenkov [Sat, 31 Aug 2019 12:22:53 +0000 (15:22 +0300)]
Stabilize proc macros generating `macro_rules` items

4 years agoAuto merge of #65422 - tmandry:rollup-r5u3mlc, r=tmandry
bors [Tue, 15 Oct 2019 00:54:10 +0000 (00:54 +0000)]
Auto merge of #65422 - tmandry:rollup-r5u3mlc, r=tmandry

Rollup of 10 pull requests

Successful merges:

 - #65170 (rustc_metadata: Privatize private code and remove dead code)
 - #65260 (Optimize `LexicalResolve::expansion`.)
 - #65261 (Remove `Option` from `TokenStream`)
 - #65332 (std::fmt: reorder docs)
 - #65340 (Several changes to the codegen backend organization)
 - #65365 (Include const generic arguments in metadata)
 - #65398 (Bring attention to suggestions when the only difference is capitalization)
 - #65410 (syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`)
 - #65415 (Remove an outdated test output file)
 - #65416 (Minor sync changes)

Failed merges:

r? @ghost

4 years agoRollup merge of #65416 - spastorino:minor-sync-changes, r=Mark-Simulacrum
Tyler Mandry [Tue, 15 Oct 2019 00:52:45 +0000 (17:52 -0700)]
Rollup merge of #65416 - spastorino:minor-sync-changes, r=Mark-Simulacrum

Minor sync changes

r? @Mark-Simulacrum

4 years agoRollup merge of #65415 - petrochenkov:rmtest, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:44 +0000 (17:52 -0700)]
Rollup merge of #65415 - petrochenkov:rmtest, r=varkor

Remove an outdated test output file

It was accidentally introduced during some rebase, but it's no longer necessary and `--bless` removes it, but it doesn't fail testing.

4 years agoRollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:42 +0000 (17:52 -0700)]
Rollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkor

syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`

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

The recovery comes in two flavors:

1. We know that `p2` is a binding so we can invert as `p2 @ p1`:

```rust
error: pattern on wrong side of `@`
  --> $DIR/intersection-patterns.rs:13:9
   |
LL |         Some(x) @ y => {}
   |         -------^^^-
   |         |         |
   |         |         binding on the right, should be to the left
   |         pattern on the left, should be to the right
   |         help: switch the order: `y @ Some(x)`
```

2. Otherwise we emit a generic diagnostic for the lack of support for intersection patterns:

```rust
error: left-hand side of `@` must be a binding
  --> $DIR/intersection-patterns.rs:23:9
   |
LL |         Some(x) @ Some(y) => {}
   |         -------^^^-------
   |         |         |
   |         |         also a pattern
   |         interpreted as a pattern, not a binding
   |
   = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
```

For more on and-patterns, see e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern.

r? @davidtwco
cc @varkor @lzutao

4 years agoRollup merge of #65398 - estebank:capitalization-only, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:41 +0000 (17:52 -0700)]
Rollup merge of #65398 - estebank:capitalization-only, r=varkor

Bring attention to suggestions when the only difference is capitalization

CC #65386.

4 years agoRollup merge of #65365 - skinny121:const-args-metadata, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:39 +0000 (17:52 -0700)]
Rollup merge of #65365 - skinny121:const-args-metadata, r=varkor

Include const generic arguments in metadata

Fixes #64707
Fixes #61624
Fixes #64730

r? @varkor

4 years agoRollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddyb
Tyler Mandry [Tue, 15 Oct 2019 00:52:38 +0000 (17:52 -0700)]
Rollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddyb

Several changes to the codegen backend organization

* Split functions from values in cg_ssa `BackendTypes`.
* Remove `is_const_integral` function from `ConstMethods`.
* Actually register the invalid monomorphization of intrinsic long diagnostic and remove the `diagnostics` method from `CodegenBackends`, as it was unused.
* Add cg_ssa and cg_utils provided methods to `default_provide`, so codegen backend don't have to do it themself.

4 years agoRollup merge of #65332 - RalfJung:fmt, r=cramertj
Tyler Mandry [Tue, 15 Oct 2019 00:52:37 +0000 (17:52 -0700)]
Rollup merge of #65332 - RalfJung:fmt, r=cramertj

std::fmt: reorder docs

This moves the "Formatting Parameters" section up above right after the discussion of named and positional arguments. Then comes the "Syntax" section, summarizing the discussion of format string syntax.
And only *then* we get to "Formatting Traits" -- that section has some *huge* code examples, so it really should not interrupt the discussion of the grammar. Also users are much more likely to come here to learn about the format string grammar than to come here to learn about the `Binary` trait.

4 years agoRollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov
Tyler Mandry [Tue, 15 Oct 2019 00:52:35 +0000 (17:52 -0700)]
Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov

Remove `Option` from `TokenStream`

A code simplification.

r? @petrochenkov

4 years agoRollup merge of #65260 - nnethercote:optimize-LexicalResolve-expansion, r=nikomatsakis
Tyler Mandry [Tue, 15 Oct 2019 00:52:33 +0000 (17:52 -0700)]
Rollup merge of #65260 - nnethercote:optimize-LexicalResolve-expansion, r=nikomatsakis

Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis

4 years agoRollup merge of #65170 - petrochenkov:cload, r=eddyb
Tyler Mandry [Tue, 15 Oct 2019 00:52:32 +0000 (17:52 -0700)]
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

4 years agoTweak heuristics for less noise
Esteban Küber [Mon, 14 Oct 2019 21:48:45 +0000 (14:48 -0700)]
Tweak heuristics for less noise

4 years agoUse heuristics for capitalization warning in suggestions
Esteban Küber [Mon, 14 Oct 2019 21:30:59 +0000 (14:30 -0700)]
Use heuristics for capitalization warning in suggestions

4 years agoRename serial_join and serial_scope to join and scope
Santiago Pastorino [Mon, 14 Oct 2019 20:49:47 +0000 (17:49 -0300)]
Rename serial_join and serial_scope to join and scope

4 years agoMove serial_scope and serial_join to parallel_compiler = false
Santiago Pastorino [Mon, 14 Oct 2019 18:15:02 +0000 (15:15 -0300)]
Move serial_scope and serial_join to parallel_compiler = false

4 years agoMinor comment tweaks
Santiago Pastorino [Mon, 14 Oct 2019 18:12:23 +0000 (15:12 -0300)]
Minor comment tweaks

4 years agoRemove an outdated test output file
Vadim Petrochenkov [Mon, 14 Oct 2019 18:35:49 +0000 (21:35 +0300)]
Remove an outdated test output file

4 years agoInclude const generic arguments in metadata.
ben [Sun, 13 Oct 2019 04:52:09 +0000 (17:52 +1300)]
Include const generic arguments in metadata.

4 years agopprust: `p1@p2` -> `p1 @ p2`
Mazdak Farrokhzad [Mon, 14 Oct 2019 16:12:04 +0000 (18:12 +0200)]
pprust: `p1@p2` -> `p1 @ p2`

4 years agorecover_intersection_pat: adjust wording
Mazdak Farrokhzad [Mon, 14 Oct 2019 16:02:49 +0000 (18:02 +0200)]
recover_intersection_pat: adjust wording

4 years agoAuto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb
bors [Mon, 14 Oct 2019 15:52:51 +0000 (15:52 +0000)]
Auto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb

Compute the layout of uninhabited structs

fixes #64506

r? @eddyb

4 years agosyntax: use `PatKind::Wild` as our `::Err` equivalent.
Mazdak Farrokhzad [Mon, 14 Oct 2019 15:25:50 +0000 (17:25 +0200)]
syntax: use `PatKind::Wild` as our `::Err` equivalent.

4 years agosyntax: add test for intersection pattern parser recovery
Mazdak Farrokhzad [Mon, 14 Oct 2019 14:57:18 +0000 (16:57 +0200)]
syntax: add test for intersection pattern parser recovery

4 years agosyntax: add recovery for intersection patterns `p1 @ p2`
Mazdak Farrokhzad [Mon, 14 Oct 2019 14:47:12 +0000 (16:47 +0200)]
syntax: add recovery for intersection patterns `p1 @ p2`

4 years agorustc_metadata: Remove resolutions for extern crate items from `CStore`
Vadim Petrochenkov [Sun, 13 Oct 2019 22:08:13 +0000 (01:08 +0300)]
rustc_metadata: Remove resolutions for extern crate items from `CStore`

Use a more traditional scheme with providing them as a resolver output

4 years agorustc_metadata: Crate loader is immutable
Vadim Petrochenkov [Sun, 13 Oct 2019 20:47:26 +0000 (23:47 +0300)]
rustc_metadata: Crate loader is immutable

4 years agorustc_metadata: Improve documentation of `CrateMetadata`
Vadim Petrochenkov [Sun, 6 Oct 2019 19:25:57 +0000 (22:25 +0300)]
rustc_metadata: Improve documentation of `CrateMetadata`

4 years agorustc_metadata: Use `CrateSource` where appropriate
Vadim Petrochenkov [Sun, 6 Oct 2019 13:42:14 +0000 (16:42 +0300)]
rustc_metadata: Use `CrateSource` where appropriate

4 years agorustc_metadata: Privatize private code and remove dead code
Vadim Petrochenkov [Sun, 6 Oct 2019 11:30:46 +0000 (14:30 +0300)]
rustc_metadata: Privatize private code and remove dead code

4 years agoAuto merge of #65399 - Centril:rollup-6lzj0w5, r=Centril
bors [Mon, 14 Oct 2019 10:00:51 +0000 (10:00 +0000)]
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

4 years agoRollup merge of #65395 - JohnTitor:add-tests, r=Centril
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:37:01 +0000 (07:37 +0200)]
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)

4 years agoRollup merge of #65392 - Centril:nt-to-tt, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:59 +0000 (07:36 +0200)]
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

4 years agoRollup merge of #65379 - Centril:refactor-bso_and_cc, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:58 +0000 (07:36 +0200)]
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)

4 years agoRollup merge of #65363 - Centril:less-pprust, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:57 +0000 (07:36 +0200)]
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

4 years agoRollup merge of #65362 - Centril:extract_fun, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:55 +0000 (07:36 +0200)]
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

4 years agoRollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:54 +0000 (07:36 +0200)]
Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril

Print lifetimes with backticks

Fixes #65287

r? @varkor

4 years agoRollup merge of #65215 - JohnTitor:long-explanation-e0697, r=GuillaumeGomez
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:52 +0000 (07:36 +0200)]
Rollup merge of #65215 - JohnTitor:long-explanation-e0697, r=GuillaumeGomez

Add long error explanation for E0697

Part of #61137

r? @GuillaumeGomez

4 years agoBring attention to suggestions when the only difference is capitalization
Esteban Küber [Mon, 14 Oct 2019 04:48:39 +0000 (21:48 -0700)]
Bring attention to suggestions when the only difference is capitalization

4 years agoAdd test for issue-48638
Yuki Okushi [Mon, 14 Oct 2019 01:47:39 +0000 (10:47 +0900)]
Add test for issue-48638

4 years agoAdd test for issue-48027
Yuki Okushi [Mon, 14 Oct 2019 01:47:14 +0000 (10:47 +0900)]
Add test for issue-48027

4 years agoAdd test for issue-48010
Yuki Okushi [Mon, 14 Oct 2019 01:46:58 +0000 (10:46 +0900)]
Add test for issue-48010

4 years agoAdd test for issue-47486
Yuki Okushi [Mon, 14 Oct 2019 01:45:56 +0000 (10:45 +0900)]
Add test for issue-47486

4 years agoAuto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrum
bors [Mon, 14 Oct 2019 01:45:26 +0000 (01:45 +0000)]
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

4 years agoAdd test for issue-44153
Yuki Okushi [Mon, 14 Oct 2019 01:45:25 +0000 (10:45 +0900)]
Add test for issue-44153

4 years agoLazify some `mac_placeholder()` calls.
Nicholas Nethercote [Thu, 10 Oct 2019 01:55:39 +0000 (12:55 +1100)]
Lazify some `mac_placeholder()` calls.

This avoids some unnecessary creation of empty token streams.

4 years agoUse `TokenStream::default()` in more places.
Nicholas Nethercote [Thu, 10 Oct 2019 01:01:12 +0000 (12:01 +1100)]
Use `TokenStream::default()` in more places.

4 years agoRemove the `Option` in `TokenStream`.
Nicholas Nethercote [Wed, 9 Oct 2019 20:29:02 +0000 (07:29 +1100)]
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.

4 years agoAuto merge of #65342 - Mark-Simulacrum:revert-rustc-dev, r=pietroalbini
bors [Sun, 13 Oct 2019 21:35:39 +0000 (21:35 +0000)]
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 000d90b11f7be70ffb7812680f7abc6deb52ec88, reversing
changes made to 898f36c83cc28d7921a1d7b3605323dc5cfcf533.

This turned out to break quite a few targets, cc https://github.com/rust-lang/rust/issues/65335

4 years agolowering: connect to parser via function pointer instead
Mazdak Farrokhzad [Sun, 13 Oct 2019 21:27:18 +0000 (23:27 +0200)]
lowering: connect to parser via function pointer instead

4 years agolowering: don't rely on parser directly.
Mazdak Farrokhzad [Sun, 13 Oct 2019 20:51:18 +0000 (22:51 +0200)]
lowering: don't rely on parser directly.

4 years agotoken: extract Nonterminal::to_tokenstream to parser.
Mazdak Farrokhzad [Wed, 9 Oct 2019 00:34:22 +0000 (02:34 +0200)]
token: extract Nonterminal::to_tokenstream to parser.

4 years agoAuto merge of #65388 - Centril:rollup-rhg0dvs, r=Centril
bors [Sun, 13 Oct 2019 17:18:56 +0000 (17:18 +0000)]
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

4 years agoRollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:17 +0000 (19:17 +0200)]
Rollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink

Fix typo in docs for `Rc`

r? @czipperz

4 years agoRollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:15 +0000 (19:17 +0200)]
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.

4 years agoRollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:14 +0000 (19:17 +0200)]
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.

4 years agoRollup merge of #65366 - faern:source-on-intostringerror, r=bluss
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:12 +0000 (19:17 +0200)]
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.

4 years agoRollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:11 +0000 (19:17 +0200)]
Rollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor

Fix #[unwind(abort)] with Rust ABI

Fixes #63883.

4 years agoRollup merge of #65346 - RalfJung:nounwind-tests, r=nagisa
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:10 +0000 (19:17 +0200)]
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.

4 years agoRollup merge of #65336 - BO41:typo, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:08 +0000 (19:17 +0200)]
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?

4 years agoRollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnay
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:07 +0000 (19:17 +0200)]
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.

4 years agoRollup merge of #65246 - Wind-River:real_master_2, r=kennytm
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:06 +0000 (19:17 +0200)]
Rollup merge of #65246 - Wind-River:real_master_2, r=kennytm

vxWorks: implement get_path() and get_mode() for File fmt::Debug

4 years agoRollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:04 +0000 (19:17 +0200)]
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

4 years agorefactor session::config::build_session_options_and_crate_config
Mazdak Farrokhzad [Fri, 11 Oct 2019 21:30:58 +0000 (23:30 +0200)]
refactor session::config::build_session_options_and_crate_config

4 years agoFix typo in docs for `Rc`
kalabukdima [Sun, 13 Oct 2019 12:46:28 +0000 (15:46 +0300)]
Fix typo in docs for `Rc`

4 years agoImprove type safety
bjorn3 [Sun, 13 Oct 2019 10:19:14 +0000 (12:19 +0200)]
Improve type safety

4 years agoAdd top level provide/provide_extern to cg_ssa and cg_utils
bjorn3 [Sun, 13 Oct 2019 10:11:27 +0000 (12:11 +0200)]
Add top level provide/provide_extern to cg_ssa and cg_utils

4 years agoRemove MiscMethods::instances
bjorn3 [Sun, 13 Oct 2019 10:05:40 +0000 (12:05 +0200)]
Remove MiscMethods::instances

4 years agoInline functions from cg_ssa::callee and remove the mod
bjorn3 [Sun, 13 Oct 2019 09:45:34 +0000 (11:45 +0200)]
Inline functions from cg_ssa::callee and remove the mod

Fixes #65271

4 years agos/FuncId/Function
bjorn3 [Sun, 13 Oct 2019 09:28:19 +0000 (11:28 +0200)]
s/FuncId/Function

4 years agoMove span_invalid_monomorphization_error from cg_llvm to cg_ssa
bjorn3 [Sat, 12 Oct 2019 12:49:03 +0000 (14:49 +0200)]
Move span_invalid_monomorphization_error from cg_llvm to cg_ssa

The associated long diagnostic didn't get registered before

4 years agoMove some provides from cg_llvm to rustc_interface
bjorn3 [Sat, 12 Oct 2019 10:57:36 +0000 (12:57 +0200)]
Move some provides from cg_llvm to rustc_interface

4 years agoRemove unused method CodegenBackend::diagnostics
bjorn3 [Sat, 12 Oct 2019 10:36:48 +0000 (12:36 +0200)]
Remove unused method CodegenBackend::diagnostics

4 years agoRemove is_const_integral method from ConstMethods
bjorn3 [Tue, 27 Aug 2019 09:51:53 +0000 (11:51 +0200)]
Remove is_const_integral method from ConstMethods

4 years agoIntroduce FuncId backend type
bjorn3 [Tue, 27 Aug 2019 09:45:03 +0000 (11:45 +0200)]
Introduce FuncId backend type

4 years agosyntax: consolidate function parsing in `item.rs`
Mazdak Farrokhzad [Fri, 11 Oct 2019 08:54:26 +0000 (10:54 +0200)]
syntax: consolidate function parsing in `item.rs`

4 years agoAdded code element
Cerberuser [Sun, 13 Oct 2019 12:03:21 +0000 (19:03 +0700)]
Added code element

Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
4 years agoAdd `dyn` to `Any` documentation
Cerberuser [Sun, 13 Oct 2019 11:48:07 +0000 (18:48 +0700)]
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.

4 years agoAuto merge of #65368 - Centril:rollup-lb7fe48, r=Centril
bors [Sun, 13 Oct 2019 11:36:52 +0000 (11:36 +0000)]
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

4 years agoRollup merge of #65360 - Centril:mbrpt, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:44 +0000 (13:34 +0200)]
Rollup merge of #65360 - Centril:mbrpt, r=petrochenkov

mbe: reduce panictry! uses.

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

r? @petrochenkov

4 years agoRollup merge of #65359 - Centril:sil, r=davidtwco
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:42 +0000 (13:34 +0200)]
Rollup merge of #65359 - Centril:sil, r=davidtwco

simplify integer_lit

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

r? @davidtwco

4 years agoRollup merge of #65358 - Centril:smsf, r=davidtwco
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:41 +0000 (13:34 +0200)]
Rollup merge of #65358 - Centril:smsf, r=davidtwco

simplify maybe_stage_features

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

r? @estebank

4 years agoRollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascription, r=davidtwco
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:40 +0000 (13:34 +0200)]
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

4 years agoRollup merge of #65339 - RalfJung:atomic-ordering, r=Centril
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:39 +0000 (13:34 +0200)]
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

4 years agoRollup merge of #65327 - guanqun:remove-hand-binary-search, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:37 +0000 (13:34 +0200)]
Rollup merge of #65327 - guanqun:remove-hand-binary-search, r=petrochenkov

replace the hand-written binary search with the library one

4 years agoRollup merge of #65320 - memoryruins:const_err, r=oli-obk
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:36 +0000 (13:34 +0200)]
Rollup merge of #65320 - memoryruins:const_err, r=oli-obk

Report `CONST_ERR` lint in external macros

fixes #65300
fixes #61058

r? @oli-obk

4 years agoRollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:34 +0000 (13:34 +0200)]
Rollup merge of #65295 - estebank:gotta-go-fast, r=nnethercote

Move diagnostics code out of the critical path

Follow up to #65077.

r? @nnethercote

4 years agoRollup merge of #65250 - da-x:ctor-in-error-msgs, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:33 +0000 (13:34 +0200)]
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

4 years agoRollup merge of #65248 - estebank:mention-if-let, r=cramertj
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:32 +0000 (13:34 +0200)]
Rollup merge of #65248 - estebank:mention-if-let, r=cramertj

Suggest `if let` on `let` refutable binding

Fix #58385.

4 years agoRollup merge of #65165 - BO41:char_docs, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:30 +0000 (13:34 +0200)]
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

4 years agoRollup merge of #65069 - crgl:clone-from-vec-deque, r=bluss
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:29 +0000 (13:34 +0200)]
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.

4 years agoRollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomez
Mazdak Farrokhzad [Sun, 13 Oct 2019 11:34:27 +0000 (13:34 +0200)]
Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomez

Document missing deny by default lints

4 years agoRemove Error::cause impls equal to deafult impl
Linus Färnstrand [Sun, 13 Oct 2019 10:26:45 +0000 (12:26 +0200)]
Remove Error::cause impls equal to deafult impl

4 years agoFix typos in error.rs
BO41 [Sun, 13 Oct 2019 10:12:46 +0000 (12:12 +0200)]
Fix typos in error.rs

4 years agoDon't discard value names when using address or memory sanitizer
Tomasz Miąsko [Sun, 13 Oct 2019 00:00:00 +0000 (00:00 +0000)]
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.

4 years agoImplement Error::source on IntoStringError
Linus Färnstrand [Sun, 13 Oct 2019 09:43:26 +0000 (11:43 +0200)]
Implement Error::source on IntoStringError

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.

4 years agoAuto merge of #65182 - anp:reify-shim, r=eddyb
bors [Sun, 13 Oct 2019 07:32:38 +0000 (07:32 +0000)]
Auto merge of #65182 - anp:reify-shim, r=eddyb

Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N)

Supercedes: https://github.com/rust-lang/rust/pull/65082
Depends on: https://github.com/rust-lang/rust/pull/65037
Tracking issue: https://github.com/rust-lang/rust/issues/47809
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)

steps taken:

* [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183)
* [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers
* [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function

4 years agotokenstream: don't depend on pprust
Mazdak Farrokhzad [Tue, 8 Oct 2019 23:45:40 +0000 (01:45 +0200)]
tokenstream: don't depend on pprust

4 years agoast: remove implicit pprust dependency via Display.
Mazdak Farrokhzad [Tue, 8 Oct 2019 20:17:46 +0000 (22:17 +0200)]
ast: remove implicit pprust dependency via Display.

Instead just use `pprust::path_to_string(..)` where needed.

This has two benefits:

a) The AST definition is now independent of printing it.
   (Therefore we get closer to extracting a data-crate.)

b) Debugging should be easier as program flow is clearer.

4 years agoast: don't use pprust in Debug
Mazdak Farrokhzad [Tue, 8 Oct 2019 19:50:09 +0000 (21:50 +0200)]
ast: don't use pprust in Debug