rust/src/libcore
bors 6ac4a30810 auto merge of #16634 : apoelstra/rust/to-option-fix, r=aturon
As outlined in

  https://aturon.github.io/style/naming/conversions.html

`to_` functions names should only be used for expensive operations.
Thus `to_option` is better named `as_option`. Also, putting type
names into method names is considered bad style; what the user is
really trying to get is a reference. This `as_ref` is even better.

Also, we are missing a mutable version of this method.

Finally, there is a bug in the signature of `to_option` which has
been around since lifetime elision: originally the returned reference
had 'static lifetime, but since the elision changes this become
the lifetime of the raw pointer (which does not make sense, since
the pointer lifetime and referent lifetime are unrelated). We fix
the bug to return a reference with a fresh lifetime which will be
inferred from the calling context.

[breaking-change]
2014-09-03 16:01:12 +00:00
..
fmt Unify non-snake-case lints and non-uppercase statics lints 2014-08-30 09:10:05 +12:00
num Added a note for usage of abs with ::MIN. 2014-08-26 20:45:02 -04:00
tuple std: Stabilize unit, bool, ty, tuple, arc, any 2014-07-26 13:12:20 -07:00
any.rs Implement generalized object and type parameter bounds (Fixes #16462) 2014-08-27 21:46:52 -04:00
atomic.rs stabilize atomics (now atomic) 2014-08-04 16:03:21 -07:00
bool.rs std: Stabilize unit, bool, ty, tuple, arc, any 2014-07-26 13:12:20 -07:00
cell.rs Register new snapshots 2014-08-29 14:33:08 -07:00
char.rs Unify non-snake-case lints and non-uppercase statics lints 2014-08-30 09:10:05 +12:00
clone.rs Extract tests from libcore to a separate crate 2014-06-29 15:57:21 -07:00
cmp.rs Rebasing changes 2014-08-26 16:07:32 +12:00
collections.rs Document some trait methods. 2014-07-19 12:26:18 +02:00
default.rs auto merge of #15806 : treeman/rust/std-doc, r=alexcrichton 2014-07-20 17:46:32 +00:00
failure.rs Defailbloat fail!(string) 2014-08-30 20:38:47 +02:00
finally.rs Register new snapshots 2014-08-29 14:33:08 -07:00
intrinsics.rs Register new snapshots 2014-08-29 14:33:08 -07:00
iter.rs Register new snapshots 2014-08-29 14:33:08 -07:00
kinds.rs libsyntax: Remove the use foo = bar syntax from the language in favor 2014-08-18 09:19:10 -07:00
lib.rs Register new snapshots 2014-08-29 14:33:08 -07:00
macros.rs Defailbloat fail!(string) 2014-08-30 20:38:47 +02:00
mem.rs Implement generalized object and type parameter bounds (Fixes #16462) 2014-08-27 21:46:52 -04:00
ops.rs Add lint groups; define built-in lint groups bad_style and unused 2014-08-30 09:12:04 +12:00
option.rs Fallout from stabilizing core::option 2014-08-28 09:12:54 -07:00
prelude.rs core: Rename ImmutableEqSlice to ImmutablePartialEqSlice 2014-08-13 11:30:15 -07:00
ptr.rs Rename RawPtr::to_option() to RawPtr::as_ref() 2014-08-31 13:33:55 -05:00
raw.rs Register new snapshots 2014-08-29 14:33:08 -07:00
result.rs stabilize core::result 2014-08-28 09:12:54 -07:00
simd.rs libgreen: use FFI-safe types 2014-08-20 21:02:24 -04:00
slice.rs auto merge of #16897 : japaric/rust/mut-slice-collection, r=alexcrichton 2014-09-01 21:31:00 +00:00
str.rs Unify non-snake-case lints and non-uppercase statics lints 2014-08-30 09:10:05 +12:00
ty.rs std: Stabilize unit, bool, ty, tuple, arc, any 2014-07-26 13:12:20 -07:00