<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>qnighy</author_name>
  <author_url>https://blog.hatena.ne.jp/qnighy/</author_url>
  <blog_title>簡潔なQ</blog_title>
  <blog_url>https://qnighy.hatenablog.com/</blog_url>
  <categories>
    <anon>Rust</anon>
  </categories>
  <description>概要: Rustの derive はあまり頭がよくない。 derive がドジを踏む例 derive の問題は顕在化しやすく、RustコンパイラのGitHub上でも何度も重複するissueが投げられていた。今は主に #26925 を中心に議論がまとまっているので、そちらを参照するとよいだろう。 不必要な境界を与える例 use std::rc::Rc; // 本来不必要な X: Clone を要求する #[derive(Clone)] struct A&lt;X&gt;(Rc&lt;X&gt;); struct B; fn main() { A(Rc::new(B)).clone(); // Error } error…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqnighy.hatenablog.com%2Fentry%2F2017%2F06%2F01%2F070000&quot; title=&quot;Rustのderiveはあまり頭がよくない - 簡潔なQ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-06-01 07:00:00</published>
  <title>Rustのderiveはあまり頭がよくない</title>
  <type>rich</type>
  <url>https://qnighy.hatenablog.com/entry/2017/06/01/070000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
