]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #60794 - Centril:rollup-vlguvns, r=Centril
bors [Tue, 14 May 2019 03:09:46 +0000 (03:09 +0000)]
Auto merge of #60794 - Centril:rollup-vlguvns, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #60176 (Explain error when yielding a reference to a local variable)
 - #60201 (coretest: Downgrade deny to warn)
 - #60562 (Add #[doc(hidden)] attribute on compiler generated module.)
 - #60710 (Use `delay_span_bug` for error cases when checking `AnonConst` parent)
 - #60770 (add impl_trait_in_bindings to INCOMPLETE_FEATURES)

Failed merges:

r? @ghost

5 years agoRollup merge of #60770 - Pulkit07:issue60764, r=Centril
Mazdak Farrokhzad [Mon, 13 May 2019 19:36:55 +0000 (21:36 +0200)]
Rollup merge of #60770 - Pulkit07:issue60764, r=Centril

add impl_trait_in_bindings to INCOMPLETE_FEATURES

impl_trait_in_bindings is not yet complete and can lead to compiler crashes.

Fixes #60764.

5 years agoRollup merge of #60710 - varkor:delay_span_bug-const-parent, r=matthewjasper
Mazdak Farrokhzad [Mon, 13 May 2019 19:36:54 +0000 (21:36 +0200)]
Rollup merge of #60710 - varkor:delay_span_bug-const-parent, r=matthewjasper

Use `delay_span_bug` for error cases when checking `AnonConst` parent

Fixes #60704.
Fixes #60650.

5 years agoRollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichton
Mazdak Farrokhzad [Mon, 13 May 2019 19:36:52 +0000 (21:36 +0200)]
Rollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichton

Add #[doc(hidden)] attribute on compiler generated module.

Resolves unavoidable `missing_docs` warning/error on proc-macro crates.
Resolves #42008.

Changes not yet tested locally, however I wanted to submit first since `rustc` takes forever to compile.

5 years agoRollup merge of #60201 - RalfJung:core-tests, r=alexcrichton
Mazdak Farrokhzad [Mon, 13 May 2019 19:36:51 +0000 (21:36 +0200)]
Rollup merge of #60201 - RalfJung:core-tests, r=alexcrichton

coretest: Downgrade deny to warn

The `deny` causes a build failure in https://github.com/RalfJung/miri-test-libstd. Since we use `-D warnings` for rustc builds, `warn` should be enough to lead to compile errors here, without impeding external builds.

5 years agoRollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelix
Mazdak Farrokhzad [Mon, 13 May 2019 19:36:49 +0000 (21:36 +0200)]
Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelix

Explain error when yielding a reference to a local variable

Closes #56508

5 years agoadd impl_trait_in_bindings to INCOMPLETE_FEATURES
Pulkit Goyal [Sun, 12 May 2019 21:37:05 +0000 (00:37 +0300)]
add impl_trait_in_bindings to INCOMPLETE_FEATURES

impl_trait_in_bindings is not yet complete and can lead to compiler crashes.

Fixes #60764.

5 years agoAuto merge of #60649 - Xanewok:save-analysis-assoc-const-ice, r=oli-obk
bors [Mon, 13 May 2019 10:57:59 +0000 (10:57 +0000)]
Auto merge of #60649 - Xanewok:save-analysis-assoc-const-ice, r=oli-obk

save-analysis: Fix ICE when processing associated constant

Closes #59134
Closes https://github.com/rust-lang/rls/issues/1449

Thanks @swgillespie for helping tracking this down and fixing it!

r? @eddyb

5 years agoAuto merge of #60765 - matthewjasper:fix-more-escaping-rescopes, r=oli-obk
bors [Mon, 13 May 2019 08:13:01 +0000 (08:13 +0000)]
Auto merge of #60765 - matthewjasper:fix-more-escaping-rescopes, r=oli-obk

Fix more escaping ReScopes

Closes #58840

5 years agoAuto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov
bors [Mon, 13 May 2019 00:28:38 +0000 (00:28 +0000)]
Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov

Use `Symbol` more

A `Symbol` can be equated with a string (e.g. `&str`). This involves a
TLS lookup to get the chars (and a Mutex lock in a parallel compiler)
and then a char-by-char comparison. This functionality is convenient but
avoids one of the main benefits of `Symbol`s, which is fast equality
comparisons.

This PR removes the `Symbol`/string equality operations, forcing a lot
of existing string occurrences to become `Symbol`s. Fortunately, these
are almost all static strings (many are attribute names) and we can add
static `Symbol`s as necessary, and very little extra interning occurs.
The benefits are (a) a slight speedup (possibly greater in a parallel
compiler), and (b) the code is a lot more principled about `Symbol` use.
The main downside is verbosity, particularly with more `use
syntax::symbol::symbols` items.

r? @Zoxc

5 years agoReturn a `Symbol` from `name_or_empty` functions.
Nicholas Nethercote [Wed, 8 May 2019 04:33:06 +0000 (14:33 +1000)]
Return a `Symbol` from `name_or_empty` functions.

5 years agoRemove the equality operation between `Symbol` and strings.
Nicholas Nethercote [Tue, 7 May 2019 06:03:44 +0000 (16:03 +1000)]
Remove the equality operation between `Symbol` and strings.

And also the equality between `Path` and strings, because `Path` is made
up of `Symbol`s.

5 years agoPass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.
Nicholas Nethercote [Wed, 8 May 2019 03:21:18 +0000 (13:21 +1000)]
Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.

5 years agoRename `syntax::symbol::symbols` as `syntax::symbol::sym`.
Nicholas Nethercote [Thu, 9 May 2019 23:57:08 +0000 (09:57 +1000)]
Rename `syntax::symbol::symbols` as `syntax::symbol::sym`.

Because it's going to be used a lot.

5 years agoAdd lots of static `Symbols`.
Nicholas Nethercote [Mon, 6 May 2019 23:55:12 +0000 (09:55 +1000)]
Add lots of static `Symbols`.

These will be used in the subsequent commits. Many of them are
attributes.

The commit also adds the ability to handle symbols that aren't
identifiers (e.g. "proc-macro").

5 years agoAuto merge of #60767 - Centril:rollup-4cbsb73, r=Centril
bors [Sun, 12 May 2019 20:28:19 +0000 (20:28 +0000)]
Auto merge of #60767 - Centril:rollup-4cbsb73, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #60694 (Fix HIR printing of existential type #60662)
 - #60750 (syntax: Remove some legacy nonterminal tokens)
 - #60751 (Assorted cleanup in parser & AST validation)
 - #60752 (Fix minor typos for ItemLocalId)

Failed merges:

r? @ghost

5 years agoRollup merge of #60752 - shiatsumat:minor-typos-hir, r=wesleywiser
Mazdak Farrokhzad [Sun, 12 May 2019 19:14:11 +0000 (21:14 +0200)]
Rollup merge of #60752 - shiatsumat:minor-typos-hir, r=wesleywiser

Fix minor typos for ItemLocalId

* added comma after 'that is'
* "can be implement" -> "can be implemented"

5 years agoRollup merge of #60751 - Centril:general-cleanup, r=petrochenkov
Mazdak Farrokhzad [Sun, 12 May 2019 19:14:10 +0000 (21:14 +0200)]
Rollup merge of #60751 - Centril:general-cleanup, r=petrochenkov

Assorted cleanup in parser & AST validation

r? @petrochenkov

Extracted out of a larger PR.

5 years agoRollup merge of #60750 - petrochenkov:noquotok2, r=Mark-Simulacrum
Mazdak Farrokhzad [Sun, 12 May 2019 19:14:08 +0000 (21:14 +0200)]
Rollup merge of #60750 - petrochenkov:noquotok2, r=Mark-Simulacrum

syntax: Remove some legacy nonterminal tokens

They were used by legacy quote macros removed in https://github.com/rust-lang/rust/pull/51285.

5 years agoRollup merge of #60694 - Pulkit07:issue60662, r=alexreg
Mazdak Farrokhzad [Sun, 12 May 2019 19:14:07 +0000 (21:14 +0200)]
Rollup merge of #60694 - Pulkit07:issue60662, r=alexreg

Fix HIR printing of existential type #60662

This fixes https://github.com/rust-lang/rust/issues/60662

5 years agoDon't allow any ReScope in impl trait types
Matthew Jasper [Sun, 12 May 2019 17:51:40 +0000 (18:51 +0100)]
Don't allow any ReScope in impl trait types

This shouldn't be possible any more, but if it does happen, emit an
error rather than maybe panicking later when NLL finds a the ReScope.
Impl trait in bindings is sufficiently broken that I don't think this
breaks anything that works for it.

