Apply configured return.nullable to out parameters #307

Merged
merged 1 commit into from Jan 18, 2017

Conversation

Projects
None yet
2 participants
@EPashkin
Member

EPashkin commented Jan 18, 2017

Closes #306

@antoyo, check this version please.

@antoyo

This comment has been minimized.

Show comment
Hide comment
@antoyo

antoyo Jan 18, 2017

Member

I have errors when trying to compile this:

error: no method named `at` found for type `&regex::Captures<'_>` in the current scope
  --> src/codegen/doc/format.rs:92:62
   |
92 |         format!("{}`{}{}`", &caps[1], lookup(&caps[2]), caps.at(3).unwrap_or(""))
   |                                                              ^^

error[E0308]: mismatched types
   --> src/codegen/doc/format.rs:101:5
    |
101 |     SPACES.replace_all(&out, " ")
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found enum `std::borrow::Cow`
    |
    = note: expected type `std::string::String`
    = note:    found type `std::borrow::Cow<'_, str>`
    = help: here are some functions which might fulfill your needs:
            - .escape_debug()
            - .escape_default()
            - .escape_unicode()
            - .to_lowercase()
            - .to_uppercase()

error[E0308]: mismatched types
   --> src/codegen/doc/mod.rs:268:5
    |
268 |       PARAM_NAME.replace_all(doc, |caps: &Captures| {
    |  _____^ starting here...
269 | |         if let Some(ref self_name) = *self_name {
270 | |             if &caps[1] == self_name {
271 | |                 return "@self".into()
272 | |             }
273 | |         }
274 | |         format!("@{}", nameutil::mangle_keywords(&caps[1]))
275 | |     })
    | |______^ ...ending here: expected struct `std::string::String`, found enum `std::borrow::Cow`
    |
    = note: expected type `std::string::String`
    = note:    found type `std::borrow::Cow<'_, str>`
    = help: here are some functions which might fulfill your needs:
            - .escape_debug()
            - .escape_default()
            - .escape_unicode()
            - .to_lowercase()
            - .to_uppercase()

error[E0277]: the trait bound `std::vec::Vec<std::string::String>: std::iter::FromIterator<std::borrow::Cow<'_, str>>` is not satisfied
  --> src/codegen/sys/build.rs:41:10
   |
41 |         .collect();
   |          ^^^^^^^ the trait `std::iter::FromIterator<std::borrow::Cow<'_, str>>` is not implemented for `std::vec::Vec<std::string::String>`
   |
   = note: a collection of type `std::vec::Vec<std::string::String>` cannot be built from an iterator over elements of type `std::borrow::Cow<'_, str>`

error[E0277]: the trait bound `regex::Regex: std::cmp::Eq` is not satisfied
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^ the trait `std::cmp::Eq` is not implemented for `regex::Regex`
  |
  = note: required by `std::cmp::AssertParamIsEq`

error[E0369]: binary operation `==` cannot be applied to type `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^
  |
note: an implementation of `std::cmp::PartialEq` might be missing for `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^

error[E0369]: binary operation `!=` cannot be applied to type `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^
  |
note: an implementation of `std::cmp::PartialEq` might be missing for `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^

error: aborting due to 7 previous errors

error: Could not compile `gir`.

To learn more, run the command again with --verbose.

I tried cargo update.

Member

antoyo commented Jan 18, 2017

I have errors when trying to compile this:

error: no method named `at` found for type `&regex::Captures<'_>` in the current scope
  --> src/codegen/doc/format.rs:92:62
   |
92 |         format!("{}`{}{}`", &caps[1], lookup(&caps[2]), caps.at(3).unwrap_or(""))
   |                                                              ^^

error[E0308]: mismatched types
   --> src/codegen/doc/format.rs:101:5
    |
101 |     SPACES.replace_all(&out, " ")
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found enum `std::borrow::Cow`
    |
    = note: expected type `std::string::String`
    = note:    found type `std::borrow::Cow<'_, str>`
    = help: here are some functions which might fulfill your needs:
            - .escape_debug()
            - .escape_default()
            - .escape_unicode()
            - .to_lowercase()
            - .to_uppercase()

error[E0308]: mismatched types
   --> src/codegen/doc/mod.rs:268:5
    |
