]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsized/unsized-fn-param.rs
Auto merge of #107618 - chriswailes:linker-arg, r=albertlarsan68
[rust.git] / tests / ui / unsized / unsized-fn-param.rs
1 use std::convert::AsRef;
2 use std::path::Path;
3
4 fn foo11(_bar: &dyn AsRef<Path>, _baz: &str) {}
5 fn foo12(_bar: &str, _baz: &dyn AsRef<Path>) {}
6
7 fn foo21(_bar: &dyn AsRef<str>, _baz: &str) {}
8 fn foo22(_bar: &str, _baz: &dyn AsRef<str>) {}
9
10 fn main() {
11     foo11("bar", &"baz"); //~ ERROR the size for values of type
12     foo11(&"bar", &"baz");
13     foo12(&"bar", "baz"); //~ ERROR the size for values of type
14     foo12(&"bar", &"baz");
15
16     foo21("bar", &"baz"); //~ ERROR the size for values of type
17     foo21(&"bar", &"baz");
18     foo22(&"bar", "baz"); //~ ERROR the size for values of type
19     foo22(&"bar", &"baz");
20 }