Commit Graph

64662 Commits

Author SHA1 Message Date
Marc-Antoine Perennou
53ae00a8ab rustbuild: make distcheck depend on dist-plain-source-tarball
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-23 18:13:53 +02:00
Marc-Antoine Perennou
9af464be8a rustbuild: drop unused macro in tets
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-23 18:13:53 +02:00
Matthew
6627ef228c Stabilize in 1.19 2017-05-23 14:00:20 +01:00
Scott McMurray
794e5724a8 Give step_trait a distinct tracking issue from step_by
iterator_step_by has decoupled their futures, so the tracking issue should split.
2017-05-23 03:08:18 -07:00
bors
5b13bff520 Auto merge of #42023 - nikomatsakis:issue-36799-ostn15_phf, r=arielb1
introduce local-scope to prevent `StorageLive`/`StorageDead` in statics

In investigating #36799, I found that we were creating storage-live/storage-dead instructions in statics/constants, where they are not needed. This arose due to the fix for local scopes. This PR tries to fix that (and adds a test -- I'm curious if there is a way to make that test more targeted, though).

r? @arielb1
2017-05-23 09:55:40 +00:00
Scott McMurray
fcb3a7109c Update description of iter::StepBy 2017-05-23 02:25:08 -07:00
Scott McMurray
4be488c065 Add iterator_step_by to the unstable book's summary 2017-05-23 02:25:07 -07:00
Scott McMurray
57f260d418 Override size_hint and propagate ExactSizeIterator for iter::StepBy
Generally useful, but also a prerequisite for moving a bunch of unit tests off Range::step_by.
2017-05-23 02:24:25 -07:00
bors
9fa25a7df3 Auto merge of #42015 - nikomatsakis:chalk-trait-env-2, r=eddyb
remove interior mutability of type-flags

We were previously using the flags on `Ty<'tcx>` instances to do some ad-hoc caching schemes around things like `is_sized()`, `is_freeze()`, and `moves_by_default()`. This PR replaces those schemes with a proper query; the query key is based on the pair of a `(ParameterEnvironment<'tcx>, Ty<'tcx>)` pair. This is also intended to be a preliminary template for what trait-selection and projection will eventually look like.

I did some performance measurements. In the past, I observed a noticeable speedup (6%) for building rustc, but since I've rebased, the numbers appear to be more of a wash:

| Crate | Before | After | Percentage |
| --- | --- | --- | -- |
| syntax | 167s | 166s | 0.6% faster |
| rustc | 376s | 382s | 1.5% slower |

Some advantages of this new scheme:

- `is_sized` etc are proper queries
- we get caching across generic fns, so long as trait environment is identical
- dependency tracking is correct
2017-05-23 07:14:42 +00:00
Havvy
b41b2947d5 Suggested changes by birkenfeld 2017-05-22 23:49:35 -07:00
bors
852b7cb91e Auto merge of #42165 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests

- Successful merges: #42016, #42122, #42144, #42145, #42151, #42152, #42160, #42163
- Failed merges:
2017-05-23 04:48:15 +00:00
Corey Farwell
aa7762f91f Rollup merge of #42163 - projektir:option_links, r=frewsxcv
Adding links to option::Option

Just adding some links.
2017-05-23 00:15:48 -04:00
Corey Farwell
f37b34d0fa Rollup merge of #42160 - venkatagiri:issue_38821, r=Mark-Simulacrum
regression test for #38821

Closes #38821

r? @Mark-Simulacrum
2017-05-23 00:15:47 -04:00
Corey Farwell
2cc683950b Rollup merge of #42152 - GuillaumeGomez:cstr-docs, r=frewsxcv
Add missing links for CStr and CString

r? @rust-lang/docs
2017-05-23 00:15:46 -04:00
Corey Farwell
951eb5566e Rollup merge of #42151 - Wallacoloo:docfix_into_vec, r=frewsxcv
Mention Vec::into_boxed_slice in documentation of [T]::into_vec

This is a documentation fix.

`Vec::into_boxed_slice` and `[T]::into_vec` are inverses, so it makes sense to mention the other in their respective documentation for visibility. `Vec::into_boxed_slice` already mentions `[T]::into_vec`, but not the other way around until now.

Tagging @steveklabnik per his request.
2017-05-23 00:15:45 -04:00
Corey Farwell
b2c742363d Rollup merge of #42145 - ollie27:rustdoc_inline_renamed, r=steveklabnik
rustdoc: Fix names of items in cross crate reexported modules

For renamed reexports the new name should be used.

An example of this (as pointed out in https://github.com/rust-lang/rust/issues/27741#issuecomment-302850721) is two instances of `StepBy` in [`std::iter`](https://doc.rust-lang.org/nightly/std/iter/index.html#structs). [`core::iter`](https://doc.rust-lang.org/nightly/core/iter/index.html#structs) is correct.

Fixes #37608
2017-05-23 00:15:44 -04:00
Corey Farwell
9739e8dbc9 Rollup merge of #42144 - cengizIO:master, r=nikomatsakis
make ui test output patch compatible #41948

Hello!

Previously with #41474 I've changed the internals of UI test output comparison mechanism.

That change didn't change the diff format that we were producing but we needed to improve it anyway.

This makes unified diff lines a little bit more `patch` compatible.

Also I tried to introduce a unit test to check this but couldn't decide which of the following to implement:

1. Should I replace `println` macros with `Writer`s? And access the produced output within a test?
2. Should I add an external test (something like `src/test/run-pass/command-exec.rs`)
3. There are crates that capture `stdout`. Are they safe to use here? (I don't think so)

Thanks!

cc @nikomatsakis
2017-05-23 00:15:43 -04:00
Corey Farwell
7a7e236076 Rollup merge of #42122 - rust-lang:frewsxcv/unstable-book, r=steveklabnik
Add a few entries to the Unstable Book.
2017-05-23 00:15:42 -04:00
Corey Farwell
e38d5d5039 Rollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakis
Stabilize the loop_break_value feature

Tracking issue: #37339.

Documentation PRs already sent to the various repositories.
2017-05-23 00:15:41 -04:00
projektir
6e27bd8c01 Adding links to option::Option 2017-05-22 21:59:42 -04:00
Wesley Wiser
7eebabeb92 Create the bin dir 2017-05-22 21:32:27 -04:00
bors
2e9139197e Auto merge of #41559 - GuillaumeGomez:partial-eq-msg, r=estebank
Add better error message when == operator is badly used

Part of #40660.

With the following code:

```rust
fn foo<T: PartialEq>(a: &T, b: T) {
    a == b;
}

fn main() {
    foo(&1, 1);
}
```

It prints:

```
error[E0277]: the trait bound `&T: std::cmp::PartialEq<T>` is not satisfied
 --> test.rs:2:5
  |
2 |     a == b;
  |     ^^^^^^ can't compare `&T` with `T`
  |
  = help: the trait `std::cmp::PartialEq<T>` is not implemented for `&T`
  = help: consider adding a `where &T: std::cmp::PartialEq<T>` bound

error: aborting due to previous error
```
2017-05-23 00:36:56 +00:00
Colin Wallace
6e8e5c9fd7 Slice::into_vec: Don't link to Vec::into_boxed_slice
The documentation for this method appears on multiple different pages,
which causes the relative links to not always work.
2017-05-22 16:39:31 -07:00
Havvy
5f4b0ffe59 Fix trailing whitespace. 2017-05-22 16:33:55 -07:00
Venkata Giri Reddy
d2ef70f50c regression test for #38821
Closes #38821

r? @Mark-Simulacrum
2017-05-22 17:09:18 -06:00
Havvy
d7927ffb8f Add description of how values are dropped to Drop trait. 2017-05-22 15:59:00 -07:00
Havvy
ca909c836f Add example of variable declaration drop order to Drop trait. 2017-05-22 15:15:04 -07:00
Havvy
14b767d07e Add example of recursive drop to Drop trait. 2017-05-22 15:06:25 -07:00
Guillaume Gomez
819acb5141 Add missing links for CStr and CString 2017-05-22 23:23:27 +02:00
Niko Matsakis
83641a9b6d fix atomic_lock_free test case 2017-05-22 17:11:39 -04:00
Niko Matsakis
04367100cd fix DepNode
Ideally, we'd have the `Ty` inserted directly in the dep-node, but since
we can't do that yet, we extract the characteristic def-id of the type
in question.
2017-05-22 17:11:39 -04:00
Marc-Antoine Perennou
150d644c21 rustbuild: split Install out of Dist subcommand
only create source tarball for the Dist subcommand
mark install rule as default for Kind::Install
split install-docs
split install-std
factor out empty_dir handling
split install-cargo
split install-analysis
split install-src
rework install-rustc
properly handle cross-compilation setups for install
use pkgname in install
split plain source tarball generation from rust-src dist
document src-tarball in config.toml.exmaple

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-22 22:10:12 +02:00
Niko Matsakis
9317d372c4 two more style nits 2017-05-22 15:55:56 -04:00
Niko Matsakis
45dd0632bc rename parameter_environment to param_env 2017-05-22 15:55:56 -04:00
Niko Matsakis
697146bf40 use ParamEnv from ty rather than importing 2017-05-22 15:54:16 -04:00
Niko Matsakis
226358e2fb rename ParameterEnvironment to ParamEnv 2017-05-22 15:54:16 -04:00
Niko Matsakis
ca65a8a808 kill NEEDS_DROP_CACHED 2017-05-22 15:37:10 -04:00
Niko Matsakis
25ea618e41 kill FREEZENESS_CACHED 2017-05-22 15:37:10 -04:00
Niko Matsakis
aa5232bca7 kill SIZEDNESS_CACHED 2017-05-22 15:37:10 -04:00
Niko Matsakis
4464dcc7ce remove the cell from type flags completely 2017-05-22 15:37:10 -04:00
Niko Matsakis
b46c1a95d0 move needs_drop into a query 2017-05-22 15:37:10 -04:00
Niko Matsakis
5a5c265e24 refactor common logic into ParameterEnvironment::and() 2017-05-22 15:37:10 -04:00
Niko Matsakis
194d4bc15d make parameter-environment a query 2017-05-22 15:37:10 -04:00
Niko Matsakis
1b7acb6f34 centralize the caching for is-copy, is-sized, and is-freeze
Use the trait-environment+type as the key. Note that these
are only invoked on types that live for the entire compilation
(no inference artifacts). We no longer need the various special-case
bits and caches that were in place before.
2017-05-22 14:55:03 -04:00
Niko Matsakis
8a4e5933df add arielb1 example 2017-05-22 14:40:47 -04:00
Nicolas Silva
dec23d41a6 Update Rc and Arc documentation.
It was decided in the RFC discussion https://github.com/rust-lang/rfcs/pull/1954 to make the function call syntax Rc::clone(&foo) the idiomatic way to clone a reference counted pointer (over the method call syntax foo.clone(). This change updates the documentation of Rc, Arc and their respoective Weak pointers to reflect it and bring more exposure to the existence of the function call syntax.
2017-05-22 16:15:37 +02:00
Colin Wallace
78bdda1573 Mention Vec::into_boxed_slice in docs for [T]::into_vec.
`Vec::into_boxed_slice` and `[T]::into_vec` are inverses, so it makes sense
to mention the other in their respective documentation for visibility.
`Vec::into_boxed_slice` already mentions `[T]::into_vec`, but not the other
way around until now.
2017-05-22 05:23:47 -07:00
Dmitry Vyukov
0b85b64d6b libstd/sync/mpsc: relicense under rust license
These files are licensed under a different license
than the rest of the codebase. This causes potential
issues and inconveniences.
Relicense these files under the standard license.
I hold original copyright on that code.

Fixes #36556
2017-05-22 09:27:39 +02:00
bors
81734e0e06 Auto merge of #42147 - withoutboats:run-pass-test-for-static-in-assoc-const-ty-refs, r=eddyb
Remove 'static bound in assoc const test.

Types do not have to be `'static` to be referenced in
associated consts.

Fixes #33573.
2017-05-22 06:22:52 +00:00
Without Boats
bf529fb6e6 Remove 'static bound in assoc const test.
Types do not have to be `'static` to be referenced in
associated consts.
2017-05-21 23:10:01 -07:00