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

add #[panic_handler]; deprecate #[panic_implementation] #53619

Merged
merged 4 commits into from
Aug 26, 2018

Conversation

japaric
Copy link
Member

@japaric japaric commented Aug 22, 2018

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

The job x86_64-gnu-llvm-5.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.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/4e/cf/0c313db4b8e3b231447d3807657db4f5e7fad26d5eaeb294b3cfa1388a6c/awscli-1.15.84-py2.py3-none-any.whl (1.3MB)
    0% |▎                               | 10kB 12.4MB/s eta 0:00:01
    1% |▌                               | 20kB 1.9MB/s eta 0:00:01
    2% |▊                               | 30kB 2.3MB/s eta 0:00:01
    3% |█                               | 40kB 2.0MB/s eta 0:00:01
---

[00:04:24] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:24] tidy error: /checkout/src/libsyntax/feature_gate.rs:1108: line longer than 100 chars
[00:04:25] Expected a gate test for the feature 'panic_implementation'.
[00:04:25] Hint: create a failing test file named 'feature-gate-panic_implementation.rs'
[00:04:25]       in the 'ui' test suite, with its failures due to
[00:04:25]       missing usage of #![feature(panic_implementation)].
[00:04:25] Hint: If you already have such a test and don't want to rename it,
[00:04:25]       you can also add a // gate-test-panic_implementation line to the test file.
[00:04:25] tidy error: Found 1 features without a gate test.
[00:04:26] some tidy checks failed
[00:04:26] 
[00:04:26] 
[00:04:26] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:26] 
[00:04:26] 
[00:04:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:26] Build completed unsuccessfully in 0:00:50
[00:04:26] Build completed unsuccessfully in 0:00:50
[00:04:26] Makefile:79: recipe for target 'tidy' failed
[00:04:26] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2a83a38e
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0d089130:start=1534978247571097407,finish=1534978247580420623,duration=9323216
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01b27cd2
$ 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 -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:01b44a00
travis_time:start:01b44a00
$ 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:0e320b03
$ 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)

@SimonSapin
Copy link
Contributor

Oh nice, I didn’t realize we already had a mechanism for deprecated attributes.

Looks great, r=me with the two tidy errors fixed.

@bors delegate+

@bors
Copy link
Contributor

bors commented Aug 23, 2018

✌️ @japaric can now approve this pull request

@@ -1102,11 +1103,18 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
"infer 'static lifetime requirements",
cfg_fn!(infer_static_outlives_requirements))),