5 years agoAuto merge of #60679 - petrochenkov:lit2, r=matklad
bors [Sun, 12 May 2019 17:44:06 +0000 (17:44 +0000)]
Auto merge of #60679 - petrochenkov:lit2, r=matklad

Keep original literal tokens in AST

The original literal tokens (`token::Lit`) are kept in AST until lowering to HIR.

The tokens are kept together with their lowered "semantic" representation (`ast::LitKind`), so the size of `ast::Lit` is increased (this also increases the size of meta-item structs used for processing built-in attributes).
However, the size of `ast::Expr` stays the same.

The intent is to remove the "semantic" representation from AST eventually and keep literals as tokens until lowering to HIR (at least), and I'm going to work on that, but it would be good to land this sooner to unblock progress on the [lexer refactoring](https://github.com/rust-lang/rust/pull/59706).

Fixes a part of https://github.com/rust-lang/rust/issues/43081 (literal tokens that are passed to proc macros are always precise, including hexadecimal numbers, strings with their original escaping, etc)
Fixes a part of https://github.com/rust-lang/rust/issues/60495 (everything except for proc macro API doesn't need escaping anymore)
This also allows to eliminate a certain hack from the lexer (https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/pretty-printing.20comments/near/165005357).

cc @matklad

5 years agoTreat generators the same as closure for escaping lifetimes
Matthew Jasper [Sun, 12 May 2019 16:52:33 +0000 (17:52 +0100)]
Treat generators the same as closure for escaping lifetimes

5 years agoAlways use the stronger outlives version for opaque types
Matthew Jasper [Sun, 12 May 2019 16:12:49 +0000 (17:12 +0100)]
Always use the stronger outlives version for opaque types

5 years agoAuto merge of #60244 - SimonSapin:dangling, r=oli-obk
bors [Sun, 12 May 2019 14:32:11 +0000 (14:32 +0000)]
Auto merge of #60244 - SimonSapin:dangling, r=oli-obk

const-stabilize NonNull::dangling and NonNull::cast

5 years agoAuto merge of #60474 - mati865:musl_toolchain, r=alexcrichton
bors [Sun, 12 May 2019 09:19:28 +0000 (09:19 +0000)]
Auto merge of #60474 - mati865:musl_toolchain, r=alexcrichton

 Make tests compatible with musl host

As an alternative to passing explicit linker all over the place I could try linking `cc` to musl gcc since this bootstraps itself.

Assigning for discussion:
r? @alexcrichton

5 years agoAuto merge of #60396 - cuviper:ordered-retain, r=scottmcm
bors [Sun, 12 May 2019 06:24:10 +0000 (06:24 +0000)]
Auto merge of #60396 - cuviper:ordered-retain, r=scottmcm

Document the order of {Vec,VecDeque,String}::retain

It's natural for `retain` to work in order from beginning to end, but
this wasn't actually documented to be the case. If we actually promise
this, then the caller can do useful things like track the index of each
element being tested, as [discussed in the forum][1]. This is now
documented for `Vec`, `VecDeque`, and `String`.

[1]: https://users.rust-lang.org/t/vec-retain-by-index/27697

`HashMap` and `HashSet` also have `retain`, and the `hashbrown`
implementation does happen to use a plain `iter()` order too, but it's
not certain that this should always be the case for these types.

r? @scottmcm

5 years agoFix minor typos for ItemLocalId
Yusuke Matsushita [Sun, 12 May 2019 00:52:38 +0000 (09:52 +0900)]
Fix minor typos for ItemLocalId

* added comma before 'that is'
* "can be implement" -> "can be implemented"

5 years agoMinor cleanup in parse_assoc_expr_with.
Mazdak Farrokhzad [Sun, 12 May 2019 00:17:34 +0000 (02:17 +0200)]
Minor cleanup in parse_assoc_expr_with.

5 years agoparse_bottom_expr: extract common 'return' out.
Mazdak Farrokhzad [Sun, 12 May 2019 00:01:32 +0000 (02:01 +0200)]
parse_bottom_expr: extract common 'return' out.

5 years agosyntax::parse::parser: convert unnecessary '&mut self's to '&self'.
Mazdak Farrokhzad [Sun, 12 May 2019 00:00:06 +0000 (02:00 +0200)]
syntax::parse::parser: convert unnecessary '&mut self's to '&self'.

5 years agoast_validation: comments -> doc comments
Mazdak Farrokhzad [Sun, 5 May 2019 12:06:04 +0000 (14:06 +0200)]
ast_validation: comments -> doc comments

