Skip to content

jsondoclint: False positive for #![feature(trait_alias)] #104923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aDotInTheVoid opened this issue Nov 26, 2022 · 0 comments · Fixed by #104924
Closed

jsondoclint: False positive for #![feature(trait_alias)] #104923

aDotInTheVoid opened this issue Nov 26, 2022 · 0 comments · Fixed by #104924
Assignees
Labels
A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@aDotInTheVoid
Copy link
Member

aDotInTheVoid commented Nov 26, 2022

Very much in the same vane as #104851 (trying to get jsondoclint to work on core.json)

#![feature(trait_alias)]

pub trait Orig<T> {}

pub trait Alias = Orig<i32>;

pub struct Struct;

impl Orig<i32> for Struct {}

pub fn takes_alias(_: impl Alias) {}

fn main() {
    takes_alias(Struct);
}
---- [rustdoc-json] src/test/rustdoc-json/traits/trait_alias.rs stdout ----

error: jsondoclint failed!
status: exit status: 1
command: "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondoclint" "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/trait_alias/trait_alias.json"
stdout: none
--- stderr -------------------------------
0:5:1566: Expected Trait but found TraitAlias (found at ["$.index[\"0:0:1405\"].inner.items[1]", "$.index[\"0:5:1566\"].id", "$.index[\"0:9:1568\"].inner.decl.inputs[0][1].inner[0].trait_bound.trait.id", "$.index[\"0:9:1568\"].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id"])
0:5:1566: Expected Trait but found TraitAlias (found at ["$.index[\"0:0:1405\"].inner.items[1]", "$.index[\"0:5:1566\"].id", "$.index[\"0:9:1568\"].inner.decl.inputs[0][1].inner[0].trait_bound.trait.id", "$.index[\"0:9:1568\"].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id"])
Error: Errors validating json /home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/traits/trait_alias/trait_alias.json
------------------------------------------

(This isn't fully standard jsondoclint output, as I've hacked it up to debug this)

@rustbot modify labels: +A-rustdoc-json +A-testsuite +T-rustdoc

@rustbot claim

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 26, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 26, 2022
…s, r=GuillaumeGomez

jsondoclint: Accept trait alias is places where trait expected.

More work to make `jsondoclint` work for `core.json`

Closes rust-lang#104923

r? `@GuillaumeGomez`

`@rustbot` modify labels: +A-testsuite
@bors bors closed this as completed in b1cdb05 Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants