Commit Graph

66 Commits

Author SHA1 Message Date
Alex Crichton
9d5d97b55d Remove a large amount of deprecated functionality
Spring cleaning is here! In the Fall! This commit removes quite a large amount
of deprecated functionality from the standard libraries. I tried to ensure that
only old deprecated functionality was removed.

This is removing lots and lots of deprecated features, so this is a breaking
change. Please consult the deprecation messages of the deleted code to see how
to migrate code forward if it still needs migration.

[breaking-change]
2014-10-19 12:59:40 -07:00
Brian Anderson
d21336ee0a rustc: Remove &str indexing from the language.
Being able to index into the bytes of a string encourages
poor UTF-8 hygiene. To get a view of `&[u8]` from either
a `String` or `&str` slice, use the `as_bytes()` method.

Closes #12710.

[breaking-change]
2014-07-01 19:12:29 -07:00
Alex Crichton
748bc3ca49 std: Rename {Eq,Ord} to Partial{Eq,Ord}
This is part of the ongoing renaming of the equality traits. See #12517 for more
details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.

cc #12517

[breaking-change]
2014-05-30 15:52:24 -07:00
Richo Healey
4348e23b26 std: Remove String's to_owned 2014-05-27 11:11:15 -07:00
Patrick Walton
e878721d70 libcore: Remove all uses of ~str from libcore.
[breaking-change]
2014-05-22 14:42:02 -07:00
Richo Healey
919889a1d6 Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
Huon Wilson
6d778ff610 Remove outdated and unnecessary std::vec_ng::Vec imports.
(And fix some tests.)
2014-03-22 01:08:57 +11:00
Patrick Walton
af79a5aa7d test: Make manual changes to deal with the fallout from removal of
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21 23:37:21 +11:00
Patrick Walton
579eb2400b test: Automatically remove all ~[T] from tests. 2014-03-21 23:37:21 +11:00
Alex Crichton
7858065113 std: Rename Chan/Port types and constructor
* Chan<T> => Sender<T>
* Port<T> => Receiver<T>
* Chan::new() => channel()
* constructor returns (Sender, Receiver) instead of (Receiver, Sender)
* local variables named `port` renamed to `rx`
* local variables named `chan` renamed to `tx`

Closes #11765
2014-03-13 13:23:29 -07:00
Alex Crichton
02882fbd7e std: Change assert_eq!() to use {} instead of {:?}
Formatting via reflection has been a little questionable for some time now, and
it's a little unfortunate that one of the standard macros will silently use
reflection when you weren't expecting it. This adds small bits of code bloat to
libraries, as well as not always being necessary. In light of this information,
this commit switches assert_eq!() to using {} in the error message instead of
{:?}.

In updating existing code, there were a few error cases that I encountered:

* It's impossible to define Show for [T, ..N]. I think DST will alleviate this
  because we can define Show for [T].
