]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRename `target_module` to `module` or `imported_module`.
Jeffrey Seyfried [Thu, 18 Aug 2016 01:43:26 +0000 (01:43 +0000)]
Rename `target_module` to `module` or `imported_module`.

7 years agoImprove import failure detection.
Jeffrey Seyfried [Thu, 18 Aug 2016 00:11:56 +0000 (00:11 +0000)]
Improve import failure detection.

7 years agoRefactor out `finalize_import()` from `resolve_import()`.
Jeffrey Seyfried [Mon, 15 Aug 2016 08:19:09 +0000 (08:19 +0000)]
Refactor out `finalize_import()` from `resolve_import()`.

7 years agoCheck privacy in `resolve_name_in_module`.
Jeffrey Seyfried [Mon, 15 Aug 2016 22:43:25 +0000 (22:43 +0000)]
Check privacy in `resolve_name_in_module`.

7 years agoRefactor `value_determined` -> `value_result`, `type_determined` -> `type_result`.
Jeffrey Seyfried [Wed, 17 Aug 2016 20:48:53 +0000 (20:48 +0000)]
Refactor `value_determined` -> `value_result`, `type_determined` -> `type_result`.

7 years agoRefactor `resolve_module_path` to take an `Option<Span>` instead of a `Span`.
Jeffrey Seyfried [Mon, 15 Aug 2016 20:51:19 +0000 (20:51 +0000)]
Refactor `resolve_module_path` to take an `Option<Span>` instead of a `Span`.

7 years agoRefactor `record_used: bool` -> `record_used: Option<Span>`.
Jeffrey Seyfried [Fri, 5 Aug 2016 01:58:59 +0000 (01:58 +0000)]
Refactor `record_used: bool` -> `record_used: Option<Span>`.

7 years agoRefactor away the field `arenas` of `ModuleS`.
Jeffrey Seyfried [Wed, 17 Aug 2016 01:33:19 +0000 (01:33 +0000)]
Refactor away the field `arenas` of `ModuleS`.

7 years agoRefactor away `module.resolve_name()`.
Jeffrey Seyfried [Mon, 1 Aug 2016 20:43:48 +0000 (20:43 +0000)]
Refactor away `module.resolve_name()`.

7 years agoAdd field `current_vis` to `Resolver`.
Jeffrey Seyfried [Sun, 14 Aug 2016 23:42:05 +0000 (23:42 +0000)]
Add field `current_vis` to `Resolver`.

7 years agoClean up `build_reduced_graph.rs`.
Jeffrey Seyfried [Mon, 15 Aug 2016 01:08:31 +0000 (01:08 +0000)]
Clean up `build_reduced_graph.rs`.

7 years agoRefactor `unresolved_imports` -> `indeterminate_imports`.
Jeffrey Seyfried [Wed, 17 Aug 2016 00:52:18 +0000 (00:52 +0000)]
Refactor `unresolved_imports` -> `indeterminate_imports`.

7 years agoAdd field `parent` to `ImportDirective`.
Jeffrey Seyfried [Wed, 17 Aug 2016 00:42:14 +0000 (00:42 +0000)]
Add field `parent` to `ImportDirective`.

7 years agoRefactor `module.add_import_directive()` -> `resolver.add_import_directive()`.
Jeffrey Seyfried [Wed, 17 Aug 2016 00:22:03 +0000 (00:22 +0000)]
Refactor `module.add_import_directive()` -> `resolver.add_import_directive()`.

7 years agoAuto merge of #35736 - brson:relnotes, r=steveklabnik
bors [Wed, 17 Aug 2016 23:38:44 +0000 (16:38 -0700)]
Auto merge of #35736 - brson:relnotes, r=steveklabnik

1.11 changelog

[Rendered](https://github.com/brson/rust/blob/9863afe029092d421c9a3daafd6b7a718d53f1cf/RELEASES.md)

r? @steveklabnik

It's too late to get this into the actual release, but still needs to be backported to 1.12 beta.

7 years ago1.11 changelog
Brian Anderson [Tue, 16 Aug 2016 23:11:03 +0000 (16:11 -0700)]
1.11 changelog

7 years agoAuto merge of #35747 - jonathandturner:rollup, r=jonathandturner
bors [Wed, 17 Aug 2016 16:49:34 +0000 (09:49 -0700)]
Auto merge of #35747 - jonathandturner:rollup, r=jonathandturner

Rollup of 23 pull requests

- Successful merges: #34370, #35415, #35595, #35610, #35613, #35614, #35621, #35660, #35663, #35670, #35671, #35672, #35681, #35686, #35690, #35695, #35707, #35708, #35713, #35722, #35725, #35726, #35731
- Failed merges: #35395

7 years agoAuto merge of #35733 - apasel422:issue-35721, r=alexcrichton
bors [Wed, 17 Aug 2016 13:25:56 +0000 (06:25 -0700)]
Auto merge of #35733 - apasel422:issue-35721, r=alexcrichton

Make `vec::IntoIter` covariant again

Closes #35721

r? @alexcrichton

7 years agoRollup merge of #35731 - pythoneer:fix-35192, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:28 +0000 (06:25 -0700)]
Rollup merge of #35731 - pythoneer:fix-35192, r=jonathandturner

Update E0005 to use a label

Fixes #35192 as Part of #35233

r? @jonathandturner

7 years agoRollup merge of #35726 - mikhail-m1:master2, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:28 +0000 (06:25 -0700)]
Rollup merge of #35726 - mikhail-m1:master2, r=jonathandturner

update E0409 to new error format

fixes #35699 as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35725 - brson:bump, r=alexcrichton
Jonathan Turner [Wed, 17 Aug 2016 13:25:27 +0000 (06:25 -0700)]
Rollup merge of #35725 - brson:bump, r=alexcrichton

Bump version to 1.13

7 years agoRollup merge of #35722 - knight42:update-error-msg, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:27 +0000 (06:25 -0700)]
Rollup merge of #35722 - knight42:update-error-msg, r=jonathandturner

Updated E0394 & E0422 to new format

Fixes #35692 and #35700, as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35713 - sanxiyn:ui-test, r=nikomatsakis
Jonathan Turner [Wed, 17 Aug 2016 13:25:27 +0000 (06:25 -0700)]
Rollup merge of #35713 - sanxiyn:ui-test, r=nikomatsakis

Use UI test to test spans, instead of forced line break

There must be lots more, but these are what I could easily find.

7 years agoRollup merge of #35708 - sanxiyn:new-error-format, r=nikomatsakis
Jonathan Turner [Wed, 17 Aug 2016 13:25:27 +0000 (06:25 -0700)]
Rollup merge of #35708 - sanxiyn:new-error-format, r=nikomatsakis

RUST_NEW_ERROR_FORMAT is no more

So stop setting the environment variable.

7 years agoRollup merge of #35707 - frewsxcv:vec-into-iter-debug, r=alexcrichton
Jonathan Turner [Wed, 17 Aug 2016 13:25:26 +0000 (06:25 -0700)]
Rollup merge of #35707 - frewsxcv:vec-into-iter-debug, r=alexcrichton

Implement `Debug` for `std::vec::IntoIter`.

Display all the remaining items of the iterator, similar to the `Debug`
implementation for `core::slice::Iter`:

https://github.com/rust-lang/rust/blob/f0bab98695f0a4877daabad9a5b0ba3e66121392/src/libcore/slice.rs#L930-L937

Using the `as_slice` method that was added in:

https://github.com/rust-lang/rust/pull/35447

7 years agoRollup merge of #35695 - matthew-piziak:vec-assert-over-println, r=GuillaumeGomez
Jonathan Turner [Wed, 17 Aug 2016 13:25:26 +0000 (06:25 -0700)]
Rollup merge of #35695 - matthew-piziak:vec-assert-over-println, r=GuillaumeGomez

accumulate into vector and assert, instead of printing

I'm only making this change in one place so that people can express
their preferences for this stylistic change. If/when this change is
approved I'll go ahead and translate the rest of the `std::ops`
examples.

7 years agoRollup merge of #35690 - matthew-piziak:op-overloading-limited, r=steveklabnik
Jonathan Turner [Wed, 17 Aug 2016 13:25:26 +0000 (06:25 -0700)]
Rollup merge of #35690 - matthew-piziak:op-overloading-limited, r=steveklabnik

expound on limitations of Rust's trait-based operator overloading

Part of #29330

7 years agoRollup merge of #35686 - mikhail-m1:master, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:26 +0000 (06:25 -0700)]
Rollup merge of #35686 - mikhail-m1:master, r=jonathandturner

update E0375 to new format

fixes #35635 as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35681 - Rufflewind:patch-1, r=apasel422
Jonathan Turner [Wed, 17 Aug 2016 13:25:26 +0000 (06:25 -0700)]
Rollup merge of #35681 - Rufflewind:patch-1, r=apasel422

Fix spacing in code of closures.md

The spacing seems inconsistent with existing style conventions.

7 years agoRollup merge of #35672 - yossi-k:issue/35323, r=GuillaumeGomez
Jonathan Turner [Wed, 17 Aug 2016 13:25:25 +0000 (06:25 -0700)]
Rollup merge of #35672 - yossi-k:issue/35323, r=GuillaumeGomez

Update E0322 to new format

Fixes #35323. Part of #35233.
r? @GuillaumeGomez

7 years agoRollup merge of #35671 - canaltinova:E0392, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:25 +0000 (06:25 -0700)]
Rollup merge of #35671 - canaltinova:E0392, r=jonathandturner

Update E0392 to new error format

Fixes #35631. Part of #35233
r? @jonathandturner or @GuillaumeGomez

7 years agoRollup merge of #35670 - RockyTV:e0365, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:25 +0000 (06:25 -0700)]
Rollup merge of #35670 - RockyTV:e0365, r=jonathandturner

Update error E0365 to new format

Fixes #35633 as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35663 - CryZe:no-stdlib, r=Manishearth
Jonathan Turner [Wed, 17 Aug 2016 13:25:25 +0000 (06:25 -0700)]
Rollup merge of #35663 - CryZe:no-stdlib, r=Manishearth

Improve `No stdlib` and related Documentation

This renames all lang item function names to the ones used in `libstd` and `libpanic_unwind`. It also explains the `eh_unwind_resume` lang item in the `libcore` documentation, where it was missing. A third function is also needed on certain compilation targets, so this was also added to the `No stdlib` documentation.

7 years agoRollup merge of #35660 - terrynsun:e0207, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:24 +0000 (06:25 -0700)]
Rollup merge of #35660 - terrynsun:e0207, r=jonathandturner

Update E0207 label to report parameter type

Fixes #35642.

r? @jonathandturner (Is this okay? I tagged you since it's a simple error fix similar to the other update ones.)

7 years agoRollup merge of #35621 - frewsxcv:cstring-from-vec-doc, r=peschkaj
Jonathan Turner [Wed, 17 Aug 2016 13:25:24 +0000 (06:25 -0700)]
Rollup merge of #35621 - frewsxcv:cstring-from-vec-doc, r=peschkaj

Add doc example for `std::ffi::CString::from_vec_unchecked`.

None

7 years agoRollup merge of #35614 - srinivasreddy:syntax_ext_rustfmt, r=nikomatsakis
Jonathan Turner [Wed, 17 Aug 2016 13:25:24 +0000 (06:25 -0700)]
Rollup merge of #35614 - srinivasreddy:syntax_ext_rustfmt, r=nikomatsakis

run rustfmt on libsyntax_ext folder

7 years agoRollup merge of #35613 - matthew-piziak:array-docs-trait-justification, r=steveklabnik
Jonathan Turner [Wed, 17 Aug 2016 13:25:24 +0000 (06:25 -0700)]
Rollup merge of #35613 - matthew-piziak:array-docs-trait-justification, r=steveklabnik

provide additional justification for array interface design

Explain why Rust does not implement traits for large arrays.

Explain why most methods are implemented on slices rather than arrays.

Note: I'm dipping my toes in the water with a tiny PR. Especially looking for feedback on wording and style. Points of concern: appropriate level of top-level explanation; foreshadowing (is it appropriate to imply that we expect Rust's type system to eventually support size-generic arrays?); using `Foo` and `Bar` as type variables instead of e.g. `T` and `S`.

@peschkaj

7 years agoRollup merge of #35610 - JessRudder:33637-doc-update-for-str-representaton, r=stevekl...
Jonathan Turner [Wed, 17 Aug 2016 13:25:24 +0000 (06:25 -0700)]
Rollup merge of #35610 - JessRudder:33637-doc-update-for-str-representaton, r=steveklabnik

Add note to docs for &str that example is to demo internals only

r? @steveklabnik

This adds a note below the &str representation example explaining that the example provided should not be used under normal circumstances..

Would it make sense to point people in the direction of the method(s) they should use instead?  I left it out in the interest of not complicating the documentation, but, there's definitely an argument to be made for adding a bit of guidance in there.

7 years agoRollup merge of #35595 - urschrei:associated_types_docfix, r=steveklabnik
Jonathan Turner [Wed, 17 Aug 2016 13:25:23 +0000 (06:25 -0700)]
Rollup merge of #35595 - urschrei:associated_types_docfix, r=steveklabnik

Clarify type declaration language in Associated Types docs

A small fix for the Associated Types docs

r? @steveklabnik

7 years agoRollup merge of #35415 - silenuss:e0030-formatting, r=jonathandturner
Jonathan Turner [Wed, 17 Aug 2016 13:25:23 +0000 (06:25 -0700)]
Rollup merge of #35415 - silenuss:e0030-formatting, r=jonathandturner

Update compiler error 0030 to use new error format.

Part of #35233,
Addresses #35204

r? @jonathandturner

7 years agoRollup merge of #34370 - steveklabnik:keyword-ref-mention, r=Manishearth
Jonathan Turner [Wed, 17 Aug 2016 13:25:22 +0000 (06:25 -0700)]
Rollup merge of #34370 - steveklabnik:keyword-ref-mention, r=Manishearth

A disclaimer about keywords.

Some people cite this list as "zomg Rust has so many keywords," so make
it clear that these aren't all used by the language today.

7 years agoAuto merge of #35236 - nrc:rustdoc-redirects, r=@alexcrichton
bors [Wed, 17 Aug 2016 10:20:13 +0000 (03:20 -0700)]
Auto merge of #35236 - nrc:rustdoc-redirects, r=@alexcrichton

rustdoc: redirect URLs

cc #35020 which does this properly

r? @alexcrichton

7 years agoAuto merge of #35605 - eddyb:substs, r=nikomatsakis
bors [Wed, 17 Aug 2016 05:52:55 +0000 (22:52 -0700)]
Auto merge of #35605 - eddyb:substs, r=nikomatsakis

Remove the ParamSpace separation from formal and actual generics in rustc.

This is the first step towards enabling the typesystem implemented by `rustc` to be extended
(with generic modules, HKT associated types, generics over constants, etc.).

The current implementation splits all formal (`ty::Generics`) and actual (`Substs`) lifetime and type parameters (and even `where` clauses) into 3 "parameter spaces":
* `TypeSpace` for `enum`, `struct`, `trait` and `impl`
* `SelfSpace` for `Self` in a `trait`
* `FnSpace` for functions and methods

For example, in `<X as Trait<A, B>>::method::<T, U>`, the `Substs` are `[[A, B], [X], [T, U]]`.
The representation uses a single `Vec` with 2 indices where it's split into the 3 "parameter spaces".
Such a simplistic approach doesn't scale beyond the Rust 1.0 typesystem, and its existence was mainly motivated by keeping code manipulating generic parameters correct, across all possible situations.

Summary of changes:
* `ty::Generics` are uniformly stored and can be queried with `tcx.lookup_generics(def_id)`
 * the `typeck::collect` changes for this resulted in a function to lazily compute the `ty::Generics` for a local node, given only its `DefId` - this can be further generalized to other kinds of type information
* `ty::Generics` and `ty::GenericPredicates` now contain only their own parameters (or `where` clauses, respectively), and refer to their "parent", forming a linked list
 * right now most items have one level of nesting, only associated items and variants having two
 * in the future, if `<X as mod1<A>::mod2<B>::mod3::Trait<C>>::Assoc<Y>` is supported, it would be represented by item with the path `mod1::mod2::mod3::Trait::Assoc`, and 4 levels of generics: `mod1` with `[A]`, `mod2` with `[B]`, `Trait` with `[X, C]` and `Assoc` with `[Y]`
* `Substs` gets two new APIs for working with arbitrary items:
 * `Substs::for_item(def_id, mk_region, mk_type)` will construct `Substs` expected by the definition `def_id`, calling `mk_region` for lifetime parameters and `mk_type` for type parameters, and it's guaranteed to *always* return `Substs` compatible with `def_id`
 * `substs.rebase_onto(from_base_def_id, to_base_substs)` can be used if `substs` is for an item nested within `from_base_def_id` (e.g. an associated item), to replace the "outer parameters" with `to_base_substs` - for example, you can translate a method's `Substs` between a `trait` and an `impl` (in both directions) if you have the `DefId` of one and `Substs` for the other
* trait objects, without a `Self` in their `Substs`, use *solely* `ExistentialTraitRef` now, letting `TraitRef` assume it *always* has a `Self` present
* both `TraitRef` and `ExistentialTraitRef` get methods which do operations on their `Substs` which are valid only for traits (or trait objects, respectively)
* `Substs` loses its "parameter spaces" distinction, with effectively no code creating `Substs` in an ad-hoc manner, or inspecting them, without knowing what shape they have already

Future plans:
* combine both lifetimes and types in a single `Vec<Kind<'tcx>>` where `Kind` would be a tagged pointer that can be `Ty<'tcx>`, `&'tcx ty::Region` or, in the future, potentially-polymorphic constants
 * this would require some performance investigation, if it implies a lot of dynamic checks
* introduce an abstraction for `(T, Substs)`, where the `Substs` are even more hidden away from code
manipulating it; a precedent for this is `Instance` in trans, which has `T = DefId`; @nikomatsakis also referred to this, as "lazy substitution", when `T = Ty`
* rewrite type pretty-printing to fully take advantage of this to inject actual in the exact places of formal generic parameters in any paths
* extend the set of type-level information (e.g. beyond `ty::Generics`) that can be lazily queried during `typeck` and introduce a way to do those queries from code that can't refer to `typeck` directly
 * this is almost unrelated but is necessary for DAG-shaped recursion between constant evaluation and type-level information, i.e. for implementing generics over constants

r? @nikomatsakis
cc @rust-lang/compiler

cc @nrc Could get any perf numbers ahead of merging this?

7 years agoReview changes
Nick Cameron [Mon, 15 Aug 2016 22:27:07 +0000 (10:27 +1200)]
Review changes

7 years agorustc: remove ParamSpace from Substs.
Eduard Burtescu [Wed, 17 Aug 2016 03:32:00 +0000 (06:32 +0300)]
rustc: remove ParamSpace from Substs.

7 years agorustc: split GenericPredicates of a method from its parent predicates.
Eduard Burtescu [Thu, 11 Aug 2016 06:19:42 +0000 (09:19 +0300)]
rustc: split GenericPredicates of a method from its parent predicates.

7 years agorustc: split Generics of a method from its parent Generics.
Eduard Burtescu [Wed, 10 Aug 2016 17:39:09 +0000 (20:39 +0300)]
rustc: split Generics of a method from its parent Generics.

7 years agorustc: remove SelfSpace from ParamSpace.
Eduard Burtescu [Sun, 14 Aug 2016 22:07:09 +0000 (01:07 +0300)]
rustc: remove SelfSpace from ParamSpace.

7 years agorustc: reduce Substs and Generics to a simple immutable API.
Eduard Burtescu [Mon, 8 Aug 2016 20:39:49 +0000 (23:39 +0300)]
rustc: reduce Substs and Generics to a simple immutable API.

7 years agorustc_typeck: use Substs::from_generics instead of manually building them.
Eduard Burtescu [Wed, 17 Aug 2016 01:05:00 +0000 (04:05 +0300)]
rustc_typeck: use Substs::from_generics instead of manually building them.

7 years agorustc: move trait objects from TraitRef to ExistentialTraitRef.
Eduard Burtescu [Thu, 4 Aug 2016 12:52:57 +0000 (15:52 +0300)]
rustc: move trait objects from TraitRef to ExistentialTraitRef.

7 years agorustc: move defaulting's use of &mut Substs from InferCtxt to typeck.
Eduard Burtescu [Wed, 17 Aug 2016 00:56:18 +0000 (03:56 +0300)]
rustc: move defaulting's use of &mut Substs from InferCtxt to typeck.

7 years agorustc: avoid using subst::VecPerParamSpace::{empty,new} directly.
Eduard Burtescu [Tue, 14 Jun 2016 22:40:09 +0000 (01:40 +0300)]
rustc: avoid using subst::VecPerParamSpace::{empty,new} directly.

7 years agorustc: force all raw accesses to VecPerParamSpace through as_full_slice.
Eduard Burtescu [Mon, 13 Jun 2016 17:46:08 +0000 (20:46 +0300)]
rustc: force all raw accesses to VecPerParamSpace through as_full_slice.

7 years agorustc: move the SelfSpace before TypeSpace in Substs.
Eduard Burtescu [Mon, 13 Jun 2016 17:13:37 +0000 (20:13 +0300)]
rustc: move the SelfSpace before TypeSpace in Substs.

7 years agorustc: use Vec instead of VecPerParamSpace for ty::GenericPredicates.
Eduard Burtescu [Mon, 13 Jun 2016 17:10:32 +0000 (20:10 +0300)]
rustc: use Vec instead of VecPerParamSpace for ty::GenericPredicates.

7 years agoAuto merge of #35559 - frewsxcv:slice-iter-as-ref, r=alexcrichton
bors [Wed, 17 Aug 2016 02:44:10 +0000 (19:44 -0700)]
Auto merge of #35559 - frewsxcv:slice-iter-as-ref, r=alexcrichton

Implement `AsRef<[T]>` for `std::slice::Iter`.

`AsRef` is designed for conversions that are "cheap" (as per
the API docs). It is the case that retrieving the underlying
data of `std::slice::Iter` is cheap. In my opinion, there's no
ambiguity about what slice data will be returned, otherwise,
I would be more cautious about implementing `AsRef`.

7 years agoMake `vec::IntoIter` covariant again
Andrew Paseltiner [Wed, 17 Aug 2016 00:45:07 +0000 (20:45 -0400)]
Make `vec::IntoIter` covariant again

Closes #35721

7 years agoAuto merge of #35538 - cgswords:libproc_macro, r=nrc
bors [Tue, 16 Aug 2016 23:35:10 +0000 (16:35 -0700)]
Auto merge of #35538 - cgswords:libproc_macro, r=nrc

Kicking off libproc_macro

This PR introduces `libproc_macro`, which is currently quite bare-bones (just a few macro construction tools and an initial `quote!` macro).

This PR also introduces a few test cases for it, and an additional `shim` file (at `src/libsyntax/ext/proc_macro_shim.rs` to allow a facsimile usage of Macros 2.0 *today*!

7 years agoUpdate E0005 Unit-Test
Dustin Bensing [Tue, 16 Aug 2016 22:40:08 +0000 (00:40 +0200)]
Update E0005 Unit-Test

7 years agorustdoc: redirects from sane, namespaced URLs to Rustdoc's ridiculous ones
Nick Cameron [Wed, 3 Aug 2016 01:56:18 +0000 (13:56 +1200)]
rustdoc: redirects from sane, namespaced URLs to Rustdoc's ridiculous ones

cc #35020 which does this properly

7 years agorustdoc: add namespaces for items
Nick Cameron [Wed, 3 Aug 2016 01:19:06 +0000 (13:19 +1200)]
rustdoc: add namespaces for items

7 years agorustdoc: refactoring and tidying up
Nick Cameron [Wed, 3 Aug 2016 01:14:59 +0000 (13:14 +1200)]
rustdoc: refactoring and tidying up

pulled out of #35020

7 years agoUpdate E0005 to use a label
Dustin Bensing [Tue, 16 Aug 2016 21:50:32 +0000 (23:50 +0200)]
Update E0005 to use a label

7 years agoAuto merge of #35354 - tomgarcia:covariant-drain, r=alexcrichton
bors [Tue, 16 Aug 2016 20:26:15 +0000 (13:26 -0700)]
Auto merge of #35354 - tomgarcia:covariant-drain, r=alexcrichton

Made vec_deque::Drain, hash_map::Drain, and hash_set::Drain covariant

Fixed the rest of the Drain iterators.

7 years agoProc_macro is alive
cgswords [Thu, 4 Aug 2016 19:20:01 +0000 (12:20 -0700)]
Proc_macro is alive

7 years agoupdate to new error format E0409
Mikhail Modin [Tue, 16 Aug 2016 19:13:09 +0000 (22:13 +0300)]
update to new error format E0409

7 years agoUpdated E0394 to new error message
Knight [Tue, 16 Aug 2016 17:40:57 +0000 (01:40 +0800)]
Updated E0394 to new error message

7 years agoUpdated E0422 to new error message
Knight [Tue, 16 Aug 2016 16:57:44 +0000 (00:57 +0800)]
Updated E0422 to new error message

7 years agoBump version to 1.13
Brian Anderson [Tue, 16 Aug 2016 18:29:50 +0000 (11:29 -0700)]
Bump version to 1.13

7 years agoAuto merge of #35637 - japaric:no-builtins-lto, r=alexcrichton
bors [Tue, 16 Aug 2016 17:13:18 +0000 (10:13 -0700)]
Auto merge of #35637 - japaric:no-builtins-lto, r=alexcrichton

exclude `#![no_builtins]` crates from LTO

this prevents intrinsics like `memcpy` from being mis-optimized to
infinite recursive calls when LTO is used.

fixes #31544
closes #35540

---

r? @alexcrichton
cc @Amanieu

7 years agoAdd basic unit test for `std::slice::Iter::as_slice`.
Corey Farwell [Wed, 10 Aug 2016 00:51:47 +0000 (20:51 -0400)]
Add basic unit test for `std::slice::Iter::as_slice`.

7 years agoImplement `AsRef<[T]>` for `std::slice::Iter`.
Corey Farwell [Wed, 10 Aug 2016 00:49:41 +0000 (20:49 -0400)]
Implement `AsRef<[T]>` for `std::slice::Iter`.

`AsRef` is designed for conversions that are "cheap" (as per
the API docs). It is the case that retrieving the underlying
data of `std::slice::Iter` is cheap. In my opinion, there's no
ambiguity about what slice data will be returned, otherwise,
I would be more cautious about implementing `AsRef`.

7 years agoAuto merge of #35617 - jseyfried:fix_unused_cfg_attr_path, r=eddyb
bors [Tue, 16 Aug 2016 13:32:20 +0000 (06:32 -0700)]
Auto merge of #35617 - jseyfried:fix_unused_cfg_attr_path, r=eddyb

Fix incorrect unused import warnings on `cfg_attr`ed `path` attributes

Fixes #35584.
r? @eddyb

7 years agoUse UI test to test spans, instead of forced line break
Seo Sanghyeon [Tue, 16 Aug 2016 11:14:41 +0000 (20:14 +0900)]
Use UI test to test spans, instead of forced line break

7 years agoRUST_NEW_ERROR_FORMAT is no more
Seo Sanghyeon [Tue, 16 Aug 2016 07:52:30 +0000 (16:52 +0900)]
RUST_NEW_ERROR_FORMAT is no more

7 years agoAuto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakis
bors [Tue, 16 Aug 2016 07:12:12 +0000 (00:12 -0700)]
Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakis

Implement the `!` type

This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.

7 years agoImplement `Debug` for `std::vec::IntoIter`.
Corey Farwell [Tue, 16 Aug 2016 03:45:12 +0000 (23:45 -0400)]
Implement `Debug` for `std::vec::IntoIter`.

Display all the remaining items of the iterator, similar to the `Debug`
implementation for `core::slice::Iter`:

https://github.com/rust-lang/rust/blob/f0bab98695f0a4877daabad9a5b0ba3e66121392/src/libcore/slice.rs#L930-L937

Using the `as_slice` method that was added in:

https://github.com/rust-lang/rust/pull/35447

7 years agotest that a no_builtins crate is passed to the linker
Jorge Aparicio [Mon, 15 Aug 2016 02:56:48 +0000 (21:56 -0500)]
test that a no_builtins crate is passed to the linker

7 years agoremove `.take(10)` from `Range` example
Matthew Piziak [Mon, 15 Aug 2016 22:30:25 +0000 (18:30 -0400)]
remove `.take(10)` from `Range` example

7 years agoaccumulate into vector and assert, instead of printing
Matthew Piziak [Mon, 15 Aug 2016 22:03:11 +0000 (18:03 -0400)]
accumulate into vector and assert, instead of printing

I'm only making this change in one place so that people can express
their preferences for this stylistic change. If/when this change is
approved I'll go ahead and translate the rest of the `std::ops`
examples.

7 years agoexpound on limitations of Rust's trait-based operator overloading
Matthew Piziak [Mon, 15 Aug 2016 19:34:02 +0000 (15:34 -0400)]
expound on limitations of Rust's trait-based operator overloading

Part of #29330

7 years agoAuto merge of #35680 - GuillaumeGomez:err_codes, r=jonathandturner
bors [Mon, 15 Aug 2016 18:35:01 +0000 (11:35 -0700)]
Auto merge of #35680 - GuillaumeGomez:err_codes, r=jonathandturner

Err codes

r? @jonathandturner

7 years agoupdate E0375 to new format
Mikhail Modin [Mon, 15 Aug 2016 17:37:03 +0000 (20:37 +0300)]
update E0375 to new format

7 years agoAuto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakis
bors [Mon, 15 Aug 2016 15:35:18 +0000 (08:35 -0700)]
Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakis

Take commandline arguments into account for incr. comp.

Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727.

From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples.

The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct.

One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data.

It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map.

Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.

7 years agoA disclaimer about keywords.
Steve Klabnik [Sun, 19 Jun 2016 20:27:37 +0000 (16:27 -0400)]
A disclaimer about keywords.

Some people cite this list as "zomg Rust has so many keywords," so make
it clear that these aren't all used by the language today.

7 years agoAdd new error code tests
Guillaume Gomez [Mon, 15 Aug 2016 11:58:28 +0000 (13:58 +0200)]
Add new error code tests

7 years agoAdd E0394 error explanation
Guillaume Gomez [Mon, 15 Aug 2016 11:57:10 +0000 (13:57 +0200)]
Add E0394 error explanation

7 years agoFix spacing in code of closures.md
Phil Ruffwind [Mon, 11 Jul 2016 19:25:12 +0000 (15:25 -0400)]
Fix spacing in code of closures.md

The spacing seems inconsistent with existing style conventions.

7 years agoAuto merge of #35567 - creativcoder:e0261, r=jonathandturner
bors [Mon, 15 Aug 2016 12:12:35 +0000 (05:12 -0700)]
Auto merge of #35567 - creativcoder:e0261, r=jonathandturner

Update E0261 and E0262 to new error format

Fixes #35516 and  #35517 . Part of #35233
r? @jonathandturner

7 years agoUpdate compiler error 0030 to use new error format.
silenuss [Mon, 15 Aug 2016 06:21:13 +0000 (00:21 -0600)]
Update compiler error 0030 to use new error format.

7 years agoFix bug for ! in old trans
Andrew Cann [Mon, 15 Aug 2016 05:32:12 +0000 (13:32 +0800)]
Fix bug for ! in old trans

7 years agoAuto merge of #35638 - ahmedcharles:url, r=alexcrichton
bors [Mon, 15 Aug 2016 04:38:21 +0000 (21:38 -0700)]
Auto merge of #35638 - ahmedcharles:url, r=alexcrichton

Upgrade linkchecker to url 1.2.0.

7 years agorefactor: use CStore::is_no_builtins
Jorge Aparicio [Mon, 15 Aug 2016 02:56:26 +0000 (21:56 -0500)]
refactor: use CStore::is_no_builtins

7 years agoAuto merge of #35427 - cardoe:arm-musl-targets, r=alexcrichton
bors [Mon, 15 Aug 2016 01:36:33 +0000 (18:36 -0700)]
Auto merge of #35427 - cardoe:arm-musl-targets, r=alexcrichton

add GNU make files for arm-unknown-linux-musleabi

For Yocto (Embedded Linux meta distro) Rust is provided via the [meta-rust layer](https://github.com/meta-rust/meta-rust). In this project there have been patches to add `arm-unknown-linux-musleabi`. Rust recently acquired that support via #35060 but only for rustbuild. meta-rust is currently only able to build Rust support with the existing GNU Makefiles. This adds `arm-unknown-linux-musleabi` support to Rust for the GNU Makefiles until meta-rust is able to sort out why using rustbuild does not work for it.

/cc @srwalter @derekstraka @jmesmon @japaric

7 years agoAuto merge of #35666 - eddyb:rollup, r=eddyb
bors [Sun, 14 Aug 2016 22:27:15 +0000 (15:27 -0700)]
Auto merge of #35666 - eddyb:rollup, r=eddyb

Rollup of 30 pull requests

- Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661
- Failed merges: #35395, #35415

7 years agoUpdate E0392 to new error format
Nazım Can Altınova [Sun, 14 Aug 2016 21:12:42 +0000 (00:12 +0300)]
Update E0392 to new error format

7 years agoUpdate error E0365 to new format
Alexandre Oliveira [Sun, 14 Aug 2016 19:30:50 +0000 (16:30 -0300)]
Update error E0365 to new format

7 years agoAuto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakis
bors [Sun, 14 Aug 2016 19:28:48 +0000 (12:28 -0700)]
Auto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakis

[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}.

Storage live ranges are tracked for all MIR variables and temporaries with a drop scope.
`StorageLive` is lowered to `llvm.lifetime.start` and `StorageDead` to `llvm.lifetime.end`.

There are some improvements possible here, such as:
* pack multiple storage liveness statements by using the index of first local + `u64` bitset
* enforce that locals are not directly accessed outside their storage live range
* shrink storage live ranges for never-borrowed locals to initialization -> last use
* emit storage liveness statements for *all* temporaries
 * however, the remaining ones are *always* SSA immediates, so they'd be noop in MIR trans
 * could have a flag on the temporary that its storage is irrelevant (a la C's old `register`)
   * would also deny borrows if necessary
    * this seems like an overcompliation and with packing & optimizations it may be pointless

Even in the current state, it helps stage2 `rustc` compile `boiler` without overflowing (see #35408).

A later addition fixes #26764 and closes #27372 by emitting `.section` directives for dylib metadata to avoid them being allocated into memory or read as `.note`. For this PR, those bugs were tripping valgrind.

7 years agoUpdate E0322 to new format
Yossi Konstantinovsky [Sun, 14 Aug 2016 18:57:33 +0000 (21:57 +0300)]
Update E0322 to new format