Skip to content

Rollup of 8 pull requests #28052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 89 commits into from
Aug 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
2c899ff
doc: improve E0133 explanation
tshepang Aug 19, 2015
c408b78
Move the Borrow and BorrowMut traits to libcore.
SimonSapin Aug 19, 2015
6174b8d
Refactor low-level UTF-16 decoding.
SimonSapin Aug 13, 2015
30fc4b7
book: Talk about ignore attribute in testing guide
adamcrume Aug 23, 2015
152c76e
Minimize the implementation of `Rem` in libcore
ranma42 Aug 24, 2015
82bed0a
Clarify a sentence in the Book
Aug 24, 2015
1629dce
Use correct indefinite article in reference.md
frewsxcv Aug 24, 2015
81c1d14
Simplify `String`’s `Extend<&str>` implementation
chris-morgan Aug 24, 2015
067ad99
Fix E0139 code
nagisa Aug 24, 2015
45de9de
Move entry point identification logic to libsyntax
wthrowe Aug 23, 2015
15d6837
Mark main-like functions allow(dead_code) in tests
wthrowe Aug 24, 2015
0112e7b
Move main removal to its own pass in --test mode
wthrowe Aug 24, 2015
8320a3a
Remove #[start] as well as #[main] in --test
wthrowe Aug 24, 2015
f56a478
book: Fix spacing in testing section
adamcrume Aug 25, 2015
574deb7
book: Mention that --ignored is a test binary argument
adamcrume Aug 25, 2015
7472886
Auto merge of #27986 - chris-morgan:reduce-string-extend-str-implemen…
bors Aug 25, 2015
03c6b4c
Rollup merge of #27905 - tshepang:E0133, r=brson
steveklabnik Aug 25, 2015
f45d2b5
Rollup merge of #27968 - adamcrume:master, r=steveklabnik
steveklabnik Aug 25, 2015
c15d0cf
Rollup merge of #27978 - mgrabovsky:doc-fix, r=steveklabnik
steveklabnik Aug 25, 2015
d9de182
Rollup merge of #27982 - frewsxcv:patch-25, r=steveklabnik
steveklabnik Aug 25, 2015
c4847a1
Rollup merge of #27988 - nagisa:diags-e0139, r=brson
steveklabnik Aug 25, 2015
1806174
Auto merge of #27994 - steveklabnik:rollup, r=steveklabnik
bors Aug 25, 2015
c4c533a
Do not recalculate string length in error_string
nagisa Aug 25, 2015
2f052eb
use the parameter environment when checking dtors
Aug 25, 2015
fc7c0f9
collections doc: remove mention of BitVec, BitSet, VecMap
birkenfeld Aug 25, 2015
b339f38
Auto merge of #27995 - nagisa:windows-error-message, r=alexcrichton
bors Aug 25, 2015
6e60fdb
Remove unnecessary temporaries from compare_values()
dotdash Aug 25, 2015
f3bd14a
Turn some alloca_no_lifetime() calls into plain alloca() calls
dotdash Aug 25, 2015
6c512dc
Separate lifetime starts from alloca()
dotdash Aug 25, 2015
95337a2
Add missing lifetime intrinsics in a few places
dotdash Aug 25, 2015
727a5d5
Prefer alloc_ty() instead of alloca() where possible
dotdash Aug 25, 2015
9a15d66
Omit lifetime intrinsics for function arguments and similar top-level…
dotdash Aug 25, 2015
93616af
Document the recursion_limit crate attribute
mbrubeck Aug 25, 2015
35eb3e8
Correct iterator adaptor Chain
bluss Aug 25, 2015
d07ee25
handle dtors having generics in an order different from their ADT
Aug 25, 2015
277eeb9
move destructors_for_type into AdtDef
Aug 25, 2015
14b7591
Auto merge of #28000 - mbrubeck:reference, r=steveklabnik
bors Aug 25, 2015
424d9c2
Fix docs typo
nkondratyev Aug 26, 2015
ef3255b
Auto merge of #27991 - bluss:chain-rev, r=alexcrichton
bors Aug 26, 2015
dddc4ca
Improve E0046
GuillaumeGomez Aug 26, 2015
9e51cee
Improve E0062 error explanation
GuillaumeGomez Aug 26, 2015
612221f
Improve E0063 error explanation
GuillaumeGomez Aug 26, 2015
5d8dc90
Improve E0025 error explanation
GuillaumeGomez Aug 26, 2015
af02bcc
Fix typo in E0087
GuillaumeGomez Aug 26, 2015
0c4faf2
Add erroneous code example for E0131
GuillaumeGomez Aug 26, 2015
9f15b28
Add missing ';' in E0132
GuillaumeGomez Aug 26, 2015
dfb0677
Remove unnecessary whitespace
GuillaumeGomez Aug 26, 2015
805e4e6
Remove unnecessary empty lines
GuillaumeGomez Aug 26, 2015
acafe3b
Add E0370 error explanation
GuillaumeGomez Aug 26, 2015
c891fae
Fix keyboard scrolling in rustbook
artemshitov Aug 26, 2015
b392016
Remove redundant overflowing rule
artemshitov Aug 26, 2015
685332c
Auto merge of #27998 - birkenfeld:patch-1, r=alexcrichton
bors Aug 26, 2015
05d3696
Avoid an extra alloca/memcpy when auto-ref'ing fat pointers
dotdash Aug 26, 2015
2d0cb31
mk: tell rustc that we're only looking for native libs in the LLVM_LI…
codyps Aug 26, 2015
dec4351
Any docs: as_ref doesn't exist anymore
steveklabnik Aug 26, 2015
a48c29d
Auto merge of #27992 - wthrowe:dead-main-2, r=alexcrichton
bors Aug 26, 2015
933eb3e
path: the if-else block looked unusual
tshepang Aug 26, 2015
1c3b19d
Auto merge of #28021 - steveklabnik:gh27958, r=alexcrichton
bors Aug 26, 2015
cf3d6b5
doc: improve as_path example
tshepang Aug 26, 2015
469620f
doc: I had to read this twice before understanding it
tshepang Aug 26, 2015
0ca1cae
doc: add Iterator::size_hint example
tshepang Aug 26, 2015
80b971a
Auto merge of #28003 - nkondratyev:patch-1, r=steveklabnik
bors Aug 26, 2015
2367caf
fix unstable issue ref for Unsize
durka Aug 26, 2015
fd302a9
Auto merge of #27808 - SimonSapin:utf16decoder, r=alexcrichton
bors Aug 27, 2015
af83d98
Auto merge of #28001 - arielb1:dtor-fixes, r=pnkfelix
bors Aug 27, 2015
ab21fe5
Auto merge of #28020 - dotdash:ref_fat_ptr_be_gone, r=eddyb
bors Aug 27, 2015
0d5142f
Auto merge of #28023 - jmesmon:llvm-path-native-only, r=alexcrichton
bors Aug 27, 2015
651c42f
Make iter::order functions into methods on Iterator
sfackler Aug 24, 2015
d6a65cd
Auto merge of #27975 - sfackler:iter-order-methods, r=aturon
bors Aug 27, 2015
4653a8b
Restore removed code and mark it for usage in stage0
ranma42 Aug 27, 2015
f663286
Auto merge of #28027 - tshepang:improve-sentence, r=alexcrichton
bors Aug 27, 2015
40fd4d6
Auto merge of #28028 - tshepang:add-size_hint-example, r=alexcrichton
bors Aug 27, 2015
ccf8317
Auto merge of #28016 - ranma42:mini-rem-in-core, r=alexcrichton
bors Aug 27, 2015
a7313a0
core: Implement IntoIterator for Option and Result references
birkenfeld Aug 27, 2015
b28f0b1
Auto merge of #28030 - tshepang:improve-example, r=alexcrichton
bors Aug 27, 2015
fbbd874
Comment out unused error codes in librustc_typeck/diagnostics.rs
GuillaumeGomez Aug 27, 2015
21f209a
remove calls to deprecated `iter::order` functions
apasel422 Aug 27, 2015
af58e5c
Add Windows-specific comments to testing guide
steveklabnik Aug 26, 2015
59653c1
Some extra examples for the unimplemented! macro
steveklabnik Aug 27, 2015
17b6fcd
Auto merge of #28031 - durka:patch-6, r=alexcrichton
bors Aug 27, 2015
abfa081
Auto merge of #27999 - dotdash:lt, r=eddyb
bors Aug 27, 2015
a3b32eb
Rollup merge of #28010 - GuillaumeGomez:patch-2, r=Manishearth
Manishearth Aug 27, 2015
71ecc42
Rollup merge of #28013 - artemshitov:rustbook-scrolling, r=steveklabnik
Manishearth Aug 27, 2015
ab3dc54
Rollup merge of #28022 - steveklabnik:gh27936, r=alexcrichton
Manishearth Aug 27, 2015
aebe352
Rollup merge of #28029 - tshepang:unusual, r=steveklabnik
Manishearth Aug 27, 2015
0833d87
Rollup merge of #28033 - Manishearth:compilerexpn, r=eddyb
Manishearth Aug 27, 2015
07d1a22
Rollup merge of #28039 - birkenfeld:option_result_ref_intoiter, r=ale…
Manishearth Aug 27, 2015
1c7c6ad
Rollup merge of #28045 - apasel422:iter, r=sfackler
Manishearth Aug 27, 2015
a63cd9b
Rollup merge of #28048 - steveklabnik:doc_unimplemented, r=alexcrichton
Manishearth Aug 27, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L native="$$(LLVM_LIBDIR_$(1))"
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
ifeq ($$(findstring freebsd,$(1)),freebsd)
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),
Expand Down
8 changes: 6 additions & 2 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ fn draw_twice<T: Shape>(surface: Surface, sh: T) {
}
```

Traits also define an [trait object](#trait-objects) with the same
Traits also define a [trait object](#trait-objects) with the same
name as the trait. Values of this type are created by coercing from a
pointer of some specific type to a pointer of trait type. For example,
`&T` could be coerced to `&Shape` if `T: Shape` holds (and similarly
Expand Down Expand Up @@ -1881,11 +1881,15 @@ type int8_t = i8;
- `no_start` - disable linking to the `native` crate, which specifies the
"start" language item.
- `no_std` - disable linking to the `std` crate.
- `plugin` load a list of named crates as compiler plugins, e.g.
- `plugin` - load a list of named crates as compiler plugins, e.g.
`#![plugin(foo, bar)]`. Optional arguments for each plugin,
i.e. `#![plugin(foo(... args ...))]`, are provided to the plugin's
registrar function. The `plugin` feature gate is required to use
this attribute.
- `recursion_limit` - Sets the maximum depth for potentially
infinitely-recursive compile-time operations like
auto-dereference or macro expansion. The default is
`#![recursion_limit="64"]`.

### Module-only attributes

Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/crates-and-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ $ ls target/debug
build deps examples libphrases-a7448e02a0468eaa.rlib native
```

`libphrase-hash.rlib` is the compiled crate. Before we see how to use this
`libphrases-hash.rlib` is the compiled crate. Before we see how to use this
crate from another crate, let’s break it up into multiple files.

# Multiple file crates
Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ Because these kinds of situations are relatively rare, use panics sparingly.

In certain circumstances, even though a function may fail, we may want to treat
it as a panic instead. For example, `io::stdin().read_line(&mut buffer)` returns
a `Result<usize>`, when there is an error reading the line. This allows us to
handle and possibly recover from error.
a `Result<usize>`, which can indicate an error if one occurs when reading the line.
This allows us to handle and possibly recover from errors.

If we don't want to handle this error, and would rather just abort the program,
we can use the `unwrap()` method:
Expand Down
75 changes: 74 additions & 1 deletion src/doc/trpl/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,26 @@ And that's reflected in the summary line:
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
```

We also get a non-zero status code:
We also get a non-zero status code. We can use `$?` on OS X and Linux:

```bash
$ echo $?
101
```

On Windows, if you’re using `cmd`:

```bash
> echo %ERRORLEVEL%
```

And if you’re using PowerShell:

```bash
> echo $LASTEXITCODE # the code itself
> echo $? # a boolean, fail or succeed
```

This is useful if you want to integrate `cargo test` into other tooling.

We can invert our test's failure with another attribute: `should_panic`:
Expand Down Expand Up @@ -219,6 +232,66 @@ fn it_works() {
This is a very common use of `assert_eq!`: call some function with
some known arguments and compare it to the expected output.

# The `ignore` attribute

Sometimes a few specific tests can be very time-consuming to execute. These
can be disabled by default by using the `ignore` attribute:

```rust
#[test]
fn it_works() {
assert_eq!(4, add_two(2));
}

#[test]
#[ignore]
fn expensive_test() {
// code that takes an hour to run
}
```

Now we run our tests and see that `it_works` is run, but `expensive_test` is
not:

```bash
$ cargo test
Compiling adder v0.0.1 (file:///home/you/projects/adder)
Running target/adder-91b3e234d4ed382a

running 2 tests
test expensive_test ... ignored
test it_works ... ok

test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured

Doc-tests adder

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
```

The expensive tests can be run explicitly using `cargo test -- --ignored`:

```bash
$ cargo test -- --ignored
Running target/adder-91b3e234d4ed382a

running 1 test
test expensive_test ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

Doc-tests adder

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
```

The `--ignored` argument is an argument to the test binary, and not to cargo,
which is why the command is `cargo test -- --ignored`.

# The `tests` module

There is one way in which our existing example is not idiomatic: it's
Expand Down
5 changes: 5 additions & 0 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ use boxed::Box;

use core::sync::atomic;
use core::sync::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::borrow;
use core::fmt;
use core::cmp::Ordering;
use core::mem::{align_of_val, size_of_val};
Expand Down Expand Up @@ -1109,3 +1110,7 @@ mod tests {
assert!(y.upgrade().is_none());
}
}

