Skip to content

Commit abf037a

Browse files
committed
sized-borrowed-pointer
1 parent 579b5f1 commit abf037a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
//! Check that a reference to a potentially unsized type (`&T`) is itself considered `Sized`.
2+
//! This allows functions requiring `Sized` types to accept references to dynamically sized types.
3+
14
//@ run-pass
25

36
#![allow(dead_code)]
4-
// Possibly-dynamic size of typaram should be cleared at pointer boundary.
5-
67

7-
fn bar<T: Sized>() { }
8-
fn foo<T>() { bar::<&T>() }
9-
pub fn main() { }
8+
fn bar<T: Sized>() {}
9+
fn foo<T>() {
10+
bar::<&T>()
11+
}
12+
pub fn main() {}

0 commit comments

Comments
 (0)