Commit Graph

102061 Commits

Author SHA1 Message Date
Ralf Jung
32453ce488 remvoe to_scalar_ptr and use ref_to_mplace everywhere 2019-11-06 10:06:11 +01:00
Ralf Jung
14ee66acec miri cast: avoid unnecessary to_scalar_ptr 2019-11-06 10:05:34 +01:00
3442853561
936349c81b
Update local.rs
Removed parameters not used in the macro
2019-11-06 16:39:48 +08:00
Pyry Kontio
4317263a31 Fix the Error linking. 2019-11-06 16:59:53 +09:00
Mazdak Farrokhzad
1c7595fd0f gate rustc_on_unimplemented under rustc_attrs 2019-11-06 07:34:51 +01:00
bors
e8b190ac4a Auto merge of #66143 - Centril:rollup-qmzuex0, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #65776 (Rename `LocalInternedString` and more)
 - #65973 (caller_location: point to macro invocation sites, like file!/line!, and use in core::panic!.)
 - #66015 (librustc_lexer: Refactor the module)
 - #66062 (Configure LLVM module PIC level)
 - #66086 (bump smallvec to 1.0)
 - #66092 (Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.)
 - #66103 (Add target thumbv7neon-unknown-linux-musleabihf)
 - #66133 (Update the bundled `wasi-libc` repository)
 - #66139 (use American spelling for `pluralize!`)

Failed merges:

r? @ghost
2019-11-06 06:14:03 +00:00
Mazdak Farrokhzad
4f9651b854
Rollup merge of #66139 - euclio:pluralize, r=nagisa
use American spelling for `pluralize!`
2019-11-06 07:03:14 +01:00
Mazdak Farrokhzad
7f7218fd21
Rollup merge of #66133 - alexcrichton:update-wasi-libc, r=Mark-Simulacrum
Update the bundled `wasi-libc` repository

This updates the libc that the `wasm32-wasi` target links against to the
latest revision, mostly just bringing in minor bug fixes and minor wasm
size improvements.
2019-11-06 07:03:12 +01:00
Mazdak Farrokhzad
40558c329c
Rollup merge of #66103 - smaeul:patch/thumb-musl, r=nagisa
Add target thumbv7neon-unknown-linux-musleabihf

This is a copy of thumbv7neon-unknown-linux-gnueabihf with musl changes
merged from armv7-unknown-linux-musleabihf. This appears to have been
missed when adding the other ARMv7-A thumb targets.
2019-11-06 07:03:11 +01:00
Mazdak Farrokhzad
828a3eef66
Rollup merge of #66092 - niacat:master, r=nagisa
Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.

This system call is present on all supported NetBSD versions and provides an endless stream of non-blocking random data from the kernel's ChaCha20-based CSPRNG. It doesn't require a file like `/dev/urandom` to be opened.

The system call is documented here (under kern.arandom):
https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7+NetBSD-7.0

And defined here:
https://nxr.netbsd.org/xref/src/sys/sys/sysctl.h#273

The semantics are the same as FreeBSD so reading 256 bytes per call is fine.

Similar change for getrandom crate: rust-random/getrandom#115
2019-11-06 07:03:09 +01:00
Mazdak Farrokhzad
167b8fedd6
Rollup merge of #66086 - RalfJung:smallvec, r=nagisa
bump smallvec to 1.0

This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec.

See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement.

Cc @mbrubeck @emilio
2019-11-06 07:03:08 +01:00
Mazdak Farrokhzad
98cbe17903
Rollup merge of #66062 - smaeul:patch/pic-level, r=estebank
Configure LLVM module PIC level

As of LLVM 9, this is required for 32-bit PowerPC to properly generate
PLT references. Previously, only BigPIC was supported; now LLVM supports
both BigPIC and SmallPIC, and there is no default value provided.
2019-11-06 07:03:06 +01:00
Mazdak Farrokhzad
81550a00d1
Rollup merge of #66015 - popzxc:refactor-librustc_parser, r=matklad
librustc_lexer: Refactor the module

This PR introduces a refactoring of the `librustc_lexer` in order to improve readability.

