Skip to content

Test Case for Incr. Comp. Hash for traits #36681. #36940

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 5 commits into from
Oct 7, 2016

Conversation

eulerdisk
Copy link
Contributor

@eulerdisk eulerdisk commented Oct 3, 2016

Fixes #36681
Part of #36350

Currently, the following tests fail:

Unsafe modifier
Extern modifier
Extern c to rust-intrinsic
Trait unsafety
Change type of method parameter (&i32 => &mut i32)
Mode of self parameter

r? @michaelwoerister

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@eulerdisk
Copy link
Contributor Author

r? @michaelwoerister

@michaelwoerister
Copy link
Member

Thank you so much for the PR, @eulerdisk :)
The failing tests are to be expected since they have the same root cause(s) as #36914.
I'll review this in more detail shortly. In the meantime, can you fix those make tidy errors? Our buildbots won't accept source files with lines longer than 100 characters:

/build/src/test/incremental/hashes/trait_defs.rs:967: line longer than 100 chars
/build/src/test/incremental/hashes/trait_defs.rs:1066: line longer than 100 chars
/build/src/test/incremental/hashes/trait_defs.rs:1102: line longer than 100 chars

Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work, thank you so much for putting in the time, @eulerdisk!
I've left some comments on things that need to be corrected. When that is done, this is good to merge.

#[cfg(not(cfail1))]
#[rustc_dirty(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_metadata_clean(cfg="cfail3")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add #[rustc_metadata_dirty(cfg="cfail2")] here?

// Change order of method parameters ----------------------------------------------
#[cfg(cfail1)]
trait TraitChangeMethodParametersOrder {
fn method(a: i32, b: i32);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the type of b to something different than the type of a (e.g. i64)?


// dummy trait for bound
trait ReferenceTrait0 { }
trait ReferenceTrait1 { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReferencedTraitX would be more appropriate than ReferenceTraitX.

// Add second lifetime bound to method type parameter -----------------------------
#[cfg(cfail1)]
trait TraitAddSecondLifetimeBoundToMethodTypeParameter {
fn method<'a, 'b, 'c>(a: &'a u32, b: &'b u32);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the c parameter to the cfail1 version too and add a bound to 'c, e.g. 'c : 'a. We really want to test whether just adding another bound to 'c changes the hash. Like it is written now, we don't know if the hash just changed because another parameter has been added.

@michaelwoerister
Copy link
Member

@eulerdisk FYI, I just saw that that last commit fixes the missing lifetime bound in the TraitAddSecondLifetimeBoundToMethodTypeParameter case but does not yet add the c parameter to the cfail1 version.

@michaelwoerister
Copy link
Member

Thanks, @eulerdisk, I think now we've got everything :)

@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 6, 2016

📌 Commit bd77b39 has been approved by michaelwoerister

@bors
Copy link
Collaborator

bors commented Oct 7, 2016

⌛ Testing commit bd77b39 with merge e2bd2d8...

bors added a commit that referenced this pull request Oct 7, 2016
…oerister

Test Case for Incr. Comp. Hash for traits #36681.

Fixes #36681
Part of #36350

Currently, the following tests fail:

Unsafe modifier
Extern modifier
Extern c to rust-intrinsic
Trait unsafety
Change type of method parameter (&i32 => &mut i32)
Mode of self parameter

r? @michaelwoerister
@bors bors merged commit bd77b39 into rust-lang:master Oct 7, 2016
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.

5 participants