Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.

Commit 6441134

Browse files
bors[bot]japaric
andcommitted
Merge #4
4: use `#[panic_handler]` instead of `#[panic_implementation]` r=korken89 a=japaric the later has been deprecated. `panic_implementation` was deprecated in today's nightly but existing builds won't break (they'll just get an extra warning). Do not merge this just yet because that will break builds that haven't move to the latest nightly. We should merge this in one week or so to not break people that don't often update their nightly compiler. This PR also puts our docs on GH pages because docs.rs won't be able to build the docs after this change. cc @rust-embedded/cortex-m Co-authored-by: Jorge Aparicio <jorge@japaric.io>
2 parents 61c4ed4 + 1d1771d commit 6441134

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ matrix:
44
include:
55
- env: TARGET=x86_64-unknown-linux-gnu
66
rust: nightly
7-
if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master)
87

98
- env: TARGET=thumbv7m-none-eabi
109
rust: nightly
@@ -38,6 +37,9 @@ install:
3837
script:
3938
- bash ci/script.sh
4039

40+
after_success:
41+
- bash ci/after-success.sh
42+
4143
after_script: set +e
4244

4345
cache: cache

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.3.0] - 2018-09-03
11+
12+
### Changed
13+
14+
- This crate no longer depends on `arm-none-eabi-gcc`.
15+
16+
- [breaking-change] Move from the `panic_implementation` attribute to the
17+
`panic_handler` attribute, which will be stabilized.
18+
1019
## [v0.2.0] - 2018-06-04
1120

1221
### Changed

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
authors = ["Jorge Aparicio <jorge@japaric.io>"]
33
categories = ["no-std"]
44
description = "Log panic messages using the ITM (Instrumentation Trace Macrocell)"
5+
documentation = "https://rust-embedded.github.io/panic-itm/panic_itm"
56
keywords = ["panic-impl", "panic", "ITM", "ARM", "Cortex-M"]
67
license = "MIT OR Apache-2.0"
78
name = "panic-itm"
8-
repository = "https://github.com/japaric/panic-itm"
9-
version = "0.2.0"
9+
repository = "https://github.com/rust-embedded/panic-itm"
10+
version = "0.3.0"
1011

1112
[dependencies]
12-
cortex-m = "0.5.0"
13+
cortex-m = "0.5.6"

ci/after-success.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set -euxo pipefail
2+
3+
main() {
4+
cargo doc
5+
6+
mkdir ghp-import
7+
8+
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz |
9+
tar --strip-components 1 -C ghp-import -xz
10+
11+
./ghp-import/ghp_import.py target/doc
12+
13+
set +x
14+
git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK
15+
}
16+
17+
# only publish on successful merges to master
18+
if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TARGET = x86_64-unknown-linux-gnu ]; then
19+
main
20+
fi

src/lib.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,19 @@
3030
3131
#![deny(missing_docs)]
3232
#![deny(warnings)]
33-
#![feature(panic_implementation)]
33+
#![feature(panic_handler)]
3434
#![no_std]
3535

3636
#[macro_use]
3737
extern crate cortex_m;
3838

3939
use core::panic::PanicInfo;
40+
use core::sync::atomic::{self, Ordering};
4041

4142
use cortex_m::peripheral::ITM;
4243
use cortex_m::interrupt;
4344

44-
#[panic_implementation]
45+
#[panic_handler]
4546
fn panic(info: &PanicInfo) -> ! {
4647
interrupt::disable();
4748

@@ -50,5 +51,9 @@ fn panic(info: &PanicInfo) -> ! {
5051

5152
iprintln!(stim, "{}", info);
5253

53-
loop {}
54+
loop {
55+
// add some side effect to prevent this from turning into a UDF instruction
56+
// see rust-lang/rust#28728 for details
57+
atomic::compiler_fence(Ordering::SeqCst)
58+
}
5459
}

0 commit comments

Comments
 (0)