rustc_lint_defs

Enum FutureIncompatibilityReason

Source
pub enum FutureIncompatibilityReason {
    FutureReleaseErrorDontReportInDeps,
    FutureReleaseErrorReportInDeps,
    FutureReleaseSemanticsChange,
    EditionError(Edition),
    EditionSemanticsChange(Edition),
    Custom(&'static str),
}
Expand description

The reason for future incompatibility

Future-incompatible lints come in roughly two categories:

  1. There was a mistake in the compiler (such as a soundness issue), and we’re trying to fix it, but it may be a breaking change.
  2. A change across an Edition boundary, typically used for the introduction of new language features that can’t otherwise be introduced in a backwards-compatible way.

See https://rustc-dev-guide.rust-lang.org/bug-fix-procedure.html and https://rustc-dev-guide.rust-lang.org/diagnostics.html#future-incompatible-lints for more information.

Variants§

§

FutureReleaseErrorDontReportInDeps

This will be an error in a future release for all editions

This will not show up in cargo’s future breakage report. The warning will hence only be seen in local crates, not in dependencies.

Choose this variant when you are first introducing a “future incompatible” warning that is intended to eventually be fixed in the future. This allows crate developers an opportunity to fix the warning before blasting all dependents with a warning they can’t fix (dependents have to wait for a new release of the affected crate to be published).

After a lint has been in this state for a while, consider graduating it to FutureIncompatibilityReason::FutureReleaseErrorReportInDeps.

§

FutureReleaseErrorReportInDeps

This will be an error in a future release, and Cargo should create a report even for dependencies

This is the only reason that will make future incompatibility warnings show up in cargo’s reports. All other future incompatibility warnings are not visible when they occur in a dependency.

Choose this variant after the lint has been sitting in the FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps state for a while, and you feel like it is ready to graduate to warning everyone. It is a good signal that it is ready if you can determine that all or most affected crates on crates.io have been updated.

After some period of time, lints with this variant can be turned into hard errors (and the lint removed). Preferably when there is some confidence that the number of impacted projects is very small (few should have a broken dependency in their dependency tree).

§

FutureReleaseSemanticsChange

Code that changes meaning in some way in a future release.

Choose this variant when the semantics of existing code is changing, (as opposed to FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps, which is for when code is going to be rejected in the future).

§

EditionError(Edition)

Previously accepted code that will become an error in the provided edition

Choose this variant for code that you want to start rejecting across an edition boundary. This will automatically include the lint in the rust-20xx-compatibility lint group, which is used by cargo fix --edition to do migrations. The lint should be auto-fixable with Applicability::MachineApplicable.

The lint can either be Allow or Warn by default. If it is Allow, users usually won’t see this warning unless they are doing an edition migration manually or there is a problem during the migration (cargo’s automatic migrations will force the level to Warn). If it is Warn by default, users on all editions will see this warning (only do this if you think it is important for everyone to be aware of the change, and to encourage people to update their code on all editions).

See also FutureIncompatibilityReason::EditionSemanticsChange if you have code that is changing semantics across the edition (as opposed to being rejected).

§

EditionSemanticsChange(Edition)

Code that changes meaning in some way in the provided edition

This is the same as FutureIncompatibilityReason::EditionError, except for situations where the semantics change across an edition. It slightly changes the text of the diagnostic, but is otherwise the same.

§

Custom(&'static str)

A custom reason.

Choose this variant if the built-in text of the diagnostic of the other variants doesn’t match your situation. This is behaviorally equivalent to FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps.

Implementations§

Trait Implementations§

Source§

impl Clone for FutureIncompatibilityReason

Source§

fn clone(&self) -> FutureIncompatibilityReason

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FutureIncompatibilityReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for FutureIncompatibilityReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Aligned for T

Source§

const ALIGN: Alignment = _

Alignment of Self.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T
where T: Copy,

§

fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T

§

fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> Filterable for T

Source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync,

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes

Size for each variant:

  • FutureReleaseErrorDontReportInDeps: 0 bytes
  • FutureReleaseErrorReportInDeps: 0 bytes
  • FutureReleaseSemanticsChange: 0 bytes
  • EditionError: 1 byte
  • EditionSemanticsChange: 1 byte
  • Custom: 23 bytes