Commit Graph

102669 Commits

Author SHA1 Message Date
Vadim Petrochenkov
09c1c94df3 rustc_metadata: Stop leaking Lazy from the rmeta module 2019-11-17 20:13:53 +03:00
Vadim Petrochenkov
c1570238b8 rustc_metadata: Move CrateMetadata into decoder.rs
It allows to make most of its fields private
2019-11-17 20:13:42 +03:00
Vadim Petrochenkov
41ee980f9f rustc_metadata: Give a constructor to CratePaths 2019-11-17 20:12:50 +03:00
Vadim Petrochenkov
0aed810abf rustc_metadata: Minor cleanup 2019-11-17 20:12:50 +03:00
Vadim Petrochenkov
ff3e06fbe6 rustc_metadata: Give a constructor to CrateMetadata 2019-11-17 20:12:50 +03:00
Vadim Petrochenkov
bdce69dd83 rustc_metadata: Give a constructor to CrateLocator 2019-11-17 20:12:50 +03:00
Vadim Petrochenkov
c6bcf6016c rustc_metadata: locator::Context -> CrateLocator 2019-11-17 20:12:50 +03:00
Vadim Petrochenkov
68985c7613 rustc_metadata: Move some structs from cstore to decoder
This allows to privatize their fields.
2019-11-17 19:59:34 +03:00
Nadrieril
d0cfef32a8 Unify the various slice constructors 2019-11-17 15:54:44 +00:00
Yuki Okushi
d8ea7866fc Add JohnTitor to rustc-guide toolstate notification list
Also update org names of some books
2019-11-18 00:47:38 +09:00
bors
d8014582b8 Auto merge of #66384 - cjgillot:typefoldable, r=Zoxc
Derive TypeFoldable using a proc-macro

A new proc macro is added in librustc_macros.
It is used to derive TypeFoldable inside librustc and librustc_traits.

For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime.

The Clone-based TypeFoldable implementations are not migrated.

Closes #65674
2019-11-17 15:25:10 +00:00
bors
4b6cef1e32 Auto merge of #66488 - RalfJung:miri, r=RalfJung
update Miri

r? @ghost Cc @oli-obk
2019-11-17 10:45:37 +00:00
Ralf Jung
2bfa622a99 update Miri 2019-11-17 11:40:18 +01:00
Vadim Petrochenkov
7f49f7bcc2 Rename directory rustc_plugin -> rustc_plugin_impl 2019-11-17 11:04:49 +03:00
Vadim Petrochenkov
ce7a579cac rustc_plugin: Remove the compatibility shim 2019-11-17 11:04:49 +03:00
bors
5966d9b4d9 Auto merge of #66336 - ehuss:update-cargo-books, r=Mark-Simulacrum
Update Cargo, books

## cargo

