<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `never` primitive in crate `std`."> <meta name="keywords" content="rust, rustlang, rust-lang, never"> <title>never - Rust</title> <link rel="stylesheet" type="text/css" href="../normalize.css"> <link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"> <link rel="stylesheet" type="text/css" href="../dark.css"> <link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle"> <script src="../storage.js"></script> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc primitive"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <div class="sidebar-menu">☰</div> <a href='../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a> <p class='location'>Primitive Type never</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-PartialOrd%3C!%3E">PartialOrd<!></a><a href="#impl-Ord">Ord</a><a href="#impl-Eq">Eq</a><a href="#impl-Display">Display</a><a href="#impl-PartialEq%3C!%3E">PartialEq<!></a><a href="#impl-Error">Error</a><a href="#impl-Termination">Termination</a></div></div><p class='location'><a href='index.html'>std</a></p><script>window.sidebarCurrent = {name: 'never', ty: 'primitive', relpath: ''};</script><script defer src="sidebar-items.js"></script></div> </nav> <div class="theme-picker"> <button id="theme-picker" aria-label="Pick another theme!"> <img src="../brush.svg" width="18" alt="Pick another theme!"> </button> <div id="theme-choices"></div> </div> <script src="../theme.js"></script> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content"> <h1 class='fqn'><span class='in-band'>Primitive Type <a class="primitive" href=''>never</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version '></span><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>−</span>] </a> </span></span></h1> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>never_type </code><a href="https://github.com/rust-lang/rust/issues/35121">#35121</a>)</div></div><div class='docblock'><p>The <code>!</code> type, also called "never".</p> <p><code>!</code> represents the type of computations which never resolve to any value at all. For example, the <a href="process/fn.exit.html"><code>exit</code></a> function <code>fn exit(code: i32) -> !</code> exits the process without ever returning, and so returns <code>!</code>.</p> <p><code>break</code>, <code>continue</code> and <code>return</code> expressions also have type <code>!</code>. For example we are allowed to write:</p> <pre class="rust rust-example-rendered"> <span class="attribute">#![<span class="ident">feature</span>(<span class="ident">never_type</span>)]</span> <span class="kw">let</span> <span class="ident">x</span>: <span class="op">!</span> <span class="op">=</span> { <span class="kw">return</span> <span class="number">123</span> };<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(never_type)%5D%0Afn%20main()%20%7B%0Afn%20foo()%20-%3E%20u32%20%7B%0Alet%20x%3A%20!%20%3D%20%7B%0A%20%20%20%20return%20123%0A%7D%3B%0A%7D%0A%7D&version=nightly">Run</a></pre> <p>Although the <code>let</code> is pointless here, it illustrates the meaning of <code>!</code>. Since <code>x</code> is never assigned a value (because <code>return</code> returns from the entire function), <code>x</code> can be given type <code>!</code>. We could also replace <code>return 123</code> with a <code>panic!</code> or a never-ending <code>loop</code> and this code would still be valid.</p> <p>A more realistic usage of <code>!</code> is in this code:</p> <pre class="rust rust-example-rendered"> <span class="kw">let</span> <span class="ident">num</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">get_a_number</span>() { <span class="prelude-val">Some</span>(<span class="ident">num</span>) <span class="op">=></span> <span class="ident">num</span>, <span class="prelude-val">None</span> <span class="op">=></span> <span class="kw">break</span>, };<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Afn%20get_a_number()%20-%3E%20Option%3Cu32%3E%20%7B%20None%20%7D%0Aloop%20%7B%0Alet%20num%3A%20u32%20%3D%20match%20get_a_number()%20%7B%0A%20%20%20%20Some(num)%20%3D%3E%20num%2C%0A%20%20%20%20None%20%3D%3E%20break%2C%0A%7D%3B%0A%7D%0A%7D">Run</a></pre> <p>Both match arms must produce values of type <a href="primitive.str.html"><code>u32</code></a>, but since <code>break</code> never produces a value at all we know it can never produce a value which isn't a <a href="primitive.str.html"><code>u32</code></a>. This illustrates another behaviour of the <code>!</code> type - expressions with type <code>!</code> will coerce into any other type.</p> <h1 id="-and-generics" class="section-header"><a href="#-and-generics"><code>!</code> and generics</a></h1> <p>The main place you'll see <code>!</code> used explicitly is in generic code. Consider the <a href="str/trait.FromStr.html"><code>FromStr</code></a> trait:</p> <pre class="rust rust-example-rendered"> <span class="kw">trait</span> <span class="ident">FromStr</span>: <span class="ident">Sized</span> { <span class="kw">type</span> <span class="prelude-val">Err</span>; <span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="ident">str</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="self">Self</span>::<span class="prelude-val">Err</span><span class="op">></span>; }<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Atrait%20FromStr%3A%20Sized%20%7B%0A%20%20%20%20type%20Err%3B%0A%20%20%20%20fn%20from_str(s%3A%20%26str)%20-%3E%20Result%3CSelf%2C%20Self%3A%3AErr%3E%3B%0A%7D%0A%7D">Run</a></pre> <p>When implementing this trait for <a href="string/struct.String.html"><code>String</code></a> we need to pick a type for <a href="result/enum.Result.html#variant.Err"><code>Err</code></a>. And since converting a string into a string will never result in an error, the appropriate type is <code>!</code>. (Currently the type actually used is an enum with no variants, though this is only because <code>!</code> was added to Rust at a later date and it may change in the future). With an <a href="result/enum.Result.html#variant.Err"><code>Err</code></a> type of <code>!</code>, if we have to call <a href="str/trait.FromStr.html#tymethod.from_str"><code>String::from_str</code></a> for some reason the result will be a <a href="result/enum.Result.html"><code>Result<String, !></code></a> which we can unpack like this:</p> <div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore"> <span class="comment">// NOTE: This does not work today!</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">s</span>) <span class="op">=</span> <span class="ident">String</span>::<span class="ident">from_str</span>(<span class="string">"hello"</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%2F%2F%20NOTE%3A%20This%20does%20not%20work%20today!%0Alet%20Ok(s)%20%3D%20String%3A%3Afrom_str(%22hello%22)%3B%0A%7D">Run</a></pre> <p>Since the <a href="result/enum.Result.html#variant.Err"><code>Err</code></a> variant contains a <code>!</code>, it can never occur. So we can exhaustively match on <a href="result/enum.Result.html"><code>Result<T, !></code></a> by just taking the <a href="result/enum.Result.html#variant.Ok"><code>Ok</code></a> variant. This illustrates another behaviour of <code>!</code> - it can be used to "delete" certain enum variants from generic types like <code>Result</code>.</p> <h1 id="-and-traits" class="section-header"><a href="#-and-traits"><code>!</code> and traits</a></h1> <p>When writing your own traits, <code>!</code> should have an <code>impl</code> whenever there is an obvious <code>impl</code> which doesn't <code>panic!</code>. As is turns out, most traits can have an <code>impl</code> for <code>!</code>. Take <a href="fmt/trait.Debug.html"><code>Debug</code></a> for example:</p> <pre class="rust rust-example-rendered"> <span class="kw">impl</span> <span class="ident">Debug</span> <span class="kw">for</span> <span class="op">!</span> { <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">formatter</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span>) <span class="op">-></span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> { <span class="kw-2">*</span><span class="self">self</span> } }<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(never_type)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3Afmt%3B%0Atrait%20Debug%20%7B%0Afn%20fmt(%26self%2C%20formatter%3A%20%26mut%20fmt%3A%3AFormatter)%20-%3E%20fmt%3A%3AResult%3B%0A%7D%0Aimpl%20Debug%20for%20!%20%7B%0A%20%20%20%20fn%20fmt(%26self%2C%20formatter%3A%20%26mut%20fmt%3A%3AFormatter)%20-%3E%20fmt%3A%3AResult%20%7B%0A%20%20%20%20%20%20%20%20*self%0A%20%20%20%20%7D%0A%7D%0A%7D&version=nightly">Run</a></pre> <p>Once again we're using <code>!</code>'s ability to coerce into any other type, in this case <a href="fmt/type.Result.html"><code>fmt::Result</code></a>. Since this method takes a <code>&!</code> as an argument we know that it can never be called (because there is no value of type <code>!</code> for it to be called with). Writing <code>*self</code> essentially tells the compiler "We know that this code can never be run, so just treat the entire function body has having type <a href="fmt/type.Result.html"><code>fmt::Result</code></a>". This pattern can be used a lot when implementing traits for <code>!</code>. Generally, any trait which only has methods which take a <code>self</code> parameter should have such as impl.</p> <p>On the other hand, one trait which would not be appropriate to implement is <a href="default/trait.Default.html"><code>Default</code></a>:</p> <pre class="rust rust-example-rendered"> <span class="kw">trait</span> <span class="ident">Default</span> { <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-></span> <span class="self">Self</span>; }<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Atrait%20Default%20%7B%0A%20%20%20%20fn%20default()%20-%3E%20Self%3B%0A%7D%0A%7D">Run</a></pre> <p>Since <code>!</code> has no values, it has no default value either. It's true that we could write an <code>impl</code> for this which simply panics, but the same is true for any type (we could <code>impl Default</code> for (eg.) <a href="fs/struct.File.html"><code>File</code></a> by just making <a href="default/trait.Default.html#tymethod.default"><code>default()</code></a> panic.)</p> </div> <h2 id='implementations' class='small-section-header'> Trait Implementations<a href='#implementations' class='anchor'></a> </h2> <h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/fmt/trait.Debug.html" title="trait std::fmt::Debug">Debug</a> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1579-1583' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='../std/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, &mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -> <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a><<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1580-1582' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Formats the value using the given formatter. <a href="../std/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></div><h3 id='impl-PartialOrd%3C!%3E' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/cmp/trait.PartialOrd.html" title="trait std::cmp::PartialOrd">PartialOrd</a><<a class="primitive" href="primitive.never.html">!</a>> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-PartialOrd%3C!%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#894-898' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.partial_cmp' class="method"><span id='partial_cmp.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&self, &<a class="primitive" href="primitive.never.html">!</a>) -> <a class="enum" href="../std/option/enum.Option.html" title="enum std::option::Option">Option</a><<a class="enum" href="../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#895-897' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="../std/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p> </div><h4 id='method.lt' class="method"><span id='lt.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: <a class="primitive" href="primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../src/core/cmp.rs.html#644-649' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code><</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.lt">Read more</a></p> </div><h4 id='method.le' class="method"><span id='le.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: <a class="primitive" href="primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../src/core/cmp.rs.html#666-671' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code><=</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.le">Read more</a></p> </div><h4 id='method.gt' class="method"><span id='gt.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: <a class="primitive" href="primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../src/core/cmp.rs.html#687-692' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>></code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.gt">Read more</a></p> </div><h4 id='method.ge' class="method"><span id='ge.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: <a class="primitive" href="primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../src/core/cmp.rs.html#709-714' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>>=</code> operator. <a href="../std/cmp/trait.PartialOrd.html#method.ge">Read more</a></p> </div></div><h3 id='impl-Ord' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-Ord' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#901-905' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.cmp' class="method"><span id='cmp.v' class='invisible'><code>fn <a href='../std/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&self, &<a class="primitive" href="primitive.never.html">!</a>) -> <a class="enum" href="../std/cmp/enum.Ordering.html" title="enum std::cmp::Ordering">Ordering</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#902-904' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="../std/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p> </div><h4 id='method.max' class="method"><span id='max.v' class='invisible'><code>fn <a href='../std/cmp/trait.Ord.html#method.max' class='fnname'>max</a>(self, other: Self) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../src/core/cmp.rs.html#460-463' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Compares and returns the maximum of two values. <a href="../std/cmp/trait.Ord.html#method.max">Read more</a></p> </div><h4 id='method.min' class="method"><span id='min.v' class='invisible'><code>fn <a href='../std/cmp/trait.Ord.html#method.min' class='fnname'>min</a>(self, other: Self) -> Self</code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.21.0'>1.21.0</div><a class='srclink' href='../src/core/cmp.rs.html#476-479' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Compares and returns the minimum of two values. <a href="../std/cmp/trait.Ord.html#method.min">Read more</a></p> </div></div><h3 id='impl-Eq' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/cmp/trait.Eq.html" title="trait std::cmp::Eq">Eq</a> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-Eq' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#891' title='goto source code'>[src]</a></span></h3> <div class='impl-items'></div><h3 id='impl-Display' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/fmt/trait.Display.html" title="trait std::fmt::Display">Display</a> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-Display' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1586-1590' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><code>fn <a href='../std/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, &mut <a class="struct" href="../std/fmt/struct.Formatter.html" title="struct std::fmt::Formatter">Formatter</a>) -> <a class="enum" href="../std/result/enum.Result.html" title="enum std::result::Result">Result</a><<a class="primitive" href="primitive.unit.html">()</a>, <a class="struct" href="../std/fmt/struct.Error.html" title="struct std::fmt::Error">Error</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/fmt/mod.rs.html#1587-1589' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Formats the value using the given formatter. <a href="../std/fmt/trait.Display.html#tymethod.fmt">Read more</a></p> </div></div><h3 id='impl-PartialEq%3C!%3E' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/cmp/trait.PartialEq.html" title="trait std::cmp::PartialEq">PartialEq</a><<a class="primitive" href="primitive.never.html">!</a>> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-PartialEq%3C!%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#884-888' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, &<a class="primitive" href="primitive.never.html">!</a>) -> <a class="primitive" href="primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/core/cmp.rs.html#885-887' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="../std/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p> </div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><code>fn <a href='../std/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: <a class="primitive" href="primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="primitive.bool.html">bool</a></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../src/core/cmp.rs.html#121' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>This method tests for <code>!=</code>.</p> </div></div><h3 id='impl-Error' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-Error' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/error.rs.html#238-240' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.description' class="method"><span id='description.v' class='invisible'><code>fn <a href='../std/error/trait.Error.html#tymethod.description' class='fnname'>description</a>(&self) -> &<a class="primitive" href="primitive.str.html">str</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/error.rs.html#239' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>A short description of the error. <a href="../std/error/trait.Error.html#tymethod.description">Read more</a></p> </div><h4 id='method.cause' class="method"><span id='cause.v' class='invisible'><code>fn <a href='../std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class="enum" href="../std/option/enum.Option.html" title="enum std::option::Option">Option</a><&<a class="trait" href="../std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code></span><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='../src/std/error.rs.html#154' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>The lower-level cause of this error, if any. <a href="../std/error/trait.Error.html#method.cause">Read more</a></p> </div></div><h3 id='impl-Termination' class='impl'><span class='in-band'><code>impl <a class="trait" href="../std/trait.Termination.html" title="trait std::Termination">Termination</a> for <a class="primitive" href="primitive.never.html">!</a></code><a href='#impl-Termination' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/termination.rs.html#70-72' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.report' class="method"><span id='report.v' class='invisible'><code>fn <a href='../std/trait.Termination.html#tymethod.report' class='fnname'>report</a>(self) -> <a class="primitive" href="primitive.i32.html">i32</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/std/termination.rs.html#71' title='goto source code'>[src]</a></span></h4> <div class='stability'><div class='stab unstable'><span class=microscope>🔬</span> This is a nightly-only experimental API. (<code>termination_trait </code><a href="https://github.com/rust-lang/rust/issues/43301">#43301</a>)</div></div><div class='docblock'><p>Is called to get the representation of the value as status code. This status code is returned to the operating system. <a href="../std/trait.Termination.html#tymethod.report">Read more</a></p> </div></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt><kbd>?</kbd></dt> <dd>Show this help dialog</dd> <dt><kbd>S</kbd></dt> <dd>Focus the search field</dd> <dt><kbd>↑</kbd></dt> <dd>Move up in search results</dd> <dt><kbd>↓</kbd></dt> <dd>Move down in search results</dd> <dt><kbd>↹</kbd></dt> <dd>Switch tab</dd> <dt><kbd>⏎</kbd></dt> <dd>Go to active search result</dd> <dt><kbd>+</kbd></dt> <dd>Expand all sections</dd> <dt><kbd>-</kbd></dt> <dd>Collapse all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "std"; </script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>