diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 87dc8a1ee5..b9adb624c4 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -3147,6 +3147,15 @@ class DevtoolIdeSdkTests(DevtoolBase):
                     return lineno
         self.fail("Could not find marker %r in %s" % (marker, source_path))
 
+    def _insert_source_line_shift(self, source_path, marker, line_count):
+        with open(source_path) as source_handle:
+            source = source_handle.read()
+        self.assertEqual(source.count(marker), 1)
+        inserted_lines = ''.join(
+            '    // line shift %d\n' % index for index in range(line_count))
+        with open(source_path, 'w') as source_handle:
+            source_handle.write(source.replace(marker, inserted_lines + marker, 1))
+
     def _find_multi_script_port(self, recipe_name, script_prefix, example_exe):
         """Discover the port assigned to a generated 'multi' mode debug-server
         script (gdbserver_*/lldb_server_*), since each --ide plugin allocates
@@ -4511,6 +4520,28 @@ class DevtoolIdeSdkRustTests(DevtoolIdeSdkTests):
                 'Repeated ide-sdk runs must preserve the Cargo source remap')
             self._verify_rust_lldb_debugging(tempdir, expected_input=4)
 
+            main_rs = os.path.join(tempdir, 'src', 'main.rs')
+            self._insert_source_line_shift(main_rs, '    match n {', 4)
+            with open(main_rs) as source_file:
+                shifted_source = source_file.read()
+            self.assertEqual(shifted_source.count('fibonacci(4)'), 1)
+            with open(main_rs, 'w') as source_file:
+                source_file.write(
+                    shifted_source.replace('fibonacci(4)', 'fibonacci(5)', 1))
+
+            with open(os.path.join(tempdir, '.vscode', 'tasks.json')) as tasks_file:
+                tasks = json.load(tasks_file)['tasks']
+            install_task = next(
+                task for task in tasks
+                if task['label'].startswith('install && deploy-target '))
+            task_results = self._run_vscode_task_with_dependencies(
+                tempdir, install_task['label'])
+            self.assertTrue(
+                any('Compiling cargo-example' in result.output
+                    for result in task_results),
+                'Cargo build task did not recompile the modified Rust source')
+            self._verify_rust_lldb_debugging(tempdir, expected_input=5)
+
     def _verify_rust_lldb_debugging(self, tempdir, expected_input):
         with open(os.path.join(tempdir, '.vscode', 'launch.json')) as launch_file:
             launch = json.load(launch_file)['configurations'][0]
