]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #66162 - Darksonn:master, r=ehuss
Yuki Okushi [Thu, 7 Nov 2019 00:20:48 +0000 (09:20 +0900)]
Rollup merge of #66162 - Darksonn:master, r=ehuss

Fix broken link in README

The link to the rustc guide on building and running the compiler is broken. It was broken in [rustc-guide#491](https://github.com/rust-lang/rustc-guide/pull/491).

4 years agoRollup merge of #66147 - RalfJung:no-scalar-ptr, r=oli-obk
Yuki Okushi [Thu, 7 Nov 2019 00:20:46 +0000 (09:20 +0900)]
Rollup merge of #66147 - RalfJung:no-scalar-ptr, r=oli-obk

Miri: Refactor to_scalar_ptr out of existence

`to_scalar_ptr` is somewhat subtle as it just throws away the 2nd component of a `ScalarPair` if there is one -- without any check if this is truly a pointer or so. And indeed we used it wrong on two occasions!

So I fixed those two, and then refactored things such that everyone calls `ref_to_mplace` instead (which they did anyway, I just moved up the calls), which is the only place that should interpret a `ScalarPair` as a wide ptr -- and it checks the type first. Thus we can remove `to_scalar_ptr` and `to_meta`.

r? @oli-obk

4 years agoRollup merge of #66146 - 3442853561:patch-2, r=Mark-Simulacrum
Yuki Okushi [Thu, 7 Nov 2019 00:20:45 +0000 (09:20 +0900)]
Rollup merge of #66146 - 3442853561:patch-2, r=Mark-Simulacrum

Remove unused parameters in `__thread_local_inner`

Fixes #65993.

4 years agoRollup merge of #66117 - olegnn:fixed_linked_list_marker, r=RalfJung
Yuki Okushi [Thu, 7 Nov 2019 00:20:44 +0000 (09:20 +0900)]
Rollup merge of #66117 - olegnn:fixed_linked_list_marker, r=RalfJung

Fixed PhantomData markers in Arc and Rc

Include owned internal structs in `PhantomData` markers in `Arc` (`PhantomData<T>` => `PhantomData<ArcInner<T>>`) and `Rc` (`PhantomData<T>` => `PhantomData<RcBox<T>>`).

4 years agoRollup merge of #66114 - golddranks:improve_thread_docs, r=Centril
Yuki Okushi [Thu, 7 Nov 2019 00:20:42 +0000 (09:20 +0900)]
Rollup merge of #66114 - golddranks:improve_thread_docs, r=Centril

Improve std::thread::Result documentation

Thanks to @dtolnay for pointing out the different premise of the contents of the `Err` variant in `std::thread::Result` WRT normal error handling.

4 years agoRollup merge of #66111 - RalfJung:from_raw_parts, r=Centril
Yuki Okushi [Thu, 7 Nov 2019 00:20:41 +0000 (09:20 +0900)]
Rollup merge of #66111 - RalfJung:from_raw_parts, r=Centril

improve from_raw_parts docs

Triggered by https://github.com/rust-lang/rfcs/pull/2806. Hopefully this helps clarify that joining slices across allocations is not possible in Rust currently.

r? @Centril

4 years agoRollup merge of #66084 - petrochenkov:x86arm, r=alexcrichton
Yuki Okushi [Thu, 7 Nov 2019 00:20:39 +0000 (09:20 +0900)]
Rollup merge of #66084 - petrochenkov:x86arm, r=alexcrichton

Do not require extra LLVM backends for `x.py test` to pass

For long time our testing passed with a partially built LLVM
```
[llvm]
targets = "X86;ARM"
```
, a [recent PR](https://github.com/rust-lang/rust/pull/65809) changed that.

4 years agoRollup merge of #66076 - RalfJung:qpath, r=davidtwco,oli-obk
Yuki Okushi [Thu, 7 Nov 2019 00:20:38 +0000 (09:20 +0900)]
Rollup merge of #66076 - RalfJung:qpath, r=davidtwco,oli-obk

HIR docs: mention how to resolve method paths

4 years agoRollup merge of #66044 - RalfJung:uninit-lint, r=oli-obk
Yuki Okushi [Thu, 7 Nov 2019 00:20:36 +0000 (09:20 +0900)]
Rollup merge of #66044 - RalfJung:uninit-lint, r=oli-obk

Improve uninit/zeroed lint

* Also warn when creating a raw pointer with a NULL vtable.
* Also identify `MaybeUninit::uninit().assume_init()` and `MaybeUninit::zeroed().assume_init()` as dangerous.

4 years agoRollup merge of #65945 - tmiasko:long-linker-command-line, r=alexcrichton
Yuki Okushi [Thu, 7 Nov 2019 00:20:34 +0000 (09:20 +0900)]
Rollup merge of #65945 - tmiasko:long-linker-command-line, r=alexcrichton

Optimize long-linker-command-line test

Replace O(n^3) text matching with inexpensive hash set lookups.

On my machine this reduces the total runtime of complete
run-make-fulldeps suite from roughly 75 seconds to 45 seconds.

4 years agoRollup merge of #65794 - Centril:unimpl-internal, r=varkor
Yuki Okushi [Thu, 7 Nov 2019 00:20:33 +0000 (09:20 +0900)]
Rollup merge of #65794 - Centril:unimpl-internal, r=varkor

gate rustc_on_unimplemented under rustc_attrs

Move `rustc_on_implemented` from the `on_implemented` gate to `rustc_attrs` as it is internal.

Closes #29628

r? @varkor

4 years agoAuto merge of #65750 - nnethercote:cheaper-doc-comments, r=petrochenkov
bors [Thu, 7 Nov 2019 00:10:52 +0000 (00:10 +0000)]
Auto merge of #65750 - nnethercote:cheaper-doc-comments, r=petrochenkov

Cheaper doc comments

This PR implements the idea from #60935: represent doc comments more cheaply, rather than converting them into `#[doc="..."]` attribute form. Unlike #60936 (which is about coalescing doc comments to reduce their number), this approach does not have any backwards compatibility concerns, and it eliminates about 80-90% of the current cost of doc comments (as estimated using the numbers in #60930, which eliminated the cost of doc comments entirely by treating them as normal comments).

r? @petrochenkov

4 years agoFix other broken link
Yuki Okushi [Wed, 6 Nov 2019 23:30:44 +0000 (08:30 +0900)]
Fix other broken link

4 years agoUpdate link on CONTRIBUTING.md
Yuki Okushi [Wed, 6 Nov 2019 21:48:28 +0000 (06:48 +0900)]
Update link on CONTRIBUTING.md

4 years agoFix libfmt_macros tests
Esteban Küber [Wed, 6 Nov 2019 00:02:12 +0000 (16:02 -0800)]
Fix libfmt_macros tests

4 years agoAuto merge of #65728 - ecstatic-morse:promotion-const-proj, r=eddyb
bors [Wed, 6 Nov 2019 18:12:57 +0000 (18:12 +0000)]
Auto merge of #65728 - ecstatic-morse:promotion-const-proj, r=eddyb

Fix promotion in a `const` when projections are present

Resolves #65727.

This marks the entire local as "needs promotion" when only a projection of that local appears in a promotable context. This should only affect promotion in a `const` or `static`, not in a `fn` or `const fn`, which is handled in `promote_consts.rs`.

r? @eddyb

4 years agoreview comments
Esteban Küber [Wed, 30 Oct 2019 19:55:38 +0000 (12:55 -0700)]
review comments

4 years agoSuggest missing item from `trait` in `impl`
Esteban Küber [Thu, 24 Oct 2019 05:45:15 +0000 (22:45 -0700)]
Suggest missing item from `trait` in `impl`

4 years agoTry with crate::error::Error
Pyry Kontio [Wed, 6 Nov 2019 16:45:30 +0000 (01:45 +0900)]
Try with crate::error::Error

4 years agoFix broken link in README
Alice Ryhl [Wed, 6 Nov 2019 15:41:24 +0000 (16:41 +0100)]
Fix broken link in README

4 years agoAdd test for promotability in `let`
Dylan MacKenzie [Wed, 6 Nov 2019 15:09:16 +0000 (07:09 -0800)]
Add test for promotability in `let`

The old const-checker conservatively reset qualifs when
`IsNotPromotable` was in the return place. Unfortunately, named
variables have `IsNotPromotable`, so this could cause promotion to fail.
This should work now.

4 years agoRemove `IsNotPromotable` and `IsNotImplicitlyPromotable`
Dylan MacKenzie [Sun, 3 Nov 2019 20:49:01 +0000 (12:49 -0800)]
Remove `IsNotPromotable` and `IsNotImplicitlyPromotable`

The former was cleared from `qualifs_in_return_place`, and the latter
was never checked. `QUALIF_ERROR_BIT` no longer corresponds to a real
`Qualif`, however.

4 years agoRemove `promotion_candidates` from `Checker`
Dylan MacKenzie [Sun, 3 Nov 2019 20:42:38 +0000 (12:42 -0800)]
Remove `promotion_candidates` from `Checker`

Also removes any code used only to populate `promotion_candidates`
during const checking.

4 years agoRemove `valid_promotion_candidates`
Dylan MacKenzie [Sun, 3 Nov 2019 20:36:13 +0000 (12:36 -0800)]
Remove `valid_promotion_candidates`

We no longer compare the results of
`promote_consts::validate_candidates` with
`checker.promotion_candidates`, and `promote_consts` becomes the
canonical source for determining promotability.

4 years agousing 2.0.log(2.0) in examples does not make it clear which is the base and number...
Srinivas Reddy Thatiparthy [Wed, 6 Nov 2019 13:50:01 +0000 (19:20 +0530)]
using 2.0.log(2.0) in examples  does not make it clear which is the base and number. This example makes it clear for programmers who take a glance at the example by following the calculation. It is more intuitive, and eliminates the need for executing the example in the playground.

4 years agoReplace `array.into_iter()` with `iter()` in `libtest/tests.rs`
Lukas Kalbertodt [Fri, 1 Nov 2019 12:43:44 +0000 (13:43 +0100)]
Replace `array.into_iter()` with `iter()` in `libtest/tests.rs`

4 years agoAdd UI test for `array.into_iter()` lint
Lukas Kalbertodt [Fri, 1 Nov 2019 11:04:31 +0000 (12:04 +0100)]
Add UI test for `array.into_iter()` lint

4 years agoAdd future incompatibility lint for `array.into_iter()`
Lukas Kalbertodt [Fri, 1 Nov 2019 11:04:18 +0000 (12:04 +0100)]
Add future incompatibility lint for `array.into_iter()`

As we might want to add `IntoIterator` impls for arrays in the future,
and since that introduces a breaking change, this lint warns and
suggests using `iter()` instead (which is shorter and more explicit).

4 years agoAuto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe
bors [Wed, 6 Nov 2019 12:45:35 +0000 (12:45 +0000)]
Auto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe

improper_ctypes: `extern "C"` fns

cc #19834. Fixes #65867.

This pull request implements the change [described in this comment](https://github.com/rust-lang/rust/issues/19834#issuecomment-466671572).

cc @rkruppe @varkor @shepmaster

4 years agoMake doc comments cheaper with `AttrKind`.
Nicholas Nethercote [Wed, 23 Oct 2019 19:33:12 +0000 (06:33 +1100)]
Make doc comments cheaper with `AttrKind`.

`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a
big performance win (over 10% in some cases) because `DocComment` lets doc
comments (which are common) be represented very cheaply.

`Attribute` gets some new helper methods to ease the transition:
- `has_name()`: check if the attribute name matches a single `Symbol`; for
  `DocComment` variants it succeeds if the symbol is `sym::doc`.
- `is_doc_comment()`: check if it has a `DocComment` kind.
- `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant;
  panic otherwise.

Fixes #60935.

4 years agoRemove unnecessary `Deref` impl for `Attribute`.
Nicholas Nethercote [Wed, 23 Oct 2019 19:40:35 +0000 (06:40 +1100)]
Remove unnecessary `Deref` impl for `Attribute`.

This kind of thing just makes the code harder to read.

4 years agorollback gating for failing macro matchers
Mazdak Farrokhzad [Wed, 30 Oct 2019 16:34:00 +0000 (17:34 +0100)]
rollback gating for failing macro matchers

4 years agorevamp pre-expansion gating infra
Mazdak Farrokhzad [Wed, 30 Oct 2019 15:38:16 +0000 (16:38 +0100)]
revamp pre-expansion gating infra

4 years agoFix markdown link
Ralf Jung [Wed, 6 Nov 2019 10:15:30 +0000 (11:15 +0100)]
Fix markdown link

Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
4 years agopatterns_in_fns_without_body -> deny
Mazdak Farrokhzad [Sat, 3 Aug 2019 20:33:19 +0000 (22:33 +0200)]
patterns_in_fns_without_body -> deny

4 years agoill_formed_attribute_input -> deny
Mazdak Farrokhzad [Sat, 26 Oct 2019 22:14:49 +0000 (00:14 +0200)]
ill_formed_attribute_input -> deny

4 years agonested_impl_trait -> error
Mazdak Farrokhzad [Sat, 3 Aug 2019 19:59:22 +0000 (21:59 +0200)]
nested_impl_trait -> error

4 years agoduplicate_macro_exports -> error
Mazdak Farrokhzad [Sat, 3 Aug 2019 18:29:45 +0000 (20:29 +0200)]
duplicate_macro_exports -> error

4 years agoparenthesized_params_in_types_and_modules -> error
Mazdak Farrokhzad [Sat, 3 Aug 2019 17:58:26 +0000 (19:58 +0200)]
parenthesized_params_in_types_and_modules -> error

4 years agosafe_extern_static -> error
Mazdak Farrokhzad [Sat, 3 Aug 2019 17:34:21 +0000 (19:34 +0200)]
safe_extern_static -> error

4 years agolegacy_directory_ownership -> error
Mazdak Farrokhzad [Sat, 3 Aug 2019 15:42:17 +0000 (17:42 +0200)]
legacy_directory_ownership -> error

4 years agolegacy_ctor_visibility -> error
Mazdak Farrokhzad [Sat, 3 Aug 2019 14:59:05 +0000 (16:59 +0200)]
legacy_ctor_visibility -> error

4 years agoThe unsafety in `iter.rs` is already documented wonderfully
Oliver Scherer [Fri, 25 Oct 2019 16:35:51 +0000 (18:35 +0200)]
The unsafety in `iter.rs` is already documented wonderfully

4 years agoRebase fallout
Oliver Scherer [Fri, 25 Oct 2019 10:03:34 +0000 (12:03 +0200)]
Rebase fallout

4 years agoSilence a deprecation warning
Oliver Scherer [Sat, 19 Oct 2019 11:02:17 +0000 (13:02 +0200)]
Silence a deprecation warning

4 years agoHalloween... time to get rid of 👻
Oliver Scherer [Sat, 19 Oct 2019 11:00:23 +0000 (13:00 +0200)]
Halloween... time to get rid of 👻

4 years agoHave tidy ensure that we document all `unsafe` blocks in libcore
Oliver Scherer [Wed, 21 Aug 2019 17:56:46 +0000 (19:56 +0200)]
Have tidy ensure that we document all `unsafe` blocks in libcore

4 years agoAuto merge of #65830 - Quantumplation:master, r=davidtwco,estebank
bors [Wed, 6 Nov 2019 09:35:27 +0000 (09:35 +0000)]
Auto merge of #65830 - Quantumplation:master, r=davidtwco,estebank

Use ident.span instead of def_span in dead-code pass

Hello! First time contributor! :)

This should fix #58729.

According to @estebank in the duplicate #63064, def_span scans forward on the line until it finds a {,
and if it can't find one, falls back to the span for the whole item. This
was apparently written before the identifier span was explicitly tracked on
each node.

This means that if an unused function signature spans multiple lines, the
entire function (potentially hundreds of lines) gets flagged as dead code.
This could, for example, cause IDEs to add error squiggly's to the whole
function.

By using the span from the ident instead, we narrow the scope of this in
most cases. In a wider sense, it's probably safe to use ident.span
instead of def_span in most locations throughout the whole code base,
but since this is my first contribution, I kept it small.

Some interesting points that came up while I was working on this:
- I reorganized the tests a bit to bring some of the dead code ones all
into the same location
- A few tests were for things unrelated to dead code (like the
path-lookahead for parens), so I added #![allow(dead_code)] and
cleaned up the stderr file to reduce noise in the future
- The same fix doesn't apply to const and static declarations. I tried
adding these cases to the match expression, but that created a much
wider change to tests and error messages, so I left it off until I
could get some code review to validate the approach.

4 years agoWhen a URL hash refers to a hidden element, it makes the element visible
Guillaume Gomez [Tue, 5 Nov 2019 16:41:40 +0000 (17:41 +0100)]
When a URL hash refers to a hidden element, it makes the element visible

4 years ago--bless
Ralf Jung [Wed, 6 Nov 2019 08:52:11 +0000 (09:52 +0100)]
--bless

4 years agoimprove a comment
Ralf Jung [Wed, 6 Nov 2019 07:45:50 +0000 (08:45 +0100)]
improve a comment

4 years agoremvoe to_scalar_ptr and use ref_to_mplace everywhere
Ralf Jung [Wed, 6 Nov 2019 07:44:15 +0000 (08:44 +0100)]
remvoe to_scalar_ptr and use ref_to_mplace everywhere

4 years agomiri cast: avoid unnecessary to_scalar_ptr
Ralf Jung [Tue, 5 Nov 2019 22:04:17 +0000 (23:04 +0100)]
miri cast: avoid unnecessary to_scalar_ptr

4 years agoUpdate local.rs
3442853561 [Wed, 6 Nov 2019 08:39:48 +0000 (16:39 +0800)]
Update local.rs

Removed parameters not used in the macro

4 years agoFix the Error linking.
Pyry Kontio [Wed, 6 Nov 2019 07:57:59 +0000 (16:57 +0900)]
Fix the Error linking.

4 years agogate rustc_on_unimplemented under rustc_attrs
Mazdak Farrokhzad [Fri, 25 Oct 2019 05:19:07 +0000 (07:19 +0200)]
gate rustc_on_unimplemented under rustc_attrs

4 years agoAuto merge of #66143 - Centril:rollup-qmzuex0, r=Centril
bors [Wed, 6 Nov 2019 06:14:03 +0000 (06:14 +0000)]
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

4 years agoRollup merge of #66139 - euclio:pluralize, r=nagisa
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:14 +0000 (07:03 +0100)]
Rollup merge of #66139 - euclio:pluralize, r=nagisa

use American spelling for `pluralize!`

4 years agoRollup merge of #66133 - alexcrichton:update-wasi-libc, r=Mark-Simulacrum
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:12 +0000 (07:03 +0100)]
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.

4 years agoRollup merge of #66103 - smaeul:patch/thumb-musl, r=nagisa
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:11 +0000 (07:03 +0100)]
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.

4 years agoRollup merge of #66092 - niacat:master, r=nagisa
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:09 +0000 (07:03 +0100)]
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

4 years agoRollup merge of #66086 - RalfJung:smallvec, r=nagisa
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:08 +0000 (07:03 +0100)]
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

4 years agoRollup merge of #66062 - smaeul:patch/pic-level, r=estebank
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:06 +0000 (07:03 +0100)]
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.

4 years agoRollup merge of #66015 - popzxc:refactor-librustc_parser, r=matklad
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:05 +0000 (07:03 +0100)]
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

4 years agoRollup merge of #65973 - eddyb:caller-location-panic, r=petrochenkov
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:03 +0000 (07:03 +0100)]
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

4 years agoRollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, r=estebank
Mazdak Farrokhzad [Wed, 6 Nov 2019 06:03:01 +0000 (07:03 +0100)]
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

4 years agoAddressed review comments.
Pyry Kontio [Wed, 6 Nov 2019 05:47:52 +0000 (14:47 +0900)]
Addressed review comments.

4 years agoAuto merge of #66141 - Centril:rollup-n2fcvp9, r=Centril
bors [Wed, 6 Nov 2019 02:29:21 +0000 (02:29 +0000)]
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

4 years agoRollup merge of #66115 - eddyb:global-meta-what, r=michaelwoerister
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:20 +0000 (03:28 +0100)]
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

4 years agoRollup merge of #66106 - JOE1994:master, r=GuillaumeGomez
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:19 +0000 (03:28 +0100)]
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`

4 years agoRollup merge of #66101 - estebank:break-tail-e0308, r=Centril
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:17 +0000 (03:28 +0100)]
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.

4 years agoRollup merge of #66098 - estebank:path-asciption-typo, r=Centril
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:15 +0000 (03:28 +0100)]
Rollup merge of #66098 - estebank:path-asciption-typo, r=Centril

Detect `::` -> `:` typo when involving turbofish

Fix #65569.

4 years agoRollup merge of #66093 - estebank:fmt-ice, r=Centril
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:14 +0000 (03:28 +0100)]
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.

4 years agoRollup merge of #66081 - RalfJung:ptr-offset, r=zackmdavis
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:12 +0000 (03:28 +0100)]
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

4 years agoRollup merge of #66068 - euclio:null-emitter, r=estebank
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:11 +0000 (03:28 +0100)]
Rollup merge of #66068 - euclio:null-emitter, r=estebank

use silent emitter for rustdoc highlighting pass

Partially addresses #63284.

4 years agoRollup merge of #66054 - petrochenkov:delspan, r=estebank
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:09 +0000 (03:28 +0100)]
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

4 years agoRollup merge of #66027 - Mark-Simulacrum:panic-handler-query, r=alexcrichton
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:08 +0000 (03:28 +0100)]
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.

4 years agoRollup merge of #66014 - dkadashev:47319-type-param-def-location, r=estebank
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:06 +0000 (03:28 +0100)]
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

4 years agoRollup merge of #65892 - pnkfelix:trim-special-derives, r=petrochenkov
Mazdak Farrokhzad [Wed, 6 Nov 2019 02:28:05 +0000 (03:28 +0100)]
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` .

4 years agoFix C aggregate-passing ABI on powerpc
Samuel Holland [Thu, 5 Sep 2019 01:40:18 +0000 (20:40 -0500)]
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).

4 years agoApply review suggestions
Tomasz Miąsko [Wed, 6 Nov 2019 00:00:00 +0000 (00:00 +0000)]
Apply review suggestions

4 years agoUse source_callee().is_some() to detect macros
Pi Lanningham [Tue, 5 Nov 2019 23:49:46 +0000 (23:49 +0000)]
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

4 years agoTweak type mismatch caused by break on tail expr
Esteban Küber [Tue, 5 Nov 2019 02:47:02 +0000 (18:47 -0800)]
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.

4 years agoProvide structured suggestions for valid formatting descriptors
Esteban Küber [Tue, 5 Nov 2019 20:08:22 +0000 (12:08 -0800)]
Provide structured suggestions for valid formatting descriptors

4 years agoPoint at formatting descriptor string when it is invalid
Esteban Küber [Tue, 5 Nov 2019 19:55:00 +0000 (11:55 -0800)]
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
```

4 years agoFixed libcore/cell.rs example
Oleg Nosov [Tue, 5 Nov 2019 22:03:31 +0000 (01:03 +0300)]
Fixed libcore/cell.rs example

4 years agoApply suggestions from code review
Ralf Jung [Tue, 5 Nov 2019 20:50:55 +0000 (21:50 +0100)]
Apply suggestions from code review

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoReverted PhantomData in LinkedList, fixed PhantomData markers in Rc and Arc
Oleg Nosov [Tue, 5 Nov 2019 20:34:54 +0000 (23:34 +0300)]
Reverted PhantomData in LinkedList, fixed PhantomData markers in Rc and Arc

4 years agoAuto merge of #66121 - pietroalbini:rollup-8zrwe7l, r=pietroalbini
bors [Tue, 5 Nov 2019 20:22:27 +0000 (20:22 +0000)]
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

4 years agouse American spelling for `pluralize!`
Andy Russell [Tue, 5 Nov 2019 20:10:24 +0000 (15:10 -0500)]
use American spelling for `pluralize!`

4 years agoUpdate the bundled `wasi-libc` repository
Alex Crichton [Tue, 5 Nov 2019 19:49:23 +0000 (11:49 -0800)]
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.

4 years agoDo not ICE whith a precision flag in formatting str and no format arguments
Esteban Küber [Mon, 4 Nov 2019 18:57:41 +0000 (10:57 -0800)]
Do not ICE whith a precision flag in formatting str and no format arguments

4 years agorustc: remove "GlobalMetaData" dead code from hir::map::definitions.
Eduard-Mihai Burtescu [Tue, 5 Nov 2019 11:49:36 +0000 (13:49 +0200)]
rustc: remove "GlobalMetaData" dead code from hir::map::definitions.

4 years agoAccount for typo in turbofish and suggest `::`
Esteban Küber [Tue, 5 Nov 2019 18:29:54 +0000 (10:29 -0800)]
Account for typo in turbofish and suggest `::`

4 years agoDetect if item.span is in a macro, and fall back
Pi Lanningham [Tue, 5 Nov 2019 15:42:34 +0000 (15:42 +0000)]
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.

4 years agoReview feedback: alpha-rename field from `copy_derives` to `containers_derving_copy`.
Felix S. Klock II [Mon, 4 Nov 2019 09:09:58 +0000 (10:09 +0100)]
Review feedback: alpha-rename field from `copy_derives` to `containers_derving_copy`.

4 years agoReview feedback: Remove more stuff! Simplify simplify simplify!
Felix S. Klock II [Wed, 30 Oct 2019 10:13:00 +0000 (11:13 +0100)]
Review feedback: Remove more stuff! Simplify simplify simplify!

4 years agoRemove `PartialEq` and `Eq` from the `SpecialDerives`.
Felix S. Klock II [Mon, 28 Oct 2019 11:40:12 +0000 (12:40 +0100)]
Remove `PartialEq` and `Eq` from the `SpecialDerives`.

4 years agoRollup merge of #66091 - Wind-River:master_xyz, r=cramertj
Pietro Albini [Tue, 5 Nov 2019 13:37:08 +0000 (14:37 +0100)]
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.

4 years agoRollup merge of #66082 - GuillaumeGomez:cleanup-highlightsourcelines, r=kinnison
Pietro Albini [Tue, 5 Nov 2019 13:37:07 +0000 (14:37 +0100)]
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