Skip to content

Rollup of 7 pull requests #77297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
01f65af
diag: improve closure/generic parameter mismatch
davidtwco Sep 14, 2020
8aae1ee
Move cell exterior test into library unit tests
poliorcetics Sep 7, 2020
f69c5aa
Move more tests using Cell to unit tests
poliorcetics Sep 7, 2020
af44a2a
move 'cell does not clone' test
poliorcetics Sep 8, 2020
fc152cd
move 'test zip ...' tests
poliorcetics Sep 8, 2020
85b2d9b
fmt
poliorcetics Sep 8, 2020
949c966
move format! interface tests
poliorcetics Sep 8, 2020
ed52c7b
Move deref-lval test
poliorcetics Sep 8, 2020
ac39deb
Move panic safety traits tests
poliorcetics Sep 10, 2020
8904921
Move array cycle test
poliorcetics Sep 10, 2020
275eed7
Move vec-slice-drop test
poliorcetics Sep 10, 2020
6bc0357
Move vec-cycle test
poliorcetics Sep 10, 2020
f6a4189
Move vec-cycle-wrapped test
poliorcetics Sep 11, 2020
5be843f
Move format-ref-cell test
poliorcetics Sep 13, 2020
1994cee
Add alias for iterator fold
pickfire Sep 25, 2020
ea0065a
Reposition iterator doc alias reduce before inline
pickfire Sep 25, 2020
a61b963
review: fix nits and move panic safety tests to the correct place
poliorcetics Sep 25, 2020
71bc62b
Add option to pass a custom codegen backend from a driver
bjorn3 Sep 8, 2020
2532a7e
expand: Stop un-interpolating `NtIdent`s before passing them to built…
petrochenkov Sep 27, 2020
3b27799
expand: Minor fn ptr call cleanup
petrochenkov Sep 27, 2020
1ff1431
Add a feature gate for basic function pointer use in `const fn`
ecstatic-morse Sep 24, 2020
3cbd17f
Remove `rustc_allow_const_fn_ptr`
ecstatic-morse Sep 24, 2020
e2622b9
Update tests with new feature gate
ecstatic-morse Sep 24, 2020
54d3329
Bless tests
ecstatic-morse Sep 24, 2020
368502c
Mark `min_const_fn_fn_ptr` test as gate test
ecstatic-morse Sep 24, 2020
807260b
Remove feature gate test for `rustc_allow_const_fn_ptr`
ecstatic-morse Sep 27, 2020
dc8414b
fix building libstd for Miri on macOS
RalfJung Sep 28, 2020
f9dfbb4
Rollup merge of #76454 - poliorcetics:ui-to-unit-test-1, r=matklad
RalfJung Sep 28, 2020
94d13bb
Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
RalfJung Sep 28, 2020
fef6a2d
Rollup merge of #76711 - davidtwco:issue-51154-param-closure, r=estebank
RalfJung Sep 28, 2020
a43ee0c
Rollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obk
RalfJung Sep 28, 2020
29ff334
Rollup merge of #77194 - pickfire:patch-7, r=withoutboats
RalfJung Sep 28, 2020
a9a364f
Rollup merge of #77275 - petrochenkov:interpid, r=varkor
RalfJung Sep 28, 2020
a99fb78
Rollup merge of #77288 - RalfJung:miri-macos, r=Amanieu
RalfJung Sep 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests with new feature gate
  • Loading branch information
ecstatic-morse committed Sep 27, 2020
commit e2622b915a15c06bdedc5e1278f6fb92cdaa03fa
2 changes: 1 addition & 1 deletion src/test/ui/consts/auxiliary/const_fn_lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Crate that exports a const fn. Used for testing cross-crate.

#![feature(const_fn)]
#![feature(const_fn_fn_ptr_basics)]
#![crate_type="rlib"]

pub const fn foo() -> usize { 22 }
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/issue-70804-fn-subtyping.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-pass
#![feature(const_fn)]
#![feature(const_fn_fn_ptr_basics)]

