Skip to content

Commit cbf1a0e

Browse files
authored
Rollup merge of rust-lang#105063 - aDotInTheVoid:rdj-dont-assume-core, r=notriddle
Rustdoc Json Tests: Don't assume that core::fmt::Debug will always have one item. See rust-lang#104525 (comment) and rust-lang#104525 (comment) for motivation. This still assumes that `fmt` is the first method, but thats alot less brittle than assuming it will be the only method. Sadly, we can't use a aux crate to insulate the tests from core changes, because core is special, so all we can do is try not to depend on things that may change.
2 parents eabc072 + 9286228 commit cbf1a0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test/rustdoc-json/traits/uses_extern_trait.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ pub fn drop_default<T: core::default::Default>(_x: T) {}
33

44
// FIXME(adotinthevoid): Theses shouldn't be here
55
// @has "$.index[*][?(@.name=='Debug')]"
6-
// @set Debug_fmt = "$.index[*][?(@.name=='Debug')].inner.items[*]"
6+
7+
// Debug may have several items. All we depend on here the that `fmt` is first. See
8+
// https://github.com/rust-lang/rust/pull/104525#issuecomment-1331087852 for why we
9+
// can't use [*].
10+
11+
// @set Debug_fmt = "$.index[*][?(@.name=='Debug')].inner.items[0]"
712
// @has "$.index[*][?(@.name=='fmt')].id" $Debug_fmt

0 commit comments

Comments
 (0)