Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #44155

Closed
wants to merge 26 commits into from
Closed

Rollup of 9 pull requests #44155

wants to merge 26 commits into from

Conversation

qnighy and others added 26 commits July 23, 2017 22:30
Make the ./x.py script fail when run with an invalid command, like:

  ./x.py nonsense

This helps in case of chaining multiple runs, eg.:

  ./x.py biuld && ./x.py test
The crate itself is internally referenced by serde_derive.
This, as rust-lang#43813, is due to the author of rust-lang#43728 (specifically,
3645b06) being a damnably contemptible fool. Before this entire
fiasco, we would return early from the unusedness late lints pass if
the type of the expression within the `hir::StmtSemi` was `!`, `()`,
or a boolean: these types would never get to the point of being marked
as unused results. That is, until the dunce who somehow (!?) came to
be trusted with the plum responsibility of implementing RFC
1940 (`#[must_use]` for functions) went and fouled everything up,
removing the early returns based on the (stupid) thought that there
would be no harm in it, since we would need to continue to check these
types being returned from must_use functions (which was true for the
booleans, at least). But there was harm—harm that any
quarter-way-competent programmer would have surely forseen! For after
the new functional-must-use checks, there was nothing to stop the
previously-returned-early types from falling through to be marked by
the unused-results lint!—a monumentally idiotic error that has cost
the project tens of precious developer- and reviewer-minutes dealing
with the fallout here and in rust-lang#43813.

If 3645b06 is representative of the standard of craftsmanship the
rising generation of software engineers holds themselves to, I weep
for the future of our technological civilization.

Resolves rust-lang#44119.
in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios
No need to depend on librustc! All we need is libstd

Closes rust-lang#44140
…r=nikomatsakis

Add hints when intercrate ambiguity causes overlap.

I'm going to tackle rust-lang#23980.

# Examples

## Trait impl overlap caused by possible downstream impl

```rust
trait Foo<X> {}
trait Bar<X> {}
impl<X, T> Foo<X> for T where T: Bar<X> {}
impl<X> Foo<X> for i32 {}

fn main() {}
```

```
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
 --> test1.rs:4:1
  |
3 | impl<X, T> Foo<X> for T where T: Bar<X> {}
  | ------------------------------------------ first implementation here
4 | impl<X> Foo<X> for i32 {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
  |
  = note: downstream crates may implement Bar

error: aborting due to previous error
```

## Trait impl overlap caused by possible upstream update

```rust
trait Foo {}
impl<T> Foo for T where T: ::std::fmt::Octal {}
impl Foo for () {}

fn main() {}
```

```
error[E0119]: conflicting implementations of trait `Foo` for type `()`:
 --> test2.rs:3:1
  |
2 | impl<T> Foo for T where T: ::std::fmt::Octal {}
  | ----------------------------------------------- first implementation here
3 | impl Foo for () {}
  | ^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
  |
  = note: upstream crates may add new impl for std::fmt::Octal in future versions

error: aborting due to previous error
```

## Inherent impl overlap caused by possible downstream impl

```rust
trait Bar<X> {}

struct A<T, X>(T, X);
impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
impl<X> A<i32, X> { fn f(&self) {} }

fn main() {}
```

```
error[E0592]: duplicate definitions with name `f`
 --> test3.rs:4:38
  |
4 | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
  |                                      ^^^^^^^^^^^^^^ duplicate definitions for `f`
5 | impl<X> A<i32, X> { fn f(&self) {} }
  |                     -------------- other definition for `f`
  |
  = note: downstream crates may implement Bar

error: aborting due to previous error
```

## Inherent impl overlap caused by possible upstream update

```rust
struct A<T>(T);

impl<T> A<T> where T: ::std::fmt::Octal { fn f(&self) {} }
impl A<()> { fn f(&self) {} }

fn main() {}
```

```
error[E0592]: duplicate definitions with name `f`
 --> test4.rs:3:43
  |
3 | impl<T> A<T> where T: ::std::fmt::Octal { fn f(&self) {} }
  |                                           ^^^^^^^^^^^^^^ duplicate definitions for `f`
4 | impl A<()> { fn f(&self) {} }
  |              -------------- other definition for `f`
  |
  = note: upstream crates may add new impl for std::fmt::Octal in future versions

error: aborting due to previous error
```
…xamples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating rust-lang#22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving
… r=Mark-Simulacrum

bootstrap: remove unneeded extern crate

The crate itself is internally referenced by serde_derive.
…_results, r=eddyb

un-regress behavior of `unused_results` lint for booleans

Resolves rust-lang#44119.
…matsakis

compiletest: Change Config comments to doc comments

I plan to make the same change in compiletest-rs, to have some documentation in [the docs](https://docs.rs/compiletest_rs/0.2.9/compiletest_rs/common/struct.Config.html).
…akis

Fail ./x.py on invalid command

Make the ./x.py script fail when run with an invalid command, like:

```
./x.py nonsense
```

This helps in case of chaining multiple runs, eg.:

```
./x.py biuld && ./x.py test
```
…etMisdreavus

Fix invalid linker position

Fixes rust-lang#44120.

Result isn't "optimal" though because there are spaces at the end of some lines.
…r=Manishearth

Deprecate several flags in rustdoc

Part of rust-lang#44136

cc @rust-lang/dev-tools @rust-lang/docs

This is a very basic PR to start deprecating some flags; `rustdoc` doesn't really have fancy output options like `rustc` does, so I went with `eprintln!`. Happy to change it if people feel that's not appropriate.

Also, I have no idea if we can or should write tests here, so I didn't try. If someone feels strongly about it, then let's do it, but given that the only outcome here is a side effect...
…r=Mark-Simulacrum

rustbuild: Fix dependencies of build-manifest

No need to depend on librustc! All we need is libstd

Closes rust-lang#44140
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@frewsxcv frewsxcv closed this Aug 29, 2017
@frewsxcv frewsxcv deleted the rollup branch August 29, 2017 15:15
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.