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

Re-export NonZero signed variant in std #59835

Merged
merged 2 commits into from
Apr 14, 2019
Merged

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Apr 10, 2019

Closes #59834 .

@rust-highfive
Copy link
Collaborator

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 10, 2019
@tesuji
Copy link
Contributor Author

tesuji commented Apr 10, 2019

r? @Mark-Simulacrum

@tesuji
Copy link
Contributor Author

tesuji commented Apr 10, 2019

Try the triage bot
@rustbot modify labels: T-libs

@rustbot
Copy link
Collaborator

rustbot commented Apr 10, 2019

Error: Parsing label command in comment failed: ...ls: T-libs|error: a label delta at >|
...

Please let @rust-lang/release know if you're having trouble with this bot.

@Mark-Simulacrum
Copy link
Member

@bors r+

Cc @pietroalbini @rust-lang/release

@bors
Copy link
Contributor

bors commented Apr 10, 2019

📌 Commit 2f97552 has been approved by Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Apr 10, 2019

🌲 The tree is currently closed for pull requests below priority 15, this pull request will be tested once the tree is reopened

@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 Apr 10, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:0419fb10:start=1554866831093664378,finish=1554866832102191880,duration=1008527502
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[01:05:08] .................................................................................................... 4800/5530
[01:05:11] .................................................................................................... 4900/5530
[01:05:14] .................................................................................................... 5000/5530
[01:05:18] .................................................................................................... 5100/5530
[01:05:22] ..........................................................................F......................... 5200/5530
[01:05:28] .................................................................................................... 5400/5530
[01:05:31] ....................................................................i............................... 5500/5530
[01:05:32] ..............................
[01:05:32] failures:
[01:05:32] failures:
[01:05:32] 
[01:05:32] ---- [ui] ui/try-block/try-block-bad-type.rs stdout ----
[01:05:32] diff of stderr:
[01:05:32] 
[01:05:32] 6    |
[01:05:32] 7    = help: the following implementations were found:
[01:05:32] 8              <i32 as std::convert::From<bool>>
[01:05:32] -              <i32 as std::convert::From<core::num::NonZeroI32>>
[01:05:32] 10              <i32 as std::convert::From<i16>>
[01:05:32] 11              <i32 as std::convert::From<i8>>
[01:05:32] +              <i32 as std::convert::From<std::num::NonZeroI32>>
[01:05:32] 13    = note: required by `std::convert::From::from`
[01:05:32] 14 
[01:05:32] 
[01:05:32] 
[01:05:32] 
[01:05:32] The actual stderr differed from the expected stderr.
[01:05:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/try-block/try-block-bad-type/try-block-bad-type.stderr
[01:05:32] To update references, rerun the tests and pass the `--bless` flag
[01:05:32] To only update this specific test, also pass `--test-args try-block/try-block-bad-type.rs`
[01:05:32] error: 1 errors occurred comparing output.
[01:05:32] status: exit code: 1
[01:05:32] status: exit code: 1
[01:05:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/try-block/try-block-bad-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/try-block/try-block-bad-type/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition" "2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/try-block/try-block-bad-type/auxiliary" "-A" "unused"
[01:05:32] ------------------------------------------
[01:05:32] 
[01:05:32] ------------------------------------------
[01:05:32] stderr:
[01:05:32] stderr:
[01:05:32] ------------------------------------------
[01:05:32] {"message":"the trait bound `i32: std::convert::From<&str>` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n    println!(\"{:?}\", foo);\n}\n\nfn main() {\n    // Calling the method is still fine, as i32 implements Debug.\n    some_func(5i32);\n\n    // This would fail to compile now:\n    // struct WithoutDebug;\n    // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":121,"byte_end":129,"line_start":7,"line_end":7,"column_start":9,"column_end":17,"is_primary":true,"text":[{"text":"        Err(\"\")?; //~ ERROR the trait bound `i32: std::convert::From<&str>` is not satisfied","highlight_start":9,"highlight_end":17}],"label":"the trait `std::convert::From<&str>` is not implemented for `i32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the following implementations were found:\n  <i32 as std::convert::From<bool>>\n  <i32 as std::convert::From<i16>>\n  <i32 as std::convert::From<i8>>\n  <i32 as std::convert::From<std::num::NonZeroI32>>\nand 2 others","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required by `std::convert::From::from`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `i32: std::convert::From<&str>` is not satisfied\n  --> /checkout/src/test/ui/try-block/try-block-bad-type.rs:7:9\n   |\nLL |         Err(\"\")?; //~ ERROR the trait bound `i32: std::convert::From<&str>` is not satisfied\n   |         ^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `i32`\n   |\n   = help: the following implementations were found:\n             <i32 as std::convert::From<bool>>\n             <i32 as std::convert::From<i16>>\n             <i32 as std::convert::From<i8>>\n             <i32 as std::convert::From<std::num::NonZeroI32>>\n           and 2 others\n   = note: required by `std::convert::From::from`\n\n"}
[01:05:32] {"message":"type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == &str`","code":{"code":"E0271","explanation":"\nThis is because of a type mismatch between the associated type of some\ntrait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`)\nand another type `U` that is required to be equal to `T::Bar`, but is not.\nExamples follow.\n\nHere is a basic example:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n```\n\nHere is that same example again, with some explanatory comments:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n//                    ~~~~~~~~ ~~~~~~~~~~~~~~~~~~\n//                        |            |\n//         This says `foo` can         |\n//           only be used with         |\n//              some type that         |\n//         implements `Trait`.         |\n//                                     |\n//                             This says not only must\n//                             `T` be an impl of `Trait`\n//                             but also that the impl\n//                             must assign the type `u32`\n//                             to the associated type.\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n//~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n//      |                             |\n// `i8` does have                     |\n// implementation                     |\n// of `Trait`...                      |\n//                     ... but it is an implementation\n//                     that assigns `&'static str` to\n//                     the associated type.\n\nfoo(3_i8);\n// Here, we invoke `foo` with an `i8`, which does not satisfy\n// the constraint `<i8 as Trait>::AssociatedType=u32`, and\n// therefore the type-checker complains with this error code.\n```\n\nTo avoid those issues, you have to make the types match correctly.\nSo we can fix the previous examples like this:\n\n```\n// Basic Example:\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType = &'static str> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n\n// For-Loop Example:\nlet vs = vec![1, 2, 3, 4];\nfor v in &vs {\n    match v {\n        &1 => {}\n        _ => {}\n    }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":270,"byte_end":272,"line_start":12,"line_end":12,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"        \"\" //~ ERROR type mismatch","highlight_start":9,"highlight_end":11}],"label":"expected i32, found &str","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `i32`\n   found type `&str`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == &str`\n  --> /checkout/src/test/ui/try-block/try-block-bad-type.rs:12:9\n   |\nLL |         \"\" //~ ERROR type mismatch\n   |         ^^ expected i32, found &str\n   |\n   = note: expected type `i32`\n              found type `&str`\n\n"}
[01:05:32] {"message":"type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()`","code":{"code":"E0271","explanation":"\nThis is because of a type mismatch between the associated type of some\ntrait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`)\nand another type `U` that is required to be equal to `T::Bar`, but is not.\nExamples follow.\n\nHere is a basic example:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n```\n\nHere is that same example again, with some explanatory comments:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n//                    ~~~~~~~~ ~~~~~~~~~~~~~~~~~~\n//                        |            |\n//         This says `foo` can         |\n//           only be used with         |\n//              some type that         |\n//         implements `Trait`.         |\n//                                     |\n//                             This says not only must\n//                             `T` be an impl of `Trait`\n//                             but also that the impl\n//                             must assign the type `u32`\n//                             to the associated type.\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n//~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n//      |                             |\n// `i8` does have                     |\n// implementation                     |\n// of `Trait`...                      |\n//                     ... but it is an implementation\n//                     that assigns `&'static str` to\n//                     the associated type.\n\nfoo(3_i8);\n// Here, we invoke `foo` with an `i8`, which does not satisfy\n// the constraint `<i8 as Trait>::AssociatedType=u32`, and\n// therefore the type-checker complains with this error code.\n```\n\nTo avoid those issues, you have to make the types match correctly.\nSo we can fix the previous examples like this:\n\n```\n// Basic Example:\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType = &'static str> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n\n// For-Loop Example:\nlet vs = vec![1, 2, 3, 4];\nfor v in &vs {\n    match v {\n        &1 => {}\n        _ => {}\n    }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":343,"byte_end":344,"line_start":15,"line_end":15,"column_start":39,"column_end":40,"is_primary":true,"text":[{"text":"    let res: Result<i32, i32> = try { }; //~ ERROR type mismatch","highlight_start":39,"highlight_end":40}],"label":"expected i32, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":341,"byte_end":344,"line_start":15,"line_end":15,"column_start":37,"column_end":40,"is_primary":false,"text":[{"text":"    let res: Result<i32, i32> = try { }; //~ ERROR type mismatch","highlight_start":37,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"desugaring of `try block`","def_site_span":{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":341,"byte_end":344,"line_start":15,"line_end":15,"column_start":37,"column_end":40,"is_primary":false,"text":[{"text":"    let res: Result<i32, i32> = try { }; //~ ERROR type mismatch","highlight_start":37,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"expected type `i32`\n   found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()`\n  --> /checkout/src/test/ui/try-block/try-block-bad-type.rs:15:39\n   |\nLL |     let res: Result<i32, i32> = try { }; //~ ERROR type mismatch\n   |                                       ^ expected i32, found ()\n   |\n   = note: expected type `i32`\n              found type `()`\n\n"}
[01:05:32] {"message":"the trait bound `(): std::ops::Try` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n    println!(\"{:?}\", foo);\n}\n\nfn main() {\n    // Calling the method is still fine, as i32 implements Debug.\n    some_func(5i32);\n\n    // This would fail to compile now:\n    // struct WithoutDebug;\n    // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":393,"byte_end":396,"line_start":17,"line_end":17,"column_start":23,"column_end":26,"is_primary":true,"text":[{"text":"    let res: () = try { }; //~ the trait bound `(): std::ops::Try` is not satisfied","highlight_start":23,"highlight_end":26}],"label":"the trait `std::ops::Try` is not implemented for `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":393,"byte_end":396,"line_start":17,"line_end":17,"column_start":23,"column_end":26,"is_primary":false,"text":[{"text":"    let res: () = try { }; //~ the trait bound `(): std::ops::Try` is not satisfied","highlight_start":23,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"desugaring of `try block`","def_site_span":{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":393,"byte_end":396,"line_start":17,"line_end":17,"column_start":23,"column_end":26,"is_primary":false,"text":[{"text":"    let res: () = try { }; //~ the trait bound `(): std::ops::Try` is not satisfied","highlight_start":23,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"required by `std::ops::Try::from_ok`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `(): std::ops::Try` is not satisfied\n  --> /checkout/src/test/ui/try-block/try-block-bad-type.rs:17:23\n   |\nLL |     let res: () = try { }; //~ the trait bound `(): std::ops::Try` is not satisfied\n   |                       ^^^ the trait `std::ops::Try` is not implemented for `()`\n   |\n   = note: required by `std::ops::Try::from_ok`\n\n"}
[01:05:32] {"message":"the trait bound `i32: std::ops::Try` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n    println!(\"{:?}\", foo);\n}\n\nfn main() {\n    // Calling the method is still fine, as i32 implements Debug.\n    some_func(5i32);\n\n    // This would fail to compile now:\n    // struct WithoutDebug;\n    // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":479,"byte_end":484,"line_start":19,"line_end":19,"column_start":24,"column_end":29,"is_primary":true,"text":[{"text":"    let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied","highlight_start":24,"highlight_end":29}],"label":"the trait `std::ops::Try` is not implemented for `i32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":479,"byte_end":484,"line_start":19,"line_end":19,"column_start":24,"column_end":29,"is_primary":false,"text":[{"text":"    let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied","highlight_start":24,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"desugaring of `try block`","def_site_span":{"file_name":"/checkout/src/test/ui/try-block/try-block-bad-type.rs","byte_start":479,"byte_end":484,"line_start":19,"line_end":19,"column_start":24,"column_end":29,"is_primary":false,"text":[{"text":"    let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied","highlight_start":24,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"required by `std::ops::Try::from_ok`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `i32: std::ops::Try` is not satisfied\n  --> /checkout/src/test/ui/try-block/try-block-bad-type.rs:19:24\n   |\nLL |     let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied\n   |                        ^^^^^ the trait `std::ops::Try` is not implemented for `i32`\n   |\n   = note: required by `std::ops::Try::from_ok`\n\n"}
[01:05:32] {"message":"aborting due to 5 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 5 previous errors\n\n"}
[01:05:32] {"message":"Some errors occurred: E0271, E0277.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0271, E0277.\n"}
[01:05:32] 
[01:05:32] ------------------------------------------
[01:05:32] 
[01:05:32] thread '[ui] ui/try-block/try-block-bad-type.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3425:9
---
[01:05:32] 
[01:05:32] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:516:22
[01:05:32] 
[01:05:32] 
[01:05:32] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:05:32] 
[01:05:32] 
[01:05:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:05:32] Build completed unsuccessfully in 0:04:17
[01:05:32] Build completed unsuccessfully in 0:04:17
[01:05:32] Makefile:48: recipe for target 'check' failed
[01:05:32] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:135b6d7e
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Apr 10 04:32:55 UTC 2019
---
travis_time:end:0e060fd0:start=1554870776403805454,finish=1554870776408359803,duration=4554349
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1a3dbe80
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:08b5036c
travis_time:start:08b5036c
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:00001728
$ dmesg | grep -i kill

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)

@pietroalbini
Copy link
Member

@bors r-

Legit.

@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 Apr 10, 2019
@pietroalbini
Copy link
Member

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Apr 10, 2019

📌 Commit 404df31 has been approved by Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Apr 10, 2019

🌲 The tree is currently closed for pull requests below priority 15, this pull request will be tested once the tree is reopened

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 10, 2019
@jonas-schievink jonas-schievink added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Apr 10, 2019
@pietroalbini pietroalbini added beta-accepted Accepted for backporting to the compiler in the beta channel. beta-nominated Nominated for backporting to the compiler in the beta channel. labels Apr 10, 2019
@pietroalbini
Copy link
Member

This will need to be backported to beta since it's landing on stable.

bors added a commit that referenced this pull request Apr 10, 2019
[stable] Cherry-pick stdlib fix

Cherry-picked:

* #59835: Re-export NonZero signed variant in std

r? @Mark-Simulacrum
cc #59834 @rust-lang/release
bors added a commit that referenced this pull request Apr 10, 2019
[beta] Prepare beta 1.35.0

Also cherry-picked:

* #59835: Re-export NonZero signed variant in std

cc @Mark-Simulacrum  @rust-lang/release
r? @ghost
@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 10, 2019
@pietroalbini
Copy link
Member

This has been cherry-picked both on stable 1.34 and beta 1.35.

sanxiyn added a commit to sanxiyn/rust that referenced this pull request Apr 11, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 12, 2019
…acrum

Re-export NonZero signed variant in std

Closes  rust-lang#59834 .
Centril added a commit to Centril/rust that referenced this pull request Apr 13, 2019
…acrum

Re-export NonZero signed variant in std

Closes  rust-lang#59834 .
Centril added a commit to Centril/rust that referenced this pull request Apr 13, 2019
Rollup of 18 pull requests

Successful merges:

 - rust-lang#59612 (Use normal newtype_index macro for MIR dataflows)
 - rust-lang#59675 (Stabilize the `alloc` crate.)
 - rust-lang#59708 (Mark variables captured by reference as mutable correctly)
 - rust-lang#59735 (remove lookup_char_pos_adj)
 - rust-lang#59747 (Copy book.toml unstable book generator)
 - rust-lang#59796 (Retire `IsNotConst` naming)
 - rust-lang#59804 (Clean up jobserver integration)
 - rust-lang#59818 (Eliminate `FnBox` usages from libstd.)
 - rust-lang#59830 (Fix links on keyword docs.)
 - rust-lang#59835 (Re-export NonZero signed variant in std)
 - rust-lang#59852 (std: Add `{read,write}_vectored` for more types)
 - rust-lang#59855 (Fix attributes position in type declaration)
 - rust-lang#59858 (Make duplicate matcher bindings a hard error)
 - rust-lang#59879 (Use SecRandomCopyBytes instead of /dev/urandom on MacOS)
 - rust-lang#59899 (In `-Zprint-type-size` output, sort enum variants by size.)
 - rust-lang#59912 (MaybeUninit: remove deprecated functions)
 - rust-lang#59925 (Fix paste error in split_ascii_whitespace docs.)
 - rust-lang#59930 (Exclude some copies of old book editions from search engines)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Apr 13, 2019
Rollup of 18 pull requests

Successful merges:

 - #59612 (Use normal newtype_index macro for MIR dataflows)
 - #59675 (Stabilize the `alloc` crate.)
 - #59708 (Mark variables captured by reference as mutable correctly)
 - #59735 (remove lookup_char_pos_adj)
 - #59747 (Copy book.toml unstable book generator)
 - #59796 (Retire `IsNotConst` naming)
 - #59804 (Clean up jobserver integration)
 - #59818 (Eliminate `FnBox` usages from libstd.)
 - #59830 (Fix links on keyword docs.)
 - #59835 (Re-export NonZero signed variant in std)
 - #59852 (std: Add `{read,write}_vectored` for more types)
 - #59855 (Fix attributes position in type declaration)
 - #59858 (Make duplicate matcher bindings a hard error)
 - #59879 (Use SecRandomCopyBytes instead of /dev/urandom on MacOS)
 - #59899 (In `-Zprint-type-size` output, sort enum variants by size.)
 - #59912 (MaybeUninit: remove deprecated functions)
 - #59925 (Fix paste error in split_ascii_whitespace docs.)
 - #59930 (Exclude some copies of old book editions from search engines)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Apr 13, 2019
…acrum

Re-export NonZero signed variant in std

Closes  rust-lang#59834 .
Centril added a commit to Centril/rust that referenced this pull request Apr 13, 2019
…acrum

Re-export NonZero signed variant in std

Closes  rust-lang#59834 .
bors added a commit that referenced this pull request Apr 13, 2019
Rollup of 16 pull requests

Successful merges:

 - #59675 (Stabilize the `alloc` crate.)
 - #59708 (Mark variables captured by reference as mutable correctly)
 - #59735 (remove lookup_char_pos_adj)
 - #59747 (Copy book.toml unstable book generator)
 - #59796 (Retire `IsNotConst` naming)
 - #59804 (Clean up jobserver integration)
 - #59818 (Eliminate `FnBox` usages from libstd.)
 - #59830 (Fix links on keyword docs.)
 - #59835 (Re-export NonZero signed variant in std)
 - #59852 (std: Add `{read,write}_vectored` for more types)
 - #59855 (Fix attributes position in type declaration)
 - #59858 (Make duplicate matcher bindings a hard error)
 - #59899 (In `-Zprint-type-size` output, sort enum variants by size.)
 - #59912 (MaybeUninit: remove deprecated functions)
 - #59925 (Fix paste error in split_ascii_whitespace docs.)
 - #59930 (Exclude some copies of old book editions from search engines)

Failed merges:

r? @ghost
@bors bors merged commit 404df31 into rust-lang:master Apr 14, 2019
@tesuji tesuji deleted the nonzero-signed branch April 14, 2019 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NonZero signed variants not available in std
8 participants