Skip to content
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

Remove meaningless comment decoration from code #63347

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions src/libcore/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,7 @@ pub trait TryFrom<T>: Sized {
fn try_from(value: T) -> Result<Self, Self::Error>;
}

////////////////////////////////////////////////////////////////////////////////
// GENERIC IMPLS
////////////////////////////////////////////////////////////////////////////////

// As lifts over &
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -574,9 +572,7 @@ impl<T, U> TryFrom<U> for T where U: Into<T> {
}
}

////////////////////////////////////////////////////////////////////////////////
// CONCRETE IMPLS
////////////////////////////////////////////////////////////////////////////////

#[stable(feature = "rust1", since = "1.0.0")]
impl<T> AsRef<[T]> for [T] {
Expand All @@ -600,9 +596,7 @@ impl AsRef<str> for str {
}
}

////////////////////////////////////////////////////////////////////////////////
// THE NO-ERROR ERROR TYPE
////////////////////////////////////////////////////////////////////////////////

/// The error type for errors that can never happen.
///
Expand Down
24 changes: 0 additions & 24 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,10 @@ pub enum Option<T> {
Some(#[stable(feature = "rust1", since = "1.0.0")] T),
}

/////////////////////////////////////////////////////////////////////////////
// Type implementation
/////////////////////////////////////////////////////////////////////////////

impl<T> Option<T> {
/////////////////////////////////////////////////////////////////////////
// Querying the contained values
/////////////////////////////////////////////////////////////////////////

/// Returns `true` if the option is a [`Some`] value.
///
Expand Down Expand Up @@ -235,9 +231,7 @@ impl<T> Option<T> {
}
}

/////////////////////////////////////////////////////////////////////////
// Adapter for working with references
/////////////////////////////////////////////////////////////////////////

/// Converts from `&Option<T>` to `Option<&T>`.
///
Expand Down Expand Up @@ -312,9 +306,7 @@ impl<T> Option<T> {
}
}

/////////////////////////////////////////////////////////////////////////
// Getting to contained values
/////////////////////////////////////////////////////////////////////////

/// Unwraps an option, yielding the content of a [`Some`].
///
Expand Down Expand Up @@ -420,9 +412,7 @@ impl<T> Option<T> {
}
}

/////////////////////////////////////////////////////////////////////////
// Transforming contained values
/////////////////////////////////////////////////////////////////////////

/// Maps an `Option<T>` to `Option<U>` by applying a function to a contained value.
///
Expand Down Expand Up @@ -552,9 +542,7 @@ impl<T> Option<T> {
}
}

/////////////////////////////////////////////////////////////////////////
// Iterator constructors
/////////////////////////////////////////////////////////////////////////

/// Returns an iterator over the possibly contained value.
///
Expand Down Expand Up @@ -594,9 +582,7 @@ impl<T> Option<T> {
IterMut { inner: Item { opt: self.as_mut() } }
}

/////////////////////////////////////////////////////////////////////////
// Boolean operations on the values, eager and lazy
/////////////////////////////////////////////////////////////////////////

/// Returns [`None`] if the option is [`None`], otherwise returns `optb`.
///
Expand Down Expand Up @@ -786,9 +772,7 @@ impl<T> Option<T> {
}
}

/////////////////////////////////////////////////////////////////////////
// Entry-like operations to insert if None and return a reference
/////////////////////////////////////////////////////////////////////////

/// Inserts `v` into the option if it is [`None`], then
/// returns a mutable reference to the contained value.
Expand Down Expand Up @@ -848,9 +832,7 @@ impl<T> Option<T> {
}
}

/////////////////////////////////////////////////////////////////////////
// Misc
/////////////////////////////////////////////////////////////////////////

/// Takes the value out of the option, leaving a [`None`] in its place.
///
Expand Down Expand Up @@ -1173,9 +1155,7 @@ fn expect_none_failed(msg: &str, value: &dyn fmt::Debug) -> ! {
panic!("{}: {:?}", msg, value)
}

/////////////////////////////////////////////////////////////////////////////
// Trait implementations
/////////////////////////////////////////////////////////////////////////////

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Clone> Clone for Option<T> {
Expand Down Expand Up @@ -1268,9 +1248,7 @@ impl<'a, T> From<&'a mut Option<T>> for Option<&'a mut T> {
}
}

/////////////////////////////////////////////////////////////////////////////
// The Option Iterators
/////////////////////////////////////////////////////////////////////////////

#[derive(Clone, Debug)]
struct Item<A> {
Expand Down Expand Up @@ -1426,9 +1404,7 @@ impl<A> FusedIterator for IntoIter<A> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<A> TrustedLen for IntoIter<A> {}

/////////////////////////////////////////////////////////////////////////////
// FromIterator
/////////////////////////////////////////////////////////////////////////////

#[stable(feature = "rust1", since = "1.0.0")]
impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
Expand Down
20 changes: 0 additions & 20 deletions src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,10 @@ pub enum Result<T, E> {
Err(#[stable(feature = "rust1", since = "1.0.0")] E),
}

/////////////////////////////////////////////////////////////////////////////
// Type implementation
/////////////////////////////////////////////////////////////////////////////

impl<T, E> Result<T, E> {
/////////////////////////////////////////////////////////////////////////
// Querying the contained values
/////////////////////////////////////////////////////////////////////////

/// Returns `true` if the result is [`Ok`].
///
Expand Down Expand Up @@ -361,9 +357,7 @@ impl<T, E> Result<T, E> {
}
}

/////////////////////////////////////////////////////////////////////////
// Adapter for each variant
/////////////////////////////////////////////////////////////////////////

/// Converts from `Result<T, E>` to [`Option<T>`].
///
Expand Down Expand Up @@ -419,9 +413,7 @@ impl<T, E> Result<T, E> {
}
}

/////////////////////////////////////////////////////////////////////////
// Adapter for working with references
/////////////////////////////////////////////////////////////////////////

/// Converts from `&Result<T, E>` to `Result<&T, &E>`.
///
Expand Down Expand Up @@ -479,9 +471,7 @@ impl<T, E> Result<T, E> {
}
}

/////////////////////////////////////////////////////////////////////////
// Transforming contained values
/////////////////////////////////////////////////////////////////////////

/// Maps a `Result<T, E>` to `Result<U, E>` by applying a function to a
/// contained [`Ok`] value, leaving an [`Err`] value untouched.
Expand Down Expand Up @@ -575,9 +565,7 @@ impl<T, E> Result<T, E> {
}
}

/////////////////////////////////////////////////////////////////////////
// Iterator constructors
/////////////////////////////////////////////////////////////////////////

/// Returns an iterator over the possibly contained value.
///
Expand Down Expand Up @@ -625,9 +613,7 @@ impl<T, E> Result<T, E> {
IterMut { inner: self.as_mut().ok() }
}

////////////////////////////////////////////////////////////////////////
// Boolean operations on the values, eager and lazy
/////////////////////////////////////////////////////////////////////////

/// Returns `res` if the result is [`Ok`], otherwise returns the [`Err`] value of `self`.
///
Expand Down Expand Up @@ -1084,9 +1070,7 @@ fn unwrap_failed(msg: &str, error: &dyn fmt::Debug) -> ! {
panic!("{}: {:?}", msg, error)
}

/////////////////////////////////////////////////////////////////////////////
// Trait implementations
/////////////////////////////////////////////////////////////////////////////

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Clone, E: Clone> Clone for Result<T, E> {
Expand Down Expand Up @@ -1157,9 +1141,7 @@ impl<'a, T, E> IntoIterator for &'a mut Result<T, E> {
}
}

/////////////////////////////////////////////////////////////////////////////
// The Result Iterators
/////////////////////////////////////////////////////////////////////////////

/// An iterator over a reference to the [`Ok`] variant of a [`Result`].
///
Expand Down Expand Up @@ -1290,9 +1272,7 @@ impl<T> FusedIterator for IntoIter<T> {}
#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<A> TrustedLen for IntoIter<A> {}

/////////////////////////////////////////////////////////////////////////////
// FromIterator
/////////////////////////////////////////////////////////////////////////////

#[stable(feature = "rust1", since = "1.0.0")]
impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> {
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2963,9 +2963,7 @@ impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
}
}

////////////////////////////////////////////////////////////////////////////////
// Common traits
////////////////////////////////////////////////////////////////////////////////

#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Default for &[T] {
Expand All @@ -2979,9 +2977,7 @@ impl<T> Default for &mut [T] {
fn default() -> Self { &mut [] }
}

//
// Iterators
//

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> IntoIterator for &'a [T] {
Expand Down
16 changes: 0 additions & 16 deletions src/libcore/str/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ pub unsafe trait ReverseSearcher<'a>: Searcher<'a> {
pub trait DoubleEndedSearcher<'a>: ReverseSearcher<'a> {}


/////////////////////////////////////////////////////////////////////////////
// Impl for char
/////////////////////////////////////////////////////////////////////////////

/// Associated type for `<char as Pattern<'a>>::Searcher`.
#[derive(Clone, Debug)]
Expand Down Expand Up @@ -466,9 +464,7 @@ impl<'a> Pattern<'a> for char {
}
}

/////////////////////////////////////////////////////////////////////////////
// Impl for a MultiCharEq wrapper
/////////////////////////////////////////////////////////////////////////////

#[doc(hidden)]
trait MultiCharEq {
Expand Down Expand Up @@ -556,8 +552,6 @@ unsafe impl<'a, C: MultiCharEq> ReverseSearcher<'a> for MultiCharEqSearcher<'a,

impl<'a, C: MultiCharEq> DoubleEndedSearcher<'a> for MultiCharEqSearcher<'a, C> {}

/////////////////////////////////////////////////////////////////////////////

macro_rules! pattern_methods {
($t:ty, $pmap:expr, $smap:expr) => {
type Searcher = $t;
Expand Down Expand Up @@ -621,9 +615,7 @@ macro_rules! searcher_methods {
}
}

/////////////////////////////////////////////////////////////////////////////
// Impl for &[char]
/////////////////////////////////////////////////////////////////////////////

// Todo: Change / Remove due to ambiguity in meaning.

Expand All @@ -646,9 +638,7 @@ impl<'a, 'b> Pattern<'a> for &'b [char] {
pattern_methods!(CharSliceSearcher<'a, 'b>, MultiCharEqPattern, CharSliceSearcher);
}

/////////////////////////////////////////////////////////////////////////////
// Impl for F: FnMut(char) -> bool
/////////////////////////////////////////////////////////////////////////////

/// Associated type for `<F as Pattern<'a>>::Searcher`.
#[derive(Clone)]
Expand Down Expand Up @@ -685,18 +675,14 @@ impl<'a, F> Pattern<'a> for F where F: FnMut(char) -> bool {
pattern_methods!(CharPredicateSearcher<'a, F>, MultiCharEqPattern, CharPredicateSearcher);
}

/////////////////////////////////////////////////////////////////////////////
// Impl for &&str
/////////////////////////////////////////////////////////////////////////////

/// Delegates to the `&str` impl.
impl<'a, 'b, 'c> Pattern<'a> for &'c &'b str {
pattern_methods!(StrSearcher<'a, 'b>, |&s| s, |s| s);
}

/////////////////////////////////////////////////////////////////////////////
// Impl for &str
/////////////////////////////////////////////////////////////////////////////

/// Non-allocating substring search.
///
Expand Down Expand Up @@ -727,9 +713,7 @@ impl<'a, 'b> Pattern<'a> for &'b str {
}


/////////////////////////////////////////////////////////////////////////////
// Two Way substring searcher
/////////////////////////////////////////////////////////////////////////////

#[derive(Clone, Debug)]
/// Associated type for `<&str as Pattern<'a>>::Searcher`.
Expand Down
3 changes: 0 additions & 3 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ impl<'this, 'tcx> NestedVisitorMap<'this, 'tcx> {
/// to monitor future changes to `Visitor` in case a new method with a
/// new default implementation gets introduced.)
pub trait Visitor<'v> : Sized {
///////////////////////////////////////////////////////////////////////////
// Nested items.

/// The default versions of the `visit_nested_XXX` routines invoke
Expand Down Expand Up @@ -234,8 +233,6 @@ pub trait Visitor<'v> : Sized {
DeepVisitor::new(self)
}

///////////////////////////////////////////////////////////////////////////

fn visit_id(&mut self, _hir_id: HirId) {
// Nothing to do.
}
Expand Down
1 change: 0 additions & 1 deletion src/librustc/infer/combine.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
///////////////////////////////////////////////////////////////////////////
// # Type combining
//
// There are four type combiners: equate, sub, lub, and glb. Each
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ impl NiceRegionError<'me, 'tcx> {
/// an anonymous region, emit a descriptive diagnostic error.
pub(super) fn try_report_placeholder_conflict(&self) -> Option<DiagnosticBuilder<'me>> {
match &self.error {
///////////////////////////////////////////////////////////////////////////
// NB. The ordering of cases in this match is very
// sensitive, because we are often matching against
// specific cases and then using an `_` to match all
// others.

///////////////////////////////////////////////////////////////////////////
// Check for errors from comparing trait failures -- first
// with two placeholders, then with one.
Some(RegionResolutionError::SubSupConflict(
Expand Down
3 changes: 0 additions & 3 deletions src/librustc/infer/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::mir::interpret::ConstValue;
use crate::ty::{self, Ty, Const, TyCtxt, TypeFoldable, InferConst, TypeFlags};
use crate::ty::fold::{TypeFolder, TypeVisitor};

///////////////////////////////////////////////////////////////////////////
// OPPORTUNISTIC VAR RESOLVER

/// The opportunistic resolver can be used at any time. It simply replaces
Expand Down Expand Up @@ -94,7 +93,6 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticTypeAndRegionResolver<'a, 'tcx>
}
}

///////////////////////////////////////////////////////////////////////////
// UNRESOLVED TYPE FINDER

/// The unresolved type **finder** walks a type searching for
Expand Down Expand Up @@ -151,7 +149,6 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeFinder<'a, 'tcx> {
}


///////////////////////////////////////////////////////////////////////////
// FULL TYPE RESOLUTION

/// Full type resolution replaces all type and region variables with
Expand Down
Loading