diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-03-02 21:23:15 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-02 21:23:15 +0900 |
| commit | 5e68c60406741c41d7dff65e74d05f641ee6022f (patch) | |
| tree | b9520af8789e24ebeb6aedeab006b9586840adcc /compiler/rustc_error_codes/src | |
| parent | ae5e024194a99bf265c874d64999e6beae916cde (diff) | |
| parent | 4f4e15d5eb9750c4ac8c140207612122562d6c51 (diff) | |
| download | rust-5e68c60406741c41d7dff65e74d05f641ee6022f.tar.gz rust-5e68c60406741c41d7dff65e74d05f641ee6022f.zip | |
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`
```
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0202.md | 15 |
2 files changed, 0 insertions, 16 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index c4330694504..4b529734328 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -103,7 +103,6 @@ E0198: include_str!("./error_codes/E0198.md"), E0199: include_str!("./error_codes/E0199.md"), E0200: include_str!("./error_codes/E0200.md"), E0201: include_str!("./error_codes/E0201.md"), -E0202: include_str!("./error_codes/E0202.md"), E0203: include_str!("./error_codes/E0203.md"), E0204: include_str!("./error_codes/E0204.md"), E0205: include_str!("./error_codes/E0205.md"), diff --git a/compiler/rustc_error_codes/src/error_codes/E0202.md b/compiler/rustc_error_codes/src/error_codes/E0202.md deleted file mode 100644 index afc61ec2e48..00000000000 --- a/compiler/rustc_error_codes/src/error_codes/E0202.md +++ /dev/null @@ -1,15 +0,0 @@ -Inherent associated types were part of [RFC 195] but are not yet implemented. -See [the tracking issue][iss8995] for the status of this implementation. - -Erroneous code example: - -```compile_fail,E0202 -struct Foo; - -impl Foo { - type Bar = isize; // error! -} -``` - -[RFC 195]: https://github.com/rust-lang/rfcs/blob/master/text/0195-associated-items.md -[iss8995]: https://github.com/rust-lang/rust/issues/8995 |
