@@ -17,19 +17,19 @@ use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
1717use rustc_stable_hash:: { FromStableHash , SipHasher128Hash , StableSipHasher128 } ;
1818use serde:: Deserialize ;
1919
20- /// Trait for mdtest configuration types.
21- pub trait MdtestConfig : Clone + Default + for < ' de > Deserialize < ' de > { }
22-
2320/// Parse the Markdown `source` as a test suite with given `title`.
2421///
2522/// `validate_config` is invoked once for every literally-declared `toml` config block
2623/// (after deserialization, before it replaces the section's inherited config) so callers
2724/// can enforce invariants that mdtest itself shouldn't know about.
28- pub fn parse < ' s , C : MdtestConfig > (
25+ pub fn parse < ' s , C > (
2926 title : & ' s str ,
3027 source : & ' s str ,
3128 validate_config : impl FnMut ( & C ) -> anyhow:: Result < ( ) > ,
32- ) -> anyhow:: Result < MarkdownTestSuite < ' s , C > > {
29+ ) -> anyhow:: Result < MarkdownTestSuite < ' s , C > >
30+ where
31+ C : Clone + Default + for < ' de > Deserialize < ' de > ,
32+ {
3333 let parser = Parser :: new ( title, source, validate_config) ;
3434 parser. parse ( )
3535}
@@ -516,7 +516,11 @@ struct Parser<'s, C, F> {
516516 validate_config : F ,
517517}
518518
519- impl < ' s , C : MdtestConfig , F : FnMut ( & C ) -> anyhow:: Result < ( ) > > Parser < ' s , C , F > {
519+ impl < ' s , C , F > Parser < ' s , C , F >
520+ where
521+ C : Clone + Default + for < ' de > Deserialize < ' de > ,
522+ F : FnMut ( & C ) -> anyhow:: Result < ( ) > ,
523+ {
520524 fn new ( title : & ' s str , source : & ' s str , validate_config : F ) -> Self {
521525 let mut sections = IndexVec :: default ( ) ;
522526 let root_section_id = sections. push ( Section {
@@ -1111,8 +1115,6 @@ mod tests {
11111115 typeshed : Option < String > ,
11121116 }
11131117
1114- impl super :: MdtestConfig for TestConfig { }
1115-
11161118 fn parse < ' s > (
11171119 title : & ' s str ,
11181120 source : & ' s str ,
0 commit comments