impl<T: ?Sized> borrow::Borrow<T> for Arc<T> {
fn borrow(&self) -> &T { &**self }
}
8 changes: 8 additions & 0 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ use heap;
use raw_vec::RawVec;

use core::any::Any;
use core::borrow;
use core::cmp::Ordering;
use core::fmt;
use core::hash::{self, Hash};
Expand Down Expand Up @@ -562,3 +563,10 @@ impl<T: Clone> Clone for Box<[T]> {
}
}

impl<T: ?Sized> borrow::Borrow<T> for Box<T> {
fn borrow(&self) -> &T { &**self }
}

impl<T: ?Sized> borrow::BorrowMut<T> for Box<T> {
fn borrow_mut(&mut self) -> &mut T { &mut **self }
}
5 changes: 5 additions & 0 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ use boxed::Box;
#[cfg(test)]
use std::boxed::Box;

use core::borrow;
use core::cell::Cell;
use core::cmp::Ordering;
use core::fmt;
Expand Down Expand Up @@ -1091,3 +1092,7 @@ mod tests {
assert_eq!(foo, foo.clone());
}
}

impl<T: ?Sized> borrow::Borrow<T> for Rc<T> {
fn borrow(&self) -> &T { &**self }
}
111 changes: 1 addition & 110 deletions src/libcollections/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,119 +21,10 @@ use core::ops::Deref;
use core::option::Option;

use fmt;
use alloc::{boxed, rc, arc};

use self::Cow::*;

/// A trait for borrowing data.
///
/// In general, there may be several ways to "borrow" a piece of data. The
/// typical ways of borrowing a type `T` are `&T` (a shared borrow) and `&mut T`
/// (a mutable borrow). But types like `Vec<T>` provide additional kinds of
/// borrows: the borrowed slices `&[T]` and `&mut [T]`.
///
/// When writing generic code, it is often desirable to abstract over all ways
/// of borrowing data from a given type. That is the role of the `Borrow`
/// trait: if `T: Borrow<U>`, then `&U` can be borrowed from `&T`. A given
/// type can be borrowed as multiple different types. In particular, `Vec<T>:
/// Borrow<Vec<T>>` and `Vec<T>: Borrow<[T]>`.
///
/// If you are implementing `Borrow` and both `Self` and `Borrowed` implement
/// `Hash`, `Eq`, and/or `Ord`, they must produce the same result.
///
/// `Borrow` is very similar to, but different than, `AsRef`. See
/// [the book][book] for more.
///
/// [book]: ../../book/borrow-and-asref.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Borrow<Borrowed: ?Sized> {
/// Immutably borrows from an owned value.
///
/// # Examples
///
/// ```
/// use std::borrow::Borrow;
///
/// fn check<T: Borrow<str>>(s: T) {
/// assert_eq!("Hello", s.borrow());
/// }
///
/// let s = "Hello".to_string();
///
/// check(s);
///
/// let s = "Hello";
///
/// check(s);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn borrow(&self) -> &Borrowed;
}

