Skip to content

Commit

Permalink
Update for 1.37
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jun 1, 2019
1 parent 2aa11dc commit 3738d43
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
// except according to those terms.

fn main() {
&1 as Send;
// ^^^^^^^^^^ERR cast to unsized type
// ^^^^HELP try casting to
// ^^^^HELP /Accept Replacement:.*&Send/
Box::new(1) as Send;
// ^^^^^^^^^^^^^^^^^^^ERR cast to unsized type
// ^^^^HELP try casting to a `Box` instead
// ^^^^HELP /Accept Replacement:.*Box<Send>/
&1 as dyn Send;
// ^^^^^^^^^^^^^^ERR cast to unsized type
// ^^^^^^^^HELP try casting to
// ^^^^^^^^HELP /Accept Replacement:.*&dyn Send/
Box::new(1) as dyn Send;
// ^^^^^^^^^^^^^^^^^^^^^^^ERR cast to unsized type
// ^^^^^^^^HELP try casting to a `Box` instead
// ^^^^^^^^HELP /Accept Replacement:.*Box<dyn Send>/
}
2 changes: 1 addition & 1 deletion tests/message-order/tests/test_all_levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ fn f2</*WARN 2,1 "tests/test_all_levels.rs:4" " --> tests/test_all_levels.rs:4:8
pub fn f() {
let x = Box::new(0u32);
// This is an error with a note and help.
let y: &Trait = /*ERR 1,2 "tests/test_all_levels.rs:9" " --> tests/test_all_levels.rs:9:98"*/x;
let y: &dyn Trait = /*ERR 1,2 "tests/test_all_levels.rs:9" " --> tests/test_all_levels.rs:9:103"*/x;
}
8 changes: 4 additions & 4 deletions tests/test_click_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
REPLACEMENT_TESTS = [
('tests/error-tests/tests/cast-to-unsized-trait-object-suggestion.rs', None,
# Before
((11, ' &1 as Send;'),
(15, ' Box::new(1) as Send;')),
((11, ' &1 as dyn Send;'),
(15, ' Box::new(1) as dyn Send;')),
# After
((11, ' &1 as &Send;'),
(15, ' Box::new(1) as Box<Send>;')),
((11, ' &1 as &dyn Send;'),
(15, ' Box::new(1) as Box<dyn Send>;')),
),
('tests/error-tests/tests/impl-generic-mismatch.rs', '>=1.28.0-beta',
# Before
Expand Down
20 changes: 10 additions & 10 deletions tests/workspace/workspace2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ trait Trait {}

pub fn f() {
let x = Box::new(0u32);
let y: &Trait = x;
// ^ERR(<1.29.0-beta) expected &Trait, found
// ^ERR(>=1.29.0-beta) expected &dyn Trait, found
// ^ERR mismatched types
// ^NOTE(<1.29.0-beta) expected type `&Trait`
// ^NOTE(>=1.29.0-beta) expected type `&dyn Trait`
// ^NOTE(<1.16.0) found type
// ^HELP(>=1.18.0,<1.24.0) try with `&x`
// ^HELP(>=1.24.0-beta) consider borrowing here
// ^HELP(>=1.24.0-beta) &x
let y: &dyn Trait = x;
// ^ERR(<1.29.0-beta) expected &Trait, found
// ^ERR(>=1.29.0-beta) expected &dyn Trait, found
// ^ERR mismatched types
// ^NOTE(<1.29.0-beta) expected type `&Trait`
// ^NOTE(>=1.29.0-beta) expected type `&dyn Trait`
// ^NOTE(<1.16.0) found type
// ^HELP(>=1.18.0,<1.24.0) try with `&x`
// ^HELP(>=1.24.0-beta) consider borrowing here
// ^HELP(>=1.24.0-beta) &x
}

0 comments on commit 3738d43

Please sign in to comment.