Commit Graph

78763 Commits

Author SHA1 Message Date
varkor
d7aa35eb1b Use Grapheme_Extend instead of Mn 2018-05-21 18:57:54 +01:00
varkor
d3c257b0ae Use the correct output directory for downloading Unicode files 2018-05-21 18:57:54 +01:00
varkor
68c4fb8f2f Remove example in test for is_nonspacing_mark because it's currently private 2018-05-21 18:57:54 +01:00
varkor
699a2b5c7e Add test for Debug formatting of char 2018-05-21 18:57:54 +01:00
varkor
4694d20170 Escape combining characters in escape_debug 2018-05-21 18:57:54 +01:00
varkor
b72faf5795 Keep tables.rs copyright notice up to date 2018-05-21 18:57:54 +01:00
varkor
a0b5d3813e Download unicode data files in directory of unicode.py 2018-05-21 18:57:54 +01:00
varkor
f53022f88d Update unicode/tables.rs with Mn 2018-05-21 18:57:54 +01:00
varkor
9802300302 Update .gitignore for libstd_unicode 2018-05-21 18:57:54 +01:00
Manish Goregaokar
b0e66386f7 update tests 2018-05-21 10:48:12 -07:00
Manish Goregaokar
1d8a4d16a7 Remove rustc_serialize_exclude_null 2018-05-21 10:48:12 -07:00
Manish Goregaokar
30bd586bec Stabilize suggestion applicability field in json output 2018-05-21 10:48:12 -07:00
Eduard-Mihai Burtescu
da579ef75e rustc_codegen_llvm: remove closure env alloca hack around upvar debuginfo. 2018-05-21 20:39:59 +03:00
Eduard-Mihai Burtescu
a8ceab9cd7 rustc_codegen_llvm: remove debuginfo::VariableKind::CapturedVariable. 2018-05-21 20:39:59 +03:00
bors
56e541ddf1 Auto merge of #50801 - eddyb:param-things, r=nikomatsakis
Quick refactoring around Substs & friends.

r? @nikomatsakis
2018-05-21 17:19:39 +00:00
Oliver Schneider
2788f66ab0 Add some runtime sanity checks 2018-05-21 19:00:56 +02:00
Oliver Schneider
d6fc3e176e Make [T]::len and str::len const fn 2018-05-21 18:59:09 +02:00
Oliver Schneider
5a7fc9b33a Satisfy tidy 2018-05-21 18:43:11 +02:00
Alex Crichton
3b8f791bf6 rustc: Fix procedural macros generating lifetime tokens
This commit fixes an accidental regression from #50473 where lifetime tokens
produced by procedural macros ended up getting lost in translation in the
compiler and not actually producing parseable code. The issue lies in the fact
that a lifetime's `Ident` is prefixed with `'`. The `glue` implementation for
gluing joint tokens together forgot to take this into account so the lifetime
inside of `Ident` was missing the leading tick!

The `glue` implementation here is updated to create a new `Symbol` in these
situations to manufacture a new `Ident` with a leading tick to ensure it parses
correctly.

Closes #50942
2018-05-21 09:35:15 -07:00
Stjepan Glavina
26d62f55a4 Stabilize feature from_ref 2018-05-21 18:16:08 +02:00
Oliver Schneider
af75ebdc3a Improve the diagnostic around impl Trait <-> generic param mismatch 2018-05-21 18:06:28 +02:00
Guillaume Gomez
8c004b8308 Add E0665 2018-05-21 15:41:19 +02:00
bors
6e6a4b1957 Auto merge of #50265 - japaric:sz, r=alexcrichton
stabilize opt-level={s,z}

closes #35784
closes #47651

### Rationale

Since the lastest LLVM upgrade rustc / LLVM does more agressive loop unrolling. This results in increased binary size of embedded / no_std programs: a hundreds of bytes increase, or about a 7x increase, in the case of the smallest Cortex-M binary cf. #49260.

As we are shooting for embedded Rust on stable it would be great to also provide a way to optimize for size (which is pretty important for embedded applications that target resource constrained devices) on stable.

Also this has been baking in nightly for a long time.

r? @alexcrichton which team has to sign off this?
2018-05-21 12:33:19 +00:00
Eduard-Mihai Burtescu
73f62106ad rustc: move TypeParamDef's fields into GenericParamDefKind::Type. 2018-05-21 12:13:19 +03:00
Eduard-Mihai Burtescu
ba2c5c5288 rustc: use AccumulateVec in Substs::for_item. 2018-05-21 12:13:19 +03:00
Eduard-Mihai Burtescu
dce288ec82 rustc: don't expose Substs::fill_item as public. 2018-05-21 12:13:19 +03:00
Eduard-Mihai Burtescu
7e4d8718cb rustc: use intern_* instead of mk_* where possible. 2018-05-21 12:13:19 +03:00
Eduard-Mihai Burtescu
196b2e0d82 rustc: don't call Kind::from directly, use .into() instead. 2018-05-21 12:13:19 +03:00
Eduard-Mihai Burtescu
e3df729c25 rustc: make mk_substs_trait take &[Kind] instead of &[Ty]. 2018-05-21 12:13:17 +03:00
Eduard-Mihai Burtescu
d47dc98767 rustc: avoid using intern_*(it.collect()) when mk_*(it) works better. 2018-05-21 12:12:40 +03:00
Nicholas Nethercote
2ff632484c Optimize seen Predicate filtering.
This speeds up a few rustc-perf benchmark runs, most notably ones
involving 'coercions', the best by 2%.
2018-05-21 18:43:25 +10:00
Nicholas Nethercote
95120164b0 Inline try_get.
This speeds up lots of rustc-perf benchmark runs. The maximum
improvement is 1%, but there are a lot in the 0.5--1.0% range.
2018-05-21 18:35:47 +10:00
bors
21b5367045 Auto merge of #50898 - shepmaster:typo, r=QuietMisdreavus
UnsafeCell doc typos and minor flow improvements

r? @QuietMisdreavus
2018-05-21 08:33:58 +00:00
Oliver Schneider
00842d10cd Move a test to ui tests so we can observe the output changes better 2018-05-21 09:59:37 +02:00
Oliver Schneider
0874ba0fe5 Typo caused the wrong "cannot find" error 2018-05-21 09:56:52 +02:00
bors
98686ca294 Auto merge of #50739 - gnzlbg:vec_reserve, r=sfackler
Switch Vec from doubling size on growth to using RawVec's reserve

On growth, Vec does not require to exactly double its size for correctness,
like, for example, VecDeque does.

Using reserve instead better expresses this intent. It also allows to reuse
Excess capacity on growth and for better growth-policies to be provided by
RawVec.

r? @sfackler
2018-05-21 06:19:44 +00:00
bors
ba1363ffe1 Auto merge of #50924 - petrochenkov:spanover, r=alexcrichton
lexer: Fix span override for the first token in a string

Previously due to peculiarities of `StringReader` construction something like `"a b c d".parse::<TokenStream>()` gave you one non-overridden span for `a` and then three correctly overridden spans for `b`, `c` and `d`.
Now all the spans are overridden.
2018-05-21 03:36:30 +00:00
bors
1e508c4209 Auto merge of #50860 - nox:big-niches-for-big-doggos-🐕, r=eddyb
Find the largest niche when computing layouts

Otherwise we end up with `Option<Option<(&(), bool)>>` unnecessarily large.
2018-05-21 01:23:15 +00:00
Oliver Schneider
9f79a1946a Allow Size to be any valid u64 2018-05-21 00:58:25 +02:00
bors
538fea5757 Auto merge of #50851 - eddyb:the-only-constant, r=nikomatsakis
rustc: introduce {ast,hir}::AnonConst to consolidate so-called "embedded constants".

Previously, constants in array lengths and enum variant discriminants were "merely an expression", and had no separate ID for, e.g. type-checking or const-eval, instead reusing the expression's.

That complicated code working with bodies, because such constants were the only special case where the "owner" of the body wasn't the HIR parent, but rather the same node as the body itself.
Also, if the body happened to be a closure, we had no way to allocate a `DefId` for both the constant *and* the closure, leading to *several* bugs (mostly ICEs where type errors were expected).

This PR rectifies the situation by adding another (`{ast,hir}::AnonConst`) node around every such constant. Also, const generics are expected to rely on the new `AnonConst` nodes, as well (cc @varkor).
* fixes #48838
* fixes #50600
* fixes #50688
* fixes #50689
* obsoletes #50623

r? @nikomatsakis
2018-05-20 22:37:06 +00:00
Zack M. Davis
98a04291e4 suggestion applicabilities for libsyntax and librustc, run-rustfix tests
Consider this a down payment on #50723. To recap, an `Applicability`
enum was recently (#50204) added, to convey to Rustfix and other tools
whether we think it's OK for them to blindly apply the suggestion, or
whether to prompt a human for guidance (because the suggestion might
contain placeholders that we can't infer, or because we think it has a
sufficiently high probability of being wrong even though it's—
presumably—right often enough to be worth emitting in the first place).

When a suggestion is marked as `MaybeIncorrect`, we try to use comments
to indicate precisely why (although there are a few places where we just
say `// speculative` because the present author's subjective judgement
balked at the idea that the suggestion has no false positives).

The `run-rustfix` directive is opporunistically set on some relevant UI
tests (and a couple tests that were in the `test/ui/suggestions`
directory, even if the suggestions didn't originate in librustc or
libsyntax). This is less trivial than it sounds, because a surprising
number of test files aren't equipped to be tested as fixed even when
they contain successfully fixable errors, because, e.g., there are more,
not-directly-related errors after fixing. Some test files need an
attribute or underscore to avoid unused warnings tripping up the "fixed
code is still producing diagnostics" check despite the fixes being
correct; this is an interesting contrast-to/inconsistency-with the
behavior of UI tests (which secretly pass `-A unused`), a behavior which
we probably ought to resolve one way or the other (filed issue #50926).

A few suggestion labels are reworded (e.g., to avoid phrasing it as a
question, which which is discouraged by the style guidelines listed in
`.span_suggestion`'s doc-comment).
2018-05-20 14:13:25 -07:00
Vadim Petrochenkov
b4714cdf6e lexer: Fix span override for the first token in a string 2018-05-20 23:35:00 +03:00
bors
a1d4a9503e Auto merge of #50234 - cramertj:extend, r=alexcrichton
Add implementation of Extend for ()

This is useful in some generic code which wants to collect iterators of items into a result.
2018-05-20 20:29:10 +00:00
Zack M. Davis
6bb4aad51f introducing span_suggestion_short_with_applicability
Some would argue that this 40-character method name is ludicrously
unwieldy (even ironic), but it's the unique continuation of the
precedent set by the other suggestion methods. (And there is some hope
that someday we'll just fold `Applicability` into the signature of the
"basic" method `span_suggestion`.)

This is in support of #50723.
2018-05-20 12:57:19 -07:00
David Wood
52b83d7e26
Added rustdoc documentation step outputting into compiler documentation. 2018-05-20 19:34:37 +01:00
bors
2dca249da0 Auto merge of #50719 - frewsxcv:frewsxcv-iterator-zip, r=alexcrichton
Fix incorrect statement about return value for Iterator::zip.

Fixes https://github.com/rust-lang/rust/issues/50225.
2018-05-20 18:18:12 +00:00
bors
b438449161 Auto merge of #50908 - petrochenkov:usemacself, r=alexcrichton
resolve: Don't add unnecessary import candidates for `prefix::{self}` imports

Fixes https://github.com/rust-lang/rust/issues/50725
2018-05-20 14:24:14 +00:00
bors
22c25dd737 Auto merge of #50841 - oli-obk:promote_errors_to_panics, r=eddyb
Don't lint numeric overflows in promoteds in release mode

r? @eddyb

mitigates #50814
2018-05-20 11:13:24 +00:00
Simon Martin
e6bf3e2ddb Issue #50636: Improve error diagnostic with missing commas after struct fields. 2018-05-20 13:08:25 +02:00
bors
4c26e2e3fb Auto merge of #50855 - nnethercote:fewer-macro_parser-allocs, r=petrochenkov
Speed up the macro parser

These three commits reduce the number of allocations done by the macro parser, in some cases dramatically. For example, for a clean check builds of html5ever, the number of allocations is reduced by 40%.

Here are the rustc-benchmarks that are sped up by at least 1%.
```
html5ever-check
        avg: -6.6%      min: -10.3%     max: -4.1%
html5ever
        avg: -5.2%      min: -9.5%      max: -2.8%
html5ever-opt
        avg: -4.3%      min: -9.3%      max: -1.6%
crates.io-check
        avg: -1.8%      min: -2.9%      max: -0.6%
crates.io-opt
        avg: -1.0%      min: -2.2%      max: -0.1%
crates.io
        avg: -1.1%      min: -2.2%      max: -0.2%
```
2018-05-20 08:55:50 +00:00