<?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では use std; や use rand; のようなインポートが必要な場合と、逆に書くとエラーになる場合がある。 簡単に言うと トップレベルモジュールでは、書くとエラーになる(既にある名前と衝突する)。それ以外の場所では、必要な場合がある。 これは名前をローカルで使うための仕組みと、名前の別名を公開するための仕組みが同じ use により実現されていることと関係している。 そもそも use std; は何故必要なのか 例えば、あるモジュール m1.rs 内で以下のようなコードを書くとエラーになる。 fn foo() { let stderr = std::io::stderr(); …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqnighy.hatenablog.com%2Fentry%2F2017%2F06%2F22%2F220000&quot; title=&quot;Rustで use std; が必要なときとエラーになるときがあるのは何故か - 簡潔な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-22 22:00:00</published>
  <title>Rustで use std; が必要なときとエラーになるときがあるのは何故か</title>
  <type>rich</type>
  <url>https://qnighy.hatenablog.com/entry/2017/06/22/220000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