/// A trait for mutably borrowing data.
///
/// Similar to `Borrow`, but for mutable borrows.
#[stable(feature = "rust1", since = "1.0.0")]
pub trait BorrowMut<Borrowed: ?Sized> : Borrow<Borrowed> {
/// Mutably borrows from an owned value.
///
/// # Examples
///
/// ```
/// use std::borrow::BorrowMut;
///
/// fn check<T: BorrowMut<[i32]>>(mut v: T) {
/// assert_eq!(&mut [1, 2, 3], v.borrow_mut());
/// }
///
/// let v = vec![1, 2, 3];
///
/// check(v);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn borrow_mut(&mut self) -> &mut Borrowed;
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Borrow<T> for T {
fn borrow(&self) -> &T { self }
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> BorrowMut<T> for T {
fn borrow_mut(&mut self) -> &mut T { self }
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Borrow<T> for &'a T {
fn borrow(&self) -> &T { &**self }
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> Borrow<T> for &'a mut T {
fn borrow(&self) -> &T { &**self }
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized> BorrowMut<T> for &'a mut T {
fn borrow_mut(&mut self) -> &mut T { &mut **self }
}

impl<T: ?Sized> Borrow<T> for boxed::Box<T> {
fn borrow(&self) -> &T { &**self }
}

impl<T: ?Sized> BorrowMut<T> for boxed::Box<T> {
fn borrow_mut(&mut self) -> &mut T { &mut **self }
}

impl<T: ?Sized> Borrow<T> for rc::Rc<T> {
fn borrow(&self) -> &T { &**self }
}

impl<T: ?Sized> Borrow<T> for arc::Arc<T> {
fn borrow(&self) -> &T { &**self }
}
pub use core::borrow::{Borrow, BorrowMut};

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, B: ?Sized> Borrow<B> for Cow<'a, B> where B: ToOwned, <B as ToOwned>::Owned: 'a {
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use core::fmt::Debug;
use core::hash::{Hash, Hasher};
use core::iter::{Map, FromIterator};
use core::ops::Index;
use core::{iter, fmt, mem, usize};
use core::{fmt, mem, usize};
use Bound::{self, Included, Excluded, Unbounded};

use borrow::Borrow;
Expand Down Expand Up @@ -915,15 +915,15 @@ impl<K: Eq, V: Eq> Eq for BTreeMap<K, V> {}
impl<K: PartialOrd, V: PartialOrd> PartialOrd for BTreeMap<K, V> {
#[inline]
fn partial_cmp(&self, other: &BTreeMap<K, V>) -> Option<Ordering> {
iter::order::partial_cmp(self.iter(), other.iter())
self.iter().partial_cmp(other.iter())
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<K: Ord, V: Ord> Ord for BTreeMap<K, V> {
#[inline]
fn cmp(&self, other: &BTreeMap<K, V>) -> Ordering {
iter::order::cmp(self.iter(), other.iter())
self.iter().cmp(other.iter())
}
}

Expand Down
1 change: 1 addition & 0 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#![feature(unicode)]
#![feature(unique)]
#![feature(unsafe_no_drop_flag, filling_drop)]
#![feature(decode_utf16)]
#![feature(utf8_error)]
#![cfg_attr(test, feature(rand, test))]

Expand Down
10 changes: 5 additions & 5 deletions src/libcollections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use alloc::boxed::Box;
use core::cmp::Ordering;
use core::fmt;
use core::hash::{Hasher, Hash};
use core::iter::{self, FromIterator};
use core::iter::FromIterator;
use core::mem;
use core::ptr;

Expand Down Expand Up @@ -917,12 +917,12 @@ impl<'a, T: 'a + Copy> Extend<&'a T> for LinkedList<T> {
impl<A: PartialEq> PartialEq for LinkedList<A> {
fn eq(&self, other: &LinkedList<A>) -> bool {
self.len() == other.len() &&
iter::order::eq(self.iter(), other.iter())
self.iter().eq(other.iter())
}

fn ne(&self, other: &LinkedList<A>) -> bool {
self.len() != other.len() ||
iter::order::ne(self.iter(), other.iter())
self.iter().ne(other.iter())
}
}

Expand All @@ -932,15 +932,15 @@ impl<A: Eq> Eq for LinkedList<A> {}
#[stable(feature = "rust1", since = "1.0.0")]
impl<A: PartialOrd> PartialOrd for LinkedList<A> {
fn partial_cmp(&self, other: &LinkedList<A>) -> Option<Ordering> {
iter::order::partial_cmp(self.iter(), other.iter())
self.iter().partial_cmp(other.iter())
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<A: Ord> Ord for LinkedList<A> {
#[inline]
fn cmp(&self, other: &LinkedList<A>) -> Ordering {
iter::order::cmp(self.iter(), other.iter())
self.iter().cmp(other.iter())
}
}

Expand Down
Loading