]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #82516 - PoignardAzur:inherent-impl-ty, r=oli-obk
authorYuki Okushi <huyuumi.dev@gmail.com>
Tue, 2 Mar 2021 12:23:15 +0000 (21:23 +0900)
committerGitHub <noreply@github.com>
Tue, 2 Mar 2021 12:23:15 +0000 (21:23 +0900)
commit5e68c60406741c41d7dff65e74d05f641ee6022f
treeb9520af8789e24ebeb6aedeab006b9586840adcc
parentae5e024194a99bf265c874d64999e6beae916cde
parent4f4e15d5eb9750c4ac8c140207612122562d6c51
Rollup merge of #82516 - PoignardAzur:inherent-impl-ty, r=oli-obk

Add incomplete feature gate for inherent associate types.

Mentored by ``````@oli-obk``````

So far the only change is that instead of giving an automatic error, the following code compiles:

```rust
struct Foo;

impl Foo {
    type Bar = isize;
}
```

The backend work to make it actually usable isn't there yet. In particular, this:

```rust
let x : Foo::Bar;
```

will give you:

```sh
error[E0223]: ambiguous associated type
  --> /$RUSTC_DIR/src/test/ui/assoc-inherent.rs:15:13
   |
LL |     let x : Foo::Bar;
   |             ^^^^^^^^ help: use fully-qualified syntax: `<Foo as Trait>::Bar`
```
compiler/rustc_feature/src/active.rs
compiler/rustc_span/src/symbol.rs