]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #40847 - jseyfried:decl_macro, r=nrc
bors [Thu, 25 May 2017 22:31:34 +0000 (22:31 +0000)]
Auto merge of #40847 - jseyfried:decl_macro, r=nrc

Initial implementation of declarative macros 2.0

Implement declarative macros 2.0 (rust-lang/rfcs#1584) behind `#![feature(decl_macro)]`.
Differences from `macro_rules!` include:
 - new syntax: `macro m(..) { .. }` instead of `macro_rules! m { (..) => { .. } }`
 - declarative macros are items:
```rust
// crate A:
pub mod foo {
    m!(); // use before definition; declaration order is irrelevant
    pub macro m() {} // `pub`, `pub(super)`, etc. work
}
fn main() {
    foo::m!(); // named like other items
    { use foo::m as n; n!(); } // imported like other items
}
pub use foo::m; // re-exported like other items

// crate B:
extern crate A; // no need for `#[macro_use]`
A::foo::m!(); A::m!();
```
 - Racket-like hygiene for items, imports, methods, fields, type parameters, privacy, etc.
   - Intuitively, names in a macro definition are resolved in the macro definition's scope, not the scope in which the macro is used.
   - This [explaination](http://beautifulracket.com/explainer/hygiene.html) of hygiene for Racket applies here (except for the "Breaking Hygiene" section). I wrote a similar [explanation](https://github.com/jseyfried/rfcs/blob/hygiene/text/0000-hygiene.md) for Rust.
   - Generally speaking, if `fn f() { <body> }` resolves, `pub macro m() { <body> } ... m!()` also resolves, even if `m!()` is in a separate crate.
   - `::foo::bar` in a `macro` behaves like `$crate::foo::bar` in a `macro_rules!`, except it can access everything visible from the `macro` (thus more permissive).
   - See [`src/test/{run-pass, compile-fail}/hygiene`](https://github.com/rust-lang/rust/pull/40847/commits/afe7d89858fd72b983e24727d6f4058293153c19) for examples. Small example:
```rust
mod foo {
    fn f() { println!("hello world"); }
    pub macro m() { f(); }
}
fn main() { foo::m!(); }
```

Limitations:
 - This does not address planned changes to matchers (`expr`,`ty`, etc.), c.f. #26361.
 - Lints (including stability and deprecation) and `unsafe` are not hygienic.
   - adding hygiene here will be mostly or entirely backwards compatible
 - Nested macro definitions (a `macro` inside another `macro`) don't always work correctly when invoked from external crates.
   - pending improvements in how we encode macro definitions in crate metadata
 - There is no way to "escape" hygiene without using a procedural macro.

r? @nrc

7 years agoFix merge conflicts.
Jeffrey Seyfried [Thu, 25 May 2017 21:07:30 +0000 (21:07 +0000)]
Fix merge conflicts.

7 years agoAuto merge of #42220 - alexcrichton:update, r=brson
bors [Thu, 25 May 2017 19:48:14 +0000 (19:48 +0000)]
Auto merge of #42220 - alexcrichton:update, r=brson

Update OpenSSL download location

In rustbuild itself we download from our mirror but in the containers we don't
do this yet. The OpenSSL download url changes from time to time (it breaks when
they release a new version) so let's download from our mirror instead.

7 years agoUpdate OpenSSL download location
Alex Crichton [Thu, 25 May 2017 17:07:41 +0000 (10:07 -0700)]
Update OpenSSL download location

In rustbuild itself we download from our mirror but in the containers we don't
do this yet. The OpenSSL download url changes from time to time (it breaks when
they release a new version) so let's download from our mirror instead.

7 years agoAuto merge of #42052 - kennytm:fix-42007-ice-on-decode-lint-id, r=nikomatsakis
bors [Thu, 25 May 2017 14:10:10 +0000 (14:10 +0000)]
Auto merge of #42052 - kennytm:fix-42007-ice-on-decode-lint-id, r=nikomatsakis

Refactor: Move the mutable parts out of LintStore. Fix #42007.

* #42007 happens because the `Session` `LintStore` is emptied when linting.
* The `Session` `LintStore` is emptied because the checker (`Early`/`LateContext`) wants ownership.
* The checker wants ownership because it wants to mutate the pass objects and lint levels.

The ownership of the whole store is not essential, only the lint levels and pass objects need to be owned. Therefore, these parts are extracted out of the `LintStore` into a separate structure `LintSession`. The "check crates" methods can operate on `&mut LintSession` instead of `&mut LintStore`.

This is a minor *breaking change* for lint writers since the `LintContext` trait is changed: the `mut_lints` and `level_stack` methods are removed. But no one outside of `librustc/lint/context.rs` is using these functions, so it should be safe.

7 years agoAuto merge of #41932 - wesleywiser:py-to-rust, r=alexcrichton
bors [Thu, 25 May 2017 10:35:04 +0000 (10:35 +0000)]
Auto merge of #41932 - wesleywiser:py-to-rust, r=alexcrichton

Rewrite make-win-dist.py in Rust

Fixes #41568

7 years agoAuto merge of #41145 - matthewjasper:stabilize-relaxed-adts, r=petrochenkov
bors [Thu, 25 May 2017 07:24:18 +0000 (07:24 +0000)]
Auto merge of #41145 - matthewjasper:stabilize-relaxed-adts, r=petrochenkov

Stabilize rfc 1506 - Clarified ADT Kinds

Closes #35626

Documentation:

- [ ] Reference rust-lang-nursery/reference#37
- [ ] Book?
- [ ] Rust by example?

7 years agoIgnore pretty.
Jeffrey Seyfried [Thu, 25 May 2017 02:04:03 +0000 (02:04 +0000)]
Ignore pretty.

7 years agoImprove `Self`.
Jeffrey Seyfried [Sun, 21 May 2017 22:35:39 +0000 (22:35 +0000)]
Improve `Self`.

7 years agoAdd tests.
Jeffrey Seyfried [Sat, 25 Mar 2017 02:37:55 +0000 (02:37 +0000)]
Add tests.

7 years agoImprove intercrate hygiene.
Jeffrey Seyfried [Mon, 27 Mar 2017 00:46:00 +0000 (00:46 +0000)]
Improve intercrate hygiene.

7 years agoImprove efficiency.
Jeffrey Seyfried [Sun, 26 Mar 2017 02:11:30 +0000 (02:11 +0000)]
Improve efficiency.

7 years agoHygienize lifetimes.
Jeffrey Seyfried [Sat, 25 Mar 2017 21:14:18 +0000 (21:14 +0000)]
Hygienize lifetimes.

7 years agoHygienize `librustc_privacy`.
Jeffrey Seyfried [Sat, 25 Mar 2017 01:46:38 +0000 (01:46 +0000)]
Hygienize `librustc_privacy`.

7 years agoHygienize `librustc_typeck`.
Jeffrey Seyfried [Fri, 24 Mar 2017 23:03:15 +0000 (23:03 +0000)]
Hygienize `librustc_typeck`.

7 years agoHygienize `librustc_resolve`.
Jeffrey Seyfried [Wed, 22 Mar 2017 08:39:51 +0000 (08:39 +0000)]
Hygienize `librustc_resolve`.

7 years agoRemove `trait_item_map`, clean up `resolver.with_type_parameter_rib()`.
Jeffrey Seyfried [Sat, 18 Mar 2017 02:10:13 +0000 (02:10 +0000)]
Remove `trait_item_map`, clean up `resolver.with_type_parameter_rib()`.

7 years agoDeclarative macros 2.0 without hygiene.
Jeffrey Seyfried [Sat, 18 Mar 2017 01:55:51 +0000 (01:55 +0000)]
Declarative macros 2.0 without hygiene.

7 years agoRefactor out `ast::MacroDef`.
Jeffrey Seyfried [Fri, 17 Mar 2017 21:58:48 +0000 (21:58 +0000)]
Refactor out `ast::MacroDef`.

7 years agoAuto merge of #41700 - GuillaumeGomez:extend-css-stable, r=killercup
bors [Thu, 25 May 2017 04:38:53 +0000 (04:38 +0000)]
Auto merge of #41700 - GuillaumeGomez:extend-css-stable, r=killercup

Set --extend-css stable

I think it's now time to set this option stable.

r? @rust-lang/docs

7 years agoAuto merge of #42212 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 25 May 2017 01:51:35 +0000 (01:51 +0000)]
Auto merge of #42212 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 15 pull requests

- Successful merges: #41980, #42071, #42120, #42134, #42141, #42142, #42149, #42150, #42159, #42177, #42186, #42191, #42195, #42198, #42211
- Failed merges:

7 years agoRollup merge of #42211 - aidanhs:aphs-llvm-clone-hacks, r=Mark-Simulacrum
Mark Simulacrum [Thu, 25 May 2017 01:50:11 +0000 (19:50 -0600)]
Rollup merge of #42211 - aidanhs:aphs-llvm-clone-hacks, r=Mark-Simulacrum

Hack around abysmally slow llvm clones

r? @Mark-Simulacrum

(don't r+ yet, let's see what travis says)

7 years agoRollup merge of #42198 - GuillaumeGomez:os-str-doc, r=QuietMisdreavus
Mark Simulacrum [Thu, 25 May 2017 01:50:10 +0000 (19:50 -0600)]
Rollup merge of #42198 - GuillaumeGomez:os-str-doc, r=QuietMisdreavus

Add missing urls for OsStr docs

r? @rust-lang/docs

7 years agoRollup merge of #42195 - SamWhited:fix_broken_link, r=steveklabnik
Mark Simulacrum [Thu, 25 May 2017 01:50:09 +0000 (19:50 -0600)]
Rollup merge of #42195 - SamWhited:fix_broken_link, r=steveklabnik

fix broken link to nomicon in Unsize docs

Add a missing link that is currently broken in the docs (see the last sentence of https://doc.rust-lang.org/std/marker/trait.Unsize.html)

7 years agoRollup merge of #42191 - alexcrichton:update-cargo, r=Mark-Simulacrum
Mark Simulacrum [Thu, 25 May 2017 01:50:09 +0000 (19:50 -0600)]
Rollup merge of #42191 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update Cargo submodule

Contains a fix for rust-lang/cargo#4081

7 years agoRollup merge of #42186 - devurandom:fix/bootstrap-verbose, r=alexcrichton
Mark Simulacrum [Thu, 25 May 2017 01:50:08 +0000 (19:50 -0600)]
Rollup merge of #42186 - devurandom:fix/bootstrap-verbose, r=alexcrichton

bootstrap: Make bootstrap verbose if requested

Fixes: #42099
7 years agoRollup merge of #42177 - est31:master, r=Mark-Simulacrum
Mark Simulacrum [Thu, 25 May 2017 01:50:07 +0000 (19:50 -0600)]
Rollup merge of #42177 - est31:master, r=Mark-Simulacrum

Remove some needless // gate-test- comments

Also, add detection to treat such comments as tidy errors.
We also remove the found_lib_feature code because it
was just repeating the found_feature code. Originally it
was intended to allow for gate-test lines for
lib features, but apparently nobody missed it.

7 years agoRollup merge of #42159 - Havvy:doc-drop, r=steveklabnik
Mark Simulacrum [Thu, 25 May 2017 01:50:06 +0000 (19:50 -0600)]
Rollup merge of #42159 - Havvy:doc-drop, r=steveklabnik

Document drop more.

Adds two examples to Drop and describes the recursive drop on types that contain fields.

7 years agoRollup merge of #42150 - citizen428:feature/error-count-messages, r=Mark-Simulacrum
Mark Simulacrum [Thu, 25 May 2017 01:50:05 +0000 (19:50 -0600)]
Rollup merge of #42150 - citizen428:feature/error-count-messages, r=Mark-Simulacrum

Change error count messages

See #33525 for details. r? @Mark-Simulacrum

7 years agoRollup merge of #42149 - dvyukov:license, r=brson
Mark Simulacrum [Thu, 25 May 2017 01:50:04 +0000 (19:50 -0600)]
Rollup merge of #42149 - dvyukov:license, r=brson

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

7 years agoRollup merge of #42142 - ids1024:redox, r=aturon
Mark Simulacrum [Thu, 25 May 2017 01:50:03 +0000 (19:50 -0600)]
Rollup merge of #42142 - ids1024:redox, r=aturon

Implement requires_synchronized_create() for Redox

This was breaking the libstd build for Redox.

7 years agoRollup merge of #42141 - ids1024:nobacktrace, r=aturon
Mark Simulacrum [Thu, 25 May 2017 01:50:02 +0000 (19:50 -0600)]
Rollup merge of #42141 - ids1024:nobacktrace, r=aturon

Fix building std without backtrace feature, which was broken in ca8b754

Fixes #42139

7 years agoRollup merge of #42134 - scottmcm:rangeinclusive-struct, r=aturon
Mark Simulacrum [Thu, 25 May 2017 01:50:01 +0000 (19:50 -0600)]
Rollup merge of #42134 - scottmcm:rangeinclusive-struct, r=aturon

Make RangeInclusive just a two-field struct

Not being an enum improves ergonomics and consistency, especially since NonEmpty variant wasn't prevented from being empty.  It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait.

Implements merged https://github.com/rust-lang/rfcs/pull/1980; tracking issue https://github.com/rust-lang/rust/issues/28237.

This is definitely a breaking change to anything consuming `RangeInclusive` directly (not as an Iterator) or constructing it without using the sugar.  Is there some change that would make sense before this so compilation failures could be compatibly fixed ahead of time?

r? @aturon (as FCP proposer on the RFC)

7 years agoRollup merge of #42120 - euclio:unicode, r=arielb1
Mark Simulacrum [Thu, 25 May 2017 01:50:00 +0000 (19:50 -0600)]
Rollup merge of #42120 - euclio:unicode, r=arielb1

remove "much" from unicode diagnostic

The English seems slightly awkward to me, and it's unnecessary.

7 years agoRollup merge of #42071 - nrc:parse-mods, r=nikomatsakis
Mark Simulacrum [Thu, 25 May 2017 01:50:00 +0000 (19:50 -0600)]
Rollup merge of #42071 - nrc:parse-mods, r=nikomatsakis

Add an option to the parser to avoid parsing out of line modules

This is useful if parsing from stdin or a String and don't want to try and read in a module from another file. Instead we just leave a stub in the AST.

7 years agoRollup merge of #41980 - gamazeps:thread-send, r=steveklabnik
Mark Simulacrum [Thu, 25 May 2017 01:49:59 +0000 (19:49 -0600)]
Rollup merge of #41980 - gamazeps:thread-send, r=steveklabnik

[Doc] Add `'static` and `Send` constraints explanations to `thread::spawn`

Part of #29378.

Explains why the constraints on the closure and its return value are `'static` and `Send`.

Allows to tick of `thread::spawn` from the list of things to document in the `thread` module.

r? @steveklabnik

7 years agoHack around abysmally slow llvm clones
Aidan Hobson Sayers [Thu, 25 May 2017 00:37:36 +0000 (01:37 +0100)]
Hack around abysmally slow llvm clones

7 years agoUpdate Cargo submodule
Alex Crichton [Wed, 24 May 2017 15:42:00 +0000 (08:42 -0700)]
Update Cargo submodule

Contains a fix for rust-lang/cargo#4081

7 years agoAdd missing urls for OsStr docs
Guillaume Gomez [Wed, 24 May 2017 17:33:40 +0000 (19:33 +0200)]
Add missing urls for OsStr docs

7 years agofix broken link to nomicon in Unsize docs
Sam Whited [Wed, 24 May 2017 16:27:16 +0000 (11:27 -0500)]
fix broken link to nomicon in Unsize docs

7 years agoChange error count messages
Michael Kohl [Mon, 22 May 2017 11:46:05 +0000 (18:46 +0700)]
Change error count messages

See #33525 for details.

7 years agobootstrap: Use common run() function to call cargo
Dennis Schridde [Wed, 24 May 2017 07:11:10 +0000 (09:11 +0200)]
bootstrap: Use common run() function to call cargo

This brings verbosity even to invocation of cargo itself

7 years agobootstrap: Make bootstrap verbose if requested
Dennis Schridde [Wed, 24 May 2017 07:10:15 +0000 (09:10 +0200)]
bootstrap: Make bootstrap verbose if requested

Fixes: #42099
7 years agobootstrap: Actually respect verbosity setting in config.toml
Dennis Schridde [Wed, 24 May 2017 07:09:17 +0000 (09:09 +0200)]
bootstrap: Actually respect verbosity setting in config.toml

7 years agoAdd precisions for the help message for --extend-css
Guillaume Gomez [Tue, 23 May 2017 18:48:16 +0000 (20:48 +0200)]
Add precisions for the help message for --extend-css

7 years agoRemove some needless // gate-test- comments
est31 [Tue, 23 May 2017 18:17:38 +0000 (20:17 +0200)]
Remove some needless // gate-test- comments

Also, add detection to treat such comments as tidy errors.
We also remove the found_lib_feature code because it
was just repeating the found_feature code. Originally it
was intended to allow for gate-test lines for
lib features, but apparently nobody missed it.

7 years agoStabilize in 1.19
Matthew [Tue, 23 May 2017 13:00:20 +0000 (14:00 +0100)]
Stabilize in 1.19

7 years agoAuto merge of #42023 - nikomatsakis:issue-36799-ostn15_phf, r=arielb1
bors [Tue, 23 May 2017 09:55:40 +0000 (09:55 +0000)]
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

7 years agoAuto merge of #42015 - nikomatsakis:chalk-trait-env-2, r=eddyb
bors [Tue, 23 May 2017 07:14:42 +0000 (07:14 +0000)]
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

7 years agoSuggested changes by birkenfeld
Havvy [Tue, 23 May 2017 06:49:35 +0000 (23:49 -0700)]
Suggested changes by birkenfeld

7 years agoAuto merge of #42165 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 23 May 2017 04:48:15 +0000 (04:48 +0000)]
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:

7 years agoRollup merge of #42163 - projektir:option_links, r=frewsxcv
Corey Farwell [Tue, 23 May 2017 04:15:48 +0000 (00:15 -0400)]
Rollup merge of #42163 - projektir:option_links, r=frewsxcv

Adding links to option::Option

Just adding some links.

7 years agoRollup merge of #42160 - venkatagiri:issue_38821, r=Mark-Simulacrum
Corey Farwell [Tue, 23 May 2017 04:15:47 +0000 (00:15 -0400)]
Rollup merge of #42160 - venkatagiri:issue_38821, r=Mark-Simulacrum

regression test for #38821

Closes #38821

r? @Mark-Simulacrum

7 years agoRollup merge of #42152 - GuillaumeGomez:cstr-docs, r=frewsxcv
Corey Farwell [Tue, 23 May 2017 04:15:46 +0000 (00:15 -0400)]
Rollup merge of #42152 - GuillaumeGomez:cstr-docs, r=frewsxcv

Add missing links for CStr and CString

r? @rust-lang/docs

7 years agoRollup merge of #42151 - Wallacoloo:docfix_into_vec, r=frewsxcv
Corey Farwell [Tue, 23 May 2017 04:15:45 +0000 (00:15 -0400)]
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.

7 years agoRollup merge of #42145 - ollie27:rustdoc_inline_renamed, r=steveklabnik
Corey Farwell [Tue, 23 May 2017 04:15:44 +0000 (00:15 -0400)]
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

7 years agoRollup merge of #42144 - cengizIO:master, r=nikomatsakis
Corey Farwell [Tue, 23 May 2017 04:15:43 +0000 (00:15 -0400)]
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

7 years agoRollup merge of #42122 - rust-lang:frewsxcv/unstable-book, r=steveklabnik
Corey Farwell [Tue, 23 May 2017 04:15:42 +0000 (00:15 -0400)]
Rollup merge of #42122 - rust-lang:frewsxcv/unstable-book, r=steveklabnik

Add a few entries to the Unstable Book.

7 years agoRollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakis
Corey Farwell [Tue, 23 May 2017 04:15:41 +0000 (00:15 -0400)]
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.

7 years agoAdding links to option::Option
projektir [Tue, 23 May 2017 01:59:42 +0000 (21:59 -0400)]
Adding links to option::Option

7 years agoCreate the bin dir
Wesley Wiser [Tue, 23 May 2017 01:32:27 +0000 (21:32 -0400)]
Create the bin dir

7 years agoAuto merge of #41559 - GuillaumeGomez:partial-eq-msg, r=estebank
bors [Tue, 23 May 2017 00:36:56 +0000 (00:36 +0000)]
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
```

7 years agoSlice::into_vec: Don't link to Vec::into_boxed_slice
Colin Wallace [Mon, 22 May 2017 23:39:31 +0000 (16:39 -0700)]
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.

7 years agoFix trailing whitespace.
Havvy [Mon, 22 May 2017 23:33:55 +0000 (16:33 -0700)]
Fix trailing whitespace.

7 years agoregression test for #38821
Venkata Giri Reddy [Mon, 22 May 2017 23:09:18 +0000 (17:09 -0600)]
regression test for #38821

Closes #38821

r? @Mark-Simulacrum

7 years agoAdd description of how values are dropped to Drop trait.
Havvy [Mon, 22 May 2017 22:59:00 +0000 (15:59 -0700)]
Add description of how values are dropped to Drop trait.

7 years agoAdd example of variable declaration drop order to Drop trait.
Havvy [Mon, 22 May 2017 22:15:04 +0000 (15:15 -0700)]
Add example of variable declaration drop order to Drop trait.

7 years agoAdd example of recursive drop to Drop trait.
Havvy [Mon, 22 May 2017 22:06:25 +0000 (15:06 -0700)]
Add example of recursive drop to Drop trait.

7 years agoAdd missing links for CStr and CString
Guillaume Gomez [Mon, 22 May 2017 14:55:00 +0000 (16:55 +0200)]
Add missing links for CStr and CString

7 years agofix `atomic_lock_free` test case
Niko Matsakis [Tue, 16 May 2017 12:43:23 +0000 (08:43 -0400)]
fix `atomic_lock_free` test case

7 years agofix DepNode
Niko Matsakis [Tue, 16 May 2017 03:23:40 +0000 (23:23 -0400)]
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.

7 years agotwo more style nits
Niko Matsakis [Mon, 15 May 2017 23:36:45 +0000 (19:36 -0400)]
two more style nits

7 years agorename `parameter_environment` to `param_env`
Niko Matsakis [Mon, 15 May 2017 22:00:35 +0000 (18:00 -0400)]
rename `parameter_environment` to `param_env`

7 years agouse `ParamEnv` from `ty` rather than importing
Niko Matsakis [Mon, 15 May 2017 21:58:58 +0000 (17:58 -0400)]
use `ParamEnv` from `ty` rather than importing

7 years agorename `ParameterEnvironment` to `ParamEnv`
Niko Matsakis [Mon, 15 May 2017 21:57:30 +0000 (17:57 -0400)]
rename `ParameterEnvironment` to `ParamEnv`

7 years agokill NEEDS_DROP_CACHED
Niko Matsakis [Fri, 12 May 2017 16:04:27 +0000 (12:04 -0400)]
kill NEEDS_DROP_CACHED

7 years agokill FREEZENESS_CACHED
Niko Matsakis [Fri, 12 May 2017 16:04:07 +0000 (12:04 -0400)]
kill FREEZENESS_CACHED

7 years agokill SIZEDNESS_CACHED
Niko Matsakis [Fri, 12 May 2017 16:03:43 +0000 (12:03 -0400)]
kill SIZEDNESS_CACHED

7 years agoremove the cell from type flags completely
Niko Matsakis [Fri, 12 May 2017 16:01:43 +0000 (12:01 -0400)]
remove the cell from type flags completely

7 years agomove `needs_drop` into a query
Niko Matsakis [Fri, 12 May 2017 15:44:31 +0000 (11:44 -0400)]
move `needs_drop` into a query

7 years agorefactor common logic into `ParameterEnvironment::and()`
Niko Matsakis [Fri, 12 May 2017 15:44:00 +0000 (11:44 -0400)]
refactor common logic into `ParameterEnvironment::and()`

7 years agomake parameter-environment a query
Niko Matsakis [Thu, 11 May 2017 21:40:03 +0000 (17:40 -0400)]
make parameter-environment a query

7 years agocentralize the caching for is-copy, is-sized, and is-freeze
Niko Matsakis [Wed, 10 May 2017 14:28:06 +0000 (10:28 -0400)]
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.

7 years agoadd arielb1 example
Niko Matsakis [Mon, 22 May 2017 18:40:47 +0000 (14:40 -0400)]
add arielb1 example

7 years agoMention Vec::into_boxed_slice in docs for [T]::into_vec.
Colin Wallace [Mon, 22 May 2017 12:23:47 +0000 (05:23 -0700)]
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.

7 years agolibstd/sync/mpsc: relicense under rust license
Dmitry Vyukov [Mon, 22 May 2017 07:27:39 +0000 (09:27 +0200)]
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

7 years agoAuto merge of #42147 - withoutboats:run-pass-test-for-static-in-assoc-const-ty-refs...
bors [Mon, 22 May 2017 06:22:52 +0000 (06:22 +0000)]
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.

7 years agoRemove 'static bound in assoc const test.
Without Boats [Mon, 22 May 2017 06:10:01 +0000 (23:10 -0700)]
Remove 'static bound in assoc const test.

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

7 years agorustdoc: Fix names of items in cross crate reexported modules
Oliver Middleton [Mon, 22 May 2017 01:05:16 +0000 (02:05 +0100)]
rustdoc: Fix names of items in cross crate reexported modules

For renamed reexports the new name should be used.

7 years agoAuto merge of #42140 - anderspapitto:doc-typo-fixes, r=Mark-Simulacrum
bors [Mon, 22 May 2017 00:51:17 +0000 (00:51 +0000)]
Auto merge of #42140 - anderspapitto:doc-typo-fixes, r=Mark-Simulacrum

bootstrap: fix minor comment typos in lib.rs

I noticed these while reading through the build system
documentation. They're hardly worth fixing, but I'm also using this to
get my feet wet with the rustc contribution system.

7 years agomake ui test output patch compatible #41948
Cengiz Can [Sun, 21 May 2017 22:34:36 +0000 (01:34 +0300)]
make ui test output patch compatible #41948

7 years agoAuto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichton
bors [Sun, 21 May 2017 22:06:08 +0000 (22:06 +0000)]
Auto merge of #41904 - sfackler:1.18-stabilization, r=alexcrichton

Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648

r? @alexcrichton

@rust-lang/libs

7 years agoImplement requires_synchronized_create() for Redox
Ian Douglas Scott [Sun, 21 May 2017 20:23:42 +0000 (13:23 -0700)]
Implement requires_synchronized_create() for Redox

This was breaking the libstd build for Redox.

7 years agoFix building without backtrace feature, which was broken in ca8b754
Ian Douglas Scott [Sun, 21 May 2017 19:38:07 +0000 (12:38 -0700)]
Fix building without backtrace feature, which was broken in ca8b754

Fixes #42139

7 years agobootstrap: fix minor comment typos in lib.rs
Anders Papitto [Thu, 18 May 2017 18:59:54 +0000 (19:59 +0100)]
bootstrap: fix minor comment typos in lib.rs

I noticed these while reading through the build system
documentation. They're hardly worth fixing, but I'm also using this to
get my feet wet with the rustc contribution system.

7 years agoReturn a correct size_hint for degenerate inclusive ranges
Scott McMurray [Sun, 21 May 2017 12:03:49 +0000 (05:03 -0700)]
Return a correct size_hint for degenerate inclusive ranges

Fixes https://github.com/rust-lang/rust/issues/42135

Found while fixing run-pass/range_inclusive test failure.

7 years agoMake RangeInclusive just a two-field struct
Scott McMurray [Mon, 24 Apr 2017 04:14:32 +0000 (21:14 -0700)]
Make RangeInclusive just a two-field struct

Not being an enum improves ergonomics, especially since NonEmpty could be Empty.  It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait.

Implements RFC 1980

7 years agoAuto merge of #42131 - neosilky:doc-fix, r=frewsxcv
bors [Sun, 21 May 2017 08:28:05 +0000 (08:28 +0000)]
Auto merge of #42131 - neosilky:doc-fix, r=frewsxcv

Update to trait bounds CSS in rustdoc

Fixed re-submission of #40719.

7 years agoAuto merge of #42132 - cuviper:manifest-paths, r=alexcrichton
bors [Sun, 21 May 2017 06:00:22 +0000 (06:00 +0000)]
Auto merge of #42132 - cuviper:manifest-paths, r=alexcrichton

Update rust-installer to normalize manifest paths

This fixes the backslash-paths found in the manifests of installers that are built on Windows.  This is the most problematic part of #42121, leaving just the non-executable install.sh.

r? @alexcrichton

7 years agoStabilize library features for 1.18.0
Steven Fackler [Thu, 11 May 2017 04:17:24 +0000 (21:17 -0700)]
Stabilize library features for 1.18.0

Closes #38863
Closes #38980
Closes #38903
Closes #36648