]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #12982 : brson/rust/optiondocs, r=alexcrichton
bors [Wed, 19 Mar 2014 13:01:48 +0000 (06:01 -0700)]
auto merge of #12982 : brson/rust/optiondocs, r=alexcrichton

Various improvements. There's a lot more that can be done.

10 years agoauto merge of #12955 : sfackler/rust/vec_ng-doc, r=alexcrichton
bors [Wed, 19 Mar 2014 08:41:43 +0000 (01:41 -0700)]
auto merge of #12955 : sfackler/rust/vec_ng-doc, r=alexcrichton

I also removed a couple of methods that were silly and added sort.

10 years agoDocify std::vec_ng
Steven Fackler [Sun, 16 Mar 2014 23:04:29 +0000 (16:04 -0700)]
Docify std::vec_ng

I also removed a couple of methods that were silly and added sort.

10 years agoauto merge of #12954 : brson/rust/atomicdocs, r=alexcrichton
bors [Wed, 19 Mar 2014 04:16:46 +0000 (21:16 -0700)]
auto merge of #12954 : brson/rust/atomicdocs, r=alexcrichton

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API (relying on `Share`) and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.

10 years agostd: Improve option docs
Brian Anderson [Mon, 17 Mar 2014 01:43:47 +0000 (18:43 -0700)]
std: Improve option docs

10 years agoauto merge of #13006 : alexcrichton/rust/rollup, r=alexcrichton
bors [Wed, 19 Mar 2014 01:22:23 +0000 (18:22 -0700)]
auto merge of #13006 : alexcrichton/rust/rollup, r=alexcrichton

Closes #13008 (Made the `clone_from` implementation for `~T` reuse the `T` itself if possible)
Closes #13003 (Make method Vec::remove() public)
Closes #13002 (disallow duplicate methods in trait impls)
Closes #13000 (rustc: test: don't silently ignore bad benches)
Closes #12999 (rustc: buffer the output writer for -Z ast-json[-noexpand].)
Closes #12993 (syntax: Don't parameterize the the pretty printer)
Closes #12990 (`char` reference: s/character/Unicode scalar value/)
Closes #12987 (Move syntax-extension-hexfloat.rs)
Closes #12983 (Fix linkage1 test which fails due to --as-needed)
Closes #12978 (rustc: remove linker_private/linker_private_weak)
Closes #12976 (libsyntax: librustdoc: ignore utf-8 BOM in .rs files)
Closes #12973 (closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type)
Closes #12972 (Add impl IntoStr for ::std::vec_ng::Vec<Ascii>)
Closes #12968 (deny missing docs getopts)
Closes #12965 (Documentation and formatting changes for option.rs.)
Closes #12962 (Relax the memory ordering on the implementation of UnsafeArc)
Closes #12958 (Typo fixes.)
Closes #12950 (Docsprint: Document ops module, primarily Deref.)
Closes #12946 (rustdoc: Implement cross-crate searching)

10 years agoTest fixes from the rollup
Alex Crichton [Tue, 18 Mar 2014 21:03:45 +0000 (14:03 -0700)]
Test fixes from the rollup

10 years agoMade the `clone_from` implementation for `~T` reuse the `T` itself if
Marvin Löbel [Tue, 18 Mar 2014 22:16:21 +0000 (23:16 +0100)]
Made the `clone_from` implementation for `~T` reuse the `T` itself if
possible by also calling `clone_from` on it.

In general, `Clone` implementors that overwrite `clone_from`
should try to to use it recursivly for substructures.

10 years agorustdoc: Implement cross-crate searching
Alex Crichton [Sun, 16 Mar 2014 08:08:56 +0000 (01:08 -0700)]
rustdoc: Implement cross-crate searching

A major discoverability issue with rustdoc is that all crates have their
documentation built in isolation, so it's difficult when looking at the
documentation for libstd to learn that there's a libcollections crate with a
HashMap in it.

This commit moves rustdoc a little closer to improving the multiple crate
experience. This unifies all search indexes for all crates into one file so all
pages share the same search index. This allows searching to work across crates
in the same documentation directory (as the standard distribution is currently
built).

This strategy involves updating a shared file amongst many rustdoc processes, so
I implemented a simple file locking API for handling synchronization for updates
to the shared files.

cc #12554

10 years agoDocsprint: Document ops module, primarily Deref.
Matthew McPherrin [Sun, 16 Mar 2014 22:35:35 +0000 (15:35 -0700)]
Docsprint: Document ops module, primarily Deref.

10 years agoTypo fixes.
Lindsey Kuper [Mon, 17 Mar 2014 00:12:49 +0000 (20:12 -0400)]
Typo fixes.

10 years agoRelaxed the memory ordering on the implementation of UnsafeArc
Jonathan S [Mon, 17 Mar 2014 00:39:38 +0000 (19:39 -0500)]
Relaxed the memory ordering on the implementation of UnsafeArc

10 years agoDocumentation and formatting changes for option.rs.
Ziad Hatahet [Mon, 17 Mar 2014 03:42:25 +0000 (20:42 -0700)]
Documentation and formatting changes for option.rs.

10 years agodeny missing docs
Alan Andrade [Mon, 17 Mar 2014 05:53:54 +0000 (22:53 -0700)]
deny missing docs

10 years agoAdd impl IntoStr for ::std::vec_ng::Vec<Ascii>
Eunchong Yu [Mon, 17 Mar 2014 06:30:27 +0000 (15:30 +0900)]
Add impl IntoStr for ::std::vec_ng::Vec<Ascii>

10 years agocloses #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type
Jeff Olson [Mon, 17 Mar 2014 07:26:36 +0000 (00:26 -0700)]
closes #12967 fix [en|de]coding of HashMap<K,V> where K is a numeric type

serialize: ref #12697 minor adj. to last char check + prettyencode test

10 years agolibsyntax: librustdoc: ignore utf-8 BOM in .rs files
Liigo Zhuang [Tue, 18 Mar 2014 00:59:44 +0000 (08:59 +0800)]
libsyntax: librustdoc: ignore utf-8 BOM in .rs files
Closes #12974

10 years agorustc: remove obsolete linkage types
Ben Noordhuis [Mon, 17 Mar 2014 15:37:23 +0000 (16:37 +0100)]
rustc: remove obsolete linkage types

Remove obsolete linkage types from the llvm::Linkage enum.  The linkage
types are no-ops and weren't used inside rustc anyway.

10 years agorustc: remove linker_private/linker_private_weak
Ben Noordhuis [Sun, 16 Mar 2014 13:39:51 +0000 (14:39 +0100)]
rustc: remove linker_private/linker_private_weak

Remove the linker_private and linker_private_weak linkage attributes,
they have been superseded by private and private_weak and have been
removed in upstream LLVM in commit r203866.

10 years agoFix linkage1 test which fails due to --as-needed
Nick Cameron [Mon, 17 Mar 2014 21:54:35 +0000 (10:54 +1300)]
Fix linkage1 test which fails due to --as-needed

It appears that the --as-needed flag to linkers will not pull in a dynamic library unless it satisfies a non weak undefined symbol. The linkage1 test was creating a dynamic library where it was only used for a weak-symbol as part of an executable, so the dynamic library was getting discarded.

This commit adds another symbol to the library which satisfies a strong undefined symbol, so the library is pulled in to resolve the weak reference.

10 years agoMove syntax-extension-hexfloat.rs
Nick Cameron [Tue, 18 Mar 2014 01:21:35 +0000 (14:21 +1300)]
Move syntax-extension-hexfloat.rs

Move syntax-extension-hexfloat.rs to run-pass-fulldeps so it depends on libhexfloat being compiled before running.

10 years ago`char`: s/character/Unicode scalar value/
Simon Sapin [Tue, 18 Mar 2014 04:19:18 +0000 (12:19 +0800)]
`char`: s/character/Unicode scalar value/

Tweak the definition of `char` to use the appropriate Unicode terminology.

10 years agosyntax: Don't parameterize the the pretty printer
Alex Crichton [Tue, 18 Mar 2014 05:27:37 +0000 (22:27 -0700)]
syntax: Don't parameterize the the pretty printer

The pretty printer constitues an enormous amount of code, there's no reason for
it to be generic. This just least to a huge amount of metadata which isn't
necessary. Instead, this change migrates the pretty printer to using a trait
object instead.

Closes #12985

10 years agorustc: buffer the output writer for -Z ast-json[-noexpand].
Huon Wilson [Tue, 18 Mar 2014 12:40:07 +0000 (23:40 +1100)]
rustc: buffer the output writer for -Z ast-json[-noexpand].

This takes the time for `rustc libstd/lib.rs -Z ast-json-noexpand >
file.json` from 9.0s to 3.5s (~0.5s spent parsing etc.) and `-Z
ast-json` from 11s to 5s (~1.5s spent parsing and expanding).

10 years agorustc: test: don't silently ignore bad benches
Corey Richardson [Tue, 18 Mar 2014 13:20:30 +0000 (09:20 -0400)]
rustc: test: don't silently ignore bad benches

This is adequate because when a function has a type that isn't caught here,
that is, it has a single argument, but it *isn't* `&mut BenchHarness`, it
errors later on with:

     error: mismatched types: expected `fn(&mut test::BenchHarness)` but found
     `fn(int)` (expected &-ptr but found int)

which I consider acceptable.

Closes #12997

10 years agoremove duplicate methods in impls
Corey Richardson [Tue, 18 Mar 2014 16:04:23 +0000 (12:04 -0400)]
remove duplicate methods in impls

10 years agorustc: disallow duplicate methods in trait impls
Corey Richardson [Tue, 18 Mar 2014 14:42:23 +0000 (10:42 -0400)]
rustc: disallow duplicate methods in trait impls

Closes #8153

10 years agoauto merge of #12994 : alexcrichton/rust/fix-android, r=huonw
bors [Tue, 18 Mar 2014 18:52:31 +0000 (11:52 -0700)]
auto merge of #12994 : alexcrichton/rust/fix-android, r=huonw

This compile-fail test didn't have a main function for architectures other than
x86

10 years agoMake method Vec::remove() public
Jorge Aparicio [Tue, 18 Mar 2014 16:53:32 +0000 (11:53 -0500)]
Make method Vec::remove() public

10 years agotest: Fix android tests
Alex Crichton [Tue, 18 Mar 2014 07:09:12 +0000 (00:09 -0700)]
test: Fix android tests

This compile-fail test didn't have a main function for architectures other than
x86

10 years agostd: Improve docs for atomics. Fix two bugs
Brian Anderson [Sun, 16 Mar 2014 23:05:01 +0000 (16:05 -0700)]
std: Improve docs for atomics. Fix two bugs

This adds lots of docs to the atomics module. Two of the examples
are using the future atomics API and are ignored temporarily.
I discovered a bug in the way AtomicBool's fetch_nand method is
implemented and fixed it by using the correct value for `true`.
I also fixed the implementation of AcqRel fences (it was only doing
a release barrier), and made a "relaxed" fence a failure.

10 years agoauto merge of #12935 : lbonn/rust/nullenum, r=alexcrichton
bors [Mon, 17 Mar 2014 18:57:08 +0000 (11:57 -0700)]
auto merge of #12935 : lbonn/rust/nullenum, r=alexcrichton

Fix for #12560

10 years agoauto merge of #12742 : FlaPer87/rust/issue-11411-static-mut-slice, r=nikomatsakis
bors [Mon, 17 Mar 2014 16:57:06 +0000 (09:57 -0700)]
auto merge of #12742 : FlaPer87/rust/issue-11411-static-mut-slice, r=nikomatsakis

This PR enables the use of mutable slices in *mutable* static items. The work was started by @xales and I added a follow-up commit that moves the *immutable* restriction to the recently added `check_static`

Closes #11411

10 years agoauto merge of #12957 : lkuper/rust/docsprint, r=alexcrichton
bors [Mon, 17 Mar 2014 15:01:56 +0000 (08:01 -0700)]
auto merge of #12957 : lkuper/rust/docsprint, r=alexcrichton

10 years agoauto merge of #12951 : cadencemarseille/rust/issue-12943-remove-AtomicFlag, r=alexcri...
bors [Mon, 17 Mar 2014 12:17:02 +0000 (05:17 -0700)]
auto merge of #12951 : cadencemarseille/rust/issue-12943-remove-AtomicFlag, r=alexcrichton

fixes #12943

10 years agorustc: disallow trailing parentheses for nullary enum variants
Laurent Bonnans [Sun, 16 Mar 2014 15:07:39 +0000 (16:07 +0100)]
rustc: disallow trailing parentheses for nullary enum variants

Fixes #12560

10 years agoauto merge of #12735 : eddyb/rust/at-exodus-chapter-11, r=cmr
bors [Mon, 17 Mar 2014 09:11:56 +0000 (02:11 -0700)]
auto merge of #12735 : eddyb/rust/at-exodus-chapter-11, r=cmr

10 years agoFix rustdoc and tests.
Eduard Burtescu [Mon, 17 Mar 2014 07:55:41 +0000 (09:55 +0200)]
Fix rustdoc and tests.

10 years agoRefactor pprust a bit.
Eduard Burtescu [Sun, 16 Mar 2014 18:58:11 +0000 (20:58 +0200)]
Refactor pprust a bit.

10 years agoDe-@ codemap and diagnostic.
Eduard Burtescu [Sun, 16 Mar 2014 18:56:24 +0000 (20:56 +0200)]
De-@ codemap and diagnostic.

10 years agoDe-@ move maps and rework parts of trans.
Eduard Burtescu [Sat, 15 Mar 2014 20:29:34 +0000 (22:29 +0200)]
De-@ move maps and rework parts of trans.

10 years agoDe-@ gather_loans.
Eduard Burtescu [Fri, 14 Mar 2014 08:55:30 +0000 (10:55 +0200)]
De-@ gather_loans.

10 years agoDe-@ typeck::check::method.
Eduard Burtescu [Fri, 14 Mar 2014 08:44:03 +0000 (10:44 +0200)]
De-@ typeck::check::method.

10 years agoDe-@ resolve_lifetime.
Eduard Burtescu [Thu, 13 Mar 2014 20:16:27 +0000 (22:16 +0200)]
De-@ resolve_lifetime.

10 years agoDe-@ ParseSess uses.
Eduard Burtescu [Sun, 9 Mar 2014 14:54:34 +0000 (16:54 +0200)]
De-@ ParseSess uses.

10 years agoDe-@ CStore uses.
Eduard Burtescu [Sun, 9 Mar 2014 13:20:44 +0000 (15:20 +0200)]
De-@ CStore uses.

10 years agoDe-@ filesearch.
Eduard Burtescu [Sun, 9 Mar 2014 12:24:58 +0000 (14:24 +0200)]
De-@ filesearch.

10 years agoDe-@ reachable.
Eduard Burtescu [Sun, 9 Mar 2014 11:42:22 +0000 (13:42 +0200)]
De-@ reachable.

10 years agoDe-@ trans contexts.
Eduard Burtescu [Thu, 6 Mar 2014 16:47:24 +0000 (18:47 +0200)]
De-@ trans contexts.

10 years agoDe-@ type checking contexts.
Eduard Burtescu [Thu, 6 Mar 2014 15:08:00 +0000 (17:08 +0200)]
De-@ type checking contexts.

10 years agoDe-@ liveness.
Eduard Burtescu [Thu, 6 Mar 2014 13:46:26 +0000 (15:46 +0200)]
De-@ liveness.

10 years agoDe-@ tyencode::ctxt and related parts of astencode.
Eduard Burtescu [Thu, 6 Mar 2014 03:28:28 +0000 (05:28 +0200)]
De-@ tyencode::ctxt and related parts of astencode.

10 years agoDe-@ ty::ctxt usage.
Eduard Burtescu [Thu, 6 Mar 2014 03:07:47 +0000 (05:07 +0200)]
De-@ ty::ctxt usage.

10 years agoDe-@ Session usage.
Eduard Burtescu [Wed, 5 Mar 2014 14:36:01 +0000 (16:36 +0200)]
De-@ Session usage.

10 years agoauto merge of #12945 : cadencemarseille/rust/vec_ng-as_mut_ptr, r=alexcrichton
bors [Mon, 17 Mar 2014 07:21:59 +0000 (00:21 -0700)]
auto merge of #12945 : cadencemarseille/rust/vec_ng-as_mut_ptr, r=alexcrichton

10 years agoauto merge of #12944 : mcpherrinm/rust/master, r=alexcrichton
bors [Mon, 17 Mar 2014 05:31:55 +0000 (22:31 -0700)]
auto merge of #12944 : mcpherrinm/rust/master, r=alexcrichton