// RFC 2070 (deprecated attribute name)
("panic_implementation",
Normal, Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/44489#issuecomment-415140224"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to double check: Stability::Deprecated implies unstable, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

You still need #![feature(panic_implementation)] to use the deprecated #[panic_implementation] attribute (see recently added ui / feature-gate test) so it remains a nightly-only feature.

@japaric
Copy link
Member Author

japaric commented Aug 23, 2018

@bors r=SimonSapin

@bors
Copy link
Contributor

bors commented Aug 23, 2018

📌 Commit dc904b104ba2b10500892555b474a5b09b993480 has been approved by SimonSapin

@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 Aug 23, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.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.
[00:46:26] ....................................................................................................
[00:46:29] ....................................................................................................
[00:46:32] ....................................................................................................
[00:46:35] ..............i.....................................................................................
[00:46:40] ..............................F.....................................................................
[00:46:46] ..................ii.iii............................................................................
[00:46:49] ....................................................................................................
[00:46:51] ....................................................................................................
[00:46:53] ....................................................................................................
---
[00:48:07] ....................................................................................................
[00:48:11] .........................................................i..........................................
[00:48:15] ....................................................................................................
[00:48:18] ....................................................................................................
ld/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/const_panic_libcore_main/const_panic_libcore_main.stderr
[00:48:22] To update references, rerun the tests and pass the `--bless` flag
[00:48:22] To only update this specific test, also pass `--test-args consts/const-eval/const_panic_libcore_main.rs`
[00:48:22] error: 1 errors occurred comparing output.
[00:48:22] status: exit code: 1
[00:48:22] status: exit code: 1
[00:48:22] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs" "--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/consts/const-eval/const_panic_libcore_main/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/const_panic_libcore_main/auxiliary" "-A" "unused"
[00:48:22] ------------------------------------------
[00:48:22] 
[00:48:22] ------------------------------------------
[00:48:22] stderr:
[00:48:22] stderr:
[00:48:22] ------------------------------------------
[00:48:22] {"message":"use of deprecated attribute `panic_implementation`: This attribute was renamed to `panic_handler`. See https://github.com/rust-lang/rust/issues/44489#issuecomment-415140224","code":{"code":"deprecated","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs","byte_start":936,"byte_end":959,"line_start":34,"line_end":34,"column_sart":1,"highlight_end":46},{"text":"file ! (  ) , line ! (  ) , __rust_unstable_column ! (  ) ) ) } ) ;","highlight_start":1,"highlight_end":68}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},{"file_name":"/checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs","byte_start":626,"byte_end":657,"line_start":20,"line_end":20,"column_start":1,"column_end":32,"is_primary":true,"text":[{"text":"const Z: () = panic!(\"cheese\");","highlight_start":1,"highlight_end":32}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[deny(const_err)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: this constant cannot be used\n  --> /checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs:20:1\n   |\nLL | const Z: () = panic!(\"cheese\");\n   | ^^^^^^^^^^^^^^----------------^\n   |               |\n   |               the evaluated program panicked at 'cheese', /checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs:20:15\n   |\n   = note: #[deny(const_err)] on by default\n   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n"}
[00:48:22] {"message":"this constant cannot be used","code":{"code":"const_err","explanation":null},"level":"error","spans":[{"file_name":"<panic macros>","byte_start":67,"byte_end":172,"line_start":3,"line_end":4,"column_start":1,"column_end":74,"is_primary":false,"text":[{"text":"$ crate :: panicking :: panic (","highlight_msg ) } ) ; ( $ fmt : expr , $ ( $ arg : tt ) * ) =>","highlight_start":1,"highlight_end":78},{"text":"(","highlight_start":1,"highlight_end":2},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"panic ! (","highlight_start":1,"highlight_end":10},{"text":"concat ! ( \"internal error: entered unreachable code: \" , $ fmt ) , $ ( $ arg","highlight_start":1,"highlight_end":78},{"text":") * ) } ) ;","highlight_start":1,"highlight_end":12}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}},"macro_decl_name":"panic!","def_site_span":{"file_name":"<panic macros>","byte_start":0,"byte_end":419,"line_start":1,"line_end":10,"column_start":1,"column_end":68,"is_primary":false,"text":[{"text":"(  ) => ( panic ! ( \"explicit panic\" ) ) ; ( $ msg : expr ) => (","highlight_start":1,"highlight_end":65},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"$ crate :: panicking :: panic (","highlight_start":1,"highlight_end":32},{"text":"& ( $ msg , file ! (  ) , line ! (  ) , __rust_unstable_column ! (  ) ) ) } )","highlight_start":1,"highlight_end":78},{"text":"; ( $ msg : expr , ) => ( panic ! ( $ msg ) ) ; (","highlight_start":1,"highlight_end":50},{"text":"$ fmt : expr , $ ( $ arg : tt ) + ) => (","highlight_start":1,"highlight_end":41},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"$ crate :: panicking :: panic_fmt (","highlight_start":1,"highlight_end":36},{"text":"format_args ! ( $ fmt , $ ( $ arg ) * ) , & (","highlight_start":1,"highlight_end":46},{"text":"file ! (  ) , line ! (  ) , __rust_unstable_column ! (  ) ) ) } ) ;","highlight_start":1,"highlight_end":68 at 'not yet implemented', /checkout/src/test/ui/consts/const-eval/const_panic_libcore_main.rs:26:15\n   |\n   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)\n\n"}
[00:48:22] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:48:22] ------------------------------------------
[00:48:22] 
[00:48:22] thread '[ui] ui/consts/const-eval/const_panic_libcore_main.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3196:9
[00:48:22] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:48:22] 
[00:48:22] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:497:22
[00:48:22] 
[00:48:22] 
[00:48:22] 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-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--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" "5.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"
[00:48:22] 
[00:48:22] 
[00:48:22] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:48:22] Build completed unsuccessfully in 0:03:08
[00:48:22] Build completed unsuccessfully in 0:03:08
[00:48:22] make: *** [check] Error 1
[00:48:22] Makefile:58: recipe for target 'check' failed
128740 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release
126384 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu
126380 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release
123616 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps

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)

@japaric
Copy link
Member Author

japaric commented Aug 23, 2018

I'll fix the Travis failure later today, until then

@bors r-

@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 Aug 23, 2018
@japaric
Copy link
Member Author

japaric commented Aug 23, 2018

@bors r=SimonSapin

@bors
Copy link
Contributor

bors commented Aug 23, 2018

📌 Commit 40a38b0 has been approved by SimonSapin

@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 Aug 23, 2018
@bors
Copy link
Contributor

bors commented Aug 26, 2018

⌛ Testing commit 40a38b0 with merge 6916385...

bors added a commit that referenced this pull request Aug 26, 2018
add #[panic_handler]; deprecate #[panic_implementation]

r? @SimonSapin
cc #44489
@bors
Copy link
Contributor

bors commented Aug 26, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: SimonSapin
Pushing 6916385 to master...

@bors bors merged commit 40a38b0 into rust-lang:master Aug 26, 2018
denzp added a commit to denzp/rust-ptx-builder that referenced this pull request Aug 27, 2018
Hywan added a commit to Hywan/gutenberg-parser-rs that referenced this pull request Aug 29, 2018
@japaric japaric deleted the panic-handler branch September 8, 2018 17:24
kennytm added a commit to kennytm/rust that referenced this pull request Oct 26, 2018
[CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded]

## What's included?

- Run a `thumbv7m-none-eabi` binary using `qemu-system-arm`
- We are using `cortex-m-rt = "=0.5.4"` which does not use `proc_macro`.
(reason: stage2 build of rustc does not work well with `proc_macro` in `run-make` phase.)
- We are using GNU LD for now.

## Blocker

All resolved.
- ~[Waiting] `#[panic_handler]` is not available in stable.~
  - [Merged] rust-lang#53619
- ~[Waiting] https://github.com/japaric/lm3s6965evb: does not compile on stable.~
  - [OK] dependent crate ~`panic-abort`~ `panic-halt`: already moved to use `#[panic_handler]`.

## Update

`#[panic_handler]` will be stabilized in Rust 1.30.

CC @kennytm @jamesmunns @nerdyvaishali
bors added a commit that referenced this pull request Nov 6, 2018
[CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded]

## What's included?

- Run a `thumbv7m-none-eabi` binary using `qemu-system-arm`
- We are using `cortex-m-rt = "=0.5.4"` which does not use `proc_macro`.
(reason: stage2 build of rustc does not work well with `proc_macro` in `run-make` phase.)
- We are using GNU LD for now.

## Blocker

All resolved.
- ~[Waiting] `#[panic_handler]` is not available in stable.~
  - [Merged] #53619
- ~[Waiting] https://github.com/japaric/lm3s6965evb: does not compile on stable.~
  - [OK] dependent crate ~`panic-abort`~ `panic-halt`: already moved to use `#[panic_handler]`.

## Update

`#[panic_handler]` will be stabilized in Rust 1.30.

CC @kennytm @jamesmunns @nerdyvaishali
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants