Commit Graph

98257 Commits

Author SHA1 Message Date
bors
85ed538d69 Auto merge of #63990 - Centril:rollup-q1nt0b0, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #63811 (Correctly suggest adding bounds to `impl Trait` argument)
 - #63933 (Resolve some small issues related to #63580)
 - #63938 (or-pattern: fix typo in error message)
 - #63945 (Recover `mut $pat` and other improvements)
 - #63958 (const_prop: only call error_to_const_error if we are actually showing something)
 - #63961 (Add Option<Span> to `require_lang_item`)
 - #63963 (remove the reference to __cxa_thread_atexit_impl)
 - #63965 (Prevent syntax error in LD linker version script)
 - #63968 (rustc_apfloat: make the crate #![no_std] explicitly.)
 - #63970 (Notify me (flip1995) when Clippy toolstate changes)
 - #63980 (add missing `#[repr(C)]` on the Slices union)

Failed merges:

 - #63989 (Add Yaah to clippy toolstain notification list)

r? @ghost
2019-08-29 05:05:17 +00:00
Mazdak Farrokhzad
7391009236
Rollup merge of #63980 - DutchGhost:master, r=cramertj
add missing `#[repr(C)]` on the Slices union

Adds the `#[repr(C)]` attribute to the `Slices` union used to convert an `&str` into a `&[u8]`.
Without the attribute, the union has an unspecified layout: https://doc.rust-lang.org/reference/types/union.html, so performing the 'transmute' is unsound without the attribute (as far as I understand).

The `Repr` union, used for converting a raw ptr + len to a slice has this attribute as well:
https://github.com/rust-lang/rust/blob/master/src/libcore/ptr/mod.rs#L211-#L216
2019-08-29 05:32:58 +02:00
Mazdak Farrokhzad
e3028dbda8
Rollup merge of #63970 - flip1995:notify_clippy, r=oli-obk
Notify me (flip1995) when Clippy toolstate changes

I want in on the fun 🎉

Also friendly ping @llogiq @mcarton: Since you two aren't _that_ active on the Clippy repo anymore, do you still want to get pinged on Clippy toolstate changes?

r? @oli-obk
2019-08-29 05:32:57 +02:00
Mazdak Farrokhzad
75c8c211dc
Rollup merge of #63968 - eddyb:apfloat-nostd, r=matthewjasper
rustc_apfloat: make the crate #![no_std] explicitly.

We only need allocation, and even that could be made optional.
2019-08-29 05:32:56 +02:00
Mazdak Farrokhzad
1c4a9a9050
Rollup merge of #63965 - loganwendholt:linker-script-fix, r=michaelwoerister
Prevent syntax error in LD linker version script

As discussed in #63925, there is an edge case in which an invalid LD version script is generated when building a `cdylib` with no exported symbols. This PR makes a slight modification to the  LD version script generation by first checking to see if any symbols need to be exported. If not, the `global` section of the linker script is simply omitted, and the syntax error is averted.
2019-08-29 05:32:54 +02:00
Mazdak Farrokhzad
f0e2895cf8
Rollup merge of #63963 - Wind-River:master_003, r=alexcrichton
remove the reference to __cxa_thread_atexit_impl

r? @alexcrichton

cc @n-salim
2019-08-29 05:32:53 +02:00
Mazdak Farrokhzad
d4757d5bbf
Rollup merge of #63961 - JohnTitor:improve-require-lang-item, r=estebank
Add Option<Span> to `require_lang_item`

Fixes #63954

I'm not sure where to take `Some(span)` or something so I use `None` in many places.
r? @estebank
2019-08-29 05:32:51 +02:00
Mazdak Farrokhzad
99d271f400
Rollup merge of #63958 - RalfJung:silence-const-prop, r=oli-obk
const_prop: only call error_to_const_error if we are actually showing something

This makes `RUSTC_CTFE_BACKTRACE` useful again.

r? @oli-obk

Fixes https://github.com/rust-lang/rust/issues/63439
2019-08-29 05:32:50 +02:00
Mazdak Farrokhzad
52c3846d51
Rollup merge of #63945 - Centril:recover-mut-pat, r=estebank
Recover `mut $pat` and other improvements

- Recover on e.g. `mut Foo(x, y)` and suggest `Foo(mut x, mut y)`. Fixes https://github.com/rust-lang/rust/issues/63764.
- Recover on e.g. `let mut mut x;`
- Recover on e.g. `let keyword` and `let keyword(...)`.
- Cleanups in `token.rs` with `fn is_non_raw_ident_where` and friends.
2019-08-29 05:32:48 +02:00
Mazdak Farrokhzad
eb4ac32c59
Rollup merge of #63938 - tshepang:typo, r=Centril
or-pattern: fix typo in error message

cc https://github.com/rust-lang/rust/issues/54883.
2019-08-29 05:32:46 +02:00
Mazdak Farrokhzad
b6df8276f8
Rollup merge of #63933 - wesleywiser:cleanup_from_move_promoted, r=oli-obk
Resolve some small issues related to #63580

This resolves some feedback left on #63580 after it was merged:

- Adds documentation to `mir::Static` and `mir::StaticKind`
- Simplifies `maybe_get_optimized_mir()` and `maybe_get_promoted_mir()`

cc @bjorn3 @RalfJung
2019-08-29 05:32:45 +02:00
Mazdak Farrokhzad
4cae33a176
Rollup merge of #63811 - estebank:impl-trait-arg, r=cramertj
Correctly suggest adding bounds to `impl Trait` argument

Fix #63706.
2019-08-29 05:32:43 +02:00
bors
347654324d Auto merge of #62855 - Aaron1011:feature/rustdoc-reexport-final, r=petrochenkov
Improve Rustdoc's handling of procedural macros

Fixes #58700
Fixes #58696
Fixes #49553
Fixes #52210

This commit removes the special rustdoc handling for proc macros, as we can now
retrieve their span and attributes just like any other item.

A new command-line option is added to rustdoc: `--crate-type`. This takes the same options as rustc's `--crate-type` option. However, all values other than `proc-macro` are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate.

In compiletest, a new 'rustdoc-flags' option is added. This allows us to
pass in the '--proc-macro-crate' flag in the absence of Cargo.

I've opened [an additional PR to Cargo](https://github.com/rust-lang/cargo/pull/7159) to support passing in this flag.
These two PRS can be merged in any order - the Cargo changes will not
take effect until the 'cargo' submodule is updated in this repository.
2019-08-29 01:22:11 +00:00
Aaron Hill
4c3e386bd7
Allow running rustdoc on proc-macro crates without specifying '--crate-type proc-macro'
Add a test to make sure that this works
2019-08-28 18:00:36 -04:00
bors
0414dfa0aa Auto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrum
Save crate filtering on rustdoc

Fixes #62929.

I added a hashmap and a hash encoding for the current crate list in case you have multiple crates handling on a same website (who talked about docs.rs?!). Like that, for each context, you have the filter crate selected.

r? @QuietMisdreavus
2019-08-28 21:42:52 +00:00
bors
17e73e801a Auto merge of #63875 - philipc:issue-57822, r=michaelwoerister
debuginfo: give unique names to closure and generator types

Closure types have been moved to the namespace where they
are defined, and both closure and generator type names now
include the disambiguator.

This fixes an exception when lldb prints nested closures.

Fixes #57822

I haven't included the `DW_AT_artificial` changes discussed in #57822 because they make the output worse IMO, but I can easily add these if still required. For example, for the new test case the output is now:
```
(lldb) p g
(issue_57822::main::closure-1) $1 = closure-1(closure(1))
```
but adding `DW_AT_artificial` changes this to:
```
(lldb) p g
(issue_57822::main::closure-1) $0 = closure-1 {

}
```

Note that nested generators didn't cause the exception. I haven't determined why, but I think it makes sense to add the disambiguator for them too. It feels like we still don't really understand why closures were causing an error though.

r? @michaelwoerister
2019-08-28 17:49:37 +00:00
Dodo
080fdb8184 add missing #[repr(C)] on a union 2019-08-28 17:38:24 +02:00
bors
c4223726c3 Auto merge of #63853 - matthewjasper:test-ast-serialization, r=estebank
Add default serialization for `Ident`s

Also add tests for `-Zast-json` and `-Zast-json-noexpand`

closes #63728
2019-08-28 13:43:05 +00:00
flip1995
8cf392114d
Notify me (flip1995) when Clippy toolstate changes 2019-08-28 13:25:45 +02:00
Wesley Wiser
009cce88eb Extract Decoder::entry_unless_proc_macro() 2019-08-28 07:00:27 -04:00
Wesley Wiser
30b29ab0f7 Simplify maybe_get_optimized_mir and maybe_get_promoted_mir
Since both functions are always unwrapped, don't wrap the return value
in an `Option`.
2019-08-28 07:00:27 -04:00
Wesley Wiser
cca64e7339 Add some comments to mir::Static and mir::StaticKind 2019-08-28 07:00:26 -04:00
Guillaume Gomez
06228d33ca Save crate filtering on rustdoc 2019-08-28 11:56:21 +02:00
Eduard-Mihai Burtescu
0006216c9d rustc_apfloat: make the crate #![no_std] explicitly. 2019-08-28 11:24:04 +03:00
bors
ac21131f78 Auto merge of #63820 - oli-obk:eager_const_eval, r=nikomatsakis
Simplify eager normalization of constants

r? @nikomatsakis
2019-08-28 07:29:07 +00:00
bors
bbd48e6f16 Auto merge of #63127 - kper:pr, r=nikomatsakis
Cleanup: Consistently use `Param` instead of `Arg` #62426

Fixes #62426
2019-08-28 03:42:00 +00:00
Logan Wendholt
42bd6fa22b Prevent syntax error in ld linker version script 2019-08-27 20:37:26 -04:00
Tshepang Lekhonkhobe
6f67bbc445 or-pattern: fix typo in error message 2019-08-28 02:23:58 +02:00
bors
b7178cbc0c Auto merge of #63960 - ehuss:update-cargo, r=alexcrichton
Update cargo

Update cargo

