Commit Graph

93539 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
5490cc1a41
Rollup merge of #60733 - Centril:cleanup-lowering-await, r=varkor
Cleanup the .await HIR lowering with .stmt(..).

r? @cramertj
2019-05-11 23:41:40 +02:00
Mazdak Farrokhzad
e19ad45107
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
2019-05-11 23:41:38 +02:00
Mazdak Farrokhzad
5da009e23a
Rollup merge of #60720 - estebank:no-ice-thanks, r=zackmdavis
Remove unnecessary unwraps

Fix #60713.
2019-05-11 23:41:37 +02:00
bors
af98304b9a 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.
2019-05-11 19:13:12 +00:00
Mike Boutin
5ccf2fb985 Add #[doc(hidden)] attribute on compiler generated proc-macro module.
Stops unavoidable `missing_docs` warning/error on proc-macro crates.
Resolves #42008.
2019-05-11 15:04:10 -04:00
Yusuke Matsushita
a145b14b3e
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).
2019-05-12 01:47:20 +09:00
bors
3103fb2f72 Auto merge of #60739 - Manishearth:clippyup, r=Manishearth
Update clippy

r? @ghost
2019-05-11 16:26:12 +00:00
Manish Goregaokar
d17713599c Update clippy 2019-05-11 09:02:12 -07:00
Vadim Petrochenkov
83ed781c01 Address comments + Fix tests 2019-05-11 17:06:55 +03:00
Mazdak Farrokhzad
362431b4d6 Cleanup the .await HIR lowering with .stmt(..). 2019-05-11 15:42:14 +02:00
Vadim Petrochenkov
3f064cae3d Move literal parsing code into a separate file
Remove some dead code
2019-05-11 16:03:16 +03:00
bors
5f1924c992 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
2019-05-11 12:25:11 +00:00
Vadim Petrochenkov
8739668438 Simplify conversions between tokens and semantic literals 2019-05-11 14:24:21 +03:00
Vadim Petrochenkov
a5b3f33cb9 Eliminate comments::Literal 2019-05-11 14:24:21 +03:00
Vadim Petrochenkov
751ae5af1a Introduce hir::Lit not keeping the original token 2019-05-11 14:24:21 +03:00
Vadim Petrochenkov
f2834a403a Keep the original token in ast::Lit 2019-05-11 14:24:21 +03:00
Vadim Petrochenkov
28b125b83d Turn ast::Lit into a struct 2019-05-11 14:24:21 +03:00
bors
af39a1fd73 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.
2019-05-11 09:24:45 +00:00
Thomas Heck
740a8dabb4 add comment to Rc/Arc's Eq specialization 2019-05-11 11:03:28 +02:00
bors
b8e0d0a2aa Auto merge of #60700 - petrochenkov:preintern, r=nnethercote
syntax_pos: Optimize symbol interner pre-filling slightly

r? @nnethercote
2019-05-11 06:42:36 +00:00
bors
7519eaca9a Auto merge of #60721 - estebank:ice-ice-baby, r=varkor
Avoid ICE by using delay_span_bug

Fix #59406, fix #53498.
2019-05-11 03:56:11 +00:00
Esteban Küber
adc18eb7cf Avoid ICE by using delay_span_bug 2019-05-10 18:22:25 -07:00
Josh Stone
0545375ca6 Add examples of ordered retain 2019-05-10 18:01:50 -07:00
Esteban Küber
c158a0f592 Remove unnecessary unwraps 2019-05-10 17:57:42 -07:00
varkor
bf3c46cfc9 Allow subdirectories to be tested by x.py test 2019-05-11 00:42:29 +01:00
varkor
b3207d531d Add test for const impl 2019-05-11 00:08:40 +01:00
varkor
0686daab4e Unwrap singleton block expressions in const arguments 2019-05-11 00:08:19 +01:00
bors
acc7e652f8 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
2019-05-10 22:58:52 +00:00
varkor
aa9369c7a4 Add test 2019-05-10 22:11:19 +01:00
varkor
26afc4fb91 Allow fallible lift_to_global in existential type writeback 2019-05-10 22:06:03 +01:00
bors
d595b11358 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
2019-05-10 19:56:15 +00:00
varkor
0f792abf00 Add a test for failed inference of const types 2019-05-10 20:53:46 +01:00
varkor
5310801062 Add a test for invalid const arguments 2019-05-10 20:53:35 +01:00
varkor
385d012d9e Make const parent errors delay_span_bugs 2019-05-10 20:53:21 +01:00
Mazdak Farrokhzad
329275a06f
Rollup merge of #60701 - mati865:mailmap, r=Mark-Simulacrum
Update mailmap for mati865
2019-05-10 20:31:13 +02:00
Mazdak Farrokhzad
0b63f5530b
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
2019-05-10 20:31:11 +02:00
Mazdak Farrokhzad
ec6afb1ff6
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
2019-05-10 20:31:10 +02:00
Mazdak Farrokhzad
bc8c782f60
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
2019-05-10 20:31:09 +02:00
Mazdak Farrokhzad
20dff29b35
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)
2019-05-10 20:31:07 +02:00
Mazdak Farrokhzad
d94cb9f2ea
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
2019-05-10 20:31:06 +02:00
Mazdak Farrokhzad
f9cc5a65d2 check_match: add FIXME for removing of hack. 2019-05-10 19:55:52 +02:00
Mazdak Farrokhzad
efd3733f9d add test checking that 'if cond { .. }' where 'cond: &mut? bool' isn't accepted. 2019-05-10 19:41:10 +02:00
Mazdak Farrokhzad
8d1e5b8b39 Various test changes 2019-05-10 19:41:10 +02:00
Mazdak Farrokhzad
99039689f0 Adjust mir-opt tests for new HIR without If 2019-05-10 19:41:10 +02:00
Mazdak Farrokhzad
5cccda1770 Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match. 2019-05-10 19:41:10 +02:00
David Wood
1f0fb0391c
Add a bunch more tests. 2019-05-10 17:52:13 +01:00
David Wood
214f977fee
Move uninhabited tests into subdirectory.
This commit just tries to tidy up a little.
2019-05-10 17:52:12 +01:00
David Wood
8838b9130e
Fix uninhabitedness of non-exhaustive enums.
This commit ensures that non-exhaustive enums are considered inhabited
when used in extern crates.
2019-05-10 17:52:12 +01:00
David Wood
0d034a2e4d
Fix inhabitedness of non-exhaustive variants.
This commit ensures that non-exhaustive variants are considered
inhabited when used in extern crates.
2019-05-10 17:52:12 +01:00
David Wood
0db087e684
Add uninhabitedness tests w/ #[non_exhaustive].
This commit adds tests checking that uninhabited non-exhaustive types
are considered inhabited when used in another crate.
2019-05-10 17:52:12 +01:00