10 years agoauto merge of #12942 : alan-andrade/rust/docathon-getopts, r=alexcrichton
bors [Mon, 17 Mar 2014 03:41:57 +0000 (20:41 -0700)]
auto merge of #12942 : alan-andrade/rust/docathon-getopts, r=alexcrichton

https://docs.google.com/spreadsheet/ccc?key=0An9tLRVf1SSfdE9jX1Q2QkhiUGVwTnh5YTJnMHVUYXc&usp=sharing#gid=6

10 years agoauto merge of #12940 : cadencemarseille/rust/time-doc, r=alexcrichton
bors [Mon, 17 Mar 2014 01:51:52 +0000 (18:51 -0700)]
auto merge of #12940 : cadencemarseille/rust/time-doc, r=alexcrichton

10 years agoauto merge of #12937 : sinistersnare/rust/method-error-message, r=huonw
bors [Mon, 17 Mar 2014 00:01:54 +0000 (17:01 -0700)]
auto merge of #12937 : sinistersnare/rust/method-error-message, r=huonw

its a common (yet easily fixable) error to just forget parens at the end of getter-like methods without any arguments.

The current error message for that case asks for an anonymous function, this patch adds a note asking for either an anonymous function, or for trailing parens.

This is my first contribution! do i need to do anything else?

10 years ago`strdup_uniq` doesn't have to be `pub`.
Lindsey Kuper [Sun, 16 Mar 2014 23:50:22 +0000 (19:50 -0400)]
`strdup_uniq` doesn't have to be `pub`.

10 years agoDoc-sprint: Document endian conversion functions
Matthew McPherrin [Sun, 16 Mar 2014 22:31:47 +0000 (15:31 -0700)]
Doc-sprint: Document endian conversion functions

10 years agoRemove AtomicFlag
Cadence Marseille [Sun, 16 Mar 2014 22:03:58 +0000 (18:03 -0400)]
Remove AtomicFlag

fixes #12943

10 years agoDocument the Tm struct and fields
Cadence Marseille [Sun, 16 Mar 2014 19:57:36 +0000 (15:57 -0400)]
Document the Tm struct and fields

10 years agoAdd method Vec<T>::as_mut_ptr()
Cadence Marseille [Sun, 16 Mar 2014 21:20:44 +0000 (17:20 -0400)]
Add method Vec<T>::as_mut_ptr()

10 years agoauto merge of #12931 : aochagavia/rust/option-take_unwrap, r=cmr
bors [Sun, 16 Mar 2014 21:11:26 +0000 (14:11 -0700)]
auto merge of #12931 : aochagavia/rust/option-take_unwrap, r=cmr

Using pattern matching instead of is_some + unwrap

10 years agogetopts missing docs
Alan Andrade [Sun, 16 Mar 2014 20:33:19 +0000 (13:33 -0700)]
getopts missing docs

10 years agoAsked if missing (), then asks about an anonymous function. Also added test.
Davis Silverman [Sun, 16 Mar 2014 20:46:02 +0000 (16:46 -0400)]
Asked if missing (), then asks about an anonymous function. Also added test.

10 years agoauto merge of #12933 : edwardw/rust/fallout, r=huonw
bors [Sun, 16 Mar 2014 19:21:26 +0000 (12:21 -0700)]
auto merge of #12933 : edwardw/rust/fallout, r=huonw

The same test was missed in chan/port renaming PR #12815 and was fixed in #12880:

> This was missed because it is skipped on linux and windows, and the mac bots were moving at the time the PR landed.

It seems the same happened to the liblog PR.

10 years agoFix a test that was missed in the liblog PR
Edward Wang [Sun, 16 Mar 2014 13:18:17 +0000 (21:18 +0800)]
Fix a test that was missed in the liblog PR

10 years agoauto merge of #12924 : Florob/rust/bigint, r=alexcrichton
bors [Sun, 16 Mar 2014 12:11:18 +0000 (05:11 -0700)]
auto merge of #12924 : Florob/rust/bigint, r=alexcrichton

This is a minor optimization of the bignum module. The improvements mostly come from avoiding allocations and boundary checks. This also switches all of libnum to vec_ng::Vec.

10 years agoRefactored take_unwrap (libstd/option.rs)
aochagavia [Sun, 16 Mar 2014 11:11:13 +0000 (12:11 +0100)]
Refactored take_unwrap (libstd/option.rs)

