Commit Graph

93857 Commits

Author SHA1 Message Date
Matthew Jasper
ff71b80a85 Change compare mode to use -Zborrowck=mir 2019-05-12 18:46:43 +01:00
bors
1764b29725 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
2019-05-12 17:44:06 +00:00
Matthew Jasper
1f5145e273 Treat generators the same as closure for escaping lifetimes 2019-05-12 17:52:33 +01:00
Matthew Jasper
664c8ed301 Always use the stronger outlives version for opaque types 2019-05-12 17:12:49 +01:00
bors
0df1e57991 Auto merge of #60244 - SimonSapin:dangling, r=oli-obk
const-stabilize NonNull::dangling and NonNull::cast
2019-05-12 14:32:11 +00:00
bors
efa3c27f0f 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
2019-05-12 09:19:28 +00:00
bors
16e356ebdf 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
2019-05-12 06:24:10 +00:00
Yusuke Matsushita
0fc2cfb66c
Fix minor typos for ItemLocalId
* added comma before 'that is'
* "can be implement" -> "can be implemented"
2019-05-12 09:52:38 +09:00
Mazdak Farrokhzad
4aa4a8f776 Minor cleanup in parse_assoc_expr_with. 2019-05-12 02:17:34 +02:00
Mazdak Farrokhzad
b680b66ddd parse_bottom_expr: extract common 'return' out. 2019-05-12 02:01:32 +02:00
Mazdak Farrokhzad
9b4a630baa syntax::parse::parser: convert unnecessary '&mut self's to '&self'. 2019-05-12 02:00:06 +02:00
Mazdak Farrokhzad
0535e42678 ast_validation: comments -> doc comments 2019-05-12 01:52:46 +02:00
Vadim Petrochenkov
14b353820f syntax: Remove some legacy nonterminal tokens 2019-05-12 02:01:56 +03:00
Pulkit Goyal
3b78a474f3 Fix HIR printing of existential type #60662
This fixes https://github.com/rust-lang/rust/issues/60662
2019-05-12 01:50:58 +03:00
bors
d28e948b92 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
2019-05-11 22:13:10 +00:00
Mazdak Farrokhzad
f2dd97cc34
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).
2019-05-11 23:41:41 +02:00
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