rust/compiler/rustc_typeck
Esteban Küber ede0a71b9e Remove incorrect delay_span_bug
The following code is supposed to compile

```rust
use std::ops::BitOr;

pub trait IntWrapper {
    type InternalStorage;
}

impl<T> BitOr for dyn IntWrapper<InternalStorage = T>
where
    Self: Sized,
    T: BitOr + BitOr<Output = T>,
{
    type Output = Self;
    fn bitor(self, _other: Self) -> Self {
        todo!()
    }
}
```

Before this change it would ICE. In #70998 the removed logic was added
to provide better suggestions, and the `delay_span_bug` guard was added
to  protect against a potential logic error when returning traits. As it
happens, there are cases, like the one above, where traits can indeed be
returned, so valid code was being rejected.

Fix #80207.
2021-02-03 08:52:57 -08:00
..
src Remove incorrect delay_span_bug 2021-02-03 08:52:57 -08:00
Cargo.toml Replace some trivial struct_span_err!s in typeck. 2020-09-01 23:05:56 +10:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.