Skip to content

Commit eabeb5e

Browse files
Merge #596 from ChrisDenton/windows-nightly
Fix CI and remove rustc-serialize
2 parents d80990b + 6bc4fca commit eabeb5e

File tree

6 files changed

+16
-82
lines changed

6 files changed

+16
-82
lines changed

.github/workflows/main.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ jobs:
2626
rust: stable
2727
- os: macos-latest
2828
rust: nightly
29-
# HACK(jubilee): 1.77 broke backtraces on Windows lol
3029
- os: windows-latest
31-
rust: 1.76.0-x86_64-msvc
30+
rust: stable-x86_64-msvc
3231
- os: windows-latest
33-
rust: 1.76.0-i686-msvc
32+
rust: stable-i686-msvc
3433
- os: windows-latest
35-
rust: 1.76.0-x86_64-gnu
34+
rust: stable-x86_64-gnu
35+
- os: windows-latest
36+
rust: nightly-x86_64-msvc
37+
- os: windows-latest
38+
rust: nightly-i686-msvc
39+
- os: windows-latest
40+
rust: nightly-x86_64-gnu
3641
steps:
3742
- uses: actions/checkout@v3
3843
with:
@@ -52,7 +57,6 @@ jobs:
5257

5358
- run: cargo build
5459
- run: cargo test
55-
- run: cargo test --features "serialize-rustc"
5660
- run: cargo test --features "serialize-serde"
5761
- run: cargo test --features "verify-winapi"
5862
- run: cargo test --features "cpp_demangle"

Cargo.lock

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ rust-version = "1.65.0"
2020
[workspace]
2121
members = ['crates/cpp_smoke_test', 'crates/as-if-std']
2222
exclude = [
23-
'crates/without_debuginfo',
24-
'crates/macos_frames_test',
25-
'crates/line-tables-only',
26-
'crates/debuglink',
23+
'crates/without_debuginfo',
24+
'crates/macos_frames_test',
25+
'crates/line-tables-only',
26+
'crates/debuglink',
2727
]
2828

2929
[dependencies]
@@ -33,10 +33,11 @@ rustc-demangle = "0.1.4"
3333
# Optionally enable the ability to serialize a `Backtrace`, controlled through
3434
# the `serialize-*` features below.
3535
serde = { version = "1.0", optional = true, features = ['derive'] }
36-
rustc-serialize = { version = "0.3", optional = true }
3736

3837
# Optionally demangle C++ frames' symbols in backtraces.
39-
cpp_demangle = { default-features = false, version = "0.4.0", optional = true, features = ["alloc"] }
38+
cpp_demangle = { default-features = false, version = "0.4.0", optional = true, features = [
39+
"alloc",
40+
] }
4041

4142
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
4243
miniz_oxide = { version = "0.7.0", default-features = false }
@@ -71,7 +72,6 @@ std = []
7172
# Methods of serialization
7273
#
7374
# Various features used for enabling rustc-serialize or syntex codegen.
74-
serialize-rustc = ["rustc-serialize"]
7575
serialize-serde = ["serde"]
7676

7777
#=======================================

src/capture.rs

-49
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use serde::{Deserialize, Serialize};
2121
/// This function requires the `std` feature of the `backtrace` crate to be
2222
/// enabled, and the `std` feature is enabled by default.
2323
#[derive(Clone)]
24-
#[cfg_attr(feature = "serialize-rustc", derive(RustcDecodable, RustcEncodable))]
2524
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
2625
pub struct Backtrace {
2726
// Frames here are listed from top-to-bottom of the stack
@@ -116,7 +115,6 @@ impl Frame {
116115
/// This function requires the `std` feature of the `backtrace` crate to be
117116
/// enabled, and the `std` feature is enabled by default.
118117
#[derive(Clone)]
119-
#[cfg_attr(feature = "serialize-rustc", derive(RustcDecodable, RustcEncodable))]
120118
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
121119
pub struct BacktraceSymbol {
122120
name: Option<Vec<u8>>,
@@ -440,53 +438,6 @@ impl fmt::Debug for BacktraceSymbol {
440438
}
441439
}
442440

443-
#[cfg(feature = "serialize-rustc")]
444-
mod rustc_serialize_impls {
445-
use super::*;
446-
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
447-
448-
#[derive(RustcEncodable, RustcDecodable)]
449-
struct SerializedFrame {
450-
ip: usize,
451-
symbol_address: usize,
452-
module_base_address: Option<usize>,
453-
symbols: Option<Vec<BacktraceSymbol>>,
454-
}
455-
456-
impl Decodable for BacktraceFrame {
457-
fn decode<D>(d: &mut D) -> Result<Self, D::Error>
458-
where
459-
D: Decoder,
460-
{
461-
let frame: SerializedFrame = SerializedFrame::decode(d)?;
462-
Ok(BacktraceFrame {
463-
frame: Frame::Deserialized {
464-
ip: frame.ip,
465-
symbol_address: frame.symbol_address,
466-
module_base_address: frame.module_base_address,
467-
},
468-
symbols: frame.symbols,
469-
})
470-
}
471-
}
472-
473-
impl Encodable for BacktraceFrame {
474-
fn encode<E>(&self, e: &mut E) -> Result<(), E::Error>
475-
where
476-
E: Encoder,
477-
{
478-
let BacktraceFrame { frame, symbols } = self;
479-
SerializedFrame {
480-
ip: frame.ip() as usize,
481-
symbol_address: frame.symbol_address() as usize,
482-
module_base_address: frame.module_base_address().map(|addr| addr as usize),
483-
symbols: symbols.clone(),
484-
}
485-
.encode(e)
486-
}
487-
}
488-
}
489-
490441
#[cfg(feature = "serde")]
491442
mod serde_impls {
492443
use super::*;

src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@
9797
// irrelevant as this crate is developed out-of-tree.
9898
#![cfg_attr(backtrace_in_libstd, allow(warnings))]
9999
#![cfg_attr(not(feature = "std"), allow(dead_code))]
100-
// We know this is deprecated, it's only here for back-compat reasons.
101-
#![cfg_attr(feature = "rustc-serialize", allow(deprecated))]
102100

103101
#[cfg(feature = "std")]
104102
#[macro_use]

tests/smoke.rs

-12
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,6 @@ fn many_threads() {
230230
}
231231
}
232232

233-
#[test]
234-
#[cfg(feature = "rustc-serialize")]
235-
fn is_rustc_serialize() {
236-
extern crate rustc_serialize;
237-
238-
fn is_encode<T: rustc_serialize::Encodable>() {}
239-
fn is_decode<T: rustc_serialize::Decodable>() {}
240-
241-
is_encode::<backtrace::Backtrace>();
242-
is_decode::<backtrace::Backtrace>();
243-
}
244-
245233
#[test]
246234
#[cfg(feature = "serde")]
247235
fn is_serde() {

0 commit comments

Comments
 (0)