Skip to content

Commit dec2e11

Browse files
authored
Merge pull request #541 from ehuss/rust-1.89
Update tests for 1.89
2 parents b5774b4 + 42db83e commit dec2e11

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

tests/error-tests/tests/cast-to-unsized-trait-object-suggestion.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
fn main() {
1212
&1 as dyn Send;
1313
// ^^^^^^^^^^^^^^ERR cast to unsized type
14-
// ^^^^^^^^HELP try casting to
15-
// ^^^^^^^^HELP /Accept Replacement:.*&dyn Send/
14+
// ^^^^^^^^HELP(<1.89.0-beta) try casting to
15+
// |HELP(>=1.89.0-beta) consider casting to
16+
// ^^^^^^^^HELP(<1.89.0-beta) /Accept Replacement:.*&dyn Send/
17+
// |HELP(>=1.89.0-beta) /Accept Replacement:.*&/
1618
Box::new(1) as dyn Send;
1719
// ^^^^^^^^^^^^^^^^^^^^^^^ERR cast to unsized type
1820
// ^^^^^^^^HELP(<1.46.0-beta) try casting to a `Box` instead
19-
// ^^^^^^^^HELP(>=1.46.0-beta) you can cast to a `Box` instead
20-
// ^^^^^^^^HELP /Accept Replacement:.*Box<dyn Send>/
21+
// ^^^^^^^^HELP(>=1.46.0-beta,<1.89.0-beta) you can cast to a `Box` instead
22+
// |HELP(>=1.89.0-beta) you can cast to a `Box` instead
23+
// |HELP(>=1.89.0-beta) you can cast to a `Box` instead
24+
// ^^^^^^^^HELP(<1.89.0-beta) /Accept Replacement:.*Box<dyn Send>/
25+
// |HELP(>=1.89.0-beta) /Accept Replacement:.*Box</
26+
// |HELP(>=1.89.0-beta) /Accept Replacement:.*>/
2127
}

tests/test_click_handler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77

88
REPLACEMENT_TESTS = [
9-
('tests/error-tests/tests/cast-to-unsized-trait-object-suggestion.rs', None,
9+
('tests/error-tests/tests/cast-to-unsized-trait-object-suggestion.rs', '>=1.89.0-beta',
1010
# Before
1111
((11, ' &1 as dyn Send;'),
12-
(15, ' Box::new(1) as dyn Send;')),
12+
(17, ' Box::new(1) as dyn Send;')),
1313
# After
1414
((11, ' &1 as &dyn Send;'),
15-
(15, ' Box::new(1) as Box<dyn Send>;')),
15+
(17, ' Box::new(1) as Box<dyn Send;'),
16+
(17, ' Box::new(1) as Box<dyn Send>;'),
17+
),
1618
),
1719
('tests/error-tests/tests/impl-generic-mismatch.rs', '>=1.83.0-beta',
1820
# Before

tests/test_phantom_style.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
class TestPhantomStyle(TestBase):
77

88
def test_style_none(self):
9+
rustc_version = util.get_rustc_version(sublime.active_window(), plugin_path)
10+
if semver.match(rustc_version, '<1.89.0-beta'):
11+
return
912
self._override_setting('rust_phantom_style', 'none')
1013
self._with_open_file('tests/error-tests/tests/cast-to-unsized-trait-object-suggestion.rs',
1114
self._test_style_none)
@@ -20,9 +23,12 @@ def _test_style_none(self, view):
2023
regions = ui.view_regions[view.file_name()]
2124
# Extremely basic check, the number of unique regions displayed.
2225
rs = [(r.a, r.b) for r in regions]
23-
self.assertEqual(len(set(rs)), 4)
26+
self.assertEqual(len(set(rs)), 5)
2427

2528
def test_style_popup(self):
29+
rustc_version = util.get_rustc_version(sublime.active_window(), plugin_path)
30+
if semver.match(rustc_version, '<1.89.0-beta'):
31+
return
2632
self._override_setting('rust_phantom_style', 'popup')
2733
self._with_open_file('tests/error-tests/tests/cast-to-unsized-trait-object-suggestion.rs',
2834
self._test_style_popup)
@@ -37,7 +43,7 @@ def _test_style_popup(self, view):
3743
regions = ui.view_regions[view.file_name()]
3844
# Extremely basic check, the number of unique regions displayed.
3945
rs = [(r.a, r.b) for r in regions]
40-
self.assertEqual(len(set(rs)), 4)
46+
self.assertEqual(len(set(rs)), 5)
4147
# Trigger popup.
4248
self.assertEqual(len(ui.popups), 0)
4349
for region in regions:
@@ -48,7 +54,7 @@ def _test_style_popup(self, view):
4854
ui.popups.clear()
4955

5056
# Trigger gutter hover.
51-
for lineno in (12, 16):
57+
for lineno in (12, 18):
5258
pt = view.text_point(lineno - 1, 0)
5359
messages.message_popup(view, pt, sublime.HOVER_GUTTER)
5460
popups = ui.popups[view.file_name()]

0 commit comments

Comments
 (0)