1 // Check that E0161 is a hard error in all possible configurations that might
4 // revisions: migrate nll zflags edition migrateul nllul zflagsul editionul
5 //[zflags]compile-flags: -Z borrowck=migrate
6 //[edition]edition:2018
7 //[zflagsul]compile-flags: -Z borrowck=migrate
8 //[editionul]edition:2018
9 //[migrateul] check-pass
11 //[zflagsul] check-pass
12 //[editionul] check-pass
14 // Since we are testing nll (and migration) explicitly as a separate
15 // revisions, don't worry about the --compare-mode=nll on this test.
17 // ignore-compare-mode-nll
19 #![allow(incomplete_features)]
20 #![cfg_attr(nll, feature(nll))]
21 #![cfg_attr(nllul, feature(nll))]
22 #![cfg_attr(migrateul, feature(unsized_locals))]
23 #![cfg_attr(zflagsul, feature(unsized_locals))]
24 #![cfg_attr(nllul, feature(unsized_locals))]
25 #![cfg_attr(editionul, feature(unsized_locals))]
31 fn foo(x: Box<dyn Bar>) {
33 //[migrate,nll,zflags,edition]~^ ERROR E0161