Skip to content

rustdoc: Tweaking test generation #15000

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

Merged
merged 3 commits into from
Jun 18, 2014
Merged

Conversation

alexcrichton
Copy link
Member

Commits have the descriptions.

The collapse/unindent passes were run in the wrong order, generating different
markdown for indented tests.
No need to duplicate the compiler's work!

Closes rust-lang#14999
bors added a commit that referenced this pull request Jun 18, 2014
@bors bors closed this Jun 18, 2014
@bors bors merged commit e710653 into rust-lang:master Jun 18, 2014
@alexcrichton alexcrichton deleted the fix-rustdoc-tests branch June 18, 2014 15:17
lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 19, 2023
…oc, r=HKalbasi

fix: only generate trait bound for associated types in field types

Given the following definitions:

```rust
trait Trait {
    type A;
    type B;
    type C;
}

#[derive(Clone)]
struct S<T: Trait>
where
    T::A: Send,
{
    qualified: <T as Trait>::B,
    shorthand: T::C,
}
```

we currently expand the derive macro to:

```rust
impl<T> Clone for S<T>
where
    T: Trait + Clone,
    T::A: Clone,
    T::B: Clone,
    T::C: Clone,
{ /* ... */ }
```

This does not match how rustc expands it. Specifically, `Clone` bounds for `T::A` and `T::B` should not be generated.

The criteria for associated types to get bound seem to be 1) the associated type appears as part of field types AND 2) it's written in the shorthand form. I have no idea why rustc doesn't consider qualified associated types (there's even a comment that suggests they should be considered; see rust-lang#50730), but it's important to follow rustc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants