Commit Graph

77449 Commits

Author SHA1 Message Date
Irina Popa
04fa0e7bb3 rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00
Anthony Ramine
1c09977c9a Mark SingleVariant as repr(u8) in c-style-enum
I should rather properly fix debuginfo but I have no clue how to do that.
2018-04-26 16:22:18 +02:00
Anthony Ramine
8f36804c00 Treat repr(Rust) univariant fieldless enums as a ZST (fixes #15747)
This makes all those enums be represented the same way:

```rust
enum A1 { B1 }
enum A2 { B2 = 0 }
enum A3 { B3, C3(!) }
```
2018-04-26 16:22:18 +02:00
Alex Crichton
a2a9cc68fe rustc: Disable threads in LLD for wasm
Upstream bug reports (rustwasm/wasm-bindgen#119) show that this may be the
culprit of odd crashes/hangs. The linker is a tiny fraction of build time anyway
right now so let's disable it and figure out how to possibly reenable it later
if necessary.
2018-04-26 06:56:37 -07:00
Irina Popa
030244cd4a rustc_target: move in cabi_* from rustc_trans. 2018-04-26 16:50:31 +03:00
Irina Popa
fb15d44700 rustc_trans: generalize cabi_* to any context type. 2018-04-26 16:50:31 +03:00
Irina Popa
c45dda92fe rustc_target: move for_variant and field TyLayout methods to a trait. 2018-04-26 16:50:29 +03:00
Irina Popa
7a5147616b rustc_target: move LayoutOf's type parameter to an associated type. 2018-04-26 16:50:28 +03:00
Irina Popa
3bd7efadae rustc_target: move in type definitions from rustc_trans::abi. 2018-04-26 16:50:27 +03:00
Irina Popa
bdcd08278a rustc_target: move in type definitions from ty::layout. 2018-04-26 16:50:20 +03:00
Irina Popa
38e964077b Rename rustc_back::target to rustc_target::spec. 2018-04-26 16:39:44 +03:00
Irina Popa
6f03b80020 rustc_back: move LinkerFlavor, PanicStrategy, and RelroLevel to target. 2018-04-26 16:39:27 +03:00
Anthony Ramine
7bfe3ae00a Add a test for casts of univariant C-like enums 2018-04-26 15:07:04 +02:00
Oliver Schneider
2807f4f773 Properly evaluate zst enum 2018-04-26 15:07:04 +02:00
Anthony Ramine
1839ec5ef8 Consistently use C_uint_big for discriminants 2018-04-26 15:07:04 +02:00
Anthony Ramine
b7c8cc4b77 Properly look for uninhabitedness when handling discriminants 2018-04-26 15:07:04 +02:00
Shotaro Yamada
98c2e0976d Do not ICE on generics mismatch with non-local traits
Fixes #49841
2018-04-26 21:56:21 +09:00
bors
88cd36714c Auto merge of #50245 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #50177 (mark std::str::replace(,n) as #[must_use])
 - #50207 (Hash EntryKind::AssociatedConst const data)
 - #50214 (Js improvements)
 - #50219 (Added missing `.` in docs.)

Failed merges:

 - #50229 (Add setting to go to item if there is only one result)
2018-04-26 11:07:14 +00:00
Guillaume Gomez
30e3f1a620 Add more doc aliases 2018-04-26 12:56:10 +02:00
Nicholas Nethercote
2e4f66a86f Make dump_{alloc,allocs,local}() no-ops when tracing is disabled.
Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.

The patch also removes some now-unnecessary log_enabled! tests at call
sites.
2018-04-26 19:22:35 +10:00
bors
3eca70a0c5 Auto merge of #50072 - oli-obk:discriminants, r=eddyb
Allow variant discriminant initializers to refer to other initializer…

…s of the same enum

r? @eddyb

fixes the 2.4 failure of https://github.com/rust-lang/rust/issues/49765

cc @durka @retep998
2018-04-26 08:51:39 +00:00
Guillaume Gomez
438f3ca01c
Rollup merge of #50219 - ralfbiedert:master, r=frewsxcv
Added missing `.` in docs.
2018-04-26 10:11:16 +02:00
Guillaume Gomez
8f6b42711f
Rollup merge of #50214 - GuillaumeGomez:JS-improvements, r=QuietMisdreavus
Js improvements

r? @QuietMisdreavus
2018-04-26 10:11:15 +02:00
Guillaume Gomez
0d758ecc61
Rollup merge of #50207 - wesleywiser:hash_const_data, r=eddyb
Hash EntryKind::AssociatedConst const data

Related to #49991
r? @michaelwoerister
cc @eddyb
2018-04-26 10:11:14 +02:00
Guillaume Gomez
3b49b27e0c
Rollup merge of #50177 - matthiaskrgr:std_std_replacen__must_use, r=oli-obk
mark std::str::replace(,n) as #[must_use]

let x = "a b c c";
x.replacen("c", "d", 2");
might not do what people might think it does.
2018-04-26 10:11:11 +02:00
Anthony Ramine
3ca6ad922e Use ScalarPair for tagged enums 2018-04-26 09:30:28 +02:00
Oliver Schneider
195c9f47e9
Allow variant discriminant initializers to refer to other initializers of the same enum 2018-04-26 08:54:14 +02:00
bors
1515cded74 Auto merge of #49732 - Zoxc:sync-dep-graph, r=michaelwoerister
Make incremental compilation thread-safe

r? @michaelwoerister
2018-04-26 06:38:14 +00:00
bors
c18778704c Auto merge of #50236 - nrc:update, r=alexcrichton
Update rustfmt and rls

r? @alexcrichton
2018-04-26 03:36:22 +00:00
Nick Cameron
612830dc77 handle license check 2018-04-26 15:10:11 +12:00
Nicholas Nethercote
259ae18139 Implement LazyBTreeMap and use it in a few places.
This is a thin wrapper around BTreeMap that avoids allocating upon
creation. It speeds up some rustc-perf benchmarks by up to 3.6%.
2018-04-26 11:55:06 +10:00
bors
84ce67ef95 Auto merge of #50131 - Manishearth:crate-in-local, r=petrochenkov
Allow crate:: in local paths

Currently if you want to use `crate` locally you have to do `::crate::`. This shouldn't be necessary

(will fix up tests later)

r? @petrochenkov
2018-04-25 23:25:47 +00:00
Nick Cameron
127f9a6416 Update rustfmt and rls 2018-04-26 10:11:28 +12:00
Manish Goregaokar
4e2cd4104a Approximate -> Applicability 2018-04-25 14:55:25 -07:00
bors
6eb4f1d036 Auto merge of #50016 - tmandry:cleanup-binder, r=nikomatsakis
Make Binder's field private and clean up its usage

AKA "tour de rustc"

Closes #49814.
2018-04-25 20:58:53 +00:00
Manish Goregaokar
9f5e08e0a1 Fix crate:: in local paths 2018-04-25 12:01:59 -07:00
bors
25749ad66d Auto merge of #49321 - ishitatsuyuki:compile-pass, r=alexcrichton
Introduce compile-pass

r? @alexcrichton

The plan is to move things that cannot fail (no assert, unwrap, etc) out so we don't have to run them, and in the long term we can also stop running LLVM for them.

Out of 3215 tests...

```
Language            Files        Lines         Code     Comments       Blanks
Rust                 3215       119254        64688        35135        19431
```

16% of them has an empty main (which is already moved in this PR).

```
grep -rnPzl 'fn main\(\)\s*{\s*}' | xargs rg --files-without-match cfg | wc -l
547
```

And only 50% of the tests contains assertions:

```
rg -e assert -e unwrap -e expect -e panic -l | wc -l
1600
```

The remainder is likely able to get moved, but they need check by a human so I didn't touch them in PR.

cc @rust-lang/compiler

* [ ] Update documentation
2018-04-25 14:52:30 +00:00
Michael Woerister
a95bff3ed4 Bump bootstrap compiler to 2018-04-24 2018-04-25 15:57:33 +02:00
Ralf Biedert
1bcb267651
Added missing . in docs. 2018-04-25 14:14:43 +02:00
bors
81135c9dbc Auto merge of #50134 - andjo403:jobserver, r=michaelwoerister
make rustdoc test follow the jobserver limit of threads

fix that to many threads is executing at the same time
when rustdoc test is executed.
2018-04-25 11:40:18 +00:00
z4v1er
011df4ac88
Fix type 2018-04-25 13:51:51 +03:00
John Kåre Alsaker
3f802ee801 Move the Lock into OpenTask 2018-04-25 11:55:12 +02:00
John Kåre Alsaker
8ec629b3a0 Address comments 2018-04-25 11:25:40 +02:00
John Kåre Alsaker
64b5d408e6 Make DepGraph thread-safe 2018-04-25 11:25:40 +02:00
bors
5ec6637c15 Auto merge of #50110 - oli-obk:warn_all_the_constants, r=estebank
Warn on all erroneous constants

fixes #49791
fixes #47054

@Zoxc this PR triggers the nondeterministic errors of https://github.com/rust-lang/rust/pull/49950#issuecomment-383074959 really often (at least on stage1).
2018-04-25 09:19:07 +00:00
Tatsuyuki Ishi
00bc634f8f compiletest: introduce skip-trans 2018-04-25 18:18:03 +09:00
Guillaume Gomez
ac0f99c03f Some JS improvements 2018-04-25 09:01:32 +02:00
bors
cc79420968 Auto merge of #50106 - nnethercote:nearest_common_ancestor, r=nikomatsakis
Speed up `nearest_common_ancestor`.

`nearest_common_ancestor` can be made faster.

Here are all the benchmarks where one of the measurements improved by at least 1%.
```
clap-rs-check
	avg: -4.5%	min: -8.8%	max: -0.3%
clap-rs
	avg: -2.6%	min: -4.5%	max: 0.5%
script-servo
	avg: -1.7%	min: -3.6%	max: 0.0%
regression-31157
	avg: -1.5%	min: -2.6%	max: -0.4%
hyper
	avg: -1.2%	min: -2.5%	max: -0.0%
piston-image
	avg: -1.6%	min: -2.5%	max: 0.1%
regex
	avg: -1.2%	min: -2.2%	max: 0.0%
issue-46449
	avg: -1.8%	min: -2.1%	max: -0.7%
crates.io
	avg: -1.2%	min: -2.1%	max: 0.0%
hyper-check
	avg: -1.0%	min: -2.1%	max: -0.1%
clap-rs-opt
	avg: -1.4%	min: -2.0%	max: -0.3%
piston-image-check
	avg: -1.2%	min: -1.9%	max: -0.1%
regex-check
	avg: -0.5%	min: -1.8%	max: -0.1%
syn
	avg: -1.1%	min: -1.7%	max: -0.1%
tokio-webpush-simple-check
	avg: -1.1%	min: -1.6%	max: -0.3%
tokio-webpush-simple
	avg: -1.2%	min: -1.6%	max: -0.0%
helloworld-check
	avg: -1.4%	min: -1.6%	max: -1.2%
deeply-nested
	avg: -1.2%	min: -1.4%	max: -0.8%
encoding-check
	avg: -0.8%	min: -1.3%	max: -0.3%
unify-linearly-check
	avg: -1.0%	min: -1.3%	max: -0.8%
script-servo-check
	avg: -0.6%	min: -1.3%	max: 0.0%
regression-31157-check
	avg: -0.9%	min: -1.2%	max: -0.7%
script-servo-opt
	avg: -0.5%	min: -1.2%	max: 0.1%
deeply-nested-check
	avg: -0.8%	min: -1.2%	max: -0.7%
encoding
	avg: -0.7%	min: -1.1%	max: -0.3%
issue-46449-check
	avg: -0.9%	min: -1.1%	max: -0.6%
parser-check
	avg: -0.9%	min: -1.1%	max: -0.8%
html5ever
	avg: -0.5%	min: -1.0%	max: -0.0%
```
2018-04-25 06:48:40 +00:00
bors
432fe0cefc Auto merge of #50100 - Manishearth:edition-path-lint, r=nikomatsakis
Edition breakage lint for absolute paths starting with modules

We plan to enable `extern_absolute_paths` in the 2018 edition. To allow for that, folks must transition their paths in a previous edition to the new one. This makes paths which import module contents via `use module::` or `::module::` obsolete, and we must edition-lint these.

https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/205?u=manishearth is the current plan for paths.

r? @nikomatsakis

Fixes #48722
2018-04-25 04:19:06 +00:00
Wesley Wiser
d81d081df3 Hash EntryKind::AssociatedConst const data
Related to #49991
2018-04-24 23:18:58 -04:00