<p dir="auto">auto-deref has been added but I'm still interested in a more uniform behavior of custom pointers (meaning the ones that exist by trait implementation) and native ones (like the dying <code class="notranslate">~T</code>).</p>
<p dir="auto"><a href="https://github.com/mozilla/rust/pull/12610#issuecomment-37586877" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/12610/hovercard">An example situation</a>:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use std::rc::Rc;

struct Bar { x: int }

fn foo(p: &amp;int) {
    println!(&quot;{}&quot;, p);
}

fn baz(p: &amp;Bar) {
    println!(&quot;{}&quot;, p.x);
}

fn main() {
    let pi = box 10;
    let pb = Rc::new(Bar {x: 3});
    foo(pi);
    // this still doesn't auto borrow:
    //baz(pb);
    // although this works:
    println!(&quot;{}&quot;, pb.x);
}"><pre class="notranslate"><span class="pl-k">use</span> std<span class="pl-kos">::</span>rc<span class="pl-kos">::</span><span class="pl-v">Rc</span><span class="pl-kos">;</span>

<span class="pl-k">struct</span> <span class="pl-smi">Bar</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span><span class="pl-kos">:</span> <span class="pl-smi">int</span> <span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s1">p</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">int</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, p<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">baz</span><span class="pl-kos">(</span><span class="pl-s1">p</span><span class="pl-kos">:</span> <span class="pl-c1">&amp;</span><span class="pl-smi">Bar</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, p.x<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> pi = box <span class="pl-c1">10</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> pb = <span class="pl-smi">Rc</span><span class="pl-kos">::</span><span class="pl-en">new</span><span class="pl-kos">(</span><span class="pl-smi">Bar</span> <span class="pl-kos">{</span><span class="pl-c1">x</span><span class="pl-kos">:</span> <span class="pl-c1">3</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-en">foo</span><span class="pl-kos">(</span>pi<span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-c">// this still doesn't auto borrow:</span>
    <span class="pl-c">//baz(pb);</span>
    <span class="pl-c">// although this works:</span>
    <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, pb.x<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I've looked in  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="15584807" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/7141" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/7141/hovercard" href="https://github.com/rust-lang/rust/issues/7141">#7141</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28114627" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/12491" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/12491/hovercard" href="https://github.com/rust-lang/rust/pull/12491">#12491</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="31602357" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/13542" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/13542/hovercard" href="https://github.com/rust-lang/rust/issues/13542">#13542</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12377601" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/5527" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/5527/hovercard" href="https://github.com/rust-lang/rust/issues/5527">#5527</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29170250" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/12825" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/12825/hovercard" href="https://github.com/rust-lang/rust/issues/12825">#12825</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="28460028" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/12610" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/12610/hovercard" href="https://github.com/rust-lang/rust/pull/12610">#12610</a> and <a href="https://github.com/rust-lang/rfcs/pull/59" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rfcs/pull/59/hovercard">RFC 59</a> but could not grasp whether any would be addressing this or whether it's desirable, sorry if it's a duplicate.</p>
<p dir="auto">The documentation for <code class="notranslate">Clone</code> states that the first implementor is <code class="notranslate">Wrapping</code>:<br>
<code class="notranslate">impl&lt;T&gt; Clone for Wrapping&lt;T&gt; where T:</code><strong>_<code class="notranslate">Clone + Clone</code></strong>_</p>
<p dir="auto"><code class="notranslate">Range</code> is even more interesting:<br>
<code class="notranslate">impl&lt;Idx&gt; Clone for Range&lt;Idx&gt; where Idx:</code><strong>_<code class="notranslate">Clone + Clone + Clone</code></strong>_</p>
<p dir="auto">I would think that these should be documented as <code class="notranslate">impl&lt;T&gt; Clone for Wrapping&lt;T&gt; where T: Clone</code> and <code class="notranslate">impl&lt;Idx&gt; Clone for Range&lt;Idx&gt; where Idx: Clone</code>, respectively.</p>