All the changes performed are only cosmetic and do not introduce any changes the lexer logic or performance.

Newly introduced modules `literal`, `token` and `utils` are just copy-pasted from the `lib.rs` and do not contain even cosmetic changes (I decided to do so so it'll be easier to review changes looking only on diff).

r? @petrochenkov

cc @Centril @matklad
2019-11-06 07:03:05 +01:00
Mazdak Farrokhzad
24af0c94b3
Rollup merge of #65973 - eddyb:caller-location-panic, r=petrochenkov
caller_location: point to macro invocation sites, like file!/line!, and use in core::panic!.

The main change here is to `core::panic!`, trying to fix this remaining regression: https://github.com/rust-lang/rust/pull/65927#issuecomment-547625147

However, in order for `caller_location` to be usable from macros the same way `file!()`/`line!()` are, it needs to have the same behavior (of extracting the macro invocation site `Span` and using that).

Arguably we would've had to do this at some point anyway, if we want to use `#[track_caller]` to replace the `file!()`/`line!()` uses from macros, but I'm not sure the RFC mentions this at all.

r? @petrochenkov cc @anp @nnethercote
2019-11-06 07:03:03 +01:00
Mazdak Farrokhzad
a0b4b4dafa
Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, r=estebank
Rename `LocalInternedString` and more

This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses.

r? @estebank
2019-11-06 07:03:01 +01:00
Pyry Kontio
f1bc4ef170 Addressed review comments. 2019-11-06 14:48:23 +09:00
bors
e4931eaaa3 Auto merge of #66141 - Centril:rollup-n2fcvp9, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #65892 (Remove `PartialEq` and `Eq` from the `SpecialDerives`.)
 - #66014 (Show type parameter name and definition in type mismatch error messages )
 - #66027 (Move has_panic_handler to query)
 - #66054 (syntax: Avoid span arithmetic for delimiter tokens)
 - #66068 (use silent emitter for rustdoc highlighting pass)
 - #66081 (let caller of check_ptr_access_align control the error message)
 - #66093 (Do not ICE with a precision flag in formatting str and no format arguments)
 - #66098 (Detect `::` -> `:` typo when involving turbofish)
 - #66101 (Tweak type mismatch caused by break on tail expr)
 - #66106 (Fix typo in explanation of `E0080`)
 - #66115 (rustc: remove "GlobalMetaData" dead code from hir::map::definitions.)

Failed merges:

r? @ghost
2019-11-06 02:29:21 +00:00
Mazdak Farrokhzad
35a5ffc8ea
Rollup merge of #66115 - eddyb:global-meta-what, r=michaelwoerister
rustc: remove "GlobalMetaData" dead code from hir::map::definitions.

Spotted while refactoring uses of `DefIndex` and/or `LocalDefId`.

r? @michaelwoerister
2019-11-06 03:28:20 +01:00
Mazdak Farrokhzad
f221c3d83c
Rollup merge of #66106 - JOE1994:master, r=GuillaumeGomez
Fix typo in explanation of `E0080`

Handling issue #66105 in Rust repo.
`evaluate an constant expression` to `evaluate a constant expression`
2019-11-06 03:28:19 +01:00
Mazdak Farrokhzad
32e745fc94
Rollup merge of #66101 - estebank:break-tail-e0308, r=Centril
Tweak type mismatch caused by break on tail expr

When `break;` has a type mismatch because the `Destination` points at a tail
expression with an obligation flowing from a return type, point at the
return type.

Fix #39968.
2019-11-06 03:28:17 +01:00
Mazdak Farrokhzad
409b2bf941
Rollup merge of #66098 - estebank:path-asciption-typo, r=Centril
Detect `::` -> `:` typo when involving turbofish

Fix #65569.
2019-11-06 03:28:15 +01:00
Mazdak Farrokhzad
7d66a09a29
Rollup merge of #66093 - estebank:fmt-ice, r=Centril
Do not ICE with a precision flag in formatting str and no format arguments

Fix #66065.
2019-11-06 03:28:14 +01:00
Mazdak Farrokhzad
76311a8db9
Rollup merge of #66081 - RalfJung:ptr-offset, r=zackmdavis
let caller of check_ptr_access_align control the error message

This is needed for https://github.com/rust-lang/miri/pull/1031
2019-11-06 03:28:12 +01:00
Mazdak Farrokhzad
f5c54896b9
Rollup merge of #66068 - euclio:null-emitter, r=estebank
use silent emitter for rustdoc highlighting pass

Partially addresses #63284.
2019-11-06 03:28:11 +01:00
Mazdak Farrokhzad
e5da1a12e7
Rollup merge of #66054 - petrochenkov:delspan, r=estebank
syntax: Avoid span arithmetic for delimiter tokens

The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it.
Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly.
If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries.

Fixes https://github.com/rust-lang/rust/issues/62524
r? @estebank
2019-11-06 03:28:09 +01:00
Mazdak Farrokhzad
5c4a595ff0
Rollup merge of #66027 - Mark-Simulacrum:panic-handler-query, r=alexcrichton
Move has_panic_handler to query

Moves us off of a global Once instead re-querying the lang item each time. The conditions on when we set it to true change a little (previously we'd make sure a few more lang items were `Some`) but I think they in practice don't matter, we won't compile later on if we don't have them.
2019-11-06 03:28:08 +01:00
Mazdak Farrokhzad
f746d99f68
Rollup merge of #66014 - dkadashev:47319-type-param-def-location, r=estebank
Show type parameter name and definition in type mismatch error messages

Fixes #47319

r? estebank
2019-11-06 03:28:06 +01:00
Mazdak Farrokhzad
5910116b17
Rollup merge of #65892 - pnkfelix:trim-special-derives, r=petrochenkov
Remove `PartialEq` and `Eq` from the `SpecialDerives`.

Now that PR #65519 landed, this is the follow-on work of removing `PartialEq` and `Eq` from the set of `SpecialDerives` .
2019-11-06 03:28:05 +01:00
Samuel Holland
e648aa8e89 Fix C aggregate-passing ABI on powerpc
The existing code (which looks like it was copied from MIPS) passes
aggregates by value in registers. This is wrong. According to the SVR4
powerpc psABI, all aggregates are passed indirectly.

See #64259 for more discussion, which addresses the ABI for the special
case of ZSTs (empty structs).
2019-11-05 20:23:58 -06:00
Tomasz Miąsko
f736de5dbc Apply review suggestions 2019-11-06 00:00:00 +00:00
Pi Lanningham
6186edeae5 Use source_callee().is_some() to detect macros
macro_backtrace() allocates a vector, whereas source_callee() doesn't
but indicates the same thing.  Suggested by @estebank
2019-11-05 23:49:46 +00:00
Esteban Küber
b0f258b2c4 Tweak type mismatch caused by break on tail expr
When `break;` has a type mismatch because the `Destination` points at a tail
expression with an obligation flowing from a return type, point at the
return type.

Fix #39968.
2019-11-05 14:50:18 -08:00
Esteban Küber
c271db284b Provide structured suggestions for valid formatting descriptors 2019-11-05 14:06:38 -08:00
Esteban Küber
08b235b5be Point at formatting descriptor string when it is invalid
When a formatting string contains an invalid descriptor, point at it
instead of the argument:

```
error: unknown format trait `foo`
  --> $DIR/ifmt-bad-arg.rs:86:17
   |
LL |     println!("{:foo}", 1);
   |                 ^^^
   |
   = note: the only appropriate formatting traits are:
           - ``, which uses the `Display` trait
           - `?`, which uses the `Debug` trait
           - `e`, which uses the `LowerExp` trait
           - `E`, which uses the `UpperExp` trait
           - `o`, which uses the `Octal` trait
           - `p`, which uses the `Pointer` trait
           - `b`, which uses the `Binary` trait
           - `x`, which uses the `LowerHex` trait
           - `X`, which uses the `UpperHex` trait
```
2019-11-05 14:06:38 -08:00
Oleg Nosov
6a5931921c
Fixed libcore/cell.rs example 2019-11-06 01:03:31 +03:00
Ralf Jung
11a48a0423
Apply suggestions from code review
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-05 21:50:55 +01:00
Oleg Nosov
45f281d461
Reverted PhantomData in LinkedList, fixed PhantomData markers in Rc and Arc 2019-11-05 23:36:54 +03:00
bors
1423bec54c Auto merge of #66121 - pietroalbini:rollup-8zrwe7l, r=pietroalbini
Rollup of 8 pull requests

Successful merges:

 - #65948 (Improve MaybeUninit::get_{ref,mut} documentation)
 - #65953 (Allow specifying LLVM's MCTargetOptions::ABIName in target specification files)
 - #66012 (De-querify `trivial_dropck_outlives`.)
 - #66025 (`Span` cannot represent `span.hi < span.lo`)
 - #66047 (Don't double-count `simd_shuffle` promotion candidates)
 - #66053 (when Miri tests are not passing, do not add Miri component)
 - #66082 (clean highlightSourceLines code)
 - #66091 (Implemented the home_dir for VxWorks)

Failed merges:

r? @ghost
2019-11-05 20:22:27 +00:00
Andy Russell
ad550b8ef3
use American spelling for pluralize! 2019-11-05 15:10:24 -05:00
Alex Crichton
73df5c5da9 Update the bundled wasi-libc repository
This updates the libc that the `wasm32-wasi` target links against to the
latest revision, mostly just bringing in minor bug fixes and minor wasm
size improvements.
2019-11-05 11:49:23 -08:00
Esteban Küber
bbd7f5c85b Do not ICE whith a precision flag in formatting str and no format arguments 2019-11-05 11:01:43 -08:00
Eduard-Mihai Burtescu
25953321c0 rustc: remove "GlobalMetaData" dead code from hir::map::definitions. 2019-11-05 21:00:38 +02:00
Esteban Küber
a8ccbf5f2f Account for typo in turbofish and suggest :: 2019-11-05 10:29:54 -08:00
Pi Lanningham
15ccad399f Detect if item.span is in a macro, and fall back
If item.span is part of a macro invocation, this has several downstream
implications.  To name two that were found while working on this:

 - The dead-code error gets annotated with a "in this macro invocation"
 - Some errors get canceled if they refer to remote crates

Ideally, we should annotate item.ident.span with the same macro info,
but this is a larger change (see: #66095), so for now we just fall
back to the old behavior if this item was generated by a macro.

I use span.macro_backtrace().len() to detect if it's part of a macro,
because that (among other things) is what is used by the code which
adds the "in this macro invocation" annotations mentioned above.
2019-11-05 15:42:34 +00:00
Felix S. Klock II
99243616cc Review feedback: alpha-rename field from copy_derives to containers_derving_copy. 2019-11-05 14:59:29 +01:00
Felix S. Klock II
0dfe0ed8e1 Review feedback: Remove more stuff! Simplify simplify simplify! 2019-11-05 14:59:29 +01:00
Felix S. Klock II
7d7fbcb301 Remove PartialEq and Eq from the SpecialDerives. 2019-11-05 14:58:10 +01:00
Pietro Albini
135b784182
Rollup merge of #66091 - Wind-River:master_xyz, r=cramertj
Implemented the home_dir for VxWorks

Use HOME's value if it is set;
otherwise return NONE.
2019-11-05 14:37:08 +01:00
Pietro Albini
63e5ed3fdc
Rollup merge of #66082 - GuillaumeGomez:cleanup-highlightsourcelines, r=kinnison
clean highlightSourceLines code

This is the first part of https://github.com/rust-lang/rust/issues/66046. Now that I've splitted the hashchange stuff and the source code lines highlighting, I'll be able to fix the whole issue once and for all.

r? @kinnison
2019-11-05 14:37:07 +01:00
Pietro Albini
50035e8d84
Rollup merge of #66053 - RalfJung:miri-toolstate, r=pietroalbini
when Miri tests are not passing, do not add Miri component

Second attempt, this time based on the JSON files that exist since https://github.com/rust-lang/rust/pull/65274.

Fixes https://github.com/rust-lang/rust/issues/60301
r? @pietroalbini @alexcrichton
2019-11-05 14:37:05 +01:00