diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26f83658..f8f67dea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/debugger/breakpoint.rs b/src/debugger/breakpoint.rs index f0b3f1de..02d8e282 100644 --- a/src/debugger/breakpoint.rs +++ b/src/debugger/breakpoint.rs @@ -875,7 +875,7 @@ pub struct BreakpointView<'a> { pub place: Option>, } -impl<'a> From for BreakpointView<'a> { +impl From for BreakpointView<'_> { fn from(brkpt: Breakpoint) -> Self { Self { addr: Address::Relocated(brkpt.addr), @@ -895,7 +895,7 @@ impl<'a> From<&'a Breakpoint> for BreakpointView<'a> { } } -impl<'a> From for BreakpointView<'a> { +impl From for BreakpointView<'_> { fn from(brkpt: UninitBreakpoint) -> Self { Self { addr: brkpt.addr, @@ -922,7 +922,7 @@ pub struct BreakpointViewOwned { pub place: Option, } -impl<'a> BreakpointView<'a> { +impl BreakpointView<'_> { pub fn to_owned(&self) -> BreakpointViewOwned { BreakpointViewOwned { addr: self.addr, diff --git a/src/debugger/debugee/dwarf/eval.rs b/src/debugger/debugee/dwarf/eval.rs index 234f45fe..5c595162 100644 --- a/src/debugger/debugee/dwarf/eval.rs +++ b/src/debugger/debugee/dwarf/eval.rs @@ -358,7 +358,7 @@ pub enum AddressKind { Value, } -impl<'a> CompletedResult<'a> { +impl CompletedResult<'_> { pub fn into_scalar(self, address_kind: AddressKind) -> Result { let (_, bytes) = self.into_raw_bytes(mem::size_of::(), address_kind)?; Ok(scalar_from_bytes(&bytes)) diff --git a/src/debugger/debugee/dwarf/location.rs b/src/debugger/debugee/dwarf/location.rs index 821e5ee7..6b1527e7 100644 --- a/src/debugger/debugee/dwarf/location.rs +++ b/src/debugger/debugee/dwarf/location.rs @@ -7,7 +7,7 @@ use gimli::{Attribute, AttributeValue, Expression}; pub(super) struct Location<'a>(pub(super) &'a Attribute); -impl<'a> Location<'a> { +impl Location<'_> { /// Converts location attribute to a dwarf expression. /// Expect location attribute one of: /// - DW_FORM_exprloc diff --git a/src/debugger/debugee/dwarf/mod.rs b/src/debugger/debugee/dwarf/mod.rs index 3036e833..baa2b013 100644 --- a/src/debugger/debugee/dwarf/mod.rs +++ b/src/debugger/debugee/dwarf/mod.rs @@ -958,13 +958,13 @@ macro_rules! ctx_resolve_unit_call { }}; } -impl<'a, T> Clone for ContextualDieRef<'a, T> { +impl Clone for ContextualDieRef<'_, T> { fn clone(&self) -> Self { *self } } -impl<'a, T> Copy for ContextualDieRef<'a, T> {} +impl Copy for ContextualDieRef<'_, T> {} impl<'a, T> ContextualDieRef<'a, T> { pub fn namespaces(&self) -> NamespaceHierarchy { @@ -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); @@ -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 { @@ -1205,7 +1205,7 @@ impl<'ctx> ContextualDieRef<'ctx, ParameterDie> { } } -impl<'ctx, D: AsAllocatedData> ContextualDieRef<'ctx, D> { +impl ContextualDieRef<'_, D> { pub fn r#type(&self) -> Option { let parser = r#type::TypeParser::new(); Some(parser.parse(*self, self.die.type_ref()?)) diff --git a/src/debugger/debugee/dwarf/type.rs b/src/debugger/debugee/dwarf/type.rs index d339409c..06360787 100644 --- a/src/debugger/debugee/dwarf/type.rs +++ b/src/debugger/debugee/dwarf/type.rs @@ -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 { self.evaluator.unit().rustc_version() } diff --git a/src/debugger/debugee/dwarf/unit/mod.rs b/src/debugger/debugee/dwarf/unit/mod.rs index 01ede44a..cbeb1ab9 100644 --- a/src/debugger/debugee/dwarf/unit/mod.rs +++ b/src/debugger/debugee/dwarf/unit/mod.rs @@ -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: {}", @@ -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 @@ -814,7 +814,7 @@ impl Unit { pub fn evaluator<'this>( &'this self, debugee: &'this Debugee, - ) -> UnitResult { + ) -> UnitResult> { match self.lazy_part.get() { None => UnitResult::Reload, Some(_) => UnitResult::Ok(ExpressionEvaluator::new(self, self.encoding(), debugee)), diff --git a/src/debugger/debugee/dwarf/unwind.rs b/src/debugger/debugee/dwarf/unwind.rs index 6ce9aff9..cbe17a8c 100644 --- a/src/debugger/debugee/dwarf/unwind.rs +++ b/src/debugger/debugee/dwarf/unwind.rs @@ -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 } } diff --git a/src/debugger/variable/render.rs b/src/debugger/variable/render.rs index 0531072c..4f8939aa 100644 --- a/src/debugger/variable/render.rs +++ b/src/debugger/variable/render.rs @@ -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(), diff --git a/src/debugger/variable/specialization/btree.rs b/src/debugger/variable/specialization/btree.rs index 879a4898..355d9d17 100644 --- a/src/debugger/variable/specialization/btree.rs +++ b/src/debugger/variable/specialization/btree.rs @@ -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; diff --git a/src/debugger/watchpoint.rs b/src/debugger/watchpoint.rs index d8737d2e..52864f48 100644 --- a/src/debugger/watchpoint.rs +++ b/src/debugger/watchpoint.rs @@ -517,7 +517,7 @@ impl<'a> From<&'a Watchpoint> for WatchpointView<'a> { } } -impl<'a> From for WatchpointView<'a> { +impl From for WatchpointView<'_> { fn from(mut wp: Watchpoint) -> Self { Self { number: wp.number, @@ -534,7 +534,7 @@ impl<'a> From for WatchpointView<'a> { } } -impl<'a> WatchpointView<'a> { +impl WatchpointView<'_> { pub fn to_owned(&self) -> WatchpointViewOwned { WatchpointViewOwned { number: self.number, diff --git a/src/ui/console/editor.rs b/src/ui/console/editor.rs index 335979e4..ad87ec3e 100644 --- a/src/ui/console/editor.rs +++ b/src/ui/console/editor.rs @@ -160,7 +160,7 @@ enum CompletableCommand<'a> { } impl<'a> CompletableCommand<'a> { - fn recognize(line: &'a str) -> Option { + fn recognize(line: &'a str) -> Option> { let op = just::<_, _, extra::Default>; let bp = op(BREAK_COMMAND) diff --git a/src/ui/console/file.rs b/src/ui/console/file.rs index 1bc4fa69..6d80df02 100644 --- a/src/ui/console/file.rs +++ b/src/ui/console/file.rs @@ -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) } diff --git a/src/ui/syntax.rs b/src/ui/syntax.rs index cbcab3db..933f471d 100644 --- a/src/ui/syntax.rs +++ b/src/ui/syntax.rs @@ -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> { match &mut self.highlighter { diff --git a/src/version.rs b/src/version.rs index 38bbfcd8..1e46489a 100644 --- a/src/version.rs +++ b/src/version.rs @@ -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 {