5 years agosyntax: Remove some legacy nonterminal tokens
Vadim Petrochenkov [Sat, 11 May 2019 19:44:33 +0000 (22:44 +0300)]
syntax: Remove some legacy nonterminal tokens

5 years agoFix HIR printing of existential type #60662
Pulkit Goyal [Thu, 9 May 2019 18:32:33 +0000 (21:32 +0300)]
Fix HIR printing of existential type #60662

This fixes https://github.com/rust-lang/rust/issues/60662

5 years agoAuto merge of #60748 - Centril:rollup-rr63jqo, r=Centril
bors [Sat, 11 May 2019 22:13:10 +0000 (22:13 +0000)]
Auto merge of #60748 - Centril:rollup-rr63jqo, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #60720 (Remove unnecessary unwraps)
 - #60727 (add comment to `Rc`/`Arc`'s `Eq` specialization)
 - #60733 (Cleanup the .await HIR lowering with .stmt(..).)
 - #60741 (Remove redundant "let mut" in write_graph_label)

Failed merges:

r? @ghost

5 years agoRollup merge of #60741 - shiatsumat:patch-let-mut-write-graph-label, r=varkor
Mazdak Farrokhzad [Sat, 11 May 2019 21:41:41 +0000 (23:41 +0200)]
Rollup merge of #60741 - shiatsumat:patch-let-mut-write-graph-label, r=varkor

Remove redundant "let mut" in write_graph_label

Removed the redundant "let mut" in the write_graph_label function (it caused "let mut let mut" for non-user-defined local variables).

5 years agoRollup merge of #60733 - Centril:cleanup-lowering-await, r=varkor
Mazdak Farrokhzad [Sat, 11 May 2019 21:41:40 +0000 (23:41 +0200)]
Rollup merge of #60733 - Centril:cleanup-lowering-await, r=varkor

Cleanup the .await HIR lowering with .stmt(..).

r? @cramertj

5 years agoRollup merge of #60727 - chpio:master, r=sfackler
Mazdak Farrokhzad [Sat, 11 May 2019 21:41:38 +0000 (23:41 +0200)]
Rollup merge of #60727 - chpio:master, r=sfackler

add comment to `Rc`/`Arc`'s `Eq` specialization

in addition to https://github.com/rust-lang/rust/pull/56550

https://github.com/rust-lang/rust/pull/42965#issuecomment-312702479

5 years agoRollup merge of #60720 - estebank:no-ice-thanks, r=zackmdavis
Mazdak Farrokhzad [Sat, 11 May 2019 21:41:37 +0000 (23:41 +0200)]
Rollup merge of #60720 - estebank:no-ice-thanks, r=zackmdavis

Remove unnecessary unwraps

Fix #60713.

5 years agoAuto merge of #60318 - jethrogb:jb/try-from-slice-to-infallible, r=sfackler
bors [Sat, 11 May 2019 19:13:12 +0000 (19:13 +0000)]
Auto merge of #60318 - jethrogb:jb/try-from-slice-to-infallible, r=sfackler

impl From<Infallible> for TryFromSliceError

I believe this was missed when TryFrom was stabilized. I think `TryFromSliceError` and `TryFromIntError` are the only two `TryFrom` error types that appear in `std`. I think trait implementations have to be insta-stable, but I'm not sure.

5 years agoAdd #[doc(hidden)] attribute on compiler generated proc-macro module.
Mike Boutin [Sun, 5 May 2019 14:25:01 +0000 (10:25 -0400)]
Add #[doc(hidden)] attribute on compiler generated proc-macro module.

Stops unavoidable `missing_docs` warning/error on proc-macro crates.
Resolves #42008.

5 years agoRemove redundant "let mut" in write_graph_label
Yusuke Matsushita [Sat, 11 May 2019 16:47:20 +0000 (01:47 +0900)]
Remove redundant "let mut" in write_graph_label

Removed the redundant "let mut" in the write_graph_label function (it caused "let mut let mut" for non-user-defined local variables).

5 years agoAuto merge of #60739 - Manishearth:clippyup, r=Manishearth
bors [Sat, 11 May 2019 16:26:12 +0000 (16:26 +0000)]
Auto merge of #60739 - Manishearth:clippyup, r=Manishearth

Update clippy

r? @ghost

5 years agoUpdate clippy
Manish Goregaokar [Sat, 11 May 2019 15:56:38 +0000 (08:56 -0700)]
Update clippy

