# Rust borrow checker에서 11년 묵은 unsoundness 버그 발견

Original title: 11 year old unsoundness bugs found in Rust borrow checker

> Hacker News story 50069499 · language: ko · submitted 2026-10-13
> Web version: https://zeli.app/ko/story/50069499
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 741 · by [formerly_proven](<https://news.ycombinator.com/user?id=formerly_proven>) · 💬 424
[original](<https://github.com/rust-lang/rust/issues/164250>) · [HN discussion](<https://news.ycombinator.com/item?id=50069499>)

## Summary

Rust의 borrow checker에서 struct의 lifetime 요구사항을 covariant field assignment로 우회할 수 있는 unsoundness 버그가 발견됐다. 이 버그는 Rust 1.4 버전부터 존재해온 것으로, Drop 구현에서 non-'static 참조를 'static으로 잘못 가정하게 만들어 use-after-free나 segfault를 일으킬 수 있다. Rust 팀은 해당 이슈를 P-high 우선순위로 지정하고 types 팀에서 검토 중이다.

## Key quote

> 내 버전의 코드는 1.18.0(2017년)부터 계속 컴파일되어 왔다. 도대체 어떻게 이게 지금까지 발견되지 않았던 거지???

## HN discussion (424 comments)

### [mrkeen](<https://news.ycombinator.com/item?id=50069883>)

> 타입 시스템은 어렵다! https://counterexamples.org/ 를 한번 보라.
>
> Rust 예제가 있는지 대충 훑어봤는데, 다음 페이지들에 11개의 샘플이 있다:
>
> https://counterexamples.org/eventually-nothing.html
>
> https://counterexamples.org/mutable-matching.html
>
> https://counterexamples.org/selfishness.html
>
> https://counterexamples.org/scope-escape.html
>
> https://counterexamples.org/nearly-universal.html
>
> 내가 항상 가장 먼저 찾는 것은 가변성(다른 까다로운 기능과 결합된)이다. 예를 들어 "이제 Just(3):Maybe<Int>이고, 이제 Nothing:Maybe<Int>이고, 이제 Nothing:Maybe<String>이다." 같은 식이다.
>
> TFA의 예제가 가변성 없이도 재현될 수 있을지 궁금하다.

### [GrantMoyer](<https://news.ycombinator.com/item?id=50070882>)

> 이 버그가 이렇게 오랫동안 unnoticed된 게 놀랍지만, 적어도 고치기는 쉽다. 왜냐하면 타입 시스템 자체의 버그가 아니라 그냥 컴파일러의 버그이기 때문이다. 컴파일러는 Rust 타입 시스템의 라이프타임 규칙에 따라 항상 그 코드를 거부했어야 했으므로, 수정은 라이프타임의 근본 규칙을 바꾸는 것이 아니라 그냥 그 코드를 거부하도록 만드는 것이다.

### [weinzierl](<https://news.ycombinator.com/item?id=50070471>)

> 이건 remarkable하지만 그렇게 unusual하지는 않다. 현재 unsound 라벨이 붙은 이슈가 100개가 넘는다. 일부는 오래된 것도 있는데, 내가 이해하기로는 새로운 trait solver가 그중 일부(아마 OP의 것은 아닐 가능성이 높지만)의 수정을 unblock할 것이다.

### [lambdaone](<https://news.ycombinator.com/item?id=50070224>)

> 아이러니하게도, Rust 컴파일러에서 버그를 AI 기반으로 검색하면 이런 것들을 더 많이 찾아낼 가능성이 높고, 이는 Rust를 완전한 신뢰성에 점점 더 가깝게 밀어붙일 것이다.
>
> 결국 Rust의 형식화와 공식적으로 증명된 컴파일러의 생성이 이 과정의 종착점이 될 것으로 보인다.

### [Eridrus](<https://news.ycombinator.com/item?id=50071964>)

> 이런 것들이 실제 코드에 영향을 미치는지에 대한 감각 없이 gotcha로 떠도는 느낌이다.
>
> 이 버그를 고치는 것이 실제로 어떤 crate의 컴파일을 막는지 보는 것은 흥미로울 것이다.

### [Surac](<https://news.ycombinator.com/item?id=50071860>)

> 문제는 이것이다. Rust가 Rust를 사용했다면 이것을 막을 수 있었을까?

### [sreekanth850](<https://news.ycombinator.com/item?id=50074835>)

> 이게 LLM이 한 건가? 이게 의문이다. 왜냐하면 최근에 이런 버그 리포트를 많이 보고 있기 때문이다.

### [FuzzywarmWalnut](<https://news.ycombinator.com/item?id=50069792>)

> 한때 variance 관련 lint를 작업한 적이 있는데, 무서운 점은 아무도 손으로 variance를 적는 경우가 거의 없다는 것이다. 그래서 그곳의 버그는 십 년 동안 테스트되지 않은 채로 방치된다.

### [randyrand](<https://news.ycombinator.com/item?id=50071104>)

> Rust가 out of memory를 일반 오류처럼 더 우아하게 처리해주면 좋겠다.

### [wat10000](<https://news.ycombinator.com/item?id=50072101>)

> 이런 것들에 대한 감정적 반응은 너무 이상하다. 그래, 소프트웨어에는 버그가 있다, 뭐 놀랍다고. 그렇다고 정적 안전성이 쓸모없다는 것도 아니고, 우리 모두 C에서 YOLO를 계속해야 한다는 것도 아니다.

---

## Cite

- Page: https://zeli.app/ko/story/50069499
- Date: 2026-10-13
- Source: github.com (https://github.com/rust-lang/rust/issues/164250)
- Hacker News: https://news.ycombinator.com/item?id=50069499

## Other languages

- en: https://zeli.app/story/50069499 · markdown: https://zeli.app/story/50069499.md
- zh: https://zeli.app/zh/story/50069499 · markdown: https://zeli.app/zh/story/50069499.md
- ja: https://zeli.app/ja/story/50069499 · markdown: https://zeli.app/ja/story/50069499.md
- de: https://zeli.app/de/story/50069499 · markdown: https://zeli.app/de/story/50069499.md
- es: https://zeli.app/es/story/50069499 · markdown: https://zeli.app/es/story/50069499.md
- ru: https://zeli.app/ru/story/50069499 · markdown: https://zeli.app/ru/story/50069499.md
