Repository: rust
Issue: "overflow evaluating the requirement `...: std::marker::Sync`" instead of error
Labels: A-type-system,A-trait-system,T-compiler,C-bug,T-types

I ran into some code that causes rustc to recurse until it hits whatever you have the recursion limit set to (I tried up to `#![recursion_limit="80192"]`). The code in question should actually result in a compile time error, but not that one.

Here's the minimal case I could come up with:
```
static FOO: Option<Foo> = None;

type NotSend = *const ();

struct Foo {
    foo: (Box<(Foo, NotSend)>, NotSend),
}

fn main() {
}
```

Here's the error I would've expected to get:
```
   Compiling playground v0.0.1 (file:///playground)
error[E0277]: `*const ()` cannot be shared between threads safely
 --> src/main.rs:1:1
  |
1 | static FOO: Option<Foo> = None;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be shared between threads safely
  |
  = help: within `(Foo, *const ())`, the trait `std::marker::Sync` is not implemented for `*const ()`
  = note: required because it appears within the type `(Foo, *const ())`
  = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<(Foo, *const ())>`
  = note: required because it appears within the type `std::boxed::Box<(Foo, *const ())>`
  = note: required because it appears within the type `Foo`
  = note: required because it appears within the type `std::option::Option<Foo>`
  = note: shared static variables must have a type that implements `Sync`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.
```

Here's what actually happened:
```
   Compiling playground v0.0.1 (file:///playground)
error[E0275]: overflow evaluating the requirement `std::ptr::Unique<(Foo, *const ())>: std::marker::Sync`
 --> src/main.rs:1:1
  |
1 | static FOO: Option<Foo> = None;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
  = note: required because it appears within the type `std::boxed::Box<(Foo, *const ())>`
  = note: required because it appears within the type `(std::boxed::Box<(Foo, *const ())>, *const ())`
  = note: required because it appears within the type `Foo`
  = note: required because it appears within the type `(Foo, *const ())`
  = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<(Foo, *const ())>`
  = note: required because it appears within the type `std::boxed::Box<(Foo, *const ())>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.
```

Here's a [link to the playground](https://play.rust-lang.org/?gist=cfa54cea5842d9b178a428f53f8a5445&version=stable&mode=debug&edition=2015).

## Meta

The above output is copy and pasted from play, but I first found the issue locally with the following rust version:
```
rustc --version --verbose
rustc 1.29.1 (b801ae664 2018-09-20)
binary: rustc
commit-hash: b801ae66425cf7c3c71052b19ef8f145b0d0513d
commit-date: 2018-09-20
host: x86_64-apple-darwin
release: 1.29.1
LLVM version: 7.0
```