5 years agoAddress comments + Fix tests
Vadim Petrochenkov [Sat, 11 May 2019 13:03:27 +0000 (16:03 +0300)]
Address comments + Fix tests

5 years agoCleanup the .await HIR lowering with .stmt(..).
Mazdak Farrokhzad [Sat, 11 May 2019 13:42:14 +0000 (15:42 +0200)]
Cleanup the .await HIR lowering with .stmt(..).

5 years agoMove literal parsing code into a separate file
Vadim Petrochenkov [Fri, 10 May 2019 23:31:34 +0000 (02:31 +0300)]
Move literal parsing code into a separate file

Remove some dead code

5 years agoAuto merge of #60714 - varkor:existential-global-lift-ice, r=oli-obk
bors [Sat, 11 May 2019 12:25:11 +0000 (12:25 +0000)]
Auto merge of #60714 - varkor:existential-global-lift-ice, r=oli-obk

Fix ICE with un-feature-gated existential type

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

r? @oli-obk

5 years agoSimplify conversions between tokens and semantic literals
Vadim Petrochenkov [Fri, 10 May 2019 00:00:51 +0000 (03:00 +0300)]
Simplify conversions between tokens and semantic literals

5 years agoEliminate `comments::Literal`
Vadim Petrochenkov [Thu, 9 May 2019 16:04:04 +0000 (19:04 +0300)]
Eliminate `comments::Literal`

5 years agoIntroduce `hir::Lit` not keeping the original token
Vadim Petrochenkov [Thu, 9 May 2019 15:04:24 +0000 (18:04 +0300)]
Introduce `hir::Lit` not keeping the original token

5 years agoKeep the original token in `ast::Lit`
Vadim Petrochenkov [Wed, 8 May 2019 23:17:32 +0000 (02:17 +0300)]
Keep the original token in `ast::Lit`

5 years agoTurn `ast::Lit` into a struct
Vadim Petrochenkov [Wed, 8 May 2019 23:00:29 +0000 (02:00 +0300)]
Turn `ast::Lit` into a struct

5 years agoAuto merge of #60717 - varkor:impl-const-generic, r=matthewjasper
bors [Sat, 11 May 2019 09:24:45 +0000 (09:24 +0000)]
Auto merge of #60717 - varkor:impl-const-generic, r=matthewjasper

Fix a bug preventing const parameters from being used in const generic impls

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

5 years agoadd comment to `Rc`/`Arc`'s `Eq` specialization
Thomas Heck [Sat, 11 May 2019 08:23:07 +0000 (10:23 +0200)]
add comment to `Rc`/`Arc`'s `Eq` specialization

5 years agoAuto merge of #60700 - petrochenkov:preintern, r=nnethercote
bors [Sat, 11 May 2019 06:42:36 +0000 (06:42 +0000)]
Auto merge of #60700 - petrochenkov:preintern, r=nnethercote

syntax_pos: Optimize symbol interner pre-filling slightly

r? @nnethercote

5 years agoAuto merge of #60721 - estebank:ice-ice-baby, r=varkor
bors [Sat, 11 May 2019 03:56:11 +0000 (03:56 +0000)]
Auto merge of #60721 - estebank:ice-ice-baby, r=varkor

Avoid ICE by using delay_span_bug

Fix #59406, fix #53498.

5 years agoAvoid ICE by using delay_span_bug
Esteban Küber [Sat, 11 May 2019 01:22:25 +0000 (18:22 -0700)]
Avoid ICE by using delay_span_bug

5 years agoAdd examples of ordered retain
Josh Stone [Sat, 11 May 2019 01:01:50 +0000 (18:01 -0700)]
Add examples of ordered retain

5 years agoRemove unnecessary unwraps
Esteban Küber [Fri, 10 May 2019 23:57:03 +0000 (16:57 -0700)]
Remove unnecessary unwraps

5 years agoAdd test for const impl
varkor [Fri, 10 May 2019 23:08:40 +0000 (00:08 +0100)]
Add test for const impl

5 years agoUnwrap singleton block expressions in const arguments
varkor [Fri, 10 May 2019 23:08:19 +0000 (00:08 +0100)]
Unwrap singleton block expressions in const arguments

5 years agoAuto merge of #59288 - Centril:hir-if-to-match, r=oli-obk
bors [Fri, 10 May 2019 22:58:52 +0000 (22:58 +0000)]
Auto merge of #59288 - Centril:hir-if-to-match, r=oli-obk

