Skip to content

Commit d27e55c

Browse files
committed
Stabilize FnOnce::Output + Fix rebase
1 parent 390b639 commit d27e55c

File tree

5 files changed

+3
-8
lines changed

5 files changed

+3
-8
lines changed

src/libcore/ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
19291929
#[fundamental] // so that regex can rely that `&str: !FnMut`
19301930
pub trait FnOnce<Args> {
19311931
/// The returned type after the call operator is used.
1932-
#[unstable(feature = "fn_traits", issue = "29625")]
1932+
#[stable(feature = "fn_once_output", since = "1.12.0")]
19331933
type Output;
19341934

19351935
/// This is called when the call operator is used.

src/librustc_resolve/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,7 @@ impl<'a> Resolver<'a> {
22872287
.and_then(|resolution| {
22882288
let always_binding = !pat_src.is_refutable() || opt_pat.is_some() ||
22892289
bmode != BindingMode::ByValue(Mutability::Immutable);
2290-
match def {
2290+
match resolution.base_def {
22912291
Def::Struct(..) | Def::Variant(..) |
22922292
Def::Const(..) | Def::AssociatedConst(..) if !always_binding => {
22932293
// A constant, unit variant, etc pattern.
@@ -2296,12 +2296,11 @@ impl<'a> Resolver<'a> {
22962296
Def::Struct(..) | Def::Variant(..) |
22972297
Def::Const(..) | Def::AssociatedConst(..) | Def::Static(..) => {
22982298
// A fresh binding that shadows something unacceptable.
2299-
let kind_name = PathResolution::new(def).kind_name();
23002299
resolve_error(
23012300
self,
23022301
ident.span,
23032302
ResolutionError::BindingShadowsSomethingUnacceptable(
2304-
pat_src.descr(), kind_name, ident.node.name)
2303+
pat_src.descr(), resolution.kind_name(), ident.node.name)
23052304
);
23062305
None
23072306
}

src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(fn_traits)]
1211
#![feature(unboxed_closures)]
1312
#![feature(rustc_attrs)]
1413

src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
// revisions: ok oneuse transmute krisskross
2020

21-
#![feature(fn_traits)]
2221
#![allow(dead_code, unused_variables)]
2322

2423
use std::marker::PhantomData;

src/test/run-pass/issue-28550.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(fn_traits)]
12-
1311
struct A<F: FnOnce()->T,T>(F::Output);
1412
struct B<F: FnOnce()->T,T>(A<F,T>);
1513

0 commit comments

Comments
 (0)