# 러스트 1.51 공개: Const Generics

> Clean Markdown view of GeekNews topic #3965. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3965](https://news.hada.io/topic?id=3965)
- GeekNews Markdown: [https://news.hada.io/topic/3965.md](https://news.hada.io/topic/3965.md)
- Type: news
- Author: [yujingaya](https://news.hada.io/@yujingaya)
- Published: 2021-03-26T14:02:37+09:00
- Updated: 2021-03-26T14:02:37+09:00
- Original source: [blog.rust-lang.org](https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html)
- Points: 7
- Comments: 0

## Topic Body

러스트 1.51를 소개합니다. 러스트는 모든 이가 믿음직하고 효율적인 소프트웨어를 작성할 수 있도록 힘을 실어주는 프로그래밍 언어입니다.

러스트 1.51은 오랜만에 큰 기능을 추가하는 버전입니다.

Const Generics MVP

- 기존에는 타입이 라이프타임이나 타입을 파라미터로 가질 수 있었습니다.

ㅤ- [T; 32] 필드를 가지는 구조체 FixedArray<T>를 정의할 수 있었습니다.

ㅤ- 하지만 [T; N]에서 N처럼 값(여기선 배열의 길이)에 대해 일반적인 코드를 작성할 수는 없었습니다.

- 러스트 1.51부터 정수, 문자, boolean 값에 대해 일반적인 코드 작성이 가능해졌습니다.

ㅤ- 이제 [T; LENGTH] 필드를 가진 구조체 Array<T, const LENGTH: usize>를 정의할 수 있습니다.

ㅤ- Array<u8, 32>를 사용한다면 컴파일러는 [u8; 32] 필드를 가지는 단형성화된(monomorphic) Array를 만듭니다.

- 앞으로 더 많은 컴파일 타임 상수값을 타입 파라미터로 사용할 수 있도록 허용할 예정입니다.

기타 변경 사항

- Cargo 기능 추가

- macOS에서 컴파일 시간 대폭 단축 (디버그 정보 처리 방식 변경)

- const generics를 활용하는 by-value iterator api 추가

## Comments



_No public comments on this page._