[let_chains, 1/6] Remove hir::ExprKind::If

Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239.

r? @oli-obk

5 years agoAdd test
varkor [Fri, 10 May 2019 21:11:19 +0000 (22:11 +0100)]
Add test

5 years agoAllow fallible `lift_to_global` in existential type writeback
varkor [Fri, 10 May 2019 21:06:03 +0000 (22:06 +0100)]
Allow fallible `lift_to_global` in existential type writeback

5 years agoAuto merge of #60708 - Centril:rollup-j5smdo0, r=Centril
bors [Fri, 10 May 2019 19:56:15 +0000 (19:56 +0000)]
Auto merge of #60708 - Centril:rollup-j5smdo0, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #60529 (RFC 2008: Uninhabitedness fixes for enum variants and tests)
 - #60620 (Fix a couple of FIXMEs in ext::tt::transcribe)
 - #60659 (Tweak `Symbol` and `InternedString`)
 - #60692 (Extend #60676 test for nested mut patterns.)
 - #60697 (add regression test for #60629)
 - #60701 (Update mailmap for mati865)

Failed merges:

r? @ghost

5 years agoAdd a test for failed inference of const types
varkor [Fri, 10 May 2019 19:53:46 +0000 (20:53 +0100)]
Add a test for failed inference of const types

5 years agoAdd a test for invalid const arguments
varkor [Fri, 10 May 2019 19:53:35 +0000 (20:53 +0100)]
Add a test for invalid const arguments

5 years agoMake const parent errors delay_span_bugs
varkor [Fri, 10 May 2019 19:53:21 +0000 (20:53 +0100)]
Make const parent errors delay_span_bugs

5 years agoRollup merge of #60701 - mati865:mailmap, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 10 May 2019 18:31:13 +0000 (20:31 +0200)]
Rollup merge of #60701 - mati865:mailmap, r=Mark-Simulacrum

Update mailmap for mati865

5 years agoRollup merge of #60697 - hellow554:fix_60629, r=michaelwoerister
Mazdak Farrokhzad [Fri, 10 May 2019 18:31:11 +0000 (20:31 +0200)]
Rollup merge of #60697 - hellow554:fix_60629, r=michaelwoerister

add regression test for #60629

This bug was fixed, but I don't know which one. (I think it even doesn't matter at all).

Added a regression test.

```
op@OP ~/m/r/s/t/incremental> rustc --version
rustc 1.35.0-nightly (acd8dd6a5 2019-04-05)
op@OP ~/m/r/s/t/incremental> rustc -C incremental= --cfg rpass1 issue-60629.rs
warning: struct is never constructed: `A`
 --> issue-60629.rs:3:1
  |
3 | struct A;
  | ^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

op@OP ~/m/r/s/t/incremental> rustc -C incremental= --cfg rpass2 issue-60629.rs
error: internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[c27c]::ops[0]::drop[0]::Drop[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:635:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.35.0-nightly (acd8dd6a5 2019-04-05) running on x86_64-unknown-linux-gnu

note: compiler flags: -C incremental
```

with latest nightly it does not crash anymore, so nothing more to do.

Fixes #60629

(accidentally removed the remote branch on github, therefore GH closed the other PR.)

r? @nikomatsakis

5 years agoRollup merge of #60692 - davidtwco:pr-60676-followup, r=Centril
Mazdak Farrokhzad [Fri, 10 May 2019 18:31:10 +0000 (20:31 +0200)]
Rollup merge of #60692 - davidtwco:pr-60676-followup, r=Centril

Extend #60676 test for nested mut patterns.

At request of @centril, this commit extends the existing test added by #60676 to include nested `mut` patterns.

cc @Centril

5 years agoRollup merge of #60659 - nnethercote:tweak-Symbol-and-InternedString, r=Zoxc
Mazdak Farrokhzad [Fri, 10 May 2019 18:31:09 +0000 (20:31 +0200)]
Rollup merge of #60659 - nnethercote:tweak-Symbol-and-InternedString, r=Zoxc

Tweak `Symbol` and `InternedString`

Some minor improvements to speed and code cleanliness.

r? @Zoxc

5 years agoRollup merge of #60620 - mark-i-m:transcribe-2, r=petrochenkov
Mazdak Farrokhzad [Fri, 10 May 2019 18:31:07 +0000 (20:31 +0200)]
Rollup merge of #60620 - mark-i-m:transcribe-2, r=petrochenkov

