]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agorustdoc: Don't add extra newlines for fully opaque structs
Oliver Middleton [Sun, 14 Aug 2016 17:01:25 +0000 (18:01 +0100)]
rustdoc: Don't add extra newlines for fully opaque structs

Changes the definition for opaque structs to look like `pub struct Vec<T>
{ /* fields omitted */ }` to save space on the page.

Also only use one line for empty braced structs.

7 years agoAuto merge of #35745 - jroesch:soundness-fix-29859, r=nikomatsakis
bors [Thu, 8 Sep 2016 17:40:31 +0000 (10:40 -0700)]
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.

7 years agoAuto merge of #36048 - GuillaumeGomez:code_clean, r=brson
bors [Thu, 8 Sep 2016 14:20:51 +0000 (07:20 -0700)]
Auto merge of #36048 - GuillaumeGomez:code_clean, r=brson

Clean code a bit

7 years agoAuto merge of #36316 - jseyfried:custom_derive_internal_unstable, r=eddyb
bors [Thu, 8 Sep 2016 08:44:51 +0000 (01:44 -0700)]
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

7 years agoAuto merge of #36310 - jstnlef:remove-extraneous-not-equal-impl, r=sfackler
bors [Thu, 8 Sep 2016 05:30:48 +0000 (22:30 -0700)]
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.

7 years agoAuto merge of #36214 - jseyfried:stackless_expansion, r=nrc
bors [Thu, 8 Sep 2016 02:02:51 +0000 (19:02 -0700)]
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

7 years agoFix duplicate error code
Jared Roesch [Thu, 8 Sep 2016 00:22:19 +0000 (17:22 -0700)]
Fix duplicate error code

7 years agoAuto merge of #36292 - japaric:musl-root, r=alexcrichton
bors [Wed, 7 Sep 2016 22:45:14 +0000 (15:45 -0700)]
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

7 years agoImprove `directory` computation during invocation collection.
Jeffrey Seyfried [Mon, 5 Sep 2016 04:08:38 +0000 (04:08 +0000)]
Improve `directory` computation during invocation collection.

7 years agoImplement stackless placeholder expansion.
Jeffrey Seyfried [Fri, 2 Sep 2016 03:35:59 +0000 (03:35 +0000)]
Implement stackless placeholder expansion.

7 years agoStrip unconfigured nodes in the `InvocationCollector` fold.
Jeffrey Seyfried [Wed, 7 Sep 2016 22:24:01 +0000 (22:24 +0000)]
Strip unconfigured nodes in the `InvocationCollector` fold.

7 years agoRefactor code out of the folder implementation for `StripUnconfigured`.
Jeffrey Seyfried [Fri, 2 Sep 2016 01:44:23 +0000 (01:44 +0000)]
Refactor code out of the folder implementation for `StripUnconfigured`.

7 years agoAuto merge of #36266 - Sawyer47:issue-35169, r=alexcrichton
bors [Wed, 7 Sep 2016 19:30:03 +0000 (12:30 -0700)]
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

7 years agoAuto merge of #36304 - TimNN:fix-36299, r=eddyb
bors [Wed, 7 Sep 2016 16:15:30 +0000 (09:15 -0700)]
Auto merge of #36304 - TimNN:fix-36299, r=eddyb

re-add accidentally removed line in wfcheck

Fixes #36299, introduced in #36119.

r? @eddyb

7 years agoAuto merge of #36289 - euclio:self-suggestion, r=jseyfried
bors [Wed, 7 Sep 2016 12:59:50 +0000 (05:59 -0700)]
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!

7 years agoAuto merge of #36296 - nagisa:pass-timing, r=eddyb
bors [Wed, 7 Sep 2016 09:47:35 +0000 (02:47 -0700)]
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

7 years agoAdd regression test.
Jeffrey Seyfried [Wed, 7 Sep 2016 03:09:09 +0000 (03:09 +0000)]
Add regression test.

7 years agoAvoid instaiblity errors in code generated by `syntax_ext::deriving::call_intrinsic()`.
Jeffrey Seyfried [Tue, 6 Sep 2016 09:47:35 +0000 (09:47 +0000)]
Avoid instaiblity errors in code generated by `syntax_ext::deriving::call_intrinsic()`.

7 years agoAuto merge of #36252 - joshtriplett:union-field-never-used, r=sanxiyn
bors [Wed, 7 Sep 2016 03:06:34 +0000 (20:06 -0700)]
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.

7 years agoadd utility musl_root method, update config.toml.example
Jorge Aparicio [Wed, 7 Sep 2016 02:49:02 +0000 (21:49 -0500)]
add utility musl_root method, update config.toml.example

7 years agoremove the extraneous not_equal implementation for slices.
Justin LeFebvre [Tue, 6 Sep 2016 05:04:07 +0000 (01:04 -0400)]
remove the extraneous not_equal implementation for slices.

7 years agoAuto merge of #36303 - jonathandturner:rollup, r=jonathandturner
bors [Tue, 6 Sep 2016 23:45:41 +0000 (16:45 -0700)]
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:

7 years agoAuto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakis
bors [Tue, 6 Sep 2016 20:22:35 +0000 (13:22 -0700)]
Auto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakis

incr. comp.: Take spans into account for ICH

This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled.

A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem.

Fixes #33888.
Fixes #32753.

7 years agore-add accidentally removed line
Tim Neumann [Tue, 6 Sep 2016 16:53:43 +0000 (18:53 +0200)]
re-add accidentally removed line

7 years agoRollup merge of #36298 - GuillaumeGomez:hashmap_doc, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:04 +0000 (09:38 -0700)]
Rollup merge of #36298 - GuillaumeGomez:hashmap_doc, r=steveklabnik

Add missing urls

r? @steveklabnik

7 years agoRollup merge of #36273 - apasel422:unsafe_no_drop_flag, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:03 +0000 (09:38 -0700)]
Rollup merge of #36273 - apasel422:unsafe_no_drop_flag, r=steveklabnik

Remove mention of `unsafe_no_drop_flag` from Reference and Nomicon

7 years agoRollup merge of #36267 - Cobrand:E0559, r=jonathandturner
Jonathan Turner [Tue, 6 Sep 2016 16:38:03 +0000 (09:38 -0700)]
Rollup merge of #36267 - Cobrand:E0559, r=jonathandturner

Updated E0559 to new format

Refactored a method that printed one suggested field name,
into a method that returns an `Option` of a suggestion

(Updated test cases accordingly)

r? @jonathandturner

Closes #36197

7 years agoRollup merge of #36263 - apasel422:scoped, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36263 - apasel422:scoped, r=steveklabnik

Clean up thread-local storage docs

`std` no longer contains an implementation of scoped TLS.

r? @steveklabnik

7 years agoRollup merge of #36243 - GuillaumeGomez:hash_map_links, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36243 - GuillaumeGomez:hash_map_links, r=steveklabnik

Add missing urls

r? @steveklabnik

7 years agoRollup merge of #36241 - Cobrand:contributing-md, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36241 - Cobrand:contributing-md, r=steveklabnik

doc: Contributing.md: Added mention of `make tidy`

r? @steveklabnik

7 years agoRollup merge of #36128 - gavinb:error_msgs_p2, r=jonathandturner
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36128 - gavinb:error_msgs_p2, r=jonathandturner

Update Error format for E0516, E0517, E0518

- E0518 Update error format #36111
- E0517 Update error format #36109
- E0516 Update error format #36108
- Part of #35233

r? @jonathandturner

7 years agoRollup merge of #36121 - Cobrand:master, r=jonathandturner
Jonathan Turner [Tue, 6 Sep 2016 16:38:01 +0000 (09:38 -0700)]
Rollup merge of #36121 - Cobrand:master, r=jonathandturner

Updated E0527 to new error format

* Closes #36113

7 years agoICH: Make CachingCodemapView robustly handle invalid spans.
Michael Woerister [Tue, 6 Sep 2016 16:14:43 +0000 (12:14 -0400)]
ICH: Make CachingCodemapView robustly handle invalid spans.

7 years agoAuto merge of #36288 - nrc:save-var-value, r=eddyb
bors [Tue, 6 Sep 2016 14:46:06 +0000 (07:46 -0700)]
Auto merge of #36288 - nrc:save-var-value, r=eddyb

save-analysis: some refinement to the value string for variables

7 years agoAdd missing urls
ggomez [Tue, 6 Sep 2016 14:31:18 +0000 (16:31 +0200)]
Add missing urls

7 years agoCount and report time taken by MIR passes
Simonas Kazlauskas [Sun, 7 Aug 2016 22:04:51 +0000 (01:04 +0300)]
Count and report time taken by MIR passes

7 years agoAuto merge of #36276 - jseyfried:fix_unused, r=nrc
bors [Tue, 6 Sep 2016 08:44:13 +0000 (01:44 -0700)]
Auto merge of #36276 - jseyfried:fix_unused, r=nrc

resolve: Fix unused import false positive with `item_like_imports`

Fixes #36249.
r? @nrc

7 years agorustbuild: per target musl-root
Jorge Aparicio [Tue, 6 Sep 2016 06:04:41 +0000 (01:04 -0500)]
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
```

7 years agoAuto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton
bors [Tue, 6 Sep 2016 05:32:36 +0000 (22:32 -0700)]
Auto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton

rustdoc: Fix associated consts in search results

Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.

Fixes #36031

7 years agoAdd struct `AmbiguityError`.
Jeffrey Seyfried [Tue, 6 Sep 2016 03:47:11 +0000 (03:47 +0000)]
Add struct `AmbiguityError`.

7 years agoAdd field `used: Cell<bool>` to variant `NameBindingKind::Import`.
Jeffrey Seyfried [Mon, 5 Sep 2016 05:27:58 +0000 (05:27 +0000)]
Add field `used: Cell<bool>` to variant `NameBindingKind::Import`.

7 years agoAdd regression test.
Jeffrey Seyfried [Mon, 5 Sep 2016 05:10:50 +0000 (05:10 +0000)]
Add regression test.

7 years agoAvoid false positive unused import warnings.
Jeffrey Seyfried [Mon, 5 Sep 2016 04:55:12 +0000 (04:55 +0000)]
Avoid false positive unused import warnings.

7 years agoshow `self` suggestion when items are in the block
Andy Russell [Tue, 6 Sep 2016 03:08:21 +0000 (23:08 -0400)]
show `self` suggestion when items are in the block

7 years agoresolve: Suggest `use self` when import resolves
Andy Russell [Tue, 6 Sep 2016 01:48:02 +0000 (21:48 -0400)]
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.

7 years agosave-analysis: some refinement to the value string for variables
Nick Cameron [Tue, 6 Sep 2016 00:44:26 +0000 (12:44 +1200)]
save-analysis: some refinement to the value string for variables

7 years agoAuto merge of #36274 - Manishearth:rollup, r=Manishearth
bors [Tue, 6 Sep 2016 00:55:45 +0000 (17:55 -0700)]
Auto merge of #36274 - Manishearth:rollup, r=Manishearth

Rollup of 6 pull requests

- Successful merges: #35845, #35983, #36065, #36102, #36242, #36245
- Failed merges:

7 years agoAuto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
bors [Mon, 5 Sep 2016 21:41:16 +0000 (14:41 -0700)]
Auto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez

Indicate where `core::result::IntoIter` is created.

None

7 years agoAuto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb
bors [Mon, 5 Sep 2016 18:28:36 +0000 (11:28 -0700)]
Auto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb

Fix issue #36036.

Fix #36036.

We were treating an associated type as unsized even when the concrete instantiation was actually sized. Fix is to normalize before checking if it is sized.

7 years agorustdoc: Filter more incorrect methods inherited through Deref
Piotr Jawniak [Sun, 4 Sep 2016 16:35:35 +0000 (18:35 +0200)]
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

7 years agoUpdated E0527 to new error format
Cobrand [Mon, 29 Aug 2016 22:33:29 +0000 (00:33 +0200)]
Updated E0527 to new error format

* Closes #36113

7 years agoAdd test for unused field in union
Josh Triplett [Mon, 5 Sep 2016 17:19:00 +0000 (10:19 -0700)]
Add test for unused field in union

7 years agoAuto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1
bors [Mon, 5 Sep 2016 15:13:32 +0000 (08:13 -0700)]
Auto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1

Fix incorrect LLVM Linkage enum

Followup of #33994 to actually work.

The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the `#[linkage=""]` attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Possible remaining concerns:

1. There could be a codegen test to make sure that the attributes are applied correctly (I don't know how to do this).
2. ~~The test does not exercise the `appending` linkage. I can't figure out how to make a global static raw pointer to an array. This might not even be possible? If not we should probably remove appending linkage as its unusable in rust.~~ Appending linkage is not 'emittable' anyway.
3. The test only runs on Linux.

Fixes #33992

r? @alexcrichton

7 years agoE0518 Update error format #36111
Gavin Baker [Tue, 30 Aug 2016 01:44:25 +0000 (11:44 +1000)]
E0518 Update error format #36111

- Fixes #36111
- Part of #35233

7 years agoE0517 Update error format #36109
Gavin Baker [Tue, 30 Aug 2016 01:30:46 +0000 (11:30 +1000)]
E0517 Update error format #36109

- Fixes #36109
- Part of #35233

7 years agoE0516 Update error format #36108
Gavin Baker [Tue, 30 Aug 2016 01:04:55 +0000 (11:04 +1000)]
E0516 Update error format #36108
- fixes #36108
- part of #35233

7 years agoAuto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb
bors [Mon, 5 Sep 2016 11:29:47 +0000 (04:29 -0700)]
Auto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb

Typecheck refactor for `!`

Ping @nikomatsakis @eddyb. This is the PR for the typeck refactor for `!`. Is this what you guys had in mind? Is there anything else that needs doing on it?

7 years agoFix issue #36036.
Felix S. Klock II [Mon, 5 Sep 2016 10:56:29 +0000 (12:56 +0200)]
Fix issue #36036.

We were treating an associated type as unsized even when the concrete
instantiation was actually sized. Fix is to normalize before checking
if it is sized.

7 years agoRollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1
Manish Goregaokar [Mon, 5 Sep 2016 03:02:04 +0000 (11:02 +0800)]
Rollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1

Add back feature accidentally removed

This feature was accidentally removed in
https://github.com/rust-lang/rust/pull/35957.

7 years agoRollup merge of #36242 - semarie:local-rebuild, r=alexcrichton
Manish Goregaokar [Mon, 5 Sep 2016 03:02:04 +0000 (11:02 +0800)]
Rollup merge of #36242 - semarie:local-rebuild, r=alexcrichton

Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton

7 years agoRollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez

Update E0496 to new format

Fixes #36000.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner

E0060 and E0061 improvement

Fixes #35290.

r? @jonathandturner

7 years agoRollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez

Indicate where `core::result::IntoIter` is created.

None

7 years agoAuto merge of #36242 - semarie:local-rebuild, r=alexcrichton
bors [Mon, 5 Sep 2016 06:50:04 +0000 (23:50 -0700)]
Auto merge of #36242 - semarie:local-rebuild, r=alexcrichton

Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton

7 years agoLoad macros from `extern crate`s in the `InvocationCollector` fold.
Jeffrey Seyfried [Fri, 2 Sep 2016 02:20:03 +0000 (02:20 +0000)]
Load macros from `extern crate`s in the `InvocationCollector` fold.

7 years agoImplement stackless expansion.
Jeffrey Seyfried [Fri, 2 Sep 2016 09:12:47 +0000 (09:12 +0000)]
Implement stackless expansion.

7 years agoAdd module `ext::placeholders` with `placeholder()` and `PlaceholderExpander`.
Jeffrey Seyfried [Mon, 29 Aug 2016 05:32:41 +0000 (05:32 +0000)]
Add module `ext::placeholders` with  `placeholder()` and `PlaceholderExpander`.

7 years agoRefactor `expand_invoc(.., fld)` -> `self.expand_invoc(..)`.
Jeffrey Seyfried [Thu, 1 Sep 2016 07:01:45 +0000 (07:01 +0000)]
Refactor `expand_invoc(.., fld)` -> `self.expand_invoc(..)`.

7 years agoRefactor `SyntaxEnv`.
Jeffrey Seyfried [Thu, 1 Sep 2016 06:44:54 +0000 (06:44 +0000)]
Refactor `SyntaxEnv`.

7 years agoRefactor `expand_*` into `expander.fold_*`.
Jeffrey Seyfried [Tue, 30 Aug 2016 23:03:52 +0000 (23:03 +0000)]
Refactor `expand_*` into `expander.fold_*`.

7 years agoClean up module processing.
Jeffrey Seyfried [Sun, 28 Aug 2016 03:49:56 +0000 (03:49 +0000)]
Clean up module processing.

7 years agoRefactor out `expand_item` (with better semantics than before).
Jeffrey Seyfried [Sun, 28 Aug 2016 03:16:03 +0000 (03:16 +0000)]
Refactor out `expand_item` (with better semantics than before).

7 years agoRefactor away `expand_item`.
Jeffrey Seyfried [Sun, 28 Aug 2016 03:11:33 +0000 (03:11 +0000)]
Refactor away `expand_item`.

7 years agoGeneralize `Invocation` to include modifiers/decorators.
Jeffrey Seyfried [Fri, 2 Sep 2016 06:14:38 +0000 (06:14 +0000)]
Generalize `Invocation` to include modifiers/decorators.

7 years agoRefactor `with_exts_frame` from a macro to a function.
Jeffrey Seyfried [Sat, 27 Aug 2016 06:27:35 +0000 (06:27 +0000)]
Refactor `with_exts_frame` from a macro to a function.

7 years agoAdd `Invocation` and `Expansion`, remove `MacroGenerable`.
Jeffrey Seyfried [Sat, 27 Aug 2016 05:27:59 +0000 (05:27 +0000)]
Add `Invocation` and `Expansion`, remove `MacroGenerable`.

7 years agoRemove `syntax::config::strip_unconfigured`, add `syntax::config::features`.
Jeffrey Seyfried [Wed, 31 Aug 2016 23:39:16 +0000 (23:39 +0000)]
Remove `syntax::config::strip_unconfigured`, add `syntax::config::features`.

7 years agoImprove `expand_type`.
Jeffrey Seyfried [Tue, 30 Aug 2016 07:05:25 +0000 (07:05 +0000)]
Improve `expand_type`.

7 years agoIn `Parser` and `ExtCtxt`, replace fields `filename` and `mod_path_stack`
Jeffrey Seyfried [Wed, 31 Aug 2016 09:02:45 +0000 (09:02 +0000)]
In `Parser` and `ExtCtxt`, replace fields `filename` and `mod_path_stack`
with a single field `directory: PathBuf`.

7 years agoRemove expr_ty method completely
Andrew Cann [Sun, 28 Aug 2016 11:37:57 +0000 (19:37 +0800)]
Remove expr_ty method completely

7 years agoUndo unnecessary bookkeeping from last commit
Andrew Cann [Sun, 28 Aug 2016 09:29:54 +0000 (17:29 +0800)]
Undo unnecessary bookkeeping from last commit

7 years agoRemove use of expr_ty from coercions code
Andrew Cann [Sun, 28 Aug 2016 08:17:52 +0000 (16:17 +0800)]
Remove use of expr_ty from coercions code

7 years agoMove write_ty to the bottom of check_pat
Andrew Cann [Sat, 27 Aug 2016 12:38:06 +0000 (20:38 +0800)]
Move write_ty to the bottom of check_pat

7 years agoFactor write_ty out of more pattern-checking functions
Andrew Cann [Sat, 27 Aug 2016 12:34:37 +0000 (20:34 +0800)]
Factor write_ty out of more pattern-checking functions

7 years agoFactor write_ty out of pattern-matching functions
Andrew Cann [Sat, 27 Aug 2016 12:06:47 +0000 (20:06 +0800)]
Factor write_ty out of pattern-matching functions

7 years agocheck_block_with_expected returns the checked type
Andrew Cann [Fri, 19 Aug 2016 06:41:25 +0000 (14:41 +0800)]
check_block_with_expected returns the checked type

7 years agoMove check_expr match block into its own method
Andrew Cann [Fri, 19 Aug 2016 06:17:00 +0000 (14:17 +0800)]
Move check_expr match block into its own method

7 years agoTidy. Rename variables.
Andrew Cann [Fri, 19 Aug 2016 06:12:37 +0000 (14:12 +0800)]
Tidy. Rename variables.

7 years agoTidy
Andrew Cann [Thu, 18 Aug 2016 16:24:32 +0000 (00:24 +0800)]
Tidy

7 years agoAdd AdjustNeverToAny in check_expr
Andrew Cann [Thu, 18 Aug 2016 16:13:15 +0000 (00:13 +0800)]
Add AdjustNeverToAny in check_expr

7 years agoFactor write_ty out of function checking functions
Andrew Cann [Thu, 18 Aug 2016 15:52:05 +0000 (23:52 +0800)]
Factor write_ty out of function checking functions

7 years agoFactor write_ty out of check_expr_closure
Andrew Cann [Thu, 18 Aug 2016 15:30:11 +0000 (23:30 +0800)]
Factor write_ty out of check_expr_closure

7 years agoFactor write_ty out of check_struct_expr
Andrew Cann [Thu, 18 Aug 2016 14:51:01 +0000 (22:51 +0800)]
Factor write_ty out of check_struct_expr

7 years agoFactor write_ty out of field/indexing methods
Andrew Cann [Thu, 18 Aug 2016 14:07:57 +0000 (22:07 +0800)]
Factor write_ty out of field/indexing methods

7 years agoFactor write_ty out of more checking functions
Andrew Cann [Thu, 18 Aug 2016 13:09:21 +0000 (21:09 +0800)]
Factor write_ty out of more checking functions

7 years agoFactor write_ty out of check_binop*
Andrew Cann [Thu, 18 Aug 2016 09:16:42 +0000 (17:16 +0800)]
Factor write_ty out of check_binop*

7 years agoRemove redundant error checking around ExprMethodCall
Andrew Cann [Thu, 18 Aug 2016 06:21:13 +0000 (14:21 +0800)]
Remove redundant error checking around ExprMethodCall

7 years agoRemove most uses of expr_ty
Andrew Cann [Tue, 9 Aug 2016 16:13:20 +0000 (00:13 +0800)]
Remove most uses of expr_ty

7 years agoMake write_ty and friends return adjusted type
Andrew Cann [Tue, 9 Aug 2016 12:57:41 +0000 (20:57 +0800)]
Make write_ty and friends return adjusted type

7 years agoRemove mention of `unsafe_no_drop_flag` from Reference and Nomicon
Andrew Paseltiner [Mon, 5 Sep 2016 02:57:27 +0000 (22:57 -0400)]
Remove mention of `unsafe_no_drop_flag` from Reference and Nomicon