]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agodebuginfo: Ignore macro-stepping test on aarch64
Michael Woerister [Wed, 30 Nov 2016 17:17:38 +0000 (12:17 -0500)]
debuginfo: Ignore macro-stepping test on aarch64

7 years agoAuto merge of #37989 - nrc:save-mod, r=nikomatsakis
bors [Wed, 30 Nov 2016 12:50:09 +0000 (12:50 +0000)]
Auto merge of #37989 - nrc:save-mod, r=nikomatsakis

save-analysis: redirect a module decl to the start of the defining file

7 years agoAuto merge of #37954 - eddyb:rustdoc-2, r=alexcrichton
bors [Wed, 30 Nov 2016 07:46:00 +0000 (07:46 +0000)]
Auto merge of #37954 - eddyb:rustdoc-2, r=alexcrichton

rustdoc: link to cross-crate sources directly.

Fixes #37684 by implementing proper support for getting the `Span` of definitions across crates.
In rustdoc this is used to generate direct links to the original source instead of fragile redirects.

This functionality could be expanded further for making error reporting code more uniform and seamless across crates, although at the moment there is no actual source to print, only file/line/column information.

Closes #37870 which is also "fixes" #37684 by throwing away the builtin macro docs from libcore.
After this lands, #37727 could be reverted, although it doesn't matter much either way.

7 years agorustdoc: link to cross-crate sources directly.
Eduard-Mihai Burtescu [Tue, 29 Nov 2016 06:15:16 +0000 (08:15 +0200)]
rustdoc: link to cross-crate sources directly.

7 years agorustc: track the Span's of definitions across crates.
Eduard-Mihai Burtescu [Wed, 23 Nov 2016 23:39:13 +0000 (01:39 +0200)]
rustc: track the Span's of definitions across crates.

7 years agoAuto merge of #37965 - Mark-Simulacrum:trait-obj-to-exis-predicate, r=eddyb
bors [Wed, 30 Nov 2016 02:41:38 +0000 (20:41 -0600)]
Auto merge of #37965 - Mark-Simulacrum:trait-obj-to-exis-predicate, r=eddyb

Refactor TraitObject to Slice<ExistentialPredicate>

For reference, the primary types changes in this PR are shown below. They may add in the understanding of what is discussed below, though they should not be required.

We change `TraitObject` into a list of `ExistentialPredicate`s to allow for a couple of things:
 - Principal (ExistentialPredicate::Trait) is now optional.
 - Region bounds are moved out of `TraitObject` into `TyDynamic`. This permits wrapping only the `ExistentialPredicate` list in `Binder`.
 - `BuiltinBounds` and `BuiltinBound` are removed entirely from the codebase, to permit future non-constrained auto traits. These are replaced with `ExistentialPredicate::AutoTrait`, which only requires a `DefId`. For the time being, only `Send` and `Sync` are supported; this constraint can be lifted in a future pull request.
 - Binder-related logic is extracted from `ExistentialPredicate` into the parent (`Binder<Slice<EP>>`), so `PolyX`s are inside `TraitObject` are replaced with `X`.

The code requires a sorting order for `ExistentialPredicate`s in the interned `Slice`. The sort order is asserted to be correct during interning, but the slices are not sorted at that point.

1. `ExistentialPredicate::Trait` are defined as always equal; **This may be wrong; should we be comparing them and sorting them in some way?**
1. `ExistentialPredicate::Projection`: Compared by `ExistentialProjection::sort_key`.
1. `ExistentialPredicate::AutoTrait`: Compared by `TraitDef.def_path_hash`.

Construction of `ExistentialPredicate`s is conducted through `TyCtxt::mk_existential_predicates`, which interns a passed iterator as a `Slice`. There are no convenience functions to construct from a set of separate iterators; callers must pass an iterator chain. The lack of convenience functions is primarily due to few uses and the relative difficulty in defining a nice API due to optional parts and difficulty in recognizing which argument goes where. It is also true that the current situation isn't significantly better than 4 arguments to a constructor function; but the extra work is deemed unnecessary as of this time.

```rust
// before this PR
struct TraitObject<'tcx> {
    pub principal: PolyExistentialTraitRef<'tcx>,
    pub region_bound: &'tcx ty::Region,
    pub builtin_bounds: BuiltinBounds,
    pub projection_bounds: Vec<PolyExistentialProjection<'tcx>>,
}

// after
pub enum ExistentialPredicate<'tcx> {
    // e.g. Iterator
    Trait(ExistentialTraitRef<'tcx>),
    // e.g. Iterator::Item = T
    Projection(ExistentialProjection<'tcx>),
    // e.g. Send
    AutoTrait(DefId),
}
```

7 years agoAuto merge of #37863 - mikhail-m1:mut_error, r=nikomatsakis
bors [Tue, 29 Nov 2016 23:27:00 +0000 (17:27 -0600)]
Auto merge of #37863 - mikhail-m1:mut_error, r=nikomatsakis

add hint to fix error for immutable ref in arg

fix  #36412 part of #35233
r? @jonathandturner

7 years agoAuto merge of #37369 - estebank:multiline-span, r=nikomatsakis
bors [Tue, 29 Nov 2016 18:53:47 +0000 (12:53 -0600)]
Auto merge of #37369 - estebank:multiline-span, r=nikomatsakis

Show multiline spans in full if short enough

When dealing with multiline spans that span few lines, show the complete span instead of restricting to the first character of the first line.

For example, instead of:

```
% ./rustc file2.rs
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
  --> file2.rs:13:9
   |
13 |    foo(1 + bar(x,
   |        ^ trait `{integer}: std::ops::Add<()>` not satisfied
   |
```

show

```
% ./rustc file2.rs
error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied
  --> file2.rs:13:9
   |
13 |      foo(1 + bar(x,
   |  ________^ starting here...
14 | |            y),
   | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied
   |
```

The [proposal in internals](https://internals.rust-lang.org/t/proposal-for-multiline-span-comments/4242/6) outlines the reasoning behind this.

7 years agoAuto merge of #37918 - flodiebold:separate-bodies, r=nikomatsakis
bors [Tue, 29 Nov 2016 14:50:38 +0000 (08:50 -0600)]
Auto merge of #37918 - flodiebold:separate-bodies, r=nikomatsakis

Separate function bodies from their signatures in HIR

Also give them their own dep map node.

I'm still unhappy with the handling of inlined items (1452edc1), but maybe you have a suggestion how to improve it.

Fixes #35078.

r? @nikomatsakis

7 years agolibrustdoc: Fix compilation after visitor change
Florian Diebold [Tue, 29 Nov 2016 12:07:04 +0000 (13:07 +0100)]
librustdoc: Fix compilation after visitor change

7 years agoupdate comments
Niko Matsakis [Mon, 28 Nov 2016 19:51:19 +0000 (14:51 -0500)]
update comments

7 years agorevamp `Visitor` with a single method for controlling nested visits
Niko Matsakis [Mon, 28 Nov 2016 19:00:26 +0000 (14:00 -0500)]
revamp `Visitor` with a single method for controlling nested visits

7 years agoFix rebase breakage
Florian Diebold [Mon, 28 Nov 2016 17:10:37 +0000 (18:10 +0100)]
Fix rebase breakage

7 years agoFix doc test collection
Florian Diebold [Fri, 25 Nov 2016 21:10:23 +0000 (22:10 +0100)]
Fix doc test collection

7 years agoFix SVH tests some more
Florian Diebold [Thu, 24 Nov 2016 19:44:11 +0000 (20:44 +0100)]
Fix SVH tests some more

7 years agoSplit nested_visit_mode function off from nested_visit_map
Florian Diebold [Thu, 24 Nov 2016 19:15:11 +0000 (20:15 +0100)]
Split nested_visit_mode function off from nested_visit_map

... and make the latter mandatory to implement.

7 years agoAddress remaining review comments
Florian Diebold [Thu, 24 Nov 2016 18:42:07 +0000 (19:42 +0100)]
Address remaining review comments

7 years agoFix remaining SVH tests
Florian Diebold [Thu, 24 Nov 2016 18:40:12 +0000 (19:40 +0100)]
Fix remaining SVH tests

7 years agoRefactor inlined items some more
Florian Diebold [Thu, 24 Nov 2016 17:25:59 +0000 (18:25 +0100)]
Refactor inlined items some more

They don't implement FnLikeNode anymore, instead are handled differently
further up in the call tree. Also, keep less information (just def ids
for the args).

7 years agoWIP: update tests to pass -- not complete
Niko Matsakis [Mon, 21 Nov 2016 22:13:42 +0000 (17:13 -0500)]
WIP: update tests to pass -- not complete

7 years agorestructure `CollectItem` dep-node to separate fn sigs from bodies
Niko Matsakis [Mon, 21 Nov 2016 22:12:35 +0000 (17:12 -0500)]
restructure `CollectItem` dep-node to separate fn sigs from bodies

Setup two tasks, one of which only processes the signatures, in order to
isolate the typeck entries for signatures from those for bodies.

Fixes #36078
Fixes #37720

7 years agoAdd make tidy fixes
Florian Diebold [Mon, 21 Nov 2016 19:34:07 +0000 (20:34 +0100)]
Add make tidy fixes

7 years agoRemove unused import
Florian Diebold [Mon, 21 Nov 2016 19:17:03 +0000 (20:17 +0100)]
Remove unused import

7 years agoFix some comments
Florian Diebold [Mon, 21 Nov 2016 18:04:07 +0000 (19:04 +0100)]
Fix some comments

7 years agoMake hello_world test work again
Florian Diebold [Sun, 20 Nov 2016 12:22:44 +0000 (13:22 +0100)]
Make hello_world test work again

This used to work with the rustc_clean attribute, but doesn't anymore
since my rebase; but I don't know enough about the type checking to find
out what's wrong. The dep graph looks like this:

ItemSignature(xxxx) -> CollectItem(xxxx)
CollectItem(xxxx) -> ItemSignature(xxxx)
ItemSignature(xxxx) -> TypeckItemBody(yyyy)
HirBody(xxxx) -> CollectItem(xxxx)

The cycle between CollectItem and ItemSignature looks wrong, and my
guess is the CollectItem -> ItemSignature edge shouldn't be there, but
I'm not sure how to prevent it.

7 years agoFix new tests
Florian Diebold [Sun, 20 Nov 2016 12:21:11 +0000 (13:21 +0100)]
Fix new tests

7 years agorustc_typeck: Make CollectItemTypesVisitor descend into bodies as well
Florian Diebold [Sat, 19 Nov 2016 20:14:06 +0000 (21:14 +0100)]
rustc_typeck: Make CollectItemTypesVisitor descend into bodies as well

7 years agoFix cross-crate associated constant evaluation
Florian Diebold [Sun, 6 Nov 2016 19:45:27 +0000 (20:45 +0100)]
Fix cross-crate associated constant evaluation

7 years agoGive function bodies their own dep graph node
Florian Diebold [Sat, 5 Nov 2016 19:12:59 +0000 (20:12 +0100)]
Give function bodies their own dep graph node

7 years agoSave bodies of functions for inlining into other crates
Florian Diebold [Tue, 1 Nov 2016 17:57:13 +0000 (18:57 +0100)]
Save bodies of functions for inlining into other crates

This is quite hacky and I hope to refactor it a bit, but at least it
seems to work.

7 years agorustc_driver: fix compilation
Florian Diebold [Sat, 29 Oct 2016 13:03:21 +0000 (15:03 +0200)]
rustc_driver: fix compilation

7 years agorustc_passes: fix compilation
Florian Diebold [Sat, 29 Oct 2016 13:01:11 +0000 (15:01 +0200)]
rustc_passes: fix compilation

7 years agorustc_plugin: fix compilation
Florian Diebold [Sat, 29 Oct 2016 12:40:17 +0000 (14:40 +0200)]
rustc_plugin: fix compilation

7 years agorustc_plugin: fix compilation
Florian Diebold [Sat, 29 Oct 2016 12:40:17 +0000 (14:40 +0200)]
rustc_plugin: fix compilation

7 years agorustc_metadata: fix compilation
Florian Diebold [Sat, 29 Oct 2016 12:39:24 +0000 (14:39 +0200)]
rustc_metadata: fix compilation

7 years agorustc_privacy: fix compilation
Florian Diebold [Sat, 29 Oct 2016 12:35:54 +0000 (14:35 +0200)]
rustc_privacy: fix compilation

7 years agorustc_trans: fix compilation
Florian Diebold [Sat, 29 Oct 2016 10:21:49 +0000 (12:21 +0200)]
rustc_trans: fix compilation

7 years agorustc_trans: fix compilation
Florian Diebold [Sat, 29 Oct 2016 10:21:49 +0000 (12:21 +0200)]
rustc_trans: fix compilation

7 years agorustc_incremental: fix compilation
Florian Diebold [Sat, 29 Oct 2016 10:21:37 +0000 (12:21 +0200)]
rustc_incremental: fix compilation

7 years agorustc_incremental: fix compilation
Florian Diebold [Sat, 29 Oct 2016 10:21:37 +0000 (12:21 +0200)]
rustc_incremental: fix compilation

7 years agorustc_typeck: fix compilation
Florian Diebold [Sat, 29 Oct 2016 10:14:14 +0000 (12:14 +0200)]
rustc_typeck: fix compilation

7 years agorustc_borrowck: fix compilation
Florian Diebold [Fri, 28 Oct 2016 21:29:02 +0000 (23:29 +0200)]
rustc_borrowck: fix compilation

7 years agorustc_mir: fix compilation
Florian Diebold [Fri, 28 Oct 2016 21:23:19 +0000 (23:23 +0200)]
rustc_mir: fix compilation

7 years agorustc_const_eval: fix compilation
Florian Diebold [Fri, 28 Oct 2016 21:23:04 +0000 (23:23 +0200)]
rustc_const_eval: fix compilation

7 years agorustc: replace body exprs by their ids
Florian Diebold [Fri, 28 Oct 2016 20:58:32 +0000 (22:58 +0200)]
rustc: replace body exprs by their ids

7 years agoAdd exprs map to crate, collect item blocks there
Florian Diebold [Thu, 27 Oct 2016 20:04:22 +0000 (22:04 +0200)]
Add exprs map to crate, collect item blocks there

7 years agoAuto merge of #38046 - rkruppe:fix-32bit-rustbuild, r=alexcrichton
bors [Tue, 29 Nov 2016 03:44:44 +0000 (21:44 -0600)]
Auto merge of #38046 - rkruppe:fix-32bit-rustbuild, r=alexcrichton

Fix rustbuild on 32 bit Linux

This is cherry-picked from #37817 which seems to be stalled and currently needs to be rebased anyway.

r? @alexcrichton (who authored this change)

7 years agoRemove allocation in push_type_params
Mark-Simulacrum [Sat, 26 Nov 2016 04:54:48 +0000 (21:54 -0700)]
Remove allocation in push_type_params

7 years agoAdds TyCtxt::require_lang_item(LangItem) to simplify lang item requires.
Mark-Simulacrum [Sat, 26 Nov 2016 04:21:03 +0000 (21:21 -0700)]
Adds TyCtxt::require_lang_item(LangItem) to simplify lang item requires.

Replaces instances of tcx.lang_items.require(..) with fatal unwrap with
this method.

7 years agoRemove auto_traits from PartitionedBounds
Mark-Simulacrum [Sat, 26 Nov 2016 02:15:25 +0000 (19:15 -0700)]
Remove auto_traits from PartitionedBounds

7 years agoRefactor TyTrait to contain a interned ExistentialPredicate slice.
Mark-Simulacrum [Wed, 16 Nov 2016 16:21:49 +0000 (09:21 -0700)]
Refactor TyTrait to contain a interned ExistentialPredicate slice.

Renames TyTrait to TyDynamic.

7 years agoadd hint to fix error for immutable ref in arg
Mikhail Modin [Tue, 8 Nov 2016 06:21:53 +0000 (09:21 +0300)]
add hint to fix error for immutable ref in arg

7 years agoAuto merge of #37791 - petrochenkov:where, r=nikomatsakis
bors [Mon, 28 Nov 2016 21:15:17 +0000 (15:15 -0600)]
Auto merge of #37791 - petrochenkov:where, r=nikomatsakis

Support `?Sized` in where clauses

Implemented as described in https://github.com/rust-lang/rust/issues/20503#issuecomment-258677026 - `?Trait` bounds are moved on type parameter definitions when possible, reported as errors otherwise.
(It'd be nice to unify bounds and where clauses in HIR, but this is mostly blocked by rustdoc now - it needs to render bounds in pleasant way and the best way to do it so far is to mirror what was written in source code.)

Fixes https://github.com/rust-lang/rust/issues/20503
r? @nikomatsakis

7 years agoRemove BuiltinBound and BuiltinBounds.
Mark-Simulacrum [Mon, 14 Nov 2016 02:42:15 +0000 (19:42 -0700)]
Remove BuiltinBound and BuiltinBounds.

7 years agoRefactor BuiltinBounds to Vec<DefId> on TraitObject.
Mark-Simulacrum [Sun, 13 Nov 2016 22:25:54 +0000 (15:25 -0700)]
Refactor BuiltinBounds to Vec<DefId> on TraitObject.

7 years agoPrivatize TraitObject.principal and add a method accessor, returning Option.
Mark-Simulacrum [Sat, 12 Nov 2016 22:46:16 +0000 (15:46 -0700)]
Privatize TraitObject.principal and add a method accessor, returning Option.

7 years agoAuto merge of #38024 - jseyfried:avoid_needless_proc_macro_deps, r=nrc
bors [Mon, 28 Nov 2016 13:03:43 +0000 (07:03 -0600)]
Auto merge of #38024 - jseyfried:avoid_needless_proc_macro_deps, r=nrc

Avoid loading needless proc-macro dependencies

Fixes #37958 when no proc-macros are exported; in particular, without `pub extern crate proc_macros;`, `#![feature(macro_reexport)]`, or `#![feature(use_extern_macros)]`.

I opened https://github.com/rust-lang/cargo/issues/3334 for exported proc macros.

r? @alexcrichton

7 years agoDefine VISIBILITY_HIDDEN when compiling compiler-rt
Robin Kruppe [Mon, 28 Nov 2016 11:23:57 +0000 (12:23 +0100)]
Define VISIBILITY_HIDDEN when compiling compiler-rt

This is cherry-picked from #37817 which seems to be stalled and currently needs to be rebased anyway.

r? @alexcrichton (who authored this change)

7 years agoAuto merge of #37676 - eddyb:lazy-7, r=nikomatsakis
bors [Mon, 28 Nov 2016 05:32:57 +0000 (23:32 -0600)]
Auto merge of #37676 - eddyb:lazy-7, r=nikomatsakis

[7/n] rustc: desugar UFCS in HIR and don't use DefMap for associated resolutions.

_This is part of a series ([prev](https://github.com/rust-lang/rust/pull/37412) | [next](https://github.com/rust-lang/rust/pull/37688)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

Previously, a path like `T::Assoc::method`, while equivalent to `<<T>::Assoc>::method`, wasn't desugared in any way at the HIR level and everything inspecting it had to either deal with knowing only `T` (before typeck) or knowing only the definition of `method` (after typeck).
Such a path also had only one `NodeId` and associated resolution during typeck modified `DefMap`, in a way that would be hard for incremental recompilation to track, and inconvenient for partial type conversions from HIR to `Ty`, which are required to break faux-cycles in on-demand type collection.

The desugarings performed by this PR are as follows:
* `use a::{b,c};` is flattened to `use a as _; use a::b; use a::c;`
  * as resolution is complete, `use a as _;` doesn't do anything, except get checked for stability
* `Vec::new` (an expression) becomes `Vec<..>::new<..>`, to distinguish it from `<Vec>::new<..>`
  * the "infer all parameters" `<..>` form is internal and not even pretty-printed
  * used when there are no type parameters at all, in an expression or pattern path segment
* `T::A::B` becomes `<<T>::A>::B` in a type, and `<<T<..>>::A<..>>::B<..>` in an expression/pattern
  * one additional `hir::Ty` node is created for each prefix, starting with the fully-resolved type (`T`) and extending it with each segment (e.g. `<T>::A`)
* fully-resolved paths contain their `Def` in HIR, getting rid of the `DefMap` and absolving incremental recompilation of needing to manually look up nodes to handle that side information

Not keeping the `DefMap` around meant that associated resolutions had to be stored somewhere else:
* expressions and patterns use a new `NodeId -> Def` map in `ty::Tables`
  * compatible with the future per-body (constant / `fn` / closure) `Tables`
* types are accessible via `Ty` and the usual per-item generics / predicates / type
  * `rustdoc` and `save-analysis` are the only situations which insist on mapping syntactical types to semantical ones, or at least understand the resolution of associated types, therefore the type conversion cache, i.e. a `NodeId -> Ty` map, is exposed by typeck for this purpose
  * stability had to be split into a pass that runs on HIR and checks the results of name resolution, and impromptu checks triggered by `typeck` for associated paths, methods, fields, etc.
  * privacy using semantic types results in accurate reachability for `impl Trait`, which fixes #35870, and thorough introspection of associated types, which may allow relaxing private-in-public checking on bounds, while keeping the intended ban on projections with private type parameters

cc @petrochenkov

7 years agoAvoid loading needless proc-macro dependencies.
Jeffrey Seyfried [Sun, 27 Nov 2016 02:57:15 +0000 (02:57 +0000)]
Avoid loading needless proc-macro dependencies.

7 years agorustc_typeck: don't record associated type resolutions.
Eduard-Mihai Burtescu [Thu, 24 Nov 2016 17:42:10 +0000 (19:42 +0200)]
rustc_typeck: don't record associated type resolutions.

7 years agorustc_privacy: switch private-in-public checking to Ty.
Eduard Burtescu [Sat, 12 Nov 2016 10:24:17 +0000 (12:24 +0200)]
rustc_privacy: switch private-in-public checking to Ty.

7 years agorustc: track fields in the HIR map.
Eduard Burtescu [Wed, 9 Nov 2016 18:57:48 +0000 (20:57 +0200)]
rustc: track fields in the HIR map.

7 years agorustc_privacy: visit Ty instead of HIR types in EmbargoVisitor.
Eduard-Mihai Burtescu [Mon, 28 Nov 2016 03:09:28 +0000 (05:09 +0200)]
rustc_privacy: visit Ty instead of HIR types in EmbargoVisitor.

7 years agoAuto merge of #38019 - sourcefrog:doc-separator, r=frewsxcv
bors [Mon, 28 Nov 2016 02:22:44 +0000 (20:22 -0600)]
Auto merge of #38019 - sourcefrog:doc-separator, r=frewsxcv

Clearer description of std::path::MAIN_SEPARATOR.

7 years agorustc: rework stability to be on-demand for type-directed lookup.
Eduard Burtescu [Thu, 10 Nov 2016 17:08:21 +0000 (19:08 +0200)]
rustc: rework stability to be on-demand for type-directed lookup.

7 years agorustc: use Span's allow_internal_unstable instead of hir::BlockCheckMode.
Eduard Burtescu [Sun, 30 Oct 2016 00:42:12 +0000 (03:42 +0300)]
rustc: use Span's allow_internal_unstable instead of hir::BlockCheckMode.

7 years agorustc_typeck: save the type cache for rustdoc and save-analysis.
Eduard Burtescu [Sat, 29 Oct 2016 10:19:59 +0000 (13:19 +0300)]
rustc_typeck: save the type cache for rustdoc and save-analysis.

7 years agorustc: embed path resolutions into the HIR instead of keeping DefMap.
Eduard-Mihai Burtescu [Fri, 25 Nov 2016 11:21:19 +0000 (13:21 +0200)]
rustc: embed path resolutions into the HIR instead of keeping DefMap.

7 years agorustc: desugar `use a::{b,c};` into `use a::b; use a::c;` in HIR.
Eduard-Mihai Burtescu [Thu, 24 Nov 2016 04:11:31 +0000 (06:11 +0200)]
rustc: desugar `use a::{b,c};` into `use a::b; use a::c;` in HIR.

7 years agorustc: track hir::{TraitRef, Visibility} in the HIR map.
Eduard Burtescu [Sun, 30 Oct 2016 06:04:52 +0000 (08:04 +0200)]
rustc: track hir::{TraitRef, Visibility} in the HIR map.

7 years agorustc: desugar UFCS as much as possible during HIR lowering.
Eduard Burtescu [Thu, 27 Oct 2016 02:17:42 +0000 (05:17 +0300)]
rustc: desugar UFCS as much as possible during HIR lowering.

7 years agorustc: encode the optionality of type parameters in HIR paths.
Eduard Burtescu [Mon, 17 Oct 2016 03:02:23 +0000 (06:02 +0300)]
rustc: encode the optionality of type parameters in HIR paths.

7 years agoAuto merge of #38022 - arthurprs:micro-opt-hm, r=bluss
bors [Sun, 27 Nov 2016 23:06:58 +0000 (17:06 -0600)]
Auto merge of #38022 - arthurprs:micro-opt-hm, r=bluss

Use displacement instead of initial bucket in HashMap code

Use displacement instead of initial bucket in HashMap code. It makes the code a bit cleaner and also saves a few instructions (handy since it'll be using some to do some sort of adaptive behavior soon).

7 years agoUse displacement instead of initial bucket in HashMap code
arthurprs [Sat, 26 Nov 2016 23:57:09 +0000 (00:57 +0100)]
Use displacement instead of initial bucket in HashMap code

7 years agoAuto merge of #38027 - rkruppe:llvm-printpasses-fwdcompat, r=alexcrichton
bors [Sun, 27 Nov 2016 19:51:40 +0000 (13:51 -0600)]
Auto merge of #38027 - rkruppe:llvm-printpasses-fwdcompat, r=alexcrichton

[LLVM 4.0] LLVMRustPrintPasses

Adapt `LLVMRustPrintPasses` to LLVM 4.0 preferring `StringRef` over `char *`

cc #37609

7 years agoAuto merge of #37983 - GuillaumeGomez:tcp_listener_doc, r=frewsxcv
bors [Sun, 27 Nov 2016 16:39:41 +0000 (10:39 -0600)]
Auto merge of #37983 - GuillaumeGomez:tcp_listener_doc, r=frewsxcv

Add examples for TcpListener struct

r? @frewsxcv

7 years agoAdapt LLVMRustPrintPasses to LLVM 4.0 preferring `StringRef` over `char *`
Robin Kruppe [Sun, 27 Nov 2016 13:48:47 +0000 (14:48 +0100)]
Adapt LLVMRustPrintPasses to LLVM 4.0 preferring `StringRef` over `char *`

7 years agoAuto merge of #38007 - alygin:err-expl-fix, r=eddyb
bors [Sun, 27 Nov 2016 12:04:18 +0000 (06:04 -0600)]
Auto merge of #38007 - alygin:err-expl-fix, r=eddyb

Fix error explanation formatting

Errors E0101, E0458, E0535 and E0537 have incorrectly formatted bulleted lists in their explanations. As the result, they are not rendered as lists in the documentation.

The fix applies the correct formatting to those lists.

7 years agoAdd examples for TcpListener struct
Guillaume Gomez [Thu, 24 Nov 2016 20:21:53 +0000 (21:21 +0100)]
Add examples for TcpListener struct

7 years agoAuto merge of #38023 - arielb1:constant-evil-x2, r=eddyb
bors [Sun, 27 Nov 2016 03:49:41 +0000 (21:49 -0600)]
Auto merge of #38023 - arielb1:constant-evil-x2, r=eddyb

don't double-apply variant padding to const enums

`build_const_struct` already returns the struct with padding - don't double-apply it in the `General` case.

This should hopefully be the last time we have this sort of bug.

Fixes #38002.

Beta-nominating because regression.

r? @eddyb

7 years agodon't double-apply variant padding to const enums
Ariel Ben-Yehuda [Sun, 27 Nov 2016 00:15:07 +0000 (02:15 +0200)]
don't double-apply variant padding to const enums

Fixes #38002.

7 years agoAuto merge of #36340 - sfackler:slice-get-slice, r=alexcrichton
bors [Sun, 27 Nov 2016 00:47:06 +0000 (18:47 -0600)]
Auto merge of #36340 - sfackler:slice-get-slice, r=alexcrichton

Implement RFC 1679

cc #35729

r? @alexcrichton

7 years agoAuto merge of #38004 - GuillaumeGomez:tcp_stream_doc, r=frewsxcv
bors [Sat, 26 Nov 2016 21:37:34 +0000 (15:37 -0600)]
Auto merge of #38004 - GuillaumeGomez:tcp_stream_doc, r=frewsxcv

Add missing urls and examples to TcpStream

r? @frewsxcv

7 years agoAuto merge of #38008 - bluss:rustbuild-benches, r=alexcrichton
bors [Sat, 26 Nov 2016 18:32:19 +0000 (12:32 -0600)]
Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichton

Add rustbuild command `bench`

Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks.

`./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates.

Fixes #37897

7 years agoFix error explanation formatting
Andrew Lygin [Sat, 26 Nov 2016 18:19:30 +0000 (21:19 +0300)]
Fix error explanation formatting

7 years agoFix error explanation formatting
Andrew Lygin [Fri, 25 Nov 2016 19:58:30 +0000 (22:58 +0300)]
Fix error explanation formatting

7 years agoOverload get{,_mut}{,_unchecked}
Steven Fackler [Tue, 19 Jul 2016 08:50:52 +0000 (10:50 +0200)]
Overload get{,_mut}{,_unchecked}

7 years agoClearer description of std::path::MAIN_SEPARATOR.
Martin Pool [Sat, 26 Nov 2016 17:24:38 +0000 (09:24 -0800)]
Clearer description of std::path::MAIN_SEPARATOR.

7 years agoAuto merge of #38015 - sanxiyn:rollup, r=sanxiyn
bors [Sat, 26 Nov 2016 13:40:43 +0000 (07:40 -0600)]
Auto merge of #38015 - sanxiyn:rollup, r=sanxiyn

Rollup of 7 pull requests

- Successful merges: #37962, #37963, #37967, #37978, #37985, #38001, #38010
- Failed merges:

7 years agoRollup merge of #38010 - frewsxcv:lock-creations, r=GuillaumeGomez
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:15 +0000 (22:02 +0900)]
Rollup merge of #38010 - frewsxcv:lock-creations, r=GuillaumeGomez

Document how lock 'guard' structures are created.

7 years agoRollup merge of #38001 - vickenty:patch-1, r=steveklabnik
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:14 +0000 (22:02 +0900)]
Rollup merge of #38001 - vickenty:patch-1, r=steveklabnik

Follow our own recommendations in the examples

Remove exclamation marks from the the example error descriptions:
> The description [...] should not contain newlines or sentence-ending punctuation

7 years agoRollup merge of #37985 - frewsxcv:completed-fixme, r=petrochenkov
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:14 +0000 (22:02 +0900)]
Rollup merge of #37985 - frewsxcv:completed-fixme, r=petrochenkov

Remove completed FIXME.

https://github.com/rust-lang/rust/issues/30530

7 years agoRollup merge of #37978 - fkjogu:master, r=sfackler
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:14 +0000 (22:02 +0900)]
Rollup merge of #37978 - fkjogu:master, r=sfackler

Define `bound` argument in std::sync::mpsc::sync_channel in the documentation

The `bound` argument in `std::sync::mpsc::sync:channel(bound: usize)` was not defined in the documentation.

7 years agoRollup merge of #37967 - sfackler:enumset-issue, r=sfackler
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:14 +0000 (22:02 +0900)]
Rollup merge of #37967 - sfackler:enumset-issue, r=sfackler

Add a tracking issue for enum_set

I totally forgot this even existed!

7 years agoRollup merge of #37963 - bluss:iterator-docs, r=alexcrichton
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:14 +0000 (22:02 +0900)]
Rollup merge of #37963 - bluss:iterator-docs, r=alexcrichton

Fix two small issues in iterator docs

- `collect()` is a regular method, not an adaptor (does not return an Iterator). I just randomly picked `filter` as a third common adaptor to mention instead.
- Fix example in `Map`'s docs so that it uses the DoubleEndedIterator implementation

7 years agoRollup merge of #37962 - GuillaumeGomez:socket-v6, r=frewsxcv
Seo Sanghyeon [Sat, 26 Nov 2016 13:02:13 +0000 (22:02 +0900)]
Rollup merge of #37962 - GuillaumeGomez:socket-v6, r=frewsxcv

Add missing examples to SocketAddrV6

r? @steveklabnik

cc @frewsxcv

7 years agoAuto merge of #37961 - samestep:radices, r=frewsxcv
bors [Sat, 26 Nov 2016 05:31:42 +0000 (23:31 -0600)]
Auto merge of #37961 - samestep:radices, r=frewsxcv

Use "radices" instead of "radicum"

The correct plural of "radix" is "radices" or "radixes", not "radicum".

7 years agoAuto merge of #37960 - samestep:five, r=frewsxcv
bors [Sat, 26 Nov 2016 02:19:47 +0000 (20:19 -0600)]
Auto merge of #37960 - samestep:five, r=frewsxcv

Use literal 5 instead of five in book section 4.1

The other two code snippets in this sentence are valid code, so it makes more sense to use the literal `5` rather than the invalid symbol `five`.

7 years agoDocument how the `MutexGuard` structure is created.
Corey Farwell [Fri, 25 Nov 2016 22:48:45 +0000 (17:48 -0500)]
Document how the `MutexGuard` structure is created.

Also, end sentence with a period.