Fix a couple of FIXMEs in ext::tt::transcribe

_Blocked on #60618_

A crater run would be nice to make sure my understanding is correct. A quick google search seems to indicate these are extremely rare errors if they are possible (which I don't believe they are).

r? @petrochenkov

cc #2887 (there is only one FIXME left and it is hygiene-related)

5 years agoRollup merge of #60529 - davidtwco:rfc-2008-uninhabited, r=petrochenkov
Mazdak Farrokhzad [Fri, 10 May 2019 18:31:06 +0000 (20:31 +0200)]
Rollup merge of #60529 - davidtwco:rfc-2008-uninhabited, r=petrochenkov

RFC 2008: Uninhabitedness fixes for enum variants and tests

Part of #44109.

At the request of @Centril, this PR adds tests asserting that uninhabited non-exhaustive types are considered inhabited in extern crates. In adding these tests, I fixed an oversight in the implementation of RFC 2008 on enum variants that resulted in non-exhaustive enum variants being considered uninhabited in extern crates.

Before this PR, these lines would error:

```rust
// extern crate
pub enum UninhabitedVariants {
    #[non_exhaustive] Tuple(!),
    #[non_exhaustive] Struct { x: ! }
}

pub enum PartiallyInhabitedVariants {
    Tuple(u8),
    #[non_exhaustive] Struct { x: ! }
}

// current crate
match uninhabited_variant() /* fn() -> Option<UninhabitedVariants> */ {
    Some(_x) => (), //~ ERROR unreachable pattern
    None => (),
}

while let PartiallyInhabitedVariants::Struct { x, .. } = partially_inhabited_variant() /* fn() -> PartiallyInhabitedVariants */ {
    //~^ ERROR unreachable pattern
}
```

cc @Centril
r? @petrochenkov

5 years agocheck_match: add FIXME for removing of hack.
Mazdak Farrokhzad [Fri, 10 May 2019 17:55:52 +0000 (19:55 +0200)]
check_match: add FIXME for removing of hack.

5 years agoadd test checking that 'if cond { .. }' where 'cond: &mut? bool' isn't accepted.
Mazdak Farrokhzad [Thu, 25 Apr 2019 03:48:26 +0000 (05:48 +0200)]
add test checking that 'if cond { .. }' where 'cond: &mut? bool' isn't accepted.

5 years agoVarious test changes
Mazdak Farrokhzad [Tue, 19 Mar 2019 03:47:07 +0000 (04:47 +0100)]
Various test changes

5 years agoAdjust mir-opt tests for new HIR without If
Mazdak Farrokhzad [Wed, 24 Apr 2019 10:50:05 +0000 (12:50 +0200)]
Adjust mir-opt tests for new HIR without If

5 years agoRemove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.
Mazdak Farrokhzad [Mon, 11 Mar 2019 15:43:27 +0000 (16:43 +0100)]
Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.

5 years agoAdd a bunch more tests.
David Wood [Sat, 4 May 2019 11:07:04 +0000 (12:07 +0100)]
Add a bunch more tests.

5 years agoMove uninhabited tests into subdirectory.
David Wood [Sat, 4 May 2019 10:08:57 +0000 (11:08 +0100)]
Move uninhabited tests into subdirectory.

This commit just tries to tidy up a little.

5 years agoFix uninhabitedness of non-exhaustive enums.
David Wood [Sat, 4 May 2019 10:03:06 +0000 (11:03 +0100)]
Fix uninhabitedness of non-exhaustive enums.

This commit ensures that non-exhaustive enums are considered inhabited
when used in extern crates.

5 years agoFix inhabitedness of non-exhaustive variants.
David Wood [Sat, 4 May 2019 00:17:26 +0000 (01:17 +0100)]
Fix inhabitedness of non-exhaustive variants.

This commit ensures that non-exhaustive variants are considered
inhabited when used in extern crates.

5 years agoAdd uninhabitedness tests w/ `#[non_exhaustive]`.
David Wood [Sat, 4 May 2019 00:15:26 +0000 (01:15 +0100)]
Add uninhabitedness tests w/ `#[non_exhaustive]`.

This commit adds tests checking that uninhabited non-exhaustive types
are considered inhabited when used in another crate.

5 years agoAuto merge of #60588 - cuviper:be-simd-swap, r=alexcrichton
bors [Fri, 10 May 2019 15:29:40 +0000 (15:29 +0000)]
Auto merge of #60588 - cuviper:be-simd-swap, r=alexcrichton

Revert "Disable big-endian simd in swap_nonoverlapping_bytes"

This reverts commit 77bd4dc65406ba3cedbc779e6f6280868231912e (#43159).

Issue #42778 was formerly easy to reproduce on two big-endian targets,
`powerpc64` and `s390x`, so we disabled SIMD on this function for all
big-endian targets as a workaround.

I have re-tested this code on `powerpc64` and `s390x`, each with the
bundled LLVM 8 and with external LLVM 7 and LLVM 6, and the problems no
longer appear. So it seems safe to remove this workaround, although I'm
still a little uncomfortable that we never found a root-cause...

Closes #42778.
r? @arielb1

5 years agoturn a couple of fixmes into span_bugs
Mark Mansi [Tue, 7 May 2019 22:58:58 +0000 (17:58 -0500)]
turn a couple of fixmes into span_bugs

5 years agoUpdate mailmap for mati865
Mateusz Mikuła [Fri, 10 May 2019 14:47:25 +0000 (16:47 +0200)]
Update mailmap for mati865

5 years agoConditionally provide cc in musl-toolchain.sh
Mateusz Mikuła [Fri, 10 May 2019 14:12:32 +0000 (16:12 +0200)]
Conditionally provide cc in musl-toolchain.sh

5 years agoMake tests compatible with musl host
Mateusz Mikuła [Thu, 2 May 2019 15:22:14 +0000 (17:22 +0200)]
Make tests compatible with musl host

5 years agosyntax_pos: Optimize symbol interner pre-filling slightly
Vadim Petrochenkov [Fri, 10 May 2019 13:57:15 +0000 (16:57 +0300)]
syntax_pos: Optimize symbol interner pre-filling slightly

5 years agoadd regression test for #60629
Marcel Hellwig [Fri, 10 May 2019 10:02:31 +0000 (12:02 +0200)]
add regression test for #60629

5 years agoAuto merge of #60684 - jethrogb:jb/sgx-test, r=joshtriplett
bors [Fri, 10 May 2019 09:56:56 +0000 (09:56 +0000)]
Auto merge of #60684 - jethrogb:jb/sgx-test, r=joshtriplett

Fix cfg(test) build on SGX

Introduced in #60657

r? @joshtriplett

5 years agoExtend existing test for nested mut patterns.
David Wood [Fri, 10 May 2019 07:55:54 +0000 (08:55 +0100)]
Extend existing test for nested mut patterns.

At request of `@centril`, this commit extends the existing test added
by #60676 to include nested `mut` patterns.

5 years agoAuto merge of #60585 - sunfishcode:wasm32-wasi, r=alexcrichton
bors [Fri, 10 May 2019 07:02:38 +0000 (07:02 +0000)]
Auto merge of #60585 - sunfishcode:wasm32-wasi, r=alexcrichton

Omit the vendor component in the WASI triple

This renames wasm32-unknown-wasi to wasm32-wasi, omitting the vendor
component. This follows aarch64-linux-android, x86_64-fuchsia, and others in
omitting the vendor field, which has the advantage of aligning with the
[multiarch tuple](https://wiki.debian.org/Multiarch/Tuples), and of being
less noisy.

r? @alexcrichton

5 years agoReduce `Symbol`'s interface slightly.
Nicholas Nethercote [Thu, 9 May 2019 04:06:10 +0000 (14:06 +1000)]
Reduce `Symbol`'s interface slightly.

5 years agoRemove the `From<InternedString> for String` impl.
Nicholas Nethercote [Thu, 9 May 2019 02:14:30 +0000 (12:14 +1000)]
Remove the `From<InternedString> for String` impl.

It's not used.

5 years agoAdd various comments.
Nicholas Nethercote [Thu, 9 May 2019 02:09:57 +0000 (12:09 +1000)]
Add various comments.

Lots of details I wish I'd known when I first looked at this code.

5 years agoAvoid recursion in de-gensym functions.
Nicholas Nethercote [Thu, 9 May 2019 01:54:47 +0000 (11:54 +1000)]
Avoid recursion in de-gensym functions.

5 years agoAdd `InternedString::with2`.
Nicholas Nethercote [Thu, 9 May 2019 01:45:56 +0000 (11:45 +1000)]
Add `InternedString::with2`.

This lets comparisons occur with a single access to the interner,
instead of two.