const fn nested(x: (for<'a> fn(&'a ()), String)) -> (fn(&'static ()), String) {
x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const extern fn unsize(x: &[u8; 3]) -> &[u8] { x }
const unsafe extern "C" fn closure() -> fn() { || {} }
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
const unsafe extern fn use_float() { 1.0 + 1.0; }
//~^ ERROR floating point arithmetic
const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/issue-37550.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(dead_code)]
#![allow(unused_variables)]

#![feature(const_fn)]
#![feature(const_fn_fn_ptr_basics)]

const fn x() {
let t = true;
Expand Down
7 changes: 3 additions & 4 deletions src/test/ui/consts/issue-56164.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#![feature(const_fn)]
#![feature(const_fn_fn_ptr_basics)]

const fn foo() { (||{})() }
//~^ ERROR calls in constant functions are limited to constant functions, tuple structs and tuple
// variants
//~^ ERROR calls in constant functions

const fn bad(input: fn()) {
input()
//~^ ERROR function pointers are not allowed in const fn
//~^ ERROR function pointer
}

fn main() {
Expand Down
8 changes: 5 additions & 3 deletions src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#![feature(rustc_attrs, staged_api)]
#![feature(rustc_attrs, staged_api, allow_internal_unstable)]
#![feature(const_fn_fn_ptr_basics)]

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(since="1.0.0", feature = "mep")]
const fn error(_: fn()) {} //~ ERROR function pointers in const fn are unstable
const fn error(_: fn()) {}
//~^ ERROR const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]`

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_allow_const_fn_ptr]
#[rustc_const_stable(since="1.0.0", feature = "mep")]
#[allow_internal_unstable(const_fn_fn_ptr_basics)]
const fn compiles(_: fn()) {}

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

#[stable(feature = "rust1", since = "1.0.0")]
const fn error(_: fn()) {}
//~^ ERROR `rustc_const_stable` or `rustc_const_unstable`
//~| ERROR `rustc_const_stable` or `rustc_const_unstable`
//~| ERROR function pointers

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_allow_const_fn_ptr]
//~^ ERROR internal implementation detail
#[rustc_const_stable(since="1.0.0", feature = "mep")]
const fn compiles(_: fn()) {}
//~^ ERROR function pointers

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// run-pass
#![feature(allow_internal_unstable)]
#![feature(const_fn_fn_ptr_basics)]

#![feature(rustc_attrs, staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_allow_const_fn_ptr]
#[rustc_const_stable(since="1.0.0", feature = "mep")]
#[allow_internal_unstable(const_fn_fn_ptr_basics)]
const fn takes_fn_ptr(_: fn()) {}

const FN: fn() = || ();
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/consts/min_const_fn/cast_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ fn main() {}

const fn unsize(x: &[u8; 3]) -> &[u8] { x }
const fn closure() -> fn() { || {} }
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
const fn closure2() {
(|| {}) as fn();
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
}
const fn reify(f: fn()) -> unsafe fn() { f }
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
const fn reify2() { main as unsafe fn(); }
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
2 changes: 1 addition & 1 deletion src/test/ui/consts/min_const_fn/cmp_fn_pointers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fn cmp(x: fn(), y: fn()) -> bool { //~ ERROR function pointers in const fn are unstable
const fn cmp(x: fn(), y: fn()) -> bool { //~ ERROR function pointer
unsafe { x == y }
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/consts/min_const_fn/min_const_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
//~^ ERROR trait bounds other than `Sized`

const fn no_fn_ptrs(_x: fn()) {}
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
//~^ ERROR function pointers in const fn are unstable
//~^ ERROR function pointer
4 changes: 2 additions & 2 deletions src/test/ui/consts/min_const_fn/min_const_fn_fn_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ fn field() {}
const fn no_inner_dyn_trait(_x: Hide) {}
const fn no_inner_dyn_trait2(x: Hide) {
x.0.field;
//~^ ERROR function pointers in const fn
//~^ ERROR function pointer
}
const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasPtr { field }) }
//~^ ERROR function pointers in const fn
//~^ ERROR function pointer

fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-37550.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fn x() {
let t = true;
let x = || t; //~ ERROR function pointers in const fn are unstable
let x = || t; //~ ERROR function pointer
}

fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-46553.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-pass
#![feature(const_fn)]
#![feature(const_fn_fn_ptr_basics)]
#![deny(const_err)]

pub struct Data<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/type-alias-impl-trait/issue-53096.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// check-pass
#![feature(const_fn)]
#![feature(const_fn, const_fn_fn_ptr_basics)]
#![feature(type_alias_impl_trait)]

type Foo = impl Fn() -> usize;
Expand Down