10 commits in 3f700ec43ce72305eb5315cfc710681f3469d4b4..22f7dd0495cd72ce2082d318d5a9b4dccb9c5b8c
2019-08-19 22:43:12 +0000 to 2019-08-27 16:10:51 +0000
- Update and improve zsh completion (rust-lang/cargo#7296)
- Document that `package` can be used in `[patch]` (rust-lang/cargo#7263)
- Fix `error:`/`warning:` coloring inconsistency with rustc (rust-lang/cargo#7294)
- Tests: Import rustc_plugin from its new location (rust-lang/cargo#7287)
- Update README azure badge. (rust-lang/cargo#7293)
- Update home dependencies to v0.5 (rust-lang/cargo#7277)
- Fix typo (rust-lang/cargo#7279)
- Update libgit2 dependencies (rust-lang/cargo#7275)
- Fix old lockfile encoding wrt newlines (rust-lang/cargo#7262)
- Fix dSYM uplifting when symlink is broken (rust-lang/cargo#7268)
2019-08-27 23:57:05 +00:00
Yuki Okushi
ede7a777c0 Remove sized spans 2019-08-28 07:32:25 +09:00
Yuki Okushi
8c921beebb Apply review comments 2019-08-28 07:11:12 +09:00
Yuki Okushi
82f2b37635 Add Option<Span> to require_lang_item 2019-08-28 07:11:12 +09:00
Baoshan
cce631a5a4
Merge pull request #9 from Wind-River/V7LIBC-948
remove the reference to __cxa_thread_atexit_impl
2019-08-27 15:06:16 -07:00
Matthew Jasper
3d718037dc Add default serialization for Idents
Add tests for -Zast-json and -Zast-json-noexpand, which need this impl.
2019-08-27 23:02:22 +01:00
Mazdak Farrokhzad
42e895d4d9 Improve 'mut ' diagnostic. 2019-08-27 23:44:44 +02:00
Eric Huss
85a4d6f522 Update cargo 2019-08-27 14:03:32 -07:00
Ralf Jung
7677d1f771 const_prop: only call error_to_const_error if we are actually showing something 2019-08-27 22:18:25 +02:00
Mazdak Farrokhzad
dbbe3363c9 Ensure 'let mut ;' where ':pat' is banned. 2019-08-27 19:51:21 +02:00
Baoshan Pang
3b2c14736d remove the reference to __cxa_thread_atexit_impl 2019-08-27 10:13:59 -07:00
bors
53df91a9b2 Auto merge of #63922 - RalfJung:miri, r=nikomatsakis
update miri

Cc @oli-obk

Fixes https://github.com/rust-lang/rust/issues/63843
2019-08-27 16:23:59 +00:00
Kevin Per
97319b2b95 Changing error messages and renaming tests #63127
`async-await/no-args-non-move-async-closure`
`generator/no-arguments-on-generators`
2019-08-27 17:31:57 +02:00
Ralf Jung
98ad4ac250 update miri 2019-08-27 15:49:47 +02:00
bors
0396aace27 Auto merge of #63639 - Mark-Simulacrum:rustdoc-clean-3, r=GuillaumeGomez
rustdoc: general cleanup
2019-08-27 12:45:16 +00:00
Kevin Per
e0ce9f8c0a Cleanup: Consistently use Param instead of Arg #62426 2019-08-27 14:07:41 +02:00
Mazdak Farrokhzad
f908aa9e80 recover on 'mut ' and improve recovery for keywords. 2019-08-27 13:04:48 +02:00
Mazdak Farrokhzad
e49b9581ba Simplify with Symbol/Token::is_book_lit. 2019-08-27 10:21:41 +02:00
Mazdak Farrokhzad
5cc1559c60 token: refactor with is_non_raw_ident_where. 2019-08-27 10:14:07 +02:00
bors
7e0afdad28 Auto merge of #63940 - Centril:rollup-47qe9gn, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #62600 (libtest: add --show-output flag to print stdout of successful tests)
 - #63698 (Fixed floating point issue with asinh function)
 - #63761 (Propagate spans and attributes from proc macro definitions)
 - #63917 (Error when generator trait is not found)

Failed merges:

r? @ghost
2019-08-27 06:18:24 +00:00
Mazdak Farrokhzad
23116baff0
Rollup merge of #63917 - lzutao:langitem_gen_63912, r=centril,cramert
Error when generator trait is not found

Closes #63912
2019-08-27 08:17:52 +02:00
Mazdak Farrokhzad
0da7098116
Rollup merge of #63761 - petrochenkov:procattrs, r=eddyb
Propagate spans and attributes from proc macro definitions

Thanks to https://github.com/rust-lang/rust/pull/63269 we now have spans and attributes from proc macro definitions available in metadata.

However, that PR didn't actually put them into use! This PR finishes that work.

Attributes `rustc_macro_transparency`, `allow_internal_unstable`, `allow_internal_unsafe`, `local_inner_macros`, `rustc_builtin_macro`, `stable`, `unstable`, `rustc_deprecated`, `deprecated` now have effect when applied to proc macro definition functions.
From those attributes only `deprecated` is both stable and supposed to be used in new code.
(`#![staged_api]` still cannot be used in proc macro crates for unrelated reasons though.)

`Span::def_site` from the proc macro API now returns the correct location of the proc macro definition.

Also, I made a mistake in https://github.com/rust-lang/rust/pull/63269#discussion_r312702919, loaded proc macros didn't actually use the resolver cache.
This PR fixes the caching issue, now proc macros go through the `Resolver::macro_map` cache as well.

(Also, the first commit turns `proc_macro::quote` into a regular built-in macro to reduce the number of places where `SyntaxExtension`s need to be manually created.)
2019-08-27 08:17:51 +02:00