Skip to content

Commit

Permalink
chore: add support for rustc 1.82 (close #53)
Browse files Browse the repository at this point in the history
  • Loading branch information
godzie44 committed Nov 30, 2024
1 parent 40ec7ce commit 9add33b
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
rustc_sup_version: [ 1.78.0, 1.79.0, 1.80.0, 1.81.0, 1.82.0 ]
rustc_sup_version: [ 1.79.0, 1.80.0, 1.81.0, 1.82.0, 1.83.0 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Install actual rustc
uses: actions-rs/toolchain@v1
with:
toolchain: 1.82.0
toolchain: 1.83.0
override: true
components: rustfmt, clippy
- name: Run functional tests on own stack unwind implementation
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.82.0
toolchain: 1.83.0
override: true
components: rustfmt, clippy
- name: Set up Python 3.7
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.82.0
toolchain: 1.83.0
override: true
components: rustfmt, clippy
- name: Install libunwind
Expand Down
6 changes: 3 additions & 3 deletions src/debugger/breakpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ pub struct BreakpointView<'a> {
pub place: Option<Cow<'a, PlaceDescriptorOwned>>,
}

impl<'a> From<Breakpoint> for BreakpointView<'a> {
impl From<Breakpoint> for BreakpointView<'_> {
fn from(brkpt: Breakpoint) -> Self {
Self {
addr: Address::Relocated(brkpt.addr),
Expand All @@ -895,7 +895,7 @@ impl<'a> From<&'a Breakpoint> for BreakpointView<'a> {
}
}

impl<'a> From<UninitBreakpoint> for BreakpointView<'a> {
impl From<UninitBreakpoint> for BreakpointView<'_> {
fn from(brkpt: UninitBreakpoint) -> Self {
Self {
addr: brkpt.addr,
Expand All @@ -922,7 +922,7 @@ pub struct BreakpointViewOwned {
pub place: Option<PlaceDescriptorOwned>,
}

impl<'a> BreakpointView<'a> {
impl BreakpointView<'_> {
pub fn to_owned(&self) -> BreakpointViewOwned {
BreakpointViewOwned {
addr: self.addr,
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/debugee/dwarf/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ pub enum AddressKind {
Value,
}

impl<'a> CompletedResult<'a> {
impl CompletedResult<'_> {
pub fn into_scalar<T: Copy>(self, address_kind: AddressKind) -> Result<T, Error> {
let (_, bytes) = self.into_raw_bytes(mem::size_of::<T>(), address_kind)?;
Ok(scalar_from_bytes(&bytes))
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/debugee/dwarf/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use gimli::{Attribute, AttributeValue, Expression};

pub(super) struct Location<'a>(pub(super) &'a Attribute<EndianArcSlice>);

impl<'a> Location<'a> {
impl Location<'_> {
/// Converts location attribute to a dwarf expression.
/// Expect location attribute one of:
/// - DW_FORM_exprloc
Expand Down
10 changes: 5 additions & 5 deletions src/debugger/debugee/dwarf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,13 @@ macro_rules! ctx_resolve_unit_call {
}};
}

impl<'a, T> Clone for ContextualDieRef<'a, T> {
impl<T> Clone for ContextualDieRef<'_, T> {
fn clone(&self) -> Self {
*self
}
}

impl<'a, T> Copy for ContextualDieRef<'a, T> {}
impl<T> Copy for ContextualDieRef<'_, T> {}

impl<'a, T> ContextualDieRef<'a, T> {
pub fn namespaces(&self) -> NamespaceHierarchy {
Expand Down Expand Up @@ -1139,7 +1139,7 @@ impl<'ctx> ContextualDieRef<'ctx, FunctionDie> {
}
}

impl<'ctx> ContextualDieRef<'ctx, VariableDie> {
impl ContextualDieRef<'_, VariableDie> {
pub fn ranges(&self) -> Option<&[Range]> {
if let Some(lb_idx) = self.die.lexical_block_idx {
let entry = ctx_resolve_unit_call!(self, entry, lb_idx);
Expand Down Expand Up @@ -1181,7 +1181,7 @@ impl<'ctx> ContextualDieRef<'ctx, VariableDie> {
}
}

impl<'ctx> ContextualDieRef<'ctx, ParameterDie> {
impl ContextualDieRef<'_, ParameterDie> {
/// Return max range (with max `end` address) of an underlying function.
/// If it's possible, `end` address in range equals to function epilog begin.
pub fn max_range(&self) -> Option<Range> {
Expand All @@ -1205,7 +1205,7 @@ impl<'ctx> ContextualDieRef<'ctx, ParameterDie> {
}
}

impl<'ctx, D: AsAllocatedData> ContextualDieRef<'ctx, D> {
impl<D: AsAllocatedData> ContextualDieRef<'_, D> {
pub fn r#type(&self) -> Option<ComplexType> {
let parser = r#type::TypeParser::new();
Some(parser.parse(*self, self.die.type_ref()?))
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/debugee/dwarf/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct EvaluationContext<'a> {
pub expl_ctx: &'a ExplorationContext,
}

impl<'a> EvaluationContext<'a> {
impl EvaluationContext<'_> {
pub fn rustc_version(&self) -> Option<Version> {
self.evaluator.unit().rustc_version()
}
Expand Down
6 changes: 3 additions & 3 deletions src/debugger/debugee/dwarf/unit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl<'a> From<(&'a Unit, usize, &LineRow)> for PlaceDescriptor<'a> {
}
}

impl<'a> Debug for PlaceDescriptor<'a> {
impl Debug for PlaceDescriptor<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!(
"file: {:?}, line: {}, addr: {}, is_stmt: {}, col: {}, epilog_begin: {}, prolog_end: {}",
Expand Down Expand Up @@ -151,7 +151,7 @@ impl<'a> PlaceDescriptor<'a> {
}
}

impl<'a> PartialEq for PlaceDescriptor<'a> {
impl PartialEq for PlaceDescriptor<'_> {
fn eq(&self, other: &Self) -> bool {
self.file == other.file
&& self.address == other.address
Expand Down Expand Up @@ -814,7 +814,7 @@ impl Unit {
pub fn evaluator<'this>(
&'this self,
debugee: &'this Debugee,
) -> UnitResult<ExpressionEvaluator> {
) -> UnitResult<ExpressionEvaluator<'this>> {
match self.lazy_part.get() {
None => UnitResult::Reload,
Some(_) => UnitResult::Ok(ExpressionEvaluator::new(self, self.encoding(), debugee)),
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/debugee/dwarf/unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl<'a> DwarfUnwinder<'a> {
/// # Arguments
///
/// * `debugee`: current debugee program.
pub fn new(debugee: &'a Debugee) -> DwarfUnwinder {
pub fn new(debugee: &'a Debugee) -> DwarfUnwinder<'a> {
Self { debugee }
}

Expand Down
2 changes: 1 addition & 1 deletion src/debugger/variable/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum ValueLayout<'a> {
Map(&'a [(VariableIR, VariableIR)]),
}

impl<'a> Debug for ValueLayout<'a> {
impl Debug for ValueLayout<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
ValueLayout::PreRendered(s) => f.debug_tuple("PreRendered").field(s).finish(),
Expand Down
2 changes: 1 addition & 1 deletion src/debugger/variable/specialization/btree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ pub struct KVIterator<'a> {
v_size: usize,
}

impl<'a> FallibleIterator for KVIterator<'a> {
impl FallibleIterator for KVIterator<'_> {
type Item = (ObjectBinaryRepr, ObjectBinaryRepr);
type Error = ParsingError;

Expand Down
4 changes: 2 additions & 2 deletions src/debugger/watchpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ impl<'a> From<&'a Watchpoint> for WatchpointView<'a> {
}
}

impl<'a> From<Watchpoint> for WatchpointView<'a> {
impl From<Watchpoint> for WatchpointView<'_> {
fn from(mut wp: Watchpoint) -> Self {
Self {
number: wp.number,
Expand All @@ -534,7 +534,7 @@ impl<'a> From<Watchpoint> for WatchpointView<'a> {
}
}

impl<'a> WatchpointView<'a> {
impl WatchpointView<'_> {
pub fn to_owned(&self) -> WatchpointViewOwned {
WatchpointViewOwned {
number: self.number,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/console/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ enum CompletableCommand<'a> {
}

impl<'a> CompletableCommand<'a> {
fn recognize(line: &'a str) -> Option<CompletableCommand> {
fn recognize(line: &'a str) -> Option<CompletableCommand<'a>> {
let op = just::<_, _, extra::Default>;

let bp = op(BREAK_COMMAND)
Expand Down
6 changes: 1 addition & 5 deletions src/ui/console/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ impl FileView {
place.line_number
};
let line_pos = line_number - 1;
let start = if line_pos < bounds {
0
} else {
line_pos - bounds
};
let start = line_pos.saturating_sub(bounds);

self.render(place.file, start, bounds * 2 + 1)
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum StylizedLine<'a> {
Stylized(Vec<(Style, &'a str)>),
}

impl<'a> RustCodeLineRenderer<'a> {
impl RustCodeLineRenderer<'_> {
/// Prettify rust code-line if needed.
pub fn render_line<'s>(&mut self, line: &'s str) -> anyhow::Result<StylizedLine<'s>> {
match &mut self.highlighter {
Expand Down
1 change: 1 addition & 0 deletions src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static SUPPORTED_RUSTC: &[(Version, Version)] = &[
(Version((1, 80, 0)), Version((1, 80, u32::MAX))),
(Version((1, 81, 0)), Version((1, 81, u32::MAX))),
(Version((1, 82, 0)), Version((1, 82, u32::MAX))),
(Version((1, 83, 0)), Version((1, 83, u32::MAX))),
];

pub fn supported_versions_to_string() -> String {
Expand Down

0 comments on commit 9add33b

Please sign in to comment.