Commit Graph

56762 Commits

Author SHA1 Message Date
Guillaume Gomez
35584629f4 Update E0049 to new error format 2016-09-14 19:03:18 +02:00
bors
a5f4cc527d Auto merge of #36333 - apasel422:issue-35668, r=eddyb
Handle `ReEmpty` for `impl Trait`

Closes #35668

r? @eddyb
2016-09-10 02:24:27 -07:00
bors
f508ddc547 Auto merge of #36332 - llogiq:static_consts_feature, r=nikomatsakis
add static_in_const feature gate

also updates tests and deletes the spurious .bk files I inadvertently added last time.

r? @nikomatsakis
2016-09-09 21:35:30 -07:00
bors
1284081d33 Auto merge of #36256 - rjgoldsborough:make-configure-detect-nodejs-36207, r=alexcrichton
adding a check to bootstrap script

and a check to the rust config script

refs #36207

first crack at making configure detect nodejs
2016-09-09 14:04:31 -07:00
bors
f1f40f850e Auto merge of #36331 - petrochenkov:tyadt, r=eddyb
Refactor `TyStruct`/`TyEnum`/`TyUnion` into `TyAdt`

r? @eddyb
2016-09-09 04:57:11 -07:00
bors
3344f893a8 Auto merge of #36324 - nrc:save-docs, r=eddyb
save-analysis bits and pieces
2016-09-09 01:43:46 -07:00
bors
5440a1fae7 Auto merge of #36322 - uweigand:nonblocking, r=alexcrichton
Fix argument to FIONBIO ioctl

The FIONBIO ioctl takes as argument a pointer to an integer, which
should be either 0 or 1 to indicate whether nonblocking mode is to
be switched off or on.  The type of the pointed-to variable is "int".

However, the set_nonblocking routine in libstd/sys/unix/net.rs passes
a pointer to a libc::c_ulong variable.  This doesn't matter on all
32-bit platforms and on all litte-endian platforms, but it will
break on big-endian 64-bit platforms.

Found while porting Rust to s390x (a big-endian 64-bit platform).

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-08 22:30:12 -07:00
bors
1df64450ec Auto merge of #36321 - uweigand:enum-abi, r=eddyb
Follow target ABI sign-/zero-extension rules for enum types

While attempting to port Rust to s390x, I ran into an ABI violation
(that caused rust_eh_personality to be miscompiled, breaking unwinding).
The problem is that this function returns an enum type, which is
supposed to be sign-extended according to the s390x ABI.  However,
common code would ignore target sign-/zero-extension rules for any
types that do not satisfy is_integral(), which includes enums.

For the general case of Rust enum types, which map to structure types
with a discriminant, that seems correct.  However, in the special case
of simple enums that map directly to C enum types (i.e. LLVM integers),
this is incorrect; we must follow the target extension rules for those.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-08 19:15:50 -07:00
Jake Goldsborough
89bc13c37d tweaking the nodejs cmd sanity check 2016-09-08 17:51:06 -07:00
bors
378195665c Auto merge of #36173 - petrochenkov:unstat, r=nikomatsakis
Issue deprecation warnings for safe accesses to extern statics

Fixes https://github.com/rust-lang/rust/issues/35112
cc https://github.com/rust-lang/rust/issues/36247
2016-09-08 15:57:02 -07:00
Vadim Petrochenkov
aadbcffb7c Issue deprecation warnings for safe accesses to extern statics 2016-09-09 01:07:01 +03:00
Andre Bogus
76a2f9f454 fix feature error, test fallout 2016-09-08 22:59:21 +02:00
Vadim Petrochenkov
553d5f0a38 Address comments 2016-09-08 23:37:32 +03:00
Vadim Petrochenkov
f2b672d556 Refactor TyStruct/TyEnum/TyUnion into TyAdt 2016-09-08 22:17:53 +03:00
bors
ea45edf0ee Auto merge of #35745 - jroesch:soundness-fix-29859, r=nikomatsakis
Fix soundness bug described in #29859

This is an attempt at fixing the problems described in #29859 based on an IRC conversation between @nikomatsakis and I today. I'm waiting on a full build to come back, otherwise both tests trigger the correct error.
2016-09-08 10:40:31 -07:00
bors
c615b21533 Auto merge of #36048 - GuillaumeGomez:code_clean, r=brson
Clean code a bit
2016-09-08 07:20:51 -07:00
bors
0b02ae02bb Auto merge of #36316 - jseyfried:custom_derive_internal_unstable, r=eddyb
Avoid instaiblity errors in code generated by `syntax_ext::deriving::call_intrinsic()`

r? @eddyb
2016-09-08 01:44:51 -07:00
Andre Bogus
df611a62bb added feature description to reference 2016-09-08 07:34:41 +02:00
bors
a5dbf8a0f8 Auto merge of #36310 - jstnlef:remove-extraneous-not-equal-impl, r=sfackler
Removing the extraneous not_equal implementation for slices

Happened to stumble upon this one awhile back. Seemed a bit silly to have both the equals and not equals implementation when they're so similar.
2016-09-07 22:30:48 -07:00
Andre Bogus
2859177ea0 added feature gate test 2016-09-08 07:29:37 +02:00
Andre Bogus
e0eea8b7c1 warning → error, lowercase 2016-09-08 07:26:55 +02:00
bors
4a26286216 Auto merge of #36214 - jseyfried:stackless_expansion, r=nrc
macros: stackless expansion

After this PR, macro expansion cannot overflow the stack unless the expanded crate is too deep to fold.
Everything but the stackless placeholder expansion commit is also groundwork for macro modularization.

r? @nrc or @eddyb
2016-09-07 19:02:51 -07:00
Jared Roesch
a25428269d Fix duplicate error code 2016-09-07 17:22:19 -07:00
bors
a7b2232d20 Auto merge of #36292 - japaric:musl-root, r=alexcrichton
rustbuild: per target musl-root

config.toml now accepts a target.$TARGET.musl-root key that lets you
override the "build" musl-root value, which is set via the --musl-root
flag or via the build.musl-root key.

With this change, it's now possible to compile std for several musl
targets at once. Here's are the sample commands to do such thing:

```
$ configure \
    --enable-rustbuild \
    --target=x86_64-unknown-linux-musl,arm-unknown-linux-musleabi \
    --musl-root=/musl/x86_64-unknown-linux-musl/

$ edit config.toml && tail config.toml
[target.arm-unknown-linux-musleabi]
musl-root = "/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr"

$ make
```

r? @alexcrichton
With this we should be able to start producing releases of std for arm musl targets
2016-09-07 15:45:14 -07:00
Jeffrey Seyfried
9ac91fa48b Improve directory computation during invocation collection. 2016-09-07 22:42:17 +00:00
Jeffrey Seyfried
2d759046ba Implement stackless placeholder expansion. 2016-09-07 22:42:17 +00:00
Jeffrey Seyfried
d76bf3ed80 Strip unconfigured nodes in the InvocationCollector fold. 2016-09-07 22:41:35 +00:00
Andrew Paseltiner
d951d5dec4
Handle ReEmpty for impl Trait
Closes #35668
2016-09-07 18:26:53 -04:00
Jeffrey Seyfried
3af0c6572e Refactor code out of the folder implementation for StripUnconfigured. 2016-09-07 22:12:30 +00:00
Andre Bogus
41d1cd7196 add static_in_const feature gate
also updates tests and deletes the spurious .bk files I inadvertently
added last time.
2016-09-07 23:18:46 +02:00
Jake Goldsborough
7e46f2ceaa moving nodejs detection logic to configure and adding
a nodejs cmd sanity check
2016-09-07 13:13:37 -07:00
bors
9627e9ef6e Auto merge of #36266 - Sawyer47:issue-35169, r=alexcrichton
rustdoc: Filter more incorrect methods inherited through Deref

Old code filtered out only static methods. This code also excludes &mut self methods if there is no DerefMut implementation.

Fixes #35169
2016-09-07 12:30:03 -07:00
Ulrich Weigand
ce3cecf116 Use layout_of to detect C enums 2016-09-07 21:03:21 +02:00
Nick Cameron
b58294e328 save-analysis: strip /// or whatever from doc comments 2016-09-07 11:03:57 -07:00
Nick Cameron
493544a1f9 save-analysis: only emit type in the value for variables 2016-09-07 11:03:56 -07:00
Nick Cameron
ce413e0da2 save-analysis: tweak the type value for functions 2016-09-07 11:03:56 -07:00
bors
cf0cdc452b Auto merge of #36304 - TimNN:fix-36299, r=eddyb
re-add accidentally removed line in wfcheck

Fixes #36299, introduced in #36119.

r? @eddyb
2016-09-07 09:15:30 -07:00
Ulrich Weigand
3f0462acbb Fix argument to FIONBIO ioctl
The FIONBIO ioctl takes as argument a pointer to an integer, which
should be either 0 or 1 to indicate whether nonblocking mode is to
be switched off or on.  The type of the pointed-to variable is "int".

However, the set_nonblocking routine in libstd/sys/unix/net.rs passes
a pointer to a libc::c_ulong variable.  This doesn't matter on all
32-bit platforms and on all litte-endian platforms, but it will
break on big-endian 64-bit platforms.

Found while porting Rust to s390x (a big-endian 64-bit platform).

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-07 17:21:10 +02:00
Ulrich Weigand
8760a5e3cc Follow target ABI sign-/zero-extension rules for enum types
While attempting to port Rust to s390x, I ran into an ABI violation
(that caused rust_eh_personality to be miscompiled, breaking unwinding).
The problem is that this function returns an enum type, which is
supposed to be sign-extended according to the s390x ABI.  However,
common code would ignore target sign-/zero-extension rules for any
types that do not satisfy is_integral(), which includes enums.

For the general case of Rust enum types, which map to structure types
with a discriminant, that seems correct.  However, in the special case
of simple enums that map directly to C enum types (i.e. LLVM integers),
this is incorrect; we must follow the target extension rules for those.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-07 17:14:10 +02:00
bors
f707582a43 Auto merge of #36289 - euclio:self-suggestion, r=jseyfried
resolve: Suggest `use self` when import resolves

Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.

Fixes #34191.

Thank you for the help @jseyfried!
2016-09-07 05:59:50 -07:00
bors
2819eca69c Auto merge of #36296 - nagisa:pass-timing, r=eddyb
Count and report time taken by MIR passes

There’s some desire for deeper introspectability into what MIR passes cost us.

-Z time-passes after this PR:

```
   Compiling test_shim v0.1.0 (file:///home/nagisa/Documents/rust/rust/src/rustc/test_shim)
time: 0.000; rss: 29MB	parsing
time: 0.000; rss: 29MB	configuration
time: 0.000; rss: 29MB	recursion limit
time: 0.000; rss: 29MB	crate injection
time: 0.000; rss: 29MB	plugin loading
time: 0.000; rss: 29MB	plugin registration
time: 0.032; rss: 54MB	expansion
time: 0.000; rss: 54MB	maybe building test harness
time: 0.000; rss: 54MB	assigning node ids
time: 0.000; rss: 54MB	checking for inline asm in case the target doesn't support it
time: 0.000; rss: 54MB	complete gated feature checking
time: 0.000; rss: 54MB	collecting defs
time: 0.004; rss: 54MB	external crate/lib resolution
time: 0.000; rss: 54MB	early lint checks
time: 0.000; rss: 54MB	AST validation
time: 0.001; rss: 54MB	name resolution
time: 0.000; rss: 54MB	lowering ast -> hir
time: 0.000; rss: 56MB	indexing hir
time: 0.000; rss: 56MB	attribute checking
time: 0.000; rss: 56MB	language item collection
time: 0.000; rss: 56MB	lifetime resolution
time: 0.000; rss: 56MB	looking for entry point
time: 0.000; rss: 56MB	looking for plugin registrar
time: 0.000; rss: 56MB	region resolution
time: 0.000; rss: 56MB	loop checking
time: 0.000; rss: 56MB	static item recursion checking
time: 0.000; rss: 56MB	compute_incremental_hashes_map
time: 0.000; rss: 56MB	load_dep_graph
time: 0.000; rss: 56MB	type collecting
time: 0.000; rss: 56MB	variance inference
time: 0.011; rss: 59MB	coherence checking
time: 0.000; rss: 59MB	wf checking
time: 0.000; rss: 59MB	item-types checking
time: 0.000; rss: 59MB	item-bodies checking
time: 0.000; rss: 59MB	drop-impl checking
time: 0.000; rss: 59MB	const checking
time: 0.000; rss: 59MB	privacy checking
time: 0.000; rss: 59MB	stability index
time: 0.000; rss: 59MB	intrinsic checking
time: 0.000; rss: 59MB	effect checking
time: 0.000; rss: 59MB	match checking
time: 0.000; rss: 59MB	liveness checking
time: 0.000; rss: 59MB	rvalue checking
time: 0.000; rss: 59MB	MIR dump
  time: 0.000; rss: 59MB	SimplifyCfg
  time: 0.000; rss: 59MB	QualifyAndPromoteConstants
  time: 0.000; rss: 59MB	TypeckMir
  time: 0.000; rss: 59MB	SimplifyBranches
  time: 0.000; rss: 59MB	SimplifyCfg
time: 0.000; rss: 59MB	MIR passes
time: 0.000; rss: 59MB	borrow checking
time: 0.000; rss: 59MB	reachability checking
time: 0.000; rss: 59MB	death checking
time: 0.000; rss: 59MB	stability checking
time: 0.000; rss: 59MB	unused lib feature checking
time: 0.000; rss: 59MB	lint checking
time: 0.000; rss: 59MB	resolving dependency formats
  time: 0.000; rss: 59MB	NoLandingPads
  time: 0.000; rss: 59MB	SimplifyCfg
  time: 0.000; rss: 59MB	EraseRegions
  time: 0.000; rss: 59MB	AddCallGuards
  time: 0.000; rss: 59MB	ElaborateDrops
  time: 0.000; rss: 59MB	NoLandingPads
  time: 0.000; rss: 59MB	SimplifyCfg
  time: 0.000; rss: 59MB	Deaggregator
  time: 0.000; rss: 59MB	AddCallGuards
  time: 0.000; rss: 59MB	PreTrans
time: 0.000; rss: 59MB	Prepare MIR codegen passes
  time: 0.000; rss: 59MB	write metadata
  time: 0.000; rss: 61MB	translation item collection
  time: 0.000; rss: 61MB	codegen unit partitioning
  time: 0.000; rss: 61MB	internalize symbols
time: 0.007; rss: 61MB	translation
time: 0.000; rss: 61MB	assert dep graph
time: 0.000; rss: 61MB	serialize dep graph
time: 0.000; rss: 61MB	llvm function passes [2]
time: 0.000; rss: 61MB	llvm function passes [3]
time: 0.000; rss: 61MB	llvm function passes [1]
time: 0.000; rss: 61MB	llvm function passes [0]
time: 0.000; rss: 61MB	llvm module passes [2]
time: 0.000; rss: 61MB	llvm module passes [1]
time: 0.000; rss: 61MB	llvm module passes [0]
time: 0.000; rss: 61MB	llvm module passes [3]
time: 0.001; rss: 62MB	codegen passes [1]
time: 0.001; rss: 62MB	codegen passes [2]
time: 0.001; rss: 62MB	codegen passes [0]
time: 0.001; rss: 62MB	codegen passes [3]
time: 0.001; rss: 63MB	codegen passes [1]
time: 0.005; rss: 63MB	LLVM passes
time: 0.000; rss: 63MB	serialize work products
time: 0.001; rss: 63MB	linking
```

r? @eddyb or @nikomatsakis

cc @nrc, @Mark-Simulacrum
2016-09-07 02:47:35 -07:00
Jeffrey Seyfried
d6ea10ec76 Add regression test. 2016-09-07 07:38:29 +00:00
Jeffrey Seyfried
f84d081a7e Avoid instaiblity errors in code generated by syntax_ext::deriving::call_intrinsic(). 2016-09-07 07:38:26 +00:00
bors
fe278a8a32 Auto merge of #36252 - joshtriplett:union-field-never-used, r=sanxiyn
Fix "field is never used" warning to take unions into account

When compiling code containing a union with an unused field, rustc says
"struct field is never used".

Rather than saying "struct or union", or adding logic to determine the
type of the item, just change the message to "field is never used",
dropping the "struct".

Update tests accordingly.
2016-09-06 20:06:34 -07:00
Jorge Aparicio
8cfc69ecea add utility musl_root method, update config.toml.example 2016-09-06 21:49:02 -05:00
Jake Goldsborough
0adcf46cdf detecting nodejs in configure 2016-09-06 18:31:00 -07:00
Justin LeFebvre
a77b55d58f remove the extraneous not_equal implementation for slices. 2016-09-06 20:39:58 -04:00
bors
3b272bf310 Auto merge of #36303 - jonathandturner:rollup, r=jonathandturner
Rollup of 8 pull requests

- Successful merges: #36121, #36128, #36241, #36243, #36263, #36267, #36273, #36298
- Failed merges:
2016-09-06 16:45:41 -07:00
Nick Cameron
31100403fd save-analysis: add a kind tag to JSON dumps 2016-09-07 11:28:13 +12:00
Nick Cameron
68d29cba95 save-analysis: add docs data 2016-09-07 11:23:49 +12:00