* A few types here and there just needed a #[deriving(Show)]
* Type parameters needed a Show bound, I often moved this to `assert!(a == b)`
* `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths.
  I don't think this is much of a regression though because {:?} on paths looks
  awful (it's a byte array).

Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime
significant for smaller binaries.
2014-02-28 23:01:54 -08:00
Alex Crichton
529e268ab9 Fallout of rewriting std::comm 2013-12-16 17:47:11 -08:00
Brian Anderson
9a773da681 Remove ancient emacs mode lines from test cases
These are relics that serve no purpose.
2013-10-25 17:41:54 -07:00
Patrick Walton
206ab89629 librustc: Stop reexporting the standard modules from prelude. 2013-05-29 19:04:53 -07:00
Corey Richardson
cc57ca012a Use assert_eq! rather than assert! where possible 2013-05-19 08:16:02 -04:00
Patrick Walton
1e91595520 librustc: Remove fail_unless! 2013-03-29 16:39:08 -07:00
Patrick Walton
3eda11a4f7 test: Remove pure from the test suite 2013-03-22 12:57:28 -07:00
Patrick Walton
d7e74b5e91 librustc: Convert all uses of assert over to fail_unless! 2013-03-07 22:37:57 -08:00
Brian Anderson
dab6a85230 core: Extract comm from pipes. #4742 2013-02-21 17:36:54 -08:00
Luqman Aden
178882c98f tests/tutorials: Get rid of move. 2013-02-15 02:49:55 -08:00
Patrick Walton
9143688197 librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
Graydon Hoare
89c8ef792f check-fast fallout from removing export, r=burningtree 2013-02-01 19:43:17 -08:00
Tim Chevalier
6d4907a742 testsuite: Eliminate uses of structural records from most run-pass tests
Except the pipes tests (that needs a snapshot)
2013-01-26 11:35:17 -08:00
Patrick Walton
4c2e4c37ce librustc: Make use statements crate-relative by default. r=brson 2012-12-13 13:05:22 -08:00
Tim Chevalier
38bd694df1 Reverse the order of the results of pipes::stream
As per #3637.
2012-12-11 19:23:28 -08:00
Graydon Hoare
d1affff623 Reliciense makefiles and testsuite. Yup. 2012-12-10 17:32:58 -08:00
Patrick Walton
318e534895 rustc: Implement explicit self for Eq and Ord. r=graydon 2012-11-19 15:33:11 -08:00
Tim Chevalier
3ebd878f4a Make moves explicit in rpass tests 2012-10-12 20:43:38 -07:00
Patrick Walton
9117dcb968 rustc: De-mode all overloaded operators 2012-09-20 09:48:05 -07:00
Brian Anderson
ea01ee2e9e Convert 'use' to 'extern mod'. Remove old 'use' syntax 2012-09-11 19:25:43 -07:00
Patrick Walton
feb014eb3c rustc: Add an "ne" method to the Eq trait, and implement it everywhere 2012-09-07 12:24:48 -07:00
Patrick Walton
f686896f60 test: "import" -> "use" 2012-09-05 12:32:05 -07:00
Patrick Walton
96534365c2 rustc: Make < and = into traits 2012-08-29 18:25:22 -07:00
Brian Anderson
cfbc7cbdc7 Convert core::pipes to camel case 2012-08-28 14:33:18 -07:00
Eric Holk
2c06e7aac9 Fixing failing test cases 2012-08-03 12:48:14 -07:00
Eric Holk
08a77e06a8 Rewrite task-comm-NN to use pipes 2012-07-25 15:15:46 -07:00
Michael Sullivan
92743dc2a6 Move the world over to using the new style string literals and types. Closes #2907. 2012-07-14 01:03:43 -07:00
Michael Sullivan
98e161f00e Switch the compiler over to using ~[] notation instead of []/~. Closes #2759. 2012-06-29 17:41:45 -07:00
Michael Sullivan
329eca6044 Make vectors uglier ([]/~). Sorry. Should be temporary. Closes #2725. 2012-06-25 20:00:46 -07:00
Eric Holk
26c11f7b50 Use must_have_lock instead of private functions. (Issue #2700)
I hereby declare that messages sent from the same source arrive in order (Issue #2605)

Removing FIXME, owned is the correct type here. (Issue #2704)

Remove outdated FIXME (Issue #2703)

Updating test for spawning native functions (Issue #2602)

Removing bogus FIXME (Issue #2599)
2012-06-22 15:14:42 -07:00
Tim Chevalier
13d4b61182 Comments only: annotate FIXMEs in tests 2012-06-14 15:35:43 -07:00
Niko Matsakis
dc07280b08 make --enforce-mut-vars always on, add mut annotations to remaining files 2012-03-22 09:58:19 -07:00
Brian Anderson
34aa956e68 test: Resolve some FIXMEs 2012-02-05 17:05:24 -08:00
Patrick Walton
59ebe6af18 rustc: Make the pretty printer output commas after enum variants. Update all tests accordingly. 2012-01-19 18:41:06 -08:00
Patrick Walton
3333fef1af test: "tag" -> "enum" in run-pass and run-fail 2012-01-19 16:11:17 -08:00
Graydon Hoare
fa9ad984fb Copy first batch of material from libstd to libcore. 2011-12-13 16:34:50 -08:00
Eric Holk
2f7c583bc1 Cleaning up task and comm exports, updating all the test cases. 2011-08-25 11:21:25 -07:00
Brian Anderson
518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00
Eric Holk
cc353aa17a Removed old object-based chans. 2011-08-15 09:26:51 -07:00
Eric Holk
39b16077bb Port ID-based channels. 2011-08-15 09:26:51 -07:00