]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #33232 - jseyfried:resolve_ast_groundwork, r=nrc
bors [Fri, 29 Apr 2016 16:02:36 +0000 (09:02 -0700)]
Auto merge of #33232 - jseyfried:resolve_ast_groundwork, r=nrc

resolve: cleanup and groundwork for resolving the AST

Cleanup `resolve` and refactor away uses of the hir map (incorrectly named `ast_map`).
r? @nrc

8 years agoAuto merge of #33272 - Manishearth:rollup, r=Manishearth
bors [Fri, 29 Apr 2016 13:49:45 +0000 (06:49 -0700)]
Auto merge of #33272 - Manishearth:rollup, r=Manishearth

Rollup of 4 pull requests

- Successful merges: #33239, #33248, #33253, #33258
- Failed merges:

8 years agoRollup merge of #33258 - birkenfeld:fmt-dollar-syntax, r=brson
Manish Goregaokar [Fri, 29 Apr 2016 10:33:32 +0000 (16:03 +0530)]
Rollup merge of #33258 - birkenfeld:fmt-dollar-syntax, r=brson

Clarify std::fmt width docs w.r.t. dollar syntax and give example.

The previous version only said "the `2$` syntax", which while introduced in the grammar is not very self-explanatory.

8 years agoRollup merge of #33253 - ergenekonyigit:master, r=alexcrichton
Manish Goregaokar [Fri, 29 Apr 2016 10:33:31 +0000 (16:03 +0530)]
Rollup merge of #33253 - ergenekonyigit:master, r=alexcrichton

rustdoc: fixed some RFCs

r? @alexcrichton

8 years agoRollup merge of #33248 - jseyfried:fix_save_analysis_bug, r=nrc
Manish Goregaokar [Fri, 29 Apr 2016 10:33:31 +0000 (16:03 +0530)]
Rollup merge of #33248 - jseyfried:fix_save_analysis_bug, r=nrc

rustc_save_analysis: fix a bug in which glob imports are not dumped

This fixes #33213, a bug that prevents glob imports from being included in the save-analysis data.
r? @nrc

8 years agoAuto merge of #33093 - alexcrichton:rustbuild-rmake, r=nikomatsakis
bors [Fri, 29 Apr 2016 06:34:00 +0000 (23:34 -0700)]
Auto merge of #33093 - alexcrichton:rustbuild-rmake, r=nikomatsakis

test: Move run-make tests into compiletest

Forcing them to be embedded in makefiles precludes being able to run them in
rustbuild, and adding them to compiletest gives us a great way to leverage
future enhancements to our "all encompassing test suite runner" as well as just
moving more things into Rust.

All tests are still Makefile-based in the sense that they rely on `make` being
available to run them, but there's no longer any Makefile-trickery to run them
and rustbuild can now run them out of the box as well.

8 years agotest: Move run-make tests into compiletest
Alex Crichton [Thu, 14 Apr 2016 22:51:03 +0000 (15:51 -0700)]
test: Move run-make tests into compiletest

Forcing them to be embedded in makefiles precludes being able to run them in
rustbuild, and adding them to compiletest gives us a great way to leverage
future enhancements to our "all encompassing test suite runner" as well as just
moving more things into Rust.

All tests are still Makefile-based in the sense that they rely on `make` being
available to run them, but there's no longer any Makefile-trickery to run them
and rustbuild can now run them out of the box as well.

8 years agoFix #33213, a bug in which glob imports are not included in save-analysis data
Jeffrey Seyfried [Wed, 27 Apr 2016 22:57:19 +0000 (22:57 +0000)]
Fix #33213, a bug in which glob imports are not included in save-analysis data

8 years agoAuto merge of #33171 - michaelwoerister:collector-drop-glue, r=nikomatsakis
bors [Thu, 28 Apr 2016 21:37:30 +0000 (14:37 -0700)]
Auto merge of #33171 - michaelwoerister:collector-drop-glue, r=nikomatsakis

Some preliminary work towards making trans "collector driven".

The `trans::collector` already collects all translation items and `trans::partitioning` distributes these translation items into codegen units. The changes in this PR provide the following extensions to this functionality:

1. Drop-glue is handled more accurately now, knowing about the difference between `DropGlueKind::Ty` and `DropGlueKind::TyContents`.
2. The partitioning module now supports the `FixedUnitCount` strategy which more or less corresponds to the partitioning one gets via supplying `-Ccodegen-units` today.
3. The partitioning scheme also takes care of assigned LLVM declarations to codegen units, not just definitions (declarations for external items not yet implemented).

It's debatable whether declarations should be handled by the partitioning scheme or whether they should just be emitted on demand.

8 years agoMake the codegen unit partitioner also emit item declarations.
Michael Woerister [Fri, 22 Apr 2016 18:07:23 +0000 (14:07 -0400)]
Make the codegen unit partitioner also emit item declarations.

8 years agoAuto merge of #33217 - aochagavia:fileloader, r=nrc
bors [Thu, 28 Apr 2016 19:27:27 +0000 (12:27 -0700)]
Auto merge of #33217 - aochagavia:fileloader, r=nrc

rustc_driver: Allow running the compiler with a FileLoader

cc @nrc. I chose to implement this in such a way that it doesn't break anything. Please let me know if you want me to change anything.

8 years agoAdd FixedUnitCount codegen unit partitioning strategy.
Michael Woerister [Thu, 21 Apr 2016 20:45:33 +0000 (16:45 -0400)]
Add FixedUnitCount codegen unit partitioning strategy.

8 years agoLet the translation item collector make a distinction between drop-glue kinds
Michael Woerister [Thu, 21 Apr 2016 19:36:57 +0000 (15:36 -0400)]
Let the translation item collector make a distinction between drop-glue kinds

8 years agoAuto merge of #33211 - alexcrichton:android-back-in-time, r=nagisa
bors [Thu, 28 Apr 2016 17:17:44 +0000 (10:17 -0700)]
Auto merge of #33211 - alexcrichton:android-back-in-time, r=nagisa

std: Add compatibility with android-9

The Gecko folks currently use Android API level 9 for their builds, so they're
requesting that we move back our minimum supported API level from 18 to 9. Turns
out, ABI-wise at least, there's not that many changes we need to take care of.
The `ftruncate64` API appeared in android-12 and the `log2` and `log2f` APIs
appeared in android-18. We can have a simple shim for `ftruncate64` which falls
back on `ftruncate` and the `log2` function can be approximated with just
`ln(f) / ln(2)`.

This should at least get the standard library building on API level 9, although
the tests aren't quite happening there just yet. As we seem to be growing a
number of Android compatibility shims, they're now centralized in a common
`sys::android` module.

8 years agoClarify std::fmt width docs w.r.t. dollar syntax and give example.
Georg Brandl [Thu, 28 Apr 2016 15:49:10 +0000 (17:49 +0200)]
Clarify std::fmt width docs w.r.t. dollar syntax and give example.

8 years agoAuto merge of #33257 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 28 Apr 2016 14:59:02 +0000 (07:59 -0700)]
Auto merge of #33257 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #32991, #33056, #33095, #33152, #33212, #33218, #33234
- Failed merges: #32912

8 years agoRollup merge of #33234 - TomasHubelbauer:TomasHubelbauer-patch-1, r=GuillaumeGomez
Steve Klabnik [Thu, 28 Apr 2016 13:51:44 +0000 (09:51 -0400)]
Rollup merge of #33234 - TomasHubelbauer:TomasHubelbauer-patch-1, r=GuillaumeGomez

Fix use of the `move` command in the Windows shell

`move` works both in `cmd` and in Powershell. `mv` works only in Powershell and the book says nothing about which shell is recommended so this could confuse beginners.

Closes #33219.

8 years agoRollup merge of #33218 - oli-obk:interned_str_cmp, r=nikomatsakis
Steve Klabnik [Thu, 28 Apr 2016 13:51:44 +0000 (09:51 -0400)]
Rollup merge of #33218 - oli-obk:interned_str_cmp, r=nikomatsakis

allow InternedString to be compared to &str directly

8 years agoRollup merge of #33212 - bombless:scope-of-function-body, r=nikomatsakis
Steve Klabnik [Thu, 28 Apr 2016 13:51:44 +0000 (09:51 -0400)]
Rollup merge of #33212 - bombless:scope-of-function-body, r=nikomatsakis

Improve error message about regions of function body

"scope of parameters for functions" is harder for me to read than "scope of function body", I hope others feel the same, as in <https://play.rust-lang.org/?gist=b4df68b395b807698bd2ba98cf3d5ce3&version=stable&backtrace=0&run=1>
 Thank @Aatch for the help :)

8 years agoRollup merge of #33152 - bwinterton:master, r=steveklabnik
Steve Klabnik [Thu, 28 Apr 2016 13:51:44 +0000 (09:51 -0400)]
Rollup merge of #33152 - bwinterton:master, r=steveklabnik

Make HashSet::Insert documentation more consistent

I have made the HashSet::Insert documentation more consistent in the use of the term 'value' vs 'key'. Also clarified that if _this_ value is present true is returned, instead of the ambiguous 'a value present'.

r? @steveklabnik

8 years agoRollup merge of #33095 - xogeny:xogeny-patch-1, r=steveklabnik
Steve Klabnik [Thu, 28 Apr 2016 13:51:44 +0000 (09:51 -0400)]
Rollup merge of #33095 - xogeny:xogeny-patch-1, r=steveklabnik

Tweaks to sections related to Ownership

Reading through these sections, I thought the intro text could be improved slightly.  So
here is a PR that addresses what was bugging me about it. :-)

Main issue was the wording of the opening sentence ("guide" is not clearly defined and the
wording was a bit too terse in my opinion).  I also took issue with the term "one of the most
unique".  Uniqueness is a `bool`, not an `f64`. :-)

r? @steveklabnik

8 years agoRollup merge of #33056 - GuillaumeGomez:as_mut_ptr_example, r=steveklabnik
Steve Klabnik [Thu, 28 Apr 2016 13:51:43 +0000 (09:51 -0400)]
Rollup merge of #33056 - GuillaumeGomez:as_mut_ptr_example, r=steveklabnik

Improve as_mut ptr method example

r? @steveklabnik

8 years agoRollup merge of #32991 - kindlychung:patch-2, r=steveklabnik
Steve Klabnik [Thu, 28 Apr 2016 13:51:43 +0000 (09:51 -0400)]
Rollup merge of #32991 - kindlychung:patch-2, r=steveklabnik

make the borrowing example more concrete

8 years agoAuto merge of #33208 - nrc:save-json, r=pnkfelix
bors [Thu, 28 Apr 2016 12:47:57 +0000 (05:47 -0700)]
Auto merge of #33208 - nrc:save-json, r=pnkfelix

save-analysis: dump in JSON format

cc #18582

8 years agoAuto merge of #33161 - jseyfried:parse_tuple_struct_field_vis, r=nikomatsakis
bors [Thu, 28 Apr 2016 10:38:04 +0000 (03:38 -0700)]
Auto merge of #33161 - jseyfried:parse_tuple_struct_field_vis, r=nikomatsakis

Parse `pub(restricted)` visibilities on tuple struct fields

Parse `pub(restricted)` on tuple struct fields (cc #32409).

r? @nikomatsakis

8 years agoAuto merge of #32980 - Aatch:better-mir-building, r=nagisa
bors [Thu, 28 Apr 2016 08:26:45 +0000 (01:26 -0700)]
Auto merge of #32980 - Aatch:better-mir-building, r=nagisa

Various improvements to MIR and LLVM IR Construction

Primarily affects the MIR construction, which indirectly improves LLVM
IR generation, but some LLVM IR changes have been made too.

* Handle "statement expressions" more intelligently. These are
  expressions that always evaluate to `()`. Previously a temporary would
  be generated as a destination to translate into, which is unnecessary.

  This affects assignment, augmented assignment, `return`, `break` and
  `continue`.
* Avoid inserting drops for non-drop types in more places. Scheduled
  drops were already skipped for types that we knew wouldn't need
  dropping at construction time. However manually-inserted drops like
  those for `x` in `x = y;` were still generated. `build_drop` now takes
  a type parameter like its `schedule_drop` counterpart and checks to
  see if the type needs dropping.

* Avoid generating an extra temporary for an assignment where the types
  involved don't need dropping. Previously an expression like
  `a = b + 1;` would result in a temporary for `b + 1`. This is so the
  RHS can be evaluated, then the LHS evaluated and dropped and have
  everything work correctly. However, this isn't necessary if the `LHS`
  doesn't need a drop, as we can just overwrite the existing value.

* Improves lvalue analysis to allow treating an `Rvalue::Use` as an
  operand in certain conditions. The reason for it never being an
  operand is so it can be zeroed/drop-filled, but this is only true for
  types that need dropping.

The first two changes result in significantly fewer MIR blocks being
generated, as previously almost every statement would end up generating
a new block due to the drop of the `()` temporary being generated.

8 years agoupdate features RFC
Ergenekon Yigit [Thu, 28 Apr 2016 08:22:54 +0000 (11:22 +0300)]
update features RFC

8 years agoupdate comments RFC and code snippets
Ergenekon Yigit [Thu, 28 Apr 2016 08:22:11 +0000 (11:22 +0300)]
update comments RFC and code snippets

8 years agoAuto merge of #33151 - ollie27:rustdoc_abi, r=alexcrichton
bors [Thu, 28 Apr 2016 06:16:41 +0000 (23:16 -0700)]
Auto merge of #33151 - ollie27:rustdoc_abi, r=alexcrichton

rustdoc: Cleanup ABI rendering

Use a common method for rendering `extern "<abi>"`.

This now consistently shows `extern fn` rather than `extern "C" fn`.

8 years agoAddress style nits
Jeffrey Seyfried [Wed, 27 Apr 2016 19:30:16 +0000 (19:30 +0000)]
Address style nits

8 years agoAuto merge of #32791 - LeoTestard:feature-gate-clean, r=nikomatsakis
bors [Thu, 28 Apr 2016 01:35:29 +0000 (18:35 -0700)]
Auto merge of #32791 - LeoTestard:feature-gate-clean, r=nikomatsakis

Feature gate clean

This PR does a bit of cleaning in the feature-gate-handling code of libsyntax. It also fixes two bugs (#32782 and #32648). Changes include:

* Change the way the existing features are declared in `feature_gate.rs`. The array of features and the `Features` struct are now defined together by a single macro. `featureck.py` has been updated accordingly. Note: there are now three different arrays for active, removed and accepted features instead of a single one with a `Status` item to tell wether a feature is active, removed, or accepted. This is mainly due to the way I implemented my macro in the first time and I can switch back to a single array if needed. But an advantage of the way it is now is that when an active feature is used, the parser only searches through the list of active features. It goes through the other arrays only if the feature is not found. I like to think that error checking (in this case, checking that an used feature is active) does not slow down compilation of valid code. :) But this is not very important...
* Feature-gate checking pass now use the `Features` structure instead of looking through a string vector. This should speed them up a bit. The construction of the `Features` struct should be faster too since it is build directly when parsing features instead of calling `has_feature` dozens of times.
* The MacroVisitor pass has been removed, it was mostly useless since the `#[cfg]-stripping` phase happens before (fixes #32648). The features that must actually be checked before expansion are now checked at the time they are used. This also allows us to check attributes that are generated by macro expansion and not visible to MacroVisitor, but are also removed by macro expansion and thus not visible to PostExpansionVisitor either. This fixes #32782. Note that in order for `#[derive_*]` to be feature-gated but still accepted when generated by `#[derive(Trait)]`, I had to do a little bit of trickery with spans that I'm not totally confident into. Please review that part carefully. (It's in `libsyntax_ext/deriving/mod.rs`.)::

Note: this is a [breaking change], since programs with feature-gated attributes on macro-generated macro invocations were not rejected before. For example:

```rust
macro_rules! bar (
    () => ()
);

macro_rules! foo (
    () => (
        #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
        bar!();
    );
);
```
foo!();

8 years agoFactor out function call checking to a helper method
James Miller [Wed, 20 Apr 2016 23:43:01 +0000 (11:43 +1200)]
Factor out function call checking to a helper method

The logic for checking `call` and `invoke` instructions was duplicated
between them, so factor it out to a helper method.

8 years agoCheck when building invoke as well as calls
James Miller [Wed, 20 Apr 2016 06:10:40 +0000 (18:10 +1200)]
Check when building invoke as well as calls

LLVM's assertion doesn't provide much insight as to what the problem
was. We were already checking `call` instructions ourselves, so this
brings the checks from there to `invoke`.

Both the `invoke` and `call` checking is controlled by
`debug_assertions`.

8 years agoHandle immediate tuples in `trans_arguments_untupled`
James Miller [Wed, 20 Apr 2016 03:27:15 +0000 (15:27 +1200)]
Handle immediate tuples in `trans_arguments_untupled`

Use either getelementptr or extractvalue depending on whether or not the
tuple is immediate or not.

8 years agoFix codegen-units tests
James Miller [Sun, 17 Apr 2016 04:35:37 +0000 (16:35 +1200)]
Fix codegen-units tests

I'm not sure what the signficance of `drop-glue i8` is, nor why one of
the tests had it appear while the others had it disappear. Either way it
doesn't seem like the presence or absense of it is the focus of the
tests.

8 years agoMove zero-sized type handling logic to `new_operand`
James Miller [Sun, 17 Apr 2016 02:37:52 +0000 (14:37 +1200)]
Move zero-sized type handling logic to `new_operand`

`new_operand` now checks the type it's given and either creates the nil
value itself, or produces an empty operand.

8 years agoFix translation of `Assign`/`AssignOp` as rvalues
James Miller [Sat, 16 Apr 2016 07:45:28 +0000 (19:45 +1200)]
Fix translation of `Assign`/`AssignOp` as rvalues

In code like `let x = y = z;`, `y = z` goes through `as_rvalue`, which
didn't handle it. Now it translates the assignment and produces `()`
directly.

8 years agoFixup tests
James Miller [Sat, 16 Apr 2016 05:39:29 +0000 (17:39 +1200)]
Fixup tests

The drop glue for `i8` is no longer generated as a trans item

8 years agoAddress comments
James Miller [Sat, 16 Apr 2016 05:38:18 +0000 (17:38 +1200)]
Address comments

Moves `stmt_expr` into its own module, `expr::stmt`.

8 years agoVarious improvements to MIR and LLVM IR Construction
James Miller [Fri, 15 Apr 2016 00:36:16 +0000 (12:36 +1200)]
Various improvements to MIR and LLVM IR Construction

Primarily affects the MIR construction, which indirectly improves LLVM
IR generation, but some LLVM IR changes have been made too.

* Handle "statement expressions" more intelligently. These are
  expressions that always evaluate to `()`. Previously a temporary would
  be generated as a destination to translate into, which is unnecessary.

  This affects assignment, augmented assignment, `return`, `break` and
  `continue`.
* Avoid inserting drops for non-drop types in more places. Scheduled
  drops were already skipped for types that we knew wouldn't need
  dropping at construction time. However manually-inserted drops like
  those for `x` in `x = y;` were still generated. `build_drop` now takes
  a type parameter like its `schedule_drop` counterpart and checks to
  see if the type needs dropping.
* Avoid generating an extra temporary for an assignment where the types
  involved don't need dropping. Previously an expression like
  `a = b + 1;` would result in a temporary for `b + 1`. This is so the
  RHS can be evaluated, then the LHS evaluated and dropped and have
  everything work correctly. However, this isn't necessary if the `LHS`
  doesn't need a drop, as we can just overwrite the existing value.
* Improves lvalue analysis to allow treating an `Rvalue::Use` as an
  operand in certain conditions. The reason for it never being an
  operand is so it can be zeroed/drop-filled, but this is only true for
  types that need dropping.

The first two changes result in significantly fewer MIR blocks being
generated, as previously almost every statement would end up generating
a new block due to the drop of the `()` temporary being generated.

8 years agoAdd tests
Jeffrey Seyfried [Sat, 23 Apr 2016 06:22:38 +0000 (06:22 +0000)]
Add tests

8 years agoAuto merge of #33199 - mitaa:tokenize-responsibly, r=nrc
bors [Wed, 27 Apr 2016 20:49:45 +0000 (13:49 -0700)]
Auto merge of #33199 - mitaa:tokenize-responsibly, r=nrc

Make some fatal lexer errors recoverable

I've kept the changes to a minimum since I'm not really sure if this approach is a acceptable.

fixes #12834

cc @nrc

8 years agoMake some fatal lexer errors recoverable
mitaa [Mon, 25 Apr 2016 15:20:32 +0000 (17:20 +0200)]
Make some fatal lexer errors recoverable

8 years agorustdoc: Render `extern fn` instead of `extern "C" fn`
Oliver Middleton [Wed, 27 Apr 2016 17:43:51 +0000 (18:43 +0100)]
rustdoc: Render `extern fn` instead of `extern "C" fn`

8 years agoReview changes and satisfy make tidy
Nick Cameron [Tue, 26 Apr 2016 20:51:00 +0000 (08:51 +1200)]
Review changes and satisfy make tidy

8 years agostd: Add compatibility with android-9
Alex Crichton [Mon, 25 Apr 2016 20:39:05 +0000 (13:39 -0700)]
std: Add compatibility with android-9

The Gecko folks currently use Android API level 9 for their builds, so they're
requesting that we move back our minimum supported API level from 18 to 9. Turns
out, ABI-wise at least, there's not that many changes we need to take care of.
The `ftruncate64` API appeared in android-12 and the `log2` and `log2f` APIs
appeared in android-18. We can have a simple shim for `ftruncate64` which falls
back on `ftruncate` and the `log2` function can be approximated with just
`ln(f) / ln(2)`.

This should at least get the standard library building on API level 9, although
the tests aren't quite happening there just yet. As we seem to be growing a
number of Android compatibility shims, they're now centralized in a common
`sys::android` module.

8 years agoAuto merge of #33214 - oli-obk:const_err_var_exprs, r=eddyb
bors [Wed, 27 Apr 2016 11:00:16 +0000 (04:00 -0700)]
Auto merge of #33214 - oli-obk:const_err_var_exprs, r=eddyb

report `const_err` on all expressions that can fail

also a drive-by fix for reporting an "overflow in shift *left*" when shifting an `i64` *right*

This increases the warning noise for shifting by more than the bitwidth and for `-T::MIN`. I can silence the bitwidth warnings explicitly and fix the const evaluator to make sure `--$expr` is treated exactly like `$expr` (which is kinda wrong, but mathematically right).

r? @eddyb

8 years agoFix use of the `move` command in the Windows shell
Tomáš Hübelbauer [Wed, 27 Apr 2016 08:56:35 +0000 (10:56 +0200)]
Fix use of the `move` command in the Windows shell

`move` work both in `cmd` and in Powershell. `mv` works only in Powershell and the book says nothing about which shell is recommended so this could confuse beginners.

Closes #33219.

8 years agorustc_driver: Allow running the compiler with a FileLoader
Adolfo Ochagavía [Tue, 26 Apr 2016 12:11:03 +0000 (14:11 +0200)]
rustc_driver: Allow running the compiler with a FileLoader

8 years agoupdate Cargo.toml for rustbuild
Oliver Schneider [Wed, 27 Apr 2016 08:47:46 +0000 (10:47 +0200)]
update Cargo.toml for rustbuild

8 years agoAvoid using the hir map when visibility checking in `resolve`
Jeffrey Seyfried [Wed, 27 Apr 2016 02:29:59 +0000 (02:29 +0000)]
Avoid using the hir map when visibility checking in `resolve`

Refactor `ty::Visibility` methods to use a new trait `NodeIdTree` instead of the ast map.

8 years agoRefactor away a use of `ast_map.span_if_local()`
Jeffrey Seyfried [Wed, 27 Apr 2016 01:18:04 +0000 (01:18 +0000)]
Refactor away a use of `ast_map.span_if_local()`

8 years agoAuto merge of #33226 - fabricedesre:update-llvm, r=alexcrichton
bors [Wed, 27 Apr 2016 05:47:40 +0000 (22:47 -0700)]
Auto merge of #33226 - fabricedesre:update-llvm, r=alexcrichton

Update llvm to 751345228a0ef03fd147394bb5104359b7a808be

Picking up the changes from https://github.com/rust-lang/llvm/commit/751345228a0ef03fd147394bb5104359b7a808be

r? @alexcrichton

8 years agoRefactor `resolve_crate_relative_path` and `resolve_module_relative_path`
Jeffrey Seyfried [Wed, 27 Apr 2016 00:59:53 +0000 (00:59 +0000)]
Refactor `resolve_crate_relative_path` and `resolve_module_relative_path`
to return a `NameBinding` instead of a `Def`

8 years agoRefactor away `get_trait_name`
Jeffrey Seyfried [Mon, 25 Apr 2016 05:34:59 +0000 (05:34 +0000)]
Refactor away `get_trait_name`

8 years agoRefactor away `is_static_method`
Jeffrey Seyfried [Tue, 26 Apr 2016 08:29:13 +0000 (08:29 +0000)]
Refactor away `is_static_method`

8 years agoRefactor away `FallbackChecks` and remove dead code
Jeffrey Seyfried [Tue, 26 Apr 2016 07:58:58 +0000 (07:58 +0000)]
Refactor away `FallbackChecks` and remove dead code

8 years agoRefactor field `span` of `NameBinding` from `Option<Span>` to `Span`.
Jeffrey Seyfried [Wed, 27 Apr 2016 01:13:15 +0000 (01:13 +0000)]
Refactor field `span` of `NameBinding` from `Option<Span>` to `Span`.

8 years agoUpdate llvm to 751345228a0ef03fd147394bb5104359b7a808be
Fabrice Desré [Wed, 27 Apr 2016 00:03:14 +0000 (17:03 -0700)]
Update llvm to 751345228a0ef03fd147394bb5104359b7a808be

8 years agoAuto merge of #31414 - durka:clone-copy, r=alexcrichton
bors [Tue, 26 Apr 2016 21:54:37 +0000 (14:54 -0700)]
Auto merge of #31414 - durka:clone-copy, r=alexcrichton

special-case #[derive(Copy, Clone)] with a shallow clone

If a type is Copy then its Clone implementation can be a no-op. Currently `#[derive(Clone)]` generates a deep clone anyway. This can lead to lots of code bloat.

This PR detects the case where Copy and Clone are both being derived (the general case of "is this type Copy" can't be determined by a syntax extension) and generates the shallow Clone impl. Right now this can only be done if there are no type parameters (see https://github.com/rust-lang/rust/issues/31085#issuecomment-178988663), but this restriction can be removed after specialization.

Fixes #31085.

8 years agoAuto merge of #33191 - alexcrichton:rustdoc-create-dir-all-racy, r=steveklabnik
bors [Tue, 26 Apr 2016 19:00:35 +0000 (12:00 -0700)]
Auto merge of #33191 - alexcrichton:rustdoc-create-dir-all-racy, r=steveklabnik

rustdoc: Handle concurrent mkdir requests

It's likely that `rustdoc` as a tool is run concurrently in the same output
(e.g. documenting multiple crates as Cargo does), in which case it needs to
handle concurrent calls to `fs::create_dir`.

8 years agoshallow Clone for #[derive(Copy,Clone)]
Alex Burka [Thu, 4 Feb 2016 00:40:59 +0000 (19:40 -0500)]
shallow Clone for #[derive(Copy,Clone)]

Changes #[derive(Copy, Clone)] to use a faster impl of Clone when
both derives are present, and there are no generics in the type.

The faster impl is simply returning *self (which works because the
type is also Copy). See the comments in libsyntax_ext/deriving/clone.rs
for more details.

There are a few types which are Copy but not Clone, in violation
of the definition of Copy. These include large arrays and tuples. The
very existence of these types is arguably a bug, but in order for this
optimization not to change the applicability of #[derive(Copy, Clone)],
the faster Clone impl also injects calls to a new function,
core::clone::assert_receiver_is_clone, to verify that all members are
actually Clone.

This is not a breaking change, because pursuant to RFC 1521, any type
that implements Copy should not do any observable work in its Clone
impl.

8 years agoAuto merge of #33142 - tshepang:split-long-line, r=guillaumegomez
bors [Tue, 26 Apr 2016 16:04:27 +0000 (09:04 -0700)]
Auto merge of #33142 - tshepang:split-long-line, r=guillaumegomez

doc: that line was too long

8 years agoUpdate references-and-borrowing.md
Kaiyin Zhong [Tue, 26 Apr 2016 15:40:59 +0000 (17:40 +0200)]
Update references-and-borrowing.md

add as 2nd example.

8 years agoallow InternedString to be compared to &str directly
Oliver Schneider [Tue, 26 Apr 2016 14:27:10 +0000 (16:27 +0200)]
allow InternedString to be compared to &str directly

8 years agoAuto merge of #33203 - Ryman:patch-3, r=alexcrichton
bors [Tue, 26 Apr 2016 13:57:03 +0000 (06:57 -0700)]
Auto merge of #33203 - Ryman:patch-3, r=alexcrichton

libstd: fix typos in thread::LocalKey docs

8 years agodon't demote expressions just because const_eval fails
Oliver Schneider [Tue, 26 Apr 2016 13:32:18 +0000 (15:32 +0200)]
don't demote expressions just because const_eval fails

this might introduce subtle bugs to code generation

8 years agoskip non-const-path errors for now
Oliver Schneider [Tue, 26 Apr 2016 12:11:14 +0000 (14:11 +0200)]
skip non-const-path errors for now

Associated constants aren't implemented fully in early const eval

8 years agodon't report bitshift overflow twice
Oliver Schneider [Tue, 26 Apr 2016 12:10:07 +0000 (14:10 +0200)]
don't report bitshift overflow twice

8 years agoskip double negation in const eval
Oliver Schneider [Tue, 26 Apr 2016 12:09:05 +0000 (14:09 +0200)]
skip double negation in const eval

8 years agoAuto merge of #32989 - GuillaumeGomez:e0393, r=Manishearth
bors [Tue, 26 Apr 2016 11:51:08 +0000 (04:51 -0700)]
Auto merge of #32989 - GuillaumeGomez:e0393, r=Manishearth

Add E0393 error explanation

Part of #32777.

r? @Manishearth
cc @steveklabnik

8 years agoAuto merge of #32962 - taralx:patch-1, r=GuillaumeGomez
bors [Tue, 26 Apr 2016 09:42:52 +0000 (02:42 -0700)]
Auto merge of #32962 - taralx:patch-1, r=GuillaumeGomez

Clean up some info log spam.

Some of this looks like merge cruft, but the region spam is especially noisy.

8 years agoconst_err lint all constant expressions
Oliver Schneider [Tue, 26 Apr 2016 09:18:48 +0000 (11:18 +0200)]
const_err lint all constant expressions

8 years agoreport shift right error instead of shift left error on right shift
Oliver Schneider [Tue, 26 Apr 2016 09:17:32 +0000 (11:17 +0200)]
report shift right error instead of shift left error on right shift

8 years agoAdd E0393 error explanation
Guillaume Gomez [Sat, 16 Apr 2016 03:33:10 +0000 (05:33 +0200)]
Add E0393 error explanation

8 years agoRefactor away field `vis` of `ModuleS`
Jeffrey Seyfried [Tue, 26 Apr 2016 04:20:50 +0000 (04:20 +0000)]
Refactor away field `vis` of `ModuleS`

8 years agoAuto merge of #33099 - eddyb:issue-33096, r=michaelwoerister
bors [Tue, 26 Apr 2016 07:36:03 +0000 (00:36 -0700)]
Auto merge of #33099 - eddyb:issue-33096, r=michaelwoerister

Normalize types before using them in debuginfo.

Small oversight, fixes #33096 - odd thing is that the old code doesn't look like it should've ever worked, although it wasn't using all of the type parameters, so maybe that's what changed.

8 years agoImprove error message about regions of function body
York Xiang [Tue, 26 Apr 2016 05:36:18 +0000 (13:36 +0800)]
Improve error message about regions of function body

8 years agoAuto merge of #33204 - Manishearth:rollup, r=Manishearth
bors [Tue, 26 Apr 2016 05:26:56 +0000 (22:26 -0700)]
Auto merge of #33204 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #33107, #33133, #33160, #33167, #33194, #33196, #33200
- Failed merges:

8 years agoAuto merge of #33210 - alexcrichton:fix-ndk-dir, r=alexcrichton
bors [Tue, 26 Apr 2016 01:48:05 +0000 (18:48 -0700)]
Auto merge of #33210 - alexcrichton:fix-ndk-dir, r=alexcrichton

mk: Fix use of deprecated configure var

The `--android-cross-path` has been deprecated for some time now, we should use
`CFG_ARM_LINUX_ANDROIDEABI_NDK` instead.

Ideally this would use the right triple, but we're only testing ARM for now.

8 years agomk: Fix use of deprecated configure var
Alex Crichton [Tue, 26 Apr 2016 01:35:58 +0000 (18:35 -0700)]
mk: Fix use of deprecated configure var

The `--android-cross-path` has been deprecated for some time now, we should use
`CFG_ARM_LINUX_ANDROIDEABI_NDK` instead.

Ideally this would use the right triple, but we're only testing ARM for now.

8 years agosave-analysis-json: lower def ids
Nick Cameron [Mon, 25 Apr 2016 22:31:48 +0000 (10:31 +1200)]
save-analysis-json: lower def ids

8 years agosave-analysis: expand smoke test to cover json and csv formats
Nick Cameron [Mon, 25 Apr 2016 22:16:44 +0000 (10:16 +1200)]
save-analysis: expand smoke test to cover json and csv formats

8 years agosave-analysis-json: thread through -z option
Nick Cameron [Mon, 25 Apr 2016 22:14:44 +0000 (10:14 +1200)]
save-analysis-json: thread through -z option

In fact, we make JSOn the default and add an option for save-analysis-csv for the legacy behaviour.

We also rename some bits and pieces `dxr` -> `save-analysis`

8 years agoRollup merge of #33200 - sfackler:nonblocking-docs, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:52 +0000 (01:44 +0530)]
Rollup merge of #33200 - sfackler:nonblocking-docs, r=alexcrichton

Fix reference to TCP in UDP docs

Closees #33195

8 years agoRollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:52 +0000 (01:44 +0530)]
Rollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichton

rustdoc: Linkify extern crates

fixes #33178

r? @alexcrichton

8 years agoRollup merge of #33194 - mitaa:rdoc-a, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:52 +0000 (01:44 +0530)]
Rollup merge of #33194 - mitaa:rdoc-a, r=alexcrichton

rustdoc: Improve accessibility of rustdoc pages

fixes #33131

r? @alexcrichton

8 years agoRollup merge of #33167 - benaryorg:master, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33167 - benaryorg:master, r=alexcrichton

clarify documentation of TcpStream::connect() for multiple valid addresses

I am not sure how the UDP part of the stdlib behaves when passing multiple valid addresses, but it should be mentioned as there are legit use cases for [`impl<'a> ToSocketAddrs for &'a [SocketAddr]`](http://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html), a TCP fallback only being one.

Just a little example program for anyone willing to enhance the documentation further:

```rust
use std::net::SocketAddr;
use std::net::ToSocketAddrs;
use std::net::TcpStream;

fn main()
{
let v: Vec<SocketAddr> = vec!
[
"127.0.0.1:1338".to_socket_addrs().unwrap().next().unwrap(),
"127.0.0.1:1337".to_socket_addrs().unwrap().next().unwrap(),
"127.0.0.1:1339".to_socket_addrs().unwrap().next().unwrap(),
];

let stream = TcpStream::connect(&v[..]).unwrap();
}
```

8 years agoRollup merge of #33160 - euclio:rustdoc-unstable-deprecated, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33160 - euclio:rustdoc-unstable-deprecated, r=alexcrichton

show unstable status for deprecated items

Fixes #32374.

8 years agoRollup merge of #33133 - mitaa:rdoc-smth-smth-impl, r=alexcrichton
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33133 - mitaa:rdoc-smth-smth-impl, r=alexcrichton

rustdoc: inline all the impls

This used to be done to avoid inlining impls referencing private items, but is now unnecessary since we actually check that impls do not reference non-doc-reachable items.

fixes #32881
fixes #33025
fixes #33113

r? @alexcrichton

8 years agoRollup merge of #33107 - sanxiyn:prev-impl-item, r=eddyb
Manish Goregaokar [Mon, 25 Apr 2016 20:14:51 +0000 (01:44 +0530)]
Rollup merge of #33107 - sanxiyn:prev-impl-item, r=eddyb

Show previous definition of duplicate impl item

Fix #32971.

8 years agolibstd: fix typos in thread::LocalKey docs
Ryman [Mon, 25 Apr 2016 20:01:19 +0000 (21:01 +0100)]
libstd: fix typos in thread::LocalKey docs

8 years agoAuto merge of #33115 - mbrubeck:vfp3-d16, r=nrc
bors [Mon, 25 Apr 2016 17:43:36 +0000 (10:43 -0700)]
Auto merge of #33115 - mbrubeck:vfp3-d16, r=nrc

Enable vfp3-d16 for ARMv7 Android target

Android's [armeabi-v7a ABI][1] guarantees at least VFPv3-d16 hardware FPU support, so Rust should include this in the default features for the `arm-linux-androideabi` target.

[1]: https://developer.android.com/ndk/guides/abis.html

8 years agoFix reference to TCP in UDP docs
Steven Fackler [Mon, 25 Apr 2016 16:12:51 +0000 (09:12 -0700)]
Fix reference to TCP in UDP docs

Closees #33195

8 years agoAuto merge of #32258 - nikomatsakis:fewer-errors, r=arielb1
bors [Mon, 25 Apr 2016 15:13:22 +0000 (08:13 -0700)]
Auto merge of #32258 - nikomatsakis:fewer-errors, r=arielb1

Suppress fallback and ambiguity errors

If the infcx has observed other errors, then suppress both default type
parameter fallback (which can be unreliable, as the full constraint set
is not available) and errors related to unresovled
variables (annoyingly, integer type variables cannot currently be
unified with error, so that has to be a separate mechanism). Also add a
flag to `infcx` to allow us to independently indicate when we have
observed an error and hence should trigger this suppression mode.

Fixes #31997

cc @alexcrichton
r? @arielb1

8 years agopatch test due to changes from compiletest-json
Niko Matsakis [Mon, 25 Apr 2016 13:38:06 +0000 (09:38 -0400)]
patch test due to changes from compiletest-json

8 years agoAuto merge of #33184 - tamird:misc-cleanup, r=alexcrichton
bors [Mon, 25 Apr 2016 12:45:52 +0000 (05:45 -0700)]
Auto merge of #33184 - tamird:misc-cleanup, r=alexcrichton

librustc_back: misc cleanup

r? @alexcrichton

8 years agosave-analysis-json: introduce a lowering step
Nick Cameron [Mon, 25 Apr 2016 10:53:01 +0000 (22:53 +1200)]
save-analysis-json: introduce a lowering step

...in which we make the spans nice.

8 years agoLinkify extern crates on rustdoc pages
mitaa [Mon, 25 Apr 2016 06:24:50 +0000 (08:24 +0200)]
Linkify extern crates on rustdoc pages

8 years agosave-analysis: implement JSON dumps
Nick Cameron [Mon, 25 Apr 2016 08:54:00 +0000 (20:54 +1200)]
save-analysis: implement JSON dumps