Skip to content

Commit b706f9d

Browse files
committed
Add missing Clone bounds detected on todays nightly
As mentioned in rust-lang/rust#27641
1 parent 7df0072 commit b706f9d

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/primitives.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub struct ParseError<P: Stream> {
210210
pub errors: Vec<Error<P::Item, P::Range>>
211211
}
212212

213-
impl <P: Positioner, S: Stream<Item=P>> ParseError<S> {
213+
impl <P: Positioner + Clone, S: Stream<Item=P>> ParseError<S> {
214214

215215
pub fn new(position: P::Position, error: Error<S::Item, S::Range>) -> ParseError<S> {
216216
ParseError::from_errors(position, vec![error])
@@ -262,36 +262,37 @@ impl <P: Positioner, S: Stream<Item=P>> ParseError<S> {
262262
}
263263
}
264264

265-
impl <S, P> StdError for ParseError<S>
266-
where S: Stream<Item=P>
265+
impl <S> StdError for ParseError<S>
266+
where S: Stream
267267
, S::Range: fmt::Display + fmt::Debug + Any
268-
, P: Positioner + fmt::Display + fmt::Debug + Any
269-
, P::Position: fmt::Display + fmt::Debug + Any {
268+
, S::Item: fmt::Display + fmt::Debug + Any
269+
, <S::Item as Positioner>::Position: fmt::Display + fmt::Debug + Any {
270270
fn description(&self) -> &str { "parse error" }
271271
}
272272

273-
impl <P: Positioner + PartialEq, S> PartialEq for ParseError<S>
274-
where S: Stream<Item=P>
275-
, P::Position: fmt::Debug {
273+
impl <S> PartialEq for ParseError<S>
274+
where S: Stream
275+
, <S::Item as Positioner>::Position: PartialEq {
276276
fn eq(&self, other: &ParseError<S>) -> bool {
277277
self.position == other.position && self.errors == other.errors
278278
}
279279
}
280280

281-
impl <P: Positioner + fmt::Debug, S> fmt::Debug for ParseError<S>
282-
where S: Stream<Item=P>
281+
impl <S> fmt::Debug for ParseError<S>
282+
where S: Stream
283283
, S::Range: fmt::Debug
284-
, P::Position: fmt::Debug {
284+
, S::Item: fmt::Debug
285+
, <S::Item as Positioner>::Position: fmt::Debug {
285286
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
286287
write!(f, "ParseError {{ position: {:?}, errors: {:?} }}", self.position, self.errors)
287288
}
288289
}
289290

290-
impl <P, S> fmt::Display for ParseError<S>
291-
where S: Stream<Item=P>
291+
impl <S> fmt::Display for ParseError<S>
292+
where S: Stream
293+
, S::Item: fmt::Display
292294
, S::Range: fmt::Display
293-
, P: Positioner + fmt::Display
294-
, P::Position: fmt::Display {
295+
, <S::Item as Positioner>::Position: fmt::Display {
295296
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
296297
try!(writeln!(f, "Parse error at {}", self.position));
297298

0 commit comments

Comments
 (0)