12 commits in 5da4b4d47963868d9878480197581ccbbdaece74..8280633db680dec5bfe1de25156d1a1d53e6d190
2019-10-28 21:53:41 +0000 to 2019-11-11 23:17:05 +0000
- Don't panic when parsing `/proc/stat` (rust-lang/cargo#7580)
- Fix unused configuration key warning for a few keys under `build`. (rust-lang/cargo#7575)
- Add back support for `BROWSER` envvar in `cargo doc --open`. (rust-lang/cargo#7576)
- Only include "already existing ..." comment in gitignore on conflict (rust-lang/cargo#7570)
- Add VS Code user dir to .gitignore (rust-lang/cargo#7578)
- Added aliases to subcommand typo suggestions. (rust-lang/cargo#7486)
- Use multiple requirement syntax consistently (rust-lang/cargo#7573)
- Update verison to 0.42 (rust-lang/cargo#7568)
- Expand documentation on build scripts. (rust-lang/cargo#7565)
- Update crossbeam-utils requirement from 0.6 to 0.7 (rust-lang/cargo#7566)
- don't download std-docs on CI (rust-lang/cargo#7513)
- Change my-buddy to github-handle (rust-lang/cargo#7553)

## nomicon

2 commits in 5004ad30d69f93553ceef74439fea2159d1f769e..58e36e0e08dec5a379ac568827c058e25990d6cd
2019-10-12 19:52:40 +0200 to 2019-10-30 08:14:24 -0500
- remove references to the nursery
- Add github action to replace Travis.yml (rust-lang-nursery/nomicon#172)

## reference

7 commits in 4b21b646669e0af49fae7cae301898dc4bfaa1f0..45558c464fb458affbcdcb34323946da45c8a117
2019-10-27 22:33:11 +0100 to 2019-11-08 14:47:35 +0100
- Audit code blocks. (rust-lang-nursery/reference#715)
- Update coherence and orphan rules documentation to match RFC 2451 (rust-lang-nursery/reference#703)
- Update organization name (rust-lang-nursery/reference#713)
- State that no_implicit_prelude also applies to nested modules (rust-lang-nursery/reference#707)
- expand Copy docs (rust-lang-nursery/reference#711)
- github action doesn't use the nursery (rust-lang-nursery/reference#706)
- Migrate to GitHub Actions. (rust-lang-nursery/reference#705)

## book

1 commits in 28fa3d15b0bc67ea5e79eeff2198e4277fc61baf..e79dd62aa63396714278d484d91d48826737f47f
2019-10-29 07:16:09 -0500 to 2019-10-30 07:33:12 -0500
- No need for an iterator here to fetch values (rust-lang/book#1957)

## rust-by-example

1 commits in f3197ddf2abab9abdbc029def8164f4a748b0d91..dcee312c66267eb5a2f6f1561354003950e29105
2019-10-29 10:17:40 -0300 to 2019-10-31 11:26:53 -0300
- refactor: simplify extracting Result from Option (rust-lang/rust-by-example#1283)

## edition-guide

2 commits in e58bc4ca104e890ac56af846877c874c432a64b5..f553fb26c60c4623ea88a1cfe731eafe0643ce34
2019-07-31 20:14:12 +0200 to 2019-10-30 08:27:42 -0500
- remove old references to the nursery
- Port from Travis to GitHub Actions (rust-lang-nursery/edition-guide#192)
2019-11-17 07:45:00 +00:00
bors
8831d766ac Auto merge of #66485 - JohnTitor:rollup-vbwhg6r, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #65739 (Improve documentation of `Vec::split_off(...)`)
 - #66271 (syntax: Keep string literals in ABIs and `asm!` more precisely)
 - #66344 (rustc_plugin: Remove `Registry::register_attribute`)
 - #66381 (find_deprecation: deprecation attr may be ill-formed meta.)
 - #66395 (Centralize panic macro documentation)
 - #66456 (Move `DIAGNOSTICS` usage to `rustc_driver`)
 - #66465 (add missing 'static lifetime in docs)
 - #66466 (miri panic_unwind: fix hack for SEH platforms)
 - #66469 (Use "field is never read" instead of "field is never used")
 - #66471 (Add test for issue 63116)
 - #66477 (Clarify transmute_copy documentation example)

Failed merges:

r? @ghost
2019-11-17 04:37:53 +00:00
Yuki Okushi
f65cb87a09
Rollup merge of #66477 - ALSchwalm:clarify-transmute-copy, r=Centril
Clarify transmute_copy documentation example

Currently the documentation for `transmute_copy` implies that the function accepts a slice due to the variable name chosen in the example. This is misleading as `foo_slice` is actually an array and `transmute_copy` cannot take an unsized type anyway.

This PR just clarifies things by renaming the variable used in the example.
2019-11-17 13:36:25 +09:00
Yuki Okushi
750dd03a23
Rollup merge of #66471 - Alexendoo:test-issue-63116, r=Centril
Add test for issue 63116

Closes #63116
2019-11-17 13:36:24 +09:00
Yuki Okushi
c0fccf5d62
Rollup merge of #66469 - CosineP:fix/field-lint, r=petrochenkov
Use "field is never read" instead of "field is never used"

this is my first PR here so please let me know if i am doing it wrong
closes #64465
i will be referencing this with a book PR that updates the same language
2019-11-17 13:36:22 +09:00
Yuki Okushi
937195beb1
Rollup merge of #66466 - RalfJung:seh, r=oli-obk
miri panic_unwind: fix hack for SEH platforms

The old hack didn't work as we ended up duplicating the `eh_personality` lang item...

I have no idea if rustc cares that `eh_catch_typeinfo` has a certain shape, but better safe than sorry. I cannot test this locally.

r? @oli-obk Cc @Aaron1011
2019-11-17 13:36:21 +09:00
Yuki Okushi
404081fd48
Rollup merge of #66465 - mulimoen:fix_lifetime_elision_not_shown, r=rkruppe
add missing 'static lifetime in docs
2019-11-17 13:36:19 +09:00
Yuki Okushi
6e6c46c694
Rollup merge of #66456 - Centril:driver-codes, r=Mark-Simulacrum
Move `DIAGNOSTICS` usage to `rustc_driver`

Remove `rustc_interface`'s dependency on `rustc_error_codes` and centralize all usages of `DIAGNOSTICS` in `rustc_driver`. Once we remove all references to `rustc_error_codes` in all other crates but `rustc_driver`, this should allow for incremental recompilation of the compiler to be smoother when tweaking error codes. This works towards https://github.com/rust-lang/rust/issues/66210#issuecomment-551862528.

(May include traces of minor drive-by cleanup.)

r? @Mark-Simulacrum
2019-11-17 13:36:18 +09:00
Yuki Okushi
05482d03bc
Rollup merge of #66395 - jplatte:centralize-panic-docs, r=Dylan-DPC
Centralize panic macro documentation

This is just the main commit from #61511 (which got closed because the author didn't reply) cherry-picked on the current master. Building `core` and `std` on this branch in stage 1 succeeded, which I thinks means the issues from the previous PR should be gone (but let's see what CI says).
2019-11-17 13:36:16 +09:00
Yuki Okushi
842612fcc0
Rollup merge of #66381 - Centril:66340, r=petrochenkov
find_deprecation: deprecation attr may be ill-formed meta.

Fixes #66340.

r? @petrochenkov
cc @pnkfelix
2019-11-17 13:36:15 +09:00
Yuki Okushi
54998d1b3f
Rollup merge of #66344 - petrochenkov:noregattr, r=matthewjasper
rustc_plugin: Remove `Registry::register_attribute`

Legacy plugins cannot register inert attributes anymore.

The preferred replacement is to use `register_tool` ([tracking issue](https://github.com/rust-lang/rust/issues/66079)).
```rust
#![register_tool(servo)]

#[servo::must_root]
struct S;
```

The more direct replacement is `register_attribute` ([tracking issue](https://github.com/rust-lang/rust/issues/66080))
```rust
#![register_attr(must_root)]

#[must_root]
struct S;
```
, but it requires registering each attribute individually rather than registering the tool once, and is more likely to be removed rather than stabilized.
2019-11-17 13:36:13 +09:00
Yuki Okushi
b83d50d34f
Rollup merge of #66271 - petrochenkov:abism, r=Centril
syntax: Keep string literals in ABIs and `asm!` more precisely

As a result we don't lose spans when `extern` functions or blocks are passed to proc macros, and also escape all string literals consistently.
Continuation of https://github.com/rust-lang/rust/pull/60679, which did a similar thing with all literals besides those in ABIs and `asm!`.

TODO: Add tests.

Fixes https://github.com/rust-lang/rust/issues/60493
Fixes https://github.com/rust-lang/rust/issues/64561
r? @Centril
2019-11-17 13:36:12 +09:00
Yuki Okushi
d8f2526703
Rollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay
Improve documentation of `Vec::split_off(...)`

The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.
2019-11-17 13:36:10 +09:00
Esteban Küber
d7efa5bd6a review comments 2019-11-16 17:10:13 -08:00
Esteban Küber
0487f0c0c3 Suggest calling async closure when needed
When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.
2019-11-16 16:24:00 -08:00
Esteban Küber
2fe8371268 review comments and fix rebase 2019-11-16 16:12:22 -08:00
bors
2cdc289cb8 Auto merge of #66394 - wesleywiser:fix_oom, r=oli-obk
Fix two OOM issues related to `ConstProp`

Fixes #66342
Fixes #66397

r? @oli-obk
2019-11-16 22:54:33 +00:00
Alex Macleod
cfe94b421b Add test for issue 63116 2019-11-16 22:32:59 +00:00
Vadim Petrochenkov
28aec1beaa Add some more tests 2019-11-17 01:11:35 +03:00
Vadim Petrochenkov
11580ced40 Address review comments 2019-11-17 01:11:28 +03:00
Esteban Küber
7a2f3ee73f Account for rustc_on_unimplemented 2019-11-16 13:23:19 -08:00
Esteban Küber
0f7f2346a6 Remove unnecessary note 2019-11-16 13:23:19 -08:00
Esteban Küber
970503b2e1 Modify primary label message to be inline with error message 2019-11-16 13:23:19 -08:00
Esteban Küber
f57413b717 Suggest borrowing when it would satisfy an unmet trait bound
When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.
2019-11-16 13:23:19 -08:00
Esteban Küber
405a3dd91c Tweak code formatting 2019-11-16 13:23:19 -08:00
Adam Schwalm
3407c49c41 Clarify transmute_copy documentation example 2019-11-16 14:47:33 -06:00
Mahmoud Al-Qudsi
a36c3f6f68 Revise the text of vec::split_off() per review in #65739
Remove the incorrect usage of "copy" as the trait is not called.
2019-11-16 14:15:07 -06:00
Mahmoud Al-Qudsi
8c7530ade8 Improve documentation of Vec::split_off(...)
The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.
2019-11-16 14:15:07 -06:00
bors
5c5b8afd80 Auto merge of #64694 - petrochenkov:reshelp, r=matthewjasper
Fully integrate derive helpers into name resolution

```rust
#[derive(Foo)]
#[foo_helper] // already goes through name resolution
struct S {
    #[foo_helper] // goes through name resolution after this PR
    field: u8
}
```
How name resolution normally works:
- We have an identifier we need to resolve, take its location (in some sense) and look what names are in scope in that location.

How derive helper attributes are "resolved" (before this PR):
- After resolving the derive `Foo` we visit the derive's input (`struct S { ... } `) as a piece of AST and mark attributes textually matching one of the derive's helper attributes (`foo_helper`) as "known", so they never go through name resolution.

This PR changes the rules for derive helpers, so they are not proactively marked as known (which is a big hack ignoring any ambiguities or hygiene), but go through regular name resolution instead.
This change was previously blocked by attributes not being resolved in some positions at all (fixed in https://github.com/rust-lang/rust/pull/63468).

"Where exactly are derive helpers in scope?" is an interesting question, and I need some feedback from proc macro authors to answer it, see the post below (https://github.com/rust-lang/rust/pull/64694#issuecomment-533925160).
2019-11-16 19:50:48 +00:00
Vadim Petrochenkov
a699f17483 parse: Use string literal parsing in the asm macro 2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
b85a3da421 parse: Support parsing optional literals
Revert weird renaming of the former `LitError::report`
2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
00bc449602 ast: Keep string literals in ABIs precisely 2019-11-16 21:21:37 +03:00
Vadim Petrochenkov
266f547127 ast: Keep extern qualifiers in functions more precisely 2019-11-16 21:21:37 +03:00
Wesley Wiser
2dea8af20c Only run tests on x86_64 2019-11-16 13:01:12 -05:00
clemencetbk
dc137dd868 Update ui tests 2019-11-16 12:05:26 -05:00