---
title: Deprecated declaration warnings (DeprecatedDeclaration)
framework: swift-compiler
role: article
role_heading: Article
path: swift-compiler/documentation/diagnostics/deprecated-declaration
---

# Deprecated declaration warnings (DeprecatedDeclaration)

Warnings related to deprecated APIs that may be removed in future versions and should be replaced with more current alternatives.

## Overview

Overview The DeprecatedDeclaration group covers the following warnings: Use of a function annotated with @available(<platform>, deprecated: <version>) @available(iOS, deprecated: 10.0) func oldFunction() {   // This function is deprecated and should not be used. }

oldFunction() // 'oldFunction()' is deprecated Use of a function annotated with @available(<platform>, deprecated: <version>, renamed: "<new name>") @available(iOS, deprecated: 10.0, renamed: "newFunction") func oldFunction() {   // This function is deprecated and should not be used. }

oldFunction() // 'oldFunction()' is deprecated: renamed to 'newFunction' Use of a type as an instance of a protocol when the type’s conformance to the protocol is marked as deprecated struct S {}

protocol P {}

@available(*, deprecated) extension S: P {}

func f(_ p: some P) {}

func test() {   f(S()) // Conformance of 'S' to 'P' is deprecated } When a protocol requirement has a default implementation marked as deprecated and the type conforming to the protocol doesn’t provide that requirement protocol P {   func f()   func g() }

extension P {   @available(*, deprecated)   func f() {}   @available(*, deprecated, message: "write it yourself")   func g() {} }

struct S: P {} // deprecated default implementation is used to satisfy instance method 'f()' required by protocol 'P'               // deprecated default implementation is used to satisfy instance method 'g()' required by protocol 'P': write it yourself When a protocol requirement has been deprecated struct S: Hashable {   var hashValue: Int { // 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'S' to 'Hashable' by implementing 'hash(into:)' instead     ...   } } final class C: Executor {   func enqueue(_ job: __owned Job) {} // 'Executor.enqueue(Job)' is deprecated as a protocol requirement; conform type 'C' to 'Executor' by implementing 'func enqueue(ExecutorJob)' instead }

## See Also

- [@dynamicCallable implementation requirements (DynamicCallable)](swift-compiler/documentation/diagnostics/dynamic-callable-requirements.md)
- [Add @preconcurrency import (AddPreconcurrencyImport)](swift-compiler/documentation/diagnostics/add-preconcurrency-import.md)
- [Always enabled availability domains (AlwaysAvailableDomain)](swift-compiler/documentation/diagnostics/always-available-domain.md)
- [Argument matching for trailing closures (TrailingClosureMatching)](swift-compiler/documentation/diagnostics/trailing-closure-matching.md)
- [Calling a mutating async actor-isolated method (ActorIsolatedMutatingAsync)](swift-compiler/documentation/diagnostics/actor-isolated-mutating-async.md)
- [Calling an actor-isolated method from a synchronous nonisolated context (ActorIsolatedCall)](swift-compiler/documentation/diagnostics/actor-isolated-call.md)
- [Captures in a `@Sendable` closure (SendableClosureCaptures)](swift-compiler/documentation/diagnostics/sendable-closure-captures.md)
- [Compilation caching (CompilationCaching)](swift-compiler/documentation/diagnostics/compilation-caching.md)
- [Conforming to `StringInterpolationProtocol` (StringInterpolationConformance)](swift-compiler/documentation/diagnostics/string-interpolation-conformance.md)
- [Conversion from `@isolated(any)` function type to synchronous function type (ConversionFromIsolatedAnyToSynchronous)](swift-compiler/documentation/diagnostics/conversion-from-isolated-any-to-synchronous.md)
- [Cross-isolation data race (RegionIsolationCrossIsolationDataRace)](swift-compiler/documentation/diagnostics/region-isolation-cross-isolation-data-race.md)
- [Deprecated implementation-only imports (ImplementationOnlyDeprecated)](swift-compiler/documentation/diagnostics/implementation-only-deprecated.md)
- [Dynamic exclusivity (DynamicExclusivity)](swift-compiler/documentation/diagnostics/dynamic-exclusivity.md)
- [Embedded Swift language restrictions (EmbeddedRestrictions)](swift-compiler/documentation/diagnostics/embedded-restrictions.md)
- [Existential Types and Performance (ExistentialType)](swift-compiler/documentation/diagnostics/existential-type.md)
