revert some more constification.
This commit is contained in:
@@ -264,7 +264,7 @@ impl<T> LinkedList<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn new() -> Self {
|
||||
pub fn new() -> Self {
|
||||
LinkedList {
|
||||
head: None,
|
||||
tail: None,
|
||||
@@ -341,7 +341,7 @@ impl<T> LinkedList<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn iter(&self) -> Iter<T> {
|
||||
pub fn iter(&self) -> Iter<T> {
|
||||
Iter {
|
||||
head: self.head,
|
||||
tail: self.tail,
|
||||
@@ -401,7 +401,7 @@ impl<T> LinkedList<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn is_empty(&self) -> bool {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.len() == 0
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ impl<T> LinkedList<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn len(&self) -> usize {
|
||||
pub fn len(&self) -> usize {
|
||||
self.len
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ pub use intrinsics::transmute;
|
||||
/// [ub]: ../../reference/behavior-considered-undefined.html
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn forget<T>(t: T) {
|
||||
pub fn forget<T>(t: T) {
|
||||
ManuallyDrop::new(t);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ impl<T> Cursor<T> {
|
||||
/// # force_inference(&buff);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn new(inner: T) -> Cursor<T> {
|
||||
pub fn new(inner: T) -> Cursor<T> {
|
||||
Cursor { pos: 0, inner: inner }
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ impl<T> Cursor<T> {
|
||||
/// let reference = buff.get_ref();
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn get_ref(&self) -> &T { &self.inner }
|
||||
pub fn get_ref(&self) -> &T { &self.inner }
|
||||
|
||||
/// Gets a mutable reference to the underlying value in this cursor.
|
||||
///
|
||||
@@ -179,7 +179,7 @@ impl<T> Cursor<T> {
|
||||
/// assert_eq!(buff.position(), 1);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn position(&self) -> u64 { self.pos }
|
||||
pub fn position(&self) -> u64 { self.pos }
|
||||
|
||||
/// Sets the position of this cursor.
|
||||
///
|
||||
|
||||
@@ -885,7 +885,7 @@ impl Initializer {
|
||||
/// Returns a new `Initializer` which will zero out buffers.
|
||||
#[unstable(feature = "read_initializer", issue = "42788")]
|
||||
#[inline]
|
||||
pub const fn zeroing() -> Initializer {
|
||||
pub fn zeroing() -> Initializer {
|
||||
Initializer(true)
|
||||
}
|
||||
|
||||
@@ -906,7 +906,7 @@ impl Initializer {
|
||||
/// Indicates if a buffer should be initialized.
|
||||
#[unstable(feature = "read_initializer", issue = "42788")]
|
||||
#[inline]
|
||||
pub const fn should_initialize(&self) -> bool {
|
||||
pub fn should_initialize(&self) -> bool {
|
||||
self.0
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ pub struct Empty { _priv: () }
|
||||
/// assert!(buffer.is_empty());
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn empty() -> Empty { Empty { _priv: () } }
|
||||
pub fn empty() -> Empty { Empty { _priv: () } }
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Read for Empty {
|
||||
@@ -199,7 +199,7 @@ pub struct Sink { _priv: () }
|
||||
/// assert_eq!(num_bytes, 5);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn sink() -> Sink { Sink { _priv: () } }
|
||||
pub fn sink() -> Sink { Sink { _priv: () } }
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Write for Sink {
|
||||
|
||||
@@ -926,7 +926,7 @@ impl Stdio {
|
||||
/// assert_eq!(String::from_utf8_lossy(&output.stdout), "!dlrow ,olleH\n");
|
||||
/// ```
|
||||
#[stable(feature = "process", since = "1.0.0")]
|
||||
pub const fn piped() -> Stdio { Stdio(imp::Stdio::MakePipe) }
|
||||
pub fn piped() -> Stdio { Stdio(imp::Stdio::MakePipe) }
|
||||
|
||||
/// The child inherits from the corresponding parent descriptor.
|
||||
///
|
||||
@@ -961,7 +961,7 @@ impl Stdio {
|
||||
/// println!("You piped in the reverse of: {}", String::from_utf8_lossy(&output.stdout));
|
||||
/// ```
|
||||
#[stable(feature = "process", since = "1.0.0")]
|
||||
pub const fn inherit() -> Stdio { Stdio(imp::Stdio::Inherit) }
|
||||
pub fn inherit() -> Stdio { Stdio(imp::Stdio::Inherit) }
|
||||
|
||||
/// This stream will be ignored. This is the equivalent of attaching the
|
||||
/// stream to `/dev/null`
|
||||
@@ -998,7 +998,7 @@ impl Stdio {
|
||||
/// // Ignores any piped-in input
|
||||
/// ```
|
||||
#[stable(feature = "process", since = "1.0.0")]
|
||||
pub const fn null() -> Stdio { Stdio(imp::Stdio::Null) }
|
||||
pub fn null() -> Stdio { Stdio(imp::Stdio::Null) }
|
||||
}
|
||||
|
||||
impl FromInner<imp::Stdio> for Stdio {
|
||||
|
||||
@@ -286,7 +286,7 @@ impl Builder {
|
||||
/// handler.join().unwrap();
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const fn new() -> Builder {
|
||||
pub fn new() -> Builder {
|
||||
Builder {
|
||||
name: None,
|
||||
stack_size: None,
|
||||
|
||||
Reference in New Issue
Block a user