268 |       PARAM_NAME.replace_all(doc, |caps: &Captures| {
    |  _____^ starting here...
269 | |         if let Some(ref self_name) = *self_name {
270 | |             if &caps[1] == self_name {
271 | |                 return "@self".into()
272 | |             }
273 | |         }
274 | |         format!("@{}", nameutil::mangle_keywords(&caps[1]))
275 | |     })
    | |______^ ...ending here: expected struct `std::string::String`, found enum `std::borrow::Cow`
    |
    = note: expected type `std::string::String`
    = note:    found type `std::borrow::Cow<'_, str>`
    = help: here are some functions which might fulfill your needs:
            - .escape_debug()
            - .escape_default()
            - .escape_unicode()
            - .to_lowercase()
            - .to_uppercase()

error[E0277]: the trait bound `std::vec::Vec<std::string::String>: std::iter::FromIterator<std::borrow::Cow<'_, str>>` is not satisfied
  --> src/codegen/sys/build.rs:41:10
   |
41 |         .collect();
   |          ^^^^^^^ the trait `std::iter::FromIterator<std::borrow::Cow<'_, str>>` is not implemented for `std::vec::Vec<std::string::String>`
   |
   = note: a collection of type `std::vec::Vec<std::string::String>` cannot be built from an iterator over elements of type `std::borrow::Cow<'_, str>`

error[E0277]: the trait bound `regex::Regex: std::cmp::Eq` is not satisfied
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^ the trait `std::cmp::Eq` is not implemented for `regex::Regex`
  |
  = note: required by `std::cmp::AssertParamIsEq`

error[E0369]: binary operation `==` cannot be applied to type `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^
  |
note: an implementation of `std::cmp::PartialEq` might be missing for `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^

error[E0369]: binary operation `!=` cannot be applied to type `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^
  |
note: an implementation of `std::cmp::PartialEq` might be missing for `regex::Regex`
 --> src/config/ident.rs:7:13
  |
7 |     Pattern(Regex),
  |             ^^^^^^

error: aborting due to 7 previous errors

error: Could not compile `gir`.

To learn more, run the command again with --verbose.

I tried cargo update.

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jan 18, 2017

Member

Your right. Cargo update was bad idea 😉 But it build with original Cargo.lock ?

Member

EPashkin commented Jan 18, 2017

Your right. Cargo update was bad idea 😉 But it build with original Cargo.lock ?

@antoyo

This comment has been minimized.

Show comment
Hide comment
@antoyo

antoyo Jan 18, 2017

Member

I used cargo update because with the original file, I have the following error:

error[E0432]: unresolved import `git_status_show_t::*`
   --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.3.9/lib.rs:536:9
    |
536 | pub use git_status_show_t::*;
    |         ^^^^^^^^^^^^^^^^^^^^^ Not a module `git_status_show_t`

error: aborting due to previous error

Build failed, waiting for other jobs to finish...
error: Could not compile `libgit2-sys`.
Member

antoyo commented Jan 18, 2017

I used cargo update because with the original file, I have the following error:

error[E0432]: unresolved import `git_status_show_t::*`
   --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.3.9/lib.rs:536:9
    |
536 | pub use git_status_show_t::*;
    |         ^^^^^^^^^^^^^^^^^^^^^ Not a module `git_status_show_t`

error: aborting due to previous error

Build failed, waiting for other jobs to finish...
error: Could not compile `libgit2-sys`.
@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jan 18, 2017

Member

For me after update in lock file line "libgit2-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", don't changed.

Member

EPashkin commented Jan 18, 2017

For me after update in lock file line "libgit2-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", don't changed.

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jan 18, 2017

Member

And my (and stored in repo) git2version is "git2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",

Member

EPashkin commented Jan 18, 2017

And my (and stored in repo) git2version is "git2 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",

@antoyo

This comment has been minimized.

Show comment
Hide comment
@antoyo

antoyo Jan 18, 2017

Member

I've had issues with my branches.
I tested this and it works fine.
Thanks.

Member

antoyo commented Jan 18, 2017

I've had issues with my branches.
I tested this and it works fine.
Thanks.

@EPashkin EPashkin merged commit 0b20667 into gtk-rs:master Jan 18, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@EPashkin EPashkin deleted the EPashkin:nullable_for_error_result branch Jan 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment