Skip to content

Commit

Permalink
#[feature(type_alias_impl_trait)] 이거 안 쓰면 나오는 에러
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungHaKim7 committed Nov 21, 2023
1 parent a4d9a1b commit 626c37e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
38 changes: 38 additions & 0 deletions rust1_74/b01_opaque_types01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

https://github.com/rust-lang/rust/issues/63063

```
$ cargo r
Compiling b01_opaque_types01 v0.1.0 (/Users/globalyoung/Documents/test/test/rust/rust_release/rust1_74/b01_opaque_types01)
warning: type alias `Foo` is never used
--> src/main.rs:4:6
|
4 | type Foo<T> = impl MyTrait;
| ^^^
|
= note: `#[warn(dead_code)]` on by default
warning: fields `a`, `b`, and `c` are never read
--> src/main.rs:7:5
|
6 | struct MyStruct<A, B, C> {
| -------- fields in this struct
7 | a: A,
| ^
8 | b: B,
| ^
9 | c: C,
| ^
warning: function `foo` is never used
--> src/main.rs:13:4
|
13 | fn foo<T>(t: T) -> Foo<T> {
| ^^^
warning: `b01_opaque_types01` (bin "b01_opaque_types01") generated 3 warnings
Finished dev [unoptimized + debuginfo] target(s) in 0.19s
Running `target/debug/b01_opaque_types01`
Hello, world!
```


- ```#![feature(type_alias_impl_trait)]``` 이거 안 쓰면 나오는 에러

```
`impl Trait` in type aliases is unstable
--> src/main.rs:2:15
Expand Down
2 changes: 2 additions & 0 deletions rust1_74/b01_opaque_types01/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![feature(type_alias_impl_trait)]
trait MyTrait {}

type Foo<T> = impl MyTrait;

struct MyStruct<A, B, C> {
Expand Down

0 comments on commit 626c37e

Please sign in to comment.