Using pattern matching instead of is_some + unwrap

10 years agoauto merge of #12929 : sfackler/rust/automatically-derived, r=cmr
bors [Sun, 16 Mar 2014 10:21:21 +0000 (03:21 -0700)]
auto merge of #12929 : sfackler/rust/automatically-derived, r=cmr

This will enable rustdoc to treat them specially.

I also got rid of `std::cmp::cmp2`, which is isomorphic to the `TotalOrd` impl for 2-tuples and never used.

10 years agoauto merge of #12899 : brson/rust/cleanbacktrace, r=alexcrichton
bors [Sun, 16 Mar 2014 08:36:21 +0000 (01:36 -0700)]
auto merge of #12899 : brson/rust/cleanbacktrace, r=alexcrichton

After `make clean` I'm seeing the build break with

```
cp: cannot stat ‘x86_64-unknown-linux-gnu/rt/libbacktrace/.libs/libbacktrace.a’: No such file or directory
```

Deleteing the libbacktrace dir entirely on clean fixes.

10 years agoauto merge of #12791 : alexcrichton/rust/liblog, r=brson
bors [Sun, 16 Mar 2014 06:01:24 +0000 (23:01 -0700)]
auto merge of #12791 : alexcrichton/rust/liblog, r=brson

The rationale and modifications can be found in the first commit message.

This does make logging a bit more painful to use initially because it involves a feature gate and some `phase` attributes, but I think it may be reasonable to not require the `phase` attribute for loading `macro_rules!` macros because defining them will still be gated.

10 years agoTest fixes and rebase conflicts
Alex Crichton [Thu, 13 Mar 2014 06:34:31 +0000 (23:34 -0700)]
Test fixes and rebase conflicts

This commit switches over the backtrace infrastructure from piggy-backing off
the RUST_LOG environment variable to using the RUST_BACKTRACE environment
variable (logging is now disabled in libstd).

10 years agoTag derived impls with #[automatically_derived]
Steven Fackler [Sun, 16 Mar 2014 05:49:41 +0000 (22:49 -0700)]
Tag derived impls with #[automatically_derived]

This will enable rustdoc to treat them specially.

10 years agorustc: Topographically sort rust dependencies
Alex Crichton [Fri, 14 Mar 2014 01:47:43 +0000 (18:47 -0700)]
rustc: Topographically sort rust dependencies

This commit starts to topographically sort rust dependencies on the linker
command line. The reason for this is that linkers use right-hand libraries to
resolve left-hand libraries symbols, which is especially crucial for us because
we're using --as-needed on linux.

10 years agorustc: Tweak where -lmorestack is on link commands
Alex Crichton [Wed, 12 Mar 2014 16:49:38 +0000 (09:49 -0700)]
rustc: Tweak where -lmorestack is on link commands

In removing many fields from the crate map, executables no longer always have an
explicit dependency on all upstream libraries. This means that the linker is no
longer picking them up as it used to.

To the best of my knowledge, the current situation is happening:

* On linux, we're passing the --as-needed flag to the linker, meaning that
  libraries are stripped out if there are no references to symbols in them.
* Executables may not reference libstd at all, such as "fn main() {}"
* When linking, the linker will discard libstd because there are no references
  to symbols in it. I presume that this means that all previous libs have had
  all their symbols resolved, so none of the libs are pulling in libstd as a
  dependency.
* The only real dependence on libstd comes from the rust_stack_exhausted symbol
  (which comes from libmorestack), but -lmorestack is at the end so by the time
  this comes up libstd is completely gone, leading to undefined references to
  rust_stack_exhausted

I'm not entirely convinced that this is what's happening, but it appears to be
along these lines. The one thing that I'm sure of is that removing the crate map
(and hence implicit dependency on all upstream libraries) has changed how
objects depend on upstream libraries.

10 years agorustc: Remove compiler support for __log_level()
Alex Crichton [Sun, 9 Mar 2014 06:36:10 +0000 (22:36 -0800)]
rustc: Remove compiler support for __log_level()

This commit removes all internal support for the previously used __log_level()
expression. The logging subsystem was previously modified to not rely on this
magical expression. This also removes the only other function to use the
module_data map in trans, decl_gc_metadata. It appears that this is an ancient
function from a GC only used long ago.

This does not remove the crate map entirely, as libgreen still uses it to hook
in to the event loop provided by libgreen.

10 years agolog: Introduce liblog, the old std::logging
Alex Crichton [Sun, 9 Mar 2014 06:11:44 +0000 (22:11 -0800)]
log: Introduce liblog, the old std::logging

This commit moves all logging out of the standard library into an external
crate. This crate is the new crate which is responsible for all logging macros
and logging implementation. A few reasons for this change are:

* The crate map has always been a bit of a code smell among rust programs. It
  has difficulty being loaded on almost all platforms, and it's used almost
  exclusively for logging and only logging. Removing the crate map is one of the
  end goals of this movement.

* The compiler has a fair bit of special support for logging. It has the
  __log_level() expression as well as generating a global word per module
  specifying the log level. This is unfairly favoring the built-in logging
  system, and is much better done purely in libraries instead of the compiler
  itself.

* Initialization of logging is much easier to do if there is no reliance on a
  magical crate map being available to set module log levels.

* If the logging library can be written outside of the standard library, there's
  no reason that it shouldn't be. It's likely that we're not going to build the
  highest quality logging library of all time, so third-party libraries should
  be able to provide just as high-quality logging systems as the default one
  provided in the rust distribution.

With a migration such as this, the change does not come for free. There are some
subtle changes in the behavior of liblog vs the previous logging macros:

* The core change of this migration is that there is no longer a physical
  log-level per module. This concept is still emulated (it is quite useful), but
  there is now only a global log level, not a local one. This global log level
  is a reflection of the maximum of all log levels specified. The previously
  generated logging code looked like:

    if specified_level <= __module_log_level() {
        println!(...)
    }

  The newly generated code looks like:

    if specified_level <= ::log::LOG_LEVEL {
        if ::log::module_enabled(module_path!()) {
            println!(...)
        }
    }

  Notably, the first layer of checking is still intended to be "super fast" in
  that it's just a load of a global word and a compare. The second layer of
  checking is executed to determine if the current module does indeed have
  logging turned on.

  This means that if any module has a debug log level turned on, all modules
  with debug log levels get a little bit slower (they all do more expensive
  dynamic checks to determine if they're turned on or not).

  Semantically, this migration brings no change in this respect, but
  runtime-wise, this will have a perf impact on some code.

* A `RUST_LOG=::help` directive will no longer print out a list of all modules
  that can be logged. This is because the crate map will no longer specify the
  log levels of all modules, so the list of modules is not known. Additionally,
  warnings can no longer be provided if a malformed logging directive was
  supplied.

The new "hello world" for logging looks like:

    #[phase(syntax, link)]
    extern crate log;

    fn main() {
        debug!("Hello, world!");
    }

10 years agoauto merge of #12927 : sfackler/rust/test-warn, r=huonw
bors [Sun, 16 Mar 2014 04:16:29 +0000 (21:16 -0700)]
auto merge of #12927 : sfackler/rust/test-warn, r=huonw

The use of `std::os::args` creates a deprecated_owned_vector warning
with a bogus span.

10 years agoRemove std::cmp::cmp2.
Steven Fackler [Sun, 16 Mar 2014 04:04:56 +0000 (21:04 -0700)]
Remove std::cmp::cmp2.

It isn't used anywhere and `cmp2(a, b, c, d)` is identical to
`(a, b).cmp(&(c, d))`.

10 years agoSquash test ~[] warning
Steven Fackler [Sun, 16 Mar 2014 03:02:11 +0000 (20:02 -0700)]
Squash test ~[] warning

The use of `std::os::args` creates a deprecated_owned_vector warning
with a bogus span.

10 years agoauto merge of #12923 : sfackler/rust/vecify, r=brson
bors [Sun, 16 Mar 2014 02:26:31 +0000 (19:26 -0700)]
auto merge of #12923 : sfackler/rust/vecify, r=brson

10 years agoauto merge of #12922 : luqmana/rust/fix-arm, r=alexcrichton
bors [Sun, 16 Mar 2014 00:51:35 +0000 (17:51 -0700)]
auto merge of #12922 : luqmana/rust/fix-arm, r=alexcrichton

10 years agomk: Clean libbacktrace w/ gusto
Brian Anderson [Sat, 15 Mar 2014 01:06:37 +0000 (18:06 -0700)]
mk: Clean libbacktrace w/ gusto

After `make clean' I'm seeing the build break with

```
cp: cannot stat ‘x86_64-unknown-linux-gnu/rt/libbacktrace/.libs/libbacktrace.a’: No such file or directory
```

Deleteing the libbacktrace dir entirely on clean fixes.

10 years agoauto merge of #12921 : alexcrichton/rust/no-extra, r=sfackler
bors [Sat, 15 Mar 2014 23:11:32 +0000 (16:11 -0700)]
auto merge of #12921 : alexcrichton/rust/no-extra, r=sfackler

Forgot to remove this as part of the previous removal of libextra

10 years agonum: Migrate `~[T]` to `std::vec_ng::Vec`
Florian Zeitz [Sat, 15 Mar 2014 23:01:01 +0000 (00:01 +0100)]
num: Migrate `~[T]` to `std::vec_ng::Vec`

10 years agonum: Slightly optimize bigint
Florian Zeitz [Sat, 15 Mar 2014 20:50:44 +0000 (21:50 +0100)]
num: Slightly optimize bigint

10 years agolibstd: Fix a typo. s/target_os/target_arch/
Luqman Aden [Sat, 15 Mar 2014 22:45:26 +0000 (18:45 -0400)]
libstd: Fix a typo. s/target_os/target_arch/

10 years agoRemove ~[] from libsemver
Steven Fackler [Sat, 15 Mar 2014 22:41:51 +0000 (15:41 -0700)]
Remove ~[] from libsemver

10 years agodoc: Remove reference to the 'extra' library
Alex Crichton [Sat, 15 Mar 2014 22:37:16 +0000 (15:37 -0700)]
doc: Remove reference to the 'extra' library

Forgot to remove this as part of the previous removal of libextra

10 years agoRemove most ~[] usage in liburl
Steven Fackler [Sat, 15 Mar 2014 22:13:00 +0000 (15:13 -0700)]
Remove most ~[] usage in liburl

10 years agoauto merge of #12918 : sfackler/rust/doc-html-attr, r=alexcrichton
bors [Sat, 15 Mar 2014 21:31:38 +0000 (14:31 -0700)]
auto merge of #12918 : sfackler/rust/doc-html-attr, r=alexcrichton

10 years agoAdd rustdoc html crate info
Steven Fackler [Sat, 15 Mar 2014 21:26:12 +0000 (14:26 -0700)]
Add rustdoc html crate info

10 years agoauto merge of #12908 : alexcrichton/rust/issue-12897, r=thestinger
bors [Sat, 15 Mar 2014 09:21:26 +0000 (02:21 -0700)]
auto merge of #12908 : alexcrichton/rust/issue-12897, r=thestinger

This is mostly just an implementation detail, and anyone worried about the stack
bounds doesn't need to be bothered with the red zone because it's not usable
anyway.

Closes #12897

10 years agoauto merge of #12906 : sfackler/rust/timespec-total, r=thestinger
bors [Sat, 15 Mar 2014 07:46:28 +0000 (00:46 -0700)]
auto merge of #12906 : sfackler/rust/timespec-total, r=thestinger

10 years agoauto merge of #12896 : alexcrichton/rust/goodbye-extra, r=brson
bors [Sat, 15 Mar 2014 06:11:31 +0000 (23:11 -0700)]
auto merge of #12896 : alexcrichton/rust/goodbye-extra, r=brson

This commit shreds all remnants of libextra from the compiler and standard
distribution. Two modules, c_vec/tempfile, were moved into libstd after some
cleanup, and the other modules were moved to separate crates as seen fit.

Closes #8784
Closes #12413
Closes #12576

10 years agogreen: Don't return the red zone in stack_bounds()
Alex Crichton [Sat, 15 Mar 2014 05:46:13 +0000 (22:46 -0700)]
green: Don't return the red zone in stack_bounds()

This is mostly just an implementation detail, and anyone worried about the stack
bounds doesn't need to be bothered with the red zone because it's not usable
anyway.

Closes #12897

10 years agoImplement TotalEq and TotalOrd for Timespec
Steven Fackler [Sat, 15 Mar 2014 04:50:23 +0000 (21:50 -0700)]
Implement TotalEq and TotalOrd for Timespec

There's a test making sure that Ord works, so the order dependence
shouldn't be an issue