Skip to content
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

resolve: Do not afraid to set current module to enums and traits #64177

Merged
merged 2 commits into from
Sep 8, 2019

Conversation

petrochenkov
Copy link
Contributor

After cfbb60b it's ok.

This is likely required for #63468 to work correctly, because that PR starts resolving attributes on enum variants.

r? @matthewjasper @c410-f3r

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 5, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-09-05T15:20:39.1459230Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-05T15:20:39.1475179Z ##[command]git config gc.auto 0
2019-09-05T15:20:39.1477933Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-05T15:20:39.1485568Z ##[command]git config --get-all http.proxy
2019-09-05T15:20:39.1502083Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64177/merge:refs/remotes/pull/64177/merge
---
2019-09-05T15:54:34.7729889Z    Compiling parking_lot_core v0.4.0
2019-09-05T15:54:35.1779425Z    Compiling ena v0.13.0
2019-09-05T15:54:35.6115102Z    Compiling polonius-engine v0.10.0
2019-09-05T15:54:36.7051056Z    Compiling num_cpus v1.8.0
2019-09-05T15:54:37.6407876Z error[E0599]: no method named `serialize_element` found for type `<Self as ser::Serializer>::SerializeSeq` in the current scope
2019-09-05T15:54:37.6408301Z     --> /cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.99/src/ser/mod.rs:1275:29
2019-09-05T15:54:37.6408541Z      |
2019-09-05T15:54:37.6408790Z 1275 |             try!(serializer.serialize_element(&item));
2019-09-05T15:54:37.6409237Z      |
2019-09-05T15:54:37.6409639Z      = help: items from traits can only be used if the trait is in scope
2019-09-05T15:54:37.6409639Z      = help: items from traits can only be used if the trait is in scope
2019-09-05T15:54:37.6410276Z      = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
2019-09-05T15:54:37.6410502Z              `use ser::SerializeSeq;`
2019-09-05T15:54:37.6410600Z 
2019-09-05T15:54:37.6578533Z error[E0599]: no method named `serialize_entry` found for type `<Self as ser::Serializer>::SerializeMap` in the current scope
2019-09-05T15:54:37.6578927Z     --> /cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.99/src/ser/mod.rs:1315:29
2019-09-05T15:54:37.6579188Z      |
2019-09-05T15:54:37.6579481Z 1315 |             try!(serializer.serialize_entry(&key, &value));
2019-09-05T15:54:37.6580017Z      |
2019-09-05T15:54:37.6580309Z      = help: items from traits can only be used if the trait is in scope
2019-09-05T15:54:37.6580309Z      = help: items from traits can only be used if the trait is in scope
2019-09-05T15:54:37.6580623Z      = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
2019-09-05T15:54:37.6580869Z              `use ser::SerializeMap;`
2019-09-05T15:54:38.3507533Z    Compiling jobserver v0.1.16
2019-09-05T15:54:38.7847341Z error: aborting due to 2 previous errors
2019-09-05T15:54:38.7853180Z 
2019-09-05T15:54:38.7859684Z For more information about this error, try `rustc --explain E0599`.
---
2019-09-05T15:54:40.5035858Z == clock drift check ==
2019-09-05T15:54:40.5055612Z   local time: Thu Sep  5 15:54:40 UTC 2019
2019-09-05T15:54:40.6630938Z   network time: Thu, 05 Sep 2019 15:54:40 GMT
2019-09-05T15:54:40.6635965Z == end clock drift check ==
2019-09-05T15:54:42.0522237Z ##[error]Bash exited with code '1'.
2019-09-05T15:54:42.0562440Z ##[section]Starting: Checkout
2019-09-05T15:54:42.0565032Z ==============================================================================
2019-09-05T15:54:42.0565090Z Task         : Get sources
2019-09-05T15:54:42.0565157Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov
Copy link
Contributor Author

Interesting.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 5, 2019
@petrochenkov
Copy link
Contributor Author

Updated.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 7, 2019
Copy link
Contributor

@matthewjasper matthewjasper left a comment

Choose a reason for hiding this comment

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

r=me with comment addressed

@@ -1640,7 +1644,7 @@ impl<'a> Resolver<'a> {
}

if let ModuleKind::Block(..) = module.kind {
return Some(module.parent.unwrap());
return Some(module.parent.unwrap().nearest_item_scope());
Copy link
Contributor

Choose a reason for hiding this comment

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

This change looks like it's not doing anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It fixes the CI failure above (minimized in block-with-trait-parent.rs ).
If the block is directly inside a trait item, then its parent is the trait and we need to skip it and jump to the trait's parent module.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I see, I missed that this was using the parent module.

@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 7, 2019

📌 Commit 56f6353 has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 7, 2019
Centril added a commit to Centril/rust that referenced this pull request Sep 7, 2019
resolve: Do not afraid to set current module to enums and traits

After rust-lang@cfbb60b it's ok.

This is likely required for rust-lang#63468 to work correctly, because that PR starts resolving attributes on enum variants.

r? @matthewjasper @c410-f3r
bors added a commit that referenced this pull request Sep 7, 2019
Rollup of 5 pull requests

Successful merges:

 - #64052 (Rename test locals to work around LLDB bug)
 - #64066 (Support "soft" feature-gating using a lint)
 - #64177 (resolve: Do not afraid to set current module to enums and traits)
 - #64229 (Reduce span to function name in unreachable calls)
 - #64255 (Add methods for converting `bool` to `Option<T>`)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Sep 8, 2019

☔ The latest upstream changes (presumably #64269) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 8, 2019
@bors bors merged commit 56f6353 into rust-lang:master Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants