Skip to content

Commit c479379

Browse files
committed
deprecated: allow use of deprecated description methods
PR #633 removed these methods, but we can't do that without making a breaking change release. Removing deprecated methods isn't worth doing a breaking change release, so we instead simply allow them for now by squashing the warnings. Closes #633
1 parent 1f773e8 commit c479379

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
1.3.2 (2020-01-09)
2+
==================
3+
This is a small maintenance release with some house cleaning and bug fixes.
4+
5+
Bug fixes:
6+
7+
* [BUG #633](https://github.com/rust-lang/regex/pull/633):
8+
Squash deprecation warnings for the `std::error::Error::description` method.
9+
10+
111
1.3.1 (2019-09-04)
212
==================
313
This is a maintenance release with no changes in order to try to work-around

regex-syntax/src/ast/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ pub enum ErrorKind {
176176
}
177177

178178
impl error::Error for Error {
179+
// TODO: Remove this method entirely on the next breaking semver release.
180+
#[allow(deprecated)]
179181
fn description(&self) -> &str {
180182
use self::ErrorKind::*;
181183
match self.kind {

regex-syntax/src/error.rs

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ impl From<hir::Error> for Error {
4040
}
4141

4242
impl error::Error for Error {
43+
// TODO: Remove this method entirely on the next breaking semver release.
44+
#[allow(deprecated)]
4345
fn description(&self) -> &str {
4446
match *self {
4547
Error::Parse(ref x) => x.description(),

regex-syntax/src/hir/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ pub enum ErrorKind {
9191
}
9292

9393
impl ErrorKind {
94+
// TODO: Remove this method entirely on the next breaking semver release.
95+
#[allow(deprecated)]
9496
fn description(&self) -> &str {
9597
use self::ErrorKind::*;
9698
match *self {
@@ -113,6 +115,8 @@ impl ErrorKind {
113115
}
114116

115117
impl error::Error for Error {
118+
// TODO: Remove this method entirely on the next breaking semver release.
119+
#[allow(deprecated)]
116120
fn description(&self) -> &str {
117121
self.kind.description()
118122
}
@@ -126,6 +130,8 @@ impl fmt::Display for Error {
126130

127131
impl fmt::Display for ErrorKind {
128132
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
133+
// TODO: Remove this on the next breaking semver release.
134+
#[allow(deprecated)]
129135
f.write_str(self.description())
130136
}
131137
}

src/error.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ pub enum Error {
1919
}
2020

2121
impl ::std::error::Error for Error {
22+
// TODO: Remove this method entirely on the next breaking semver release.
23+
#[allow(deprecated)]
2224
fn description(&self) -> &str {
2325
match *self {
2426
Error::Syntax(ref err) => err,

0 commit comments

Comments
 (0)