Skip to content
New issue

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

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

Already on GitHub? # to your account

Regression with generated template parameters. #1113

Closed
emilio opened this issue Oct 28, 2017 · 4 comments
Closed

Regression with generated template parameters. #1113

emilio opened this issue Oct 28, 2017 · 4 comments
Assignees

Comments

@emilio
Copy link
Contributor

emilio commented Oct 28, 2017

From 0.29 to 0.31, the following code corresponding to nsBaseHashTable has changed from:

    pub struct nsBaseHashtable_EntryPtr<KeyClass, DataType> {
        pub mEntry: *mut root::nsBaseHashtable_EntryType<KeyClass, DataType>,
        pub mExistingEntry: bool,
        pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<KeyClass>>,
        pub _phantom_1: ::std::marker::PhantomData<::std::cell::UnsafeCell<DataType>>,
    }

To:

pub struct nsBaseHashtable_EntryPtr < KeyClass , DataType > {
    pub mEntry : * mut root :: nsBaseHashtable_EntryType < KeyClass , DataType > < KeyClass , DataType > ,
    pub mExistingEntry : bool ,
    // ....
}

Trying to find a test-case now.

@emilio
Copy link
Contributor Author

emilio commented Oct 28, 2017

Test-case:

template<class K, class V>
class Entry : public K
{
  V mData;
};

template<typename K, typename V>
class nsBaseHashtable {
  typedef Entry<K, V> EntryType;

  struct EntryPtr {
  private:
    EntryType& mEntry;
    bool mExistingEntry;
  };
};

@emilio
Copy link
Contributor Author

emilio commented Oct 28, 2017

Bisect says that 61743aa is to blame.

@emilio
Copy link
Contributor Author

emilio commented Oct 28, 2017

Unfortunately that is not precisely a minimal commit...

@emilio emilio self-assigned this Oct 28, 2017
@emilio
Copy link
Contributor Author

emilio commented Oct 28, 2017

I got this one though.

emilio added a commit to emilio/rust-bindgen that referenced this issue Oct 28, 2017
bors-servo pushed a commit that referenced this issue Oct 28, 2017
ir: References have no implicit template parameters.

Fixes #1113.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant