]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #49826 - cuviper:rustc-main-ICE, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 28 Apr 2018 06:26:46 +0000 (06:26 +0000)
committerbors <bors@rust-lang.org>
Sat, 28 Apr 2018 06:26:46 +0000 (06:26 +0000)
rustc_driver: Catch ICEs on the main thread too

#48575 introduced an optimization to run rustc directly on the main thread when possible.  However, the threaded code detects panics when they `join()` to report as an ICE.  When running directly, we need to use `panic::catch_unwind` to get the same effect.

cc @ishitatsuyuki
r? @alexcrichton

81 files changed:
src/Cargo.lock
src/liballoc/boxed.rs
src/libcore/ops/arith.rs
src/libcore/ops/bit.rs
src/libcore/ops/deref.rs
src/libcore/ptr.rs
src/libproc_macro/lib.rs
src/librustc/hir/check_attr.rs
src/librustc/hir/lowering.rs
src/librustc/lib.rs
src/librustc/traits/error_reporting.rs
src/librustc_lint/unused.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/lib.rs
src/librustc_trans/allocator.rs
src/librustc_trans/back/linker.rs
src/librustc_typeck/lib.rs
src/librustdoc/html/layout.rs
src/librustdoc/lib.rs
src/libsyntax/feature_gate.rs
src/libsyntax_pos/hygiene.rs
src/libsyntax_pos/lib.rs
src/test/compile-fail/attr-usage-inline.rs
src/test/compile-fail/impl-trait/where-allowed.rs
src/test/compile-fail/issue-31769.rs
src/test/compile-fail/issue-43988.rs
src/test/compile-fail/mir_check_cast_unsize.rs
src/test/compile-fail/trait-bounds-not-on-struct.rs
src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
src/test/run-pass/dyn-trait.rs
src/test/run-pass/issue-47703-tuple.rs [new file with mode: 0644]
src/test/run-pass/issue-49632.rs [new file with mode: 0644]
src/test/run-pass/nll/issue-48623-closure.rs [new file with mode: 0644]
src/test/run-pass/nll/issue-48623-generator.rs [new file with mode: 0644]
src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
src/test/ui/error-codes/E0518.stderr
src/test/ui/feature-gate-dyn-trait.rs [deleted file]
src/test/ui/feature-gate-dyn-trait.stderr [deleted file]
src/test/ui/feature-gate/issue-43106-gating-of-inline.rs
src/test/ui/feature-gate/issue-43106-gating-of-inline.stderr
src/test/ui/generator/yield-while-iterating.nll.stderr
src/test/ui/impl_trait_projections.rs
src/test/ui/impl_trait_projections.stderr
src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr
src/test/ui/in-band-lifetimes/impl/dyn-trait.rs
src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr
src/test/ui/lint/must-use-ops.rs [new file with mode: 0644]
src/test/ui/lint/must-use-ops.stderr [new file with mode: 0644]
src/test/ui/mismatched_types/closure-arg-count.rs
src/test/ui/mismatched_types/closure-arg-count.stderr
src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs
src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
src/test/ui/nll/ty-outlives/projection-no-regions-fn.rs
src/test/ui/nll/ty-outlives/projection-no-regions-fn.stderr
src/test/ui/nll/ty-outlives/projection-one-region-closure.rs
src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.rs
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.rs
src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs
src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.rs
src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs
src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.rs
src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.rs
src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.stderr
src/test/ui/nll/ty-outlives/ty-param-fn-body.rs
src/test/ui/nll/ty-outlives/ty-param-fn-body.stderr
src/test/ui/nll/ty-outlives/ty-param-fn.rs
src/test/ui/nll/ty-outlives/ty-param-fn.stderr
src/test/ui/raw-literal-keywords.rs
src/test/ui/raw-literal-keywords.stderr
src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.rs
src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
src/test/ui/underscore-lifetime/dyn-trait-underscore.rs
src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr

index e14b9da971301eca0970d7349056e20971321228..a6f78a7e6b442a5b5a565802767e2a59c8989471 100644 (file)
@@ -1325,16 +1325,16 @@ dependencies = [
 
 [[package]]
 name = "parking_lot"
-version = "0.5.4"
+version = "0.5.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "parking_lot_core"
-version = "0.2.13"
+version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1755,8 +1755,8 @@ dependencies = [
  "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ena 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-ap-serialize 110.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1896,8 +1896,8 @@ dependencies = [
  "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ena 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc_cratesio_shim 0.0.0",
  "serialize 0.0.0",
  "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3096,8 +3096,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum openssl-sys 0.9.28 (registry+https://github.com/rust-lang/crates.io-index)" = "0bbd90640b148b46305c1691eed6039b5c8509bed16991e3562a01eeb76902a3"
 "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063"
 "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
-"checksum parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd9d732f2de194336fb02fe11f9eed13d9e76f13f4315b4d88a14ca411750cd"
-"checksum parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "538ef00b7317875071d5e00f603f24d16f0b474c1a5fc0ccb8b454ca72eafa79"
+"checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac"
+"checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa"
 "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
 "checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc"
 "checksum pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab94faafeb93f4c5e3ce81ca0e5a779529a602ad5d09ae6d21996bfb8b6a52bf"
index 5ebd2cc6146371febfa208b013699eadee9e963a..1b4f86dcfac1c07174e3efc4c8217b7824435a68 100644 (file)
@@ -184,6 +184,7 @@ pub fn into_raw_non_null(b: Box<T>) -> NonNull<T> {
 
     #[unstable(feature = "ptr_internals", issue = "0", reason = "use into_raw_non_null instead")]
     #[inline]
+    #[doc(hidden)]
     pub fn into_unique(b: Box<T>) -> Unique<T> {
         let unique = b.0;
         mem::forget(b);
index a1f6030428f1ef073b7d95d8fe4fa9ca37e01291..a1bc5463f7333dfa114105b2a6489ff2e28e220e 100644 (file)
@@ -94,6 +94,7 @@ pub trait Add<RHS=Self> {
     type Output;
 
     /// Performs the `+` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn add(self, rhs: RHS) -> Self::Output;
 }
@@ -191,6 +192,7 @@ pub trait Sub<RHS=Self> {
     type Output;
 
     /// Performs the `-` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn sub(self, rhs: RHS) -> Self::Output;
 }
@@ -310,6 +312,7 @@ pub trait Mul<RHS=Self> {
     type Output;
 
     /// Performs the `*` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn mul(self, rhs: RHS) -> Self::Output;
 }
@@ -433,6 +436,7 @@ pub trait Div<RHS=Self> {
     type Output;
 
     /// Performs the `/` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn div(self, rhs: RHS) -> Self::Output;
 }
@@ -517,6 +521,7 @@ pub trait Rem<RHS=Self> {
     type Output = Self;
 
     /// Performs the `%` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn rem(self, rhs: RHS) -> Self::Output;
 }
@@ -601,6 +606,7 @@ pub trait Neg {
     type Output;
 
     /// Performs the unary `-` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn neg(self) -> Self::Output;
 }
index 02b6f62db6eb109d52bd6a8e9cba4aa2470c357b..3900f365b0ab197364bb2f3c47b190c9b8507d82 100644 (file)
@@ -46,6 +46,7 @@ pub trait Not {
     type Output;
 
     /// Performs the unary `!` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn not(self) -> Self::Output;
 }
@@ -129,6 +130,7 @@ pub trait BitAnd<RHS=Self> {
     type Output;
 
     /// Performs the `&` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn bitand(self, rhs: RHS) -> Self::Output;
 }
@@ -212,6 +214,7 @@ pub trait BitOr<RHS=Self> {
     type Output;
 
     /// Performs the `|` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn bitor(self, rhs: RHS) -> Self::Output;
 }
@@ -298,6 +301,7 @@ pub trait BitXor<RHS=Self> {
     type Output;
 
     /// Performs the `^` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn bitxor(self, rhs: RHS) -> Self::Output;
 }
@@ -385,6 +389,7 @@ pub trait Shl<RHS=Self> {
     type Output;
 
     /// Performs the `<<` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn shl(self, rhs: RHS) -> Self::Output;
 }
@@ -493,6 +498,7 @@ pub trait Shr<RHS=Self> {
     type Output;
 
     /// Performs the `>>` operation.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn shr(self, rhs: RHS) -> Self::Output;
 }
index 332d154170f4da6346696871c894c58292329c7a..54eecc82e19ef4325e52ed7ec39b207f153313e1 100644 (file)
@@ -77,6 +77,7 @@ pub trait Deref {
     type Target: ?Sized;
 
     /// Dereferences the value.
+    #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     fn deref(&self) -> &Self::Target;
 }
index 74bb264cc679cc31c310cefade5b196cbd6881b8..c61bdfc9c4f37b1a2c7b501bf85fae2202c50c7a 100644 (file)
@@ -2513,6 +2513,7 @@ fn ge(&self, other: &*mut T) -> bool { *self >= *other }
            reason = "use NonNull instead and consider PhantomData<T> \
                      (if you also use #[may_dangle]), Send, and/or Sync")]
 #[allow(deprecated)]
+#[doc(hidden)]
 pub struct Unique<T: ?Sized> {
     pointer: NonZero<*const T>,
     // NOTE: this marker has no consequences for variance, but is necessary
index e171216523a1e3a6dd1ea35bf6c06d20868045d8..f51dbc3772f06ee1c3302304fe69f802b653c2e3 100644 (file)
@@ -270,7 +270,7 @@ pub fn source_file(&self) -> SourceFile {
     /// `self` was generated from, if any.
     #[unstable(feature = "proc_macro", issue = "38356")]
     pub fn parent(&self) -> Option<Span> {
-        self.0.ctxt().outer().expn_info().map(|i| Span(i.call_site))
+        self.0.parent().map(Span)
     }
 
     /// The span for the origin source code that `self` was generated from. If
index 956cd17f38f214cd91f47550641f74cdb667742a..19f8d15662d84f7a0c93862e7d7becb2e3b76eb2 100644 (file)
@@ -30,6 +30,7 @@ enum Target {
     ForeignMod,
     Expression,
     Statement,
+    Closure,
     Other,
 }
 
@@ -103,14 +104,14 @@ fn check_attributes(&self, item: &hir::Item, target: Target) {
         self.check_repr(item, target);
     }
 
-    /// Check if an `#[inline]` is applied to a function.
+    /// Check if an `#[inline]` is applied to a function or a closure.
     fn check_inline(&self, attr: &hir::Attribute, span: &Span, target: Target) {
-        if target != Target::Fn {
+        if target != Target::Fn && target != Target::Closure {
             struct_span_err!(self.tcx.sess,
                              attr.span,
                              E0518,
-                             "attribute should be applied to function")
-                .span_label(*span, "not a function")
+                             "attribute should be applied to function or closure")
+                .span_label(*span, "not a function or closure")
                 .emit();
         }
     }
@@ -286,9 +287,13 @@ fn check_stmt_attributes(&self, stmt: &hir::Stmt) {
     }
 
     fn check_expr_attributes(&self, expr: &hir::Expr) {
+        let target = match expr.node {
+            hir::ExprClosure(..) => Target::Closure,
+            _ => Target::Expression,
+        };
         for attr in expr.attrs.iter() {
             if attr.check_name("inline") {
-                self.check_inline(attr, &expr.span, Target::Expression);
+                self.check_inline(attr, &expr.span, target);
             }
             if attr.check_name("repr") {
                 self.emit_repr_error(
index f5d590f25c80f19e2167ccd8f8cd77be326393bb..e4b9fc1385d4070904d0f850aa0068d27f9fee35 100644 (file)
@@ -4107,15 +4107,13 @@ fn new_implicit_lifetime(&mut self, span: Span) -> hir::Lifetime {
     }
 
     fn maybe_lint_bare_trait(&self, span: Span, id: NodeId, is_global: bool) {
-        if self.sess.features_untracked().dyn_trait {
-            self.sess.buffer_lint_with_diagnostic(
-                builtin::BARE_TRAIT_OBJECT,
-                id,
-                span,
-                "trait objects without an explicit `dyn` are deprecated",
-                builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global),
-            )
-        }
+        self.sess.buffer_lint_with_diagnostic(
+            builtin::BARE_TRAIT_OBJECT,
+            id,
+            span,
+            "trait objects without an explicit `dyn` are deprecated",
+            builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global),
+        )
     }
 
     fn wrap_in_try_constructor(
index c2b1d7f09149e2c8a3dec39a4b2c3edb30237cb8..24892dfcc8f7d63d034b3dd15635990708235136 100644 (file)
@@ -45,8 +45,8 @@
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(drain_filter)]
-#![feature(dyn_trait)]
 #![feature(entry_or_default)]
+#![cfg_attr(stage0, feature(dyn_trait))]
 #![feature(from_ref)]
 #![feature(fs_read_write)]
 #![cfg_attr(windows, feature(libc))]
index 285d530a38a69cab5e6eda57c2f29f9f5470d651..047d4bb893096103d38a4f6c3a6af6132ea3133d 100644 (file)
@@ -979,6 +979,12 @@ pub fn get_fn_like_arguments(&self, node: hir::map::Node) -> (Span, Vec<ArgKind>
                      ArgKind::Arg(format!("{}", field.name), "_".to_string())
                  }).collect::<Vec<_>>())
             }
+            hir::map::NodeStructCtor(ref variant_data) => {
+                (self.tcx.sess.codemap().def_span(self.tcx.hir.span(variant_data.id())),
+                 variant_data.fields()
+                    .iter().map(|_| ArgKind::Arg("_".to_owned(), "_".to_owned()))
+                    .collect())
+            }
             _ => panic!("non-FnLike node found: {:?}", node),
         }
     }
index bf86f6a69522f07492094c0fc81f28fee8646931..5ec8305de788c3ecb4fa4fa84ca4a05b6466c47c 100644 (file)
@@ -91,23 +91,35 @@ fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
                 let def_id = def.def_id();
                 fn_warned = check_must_use(cx, def_id, s.span, "return value of ");
             }
-
-            if let hir::ExprBinary(bin_op, ..) = expr.node {
-                match bin_op.node {
-                    // Hardcoding the comparison operators here seemed more
-                    // expedient than the refactoring that would be needed to
-                    // look up the `#[must_use]` attribute which does exist on
-                    // the comparison trait methods
-                    hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe | hir::BiGt => {
-                        let msg = "unused comparison which must be used";
-                        cx.span_lint(UNUSED_MUST_USE, expr.span, msg);
-                        op_warned = true;
-                    },
-                    _ => {},
-                }
+            let must_use_op = match expr.node {
+                // Hardcoding operators here seemed more expedient than the
+                // refactoring that would be needed to look up the `#[must_use]`
+                // attribute which does exist on the comparison trait methods
+                hir::ExprBinary(bin_op, ..)  => {
+                    match bin_op.node {
+                        hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe | hir::BiGt => {
+                            Some("comparison")
+                        },
+                        hir::BiAdd | hir::BiSub | hir::BiDiv | hir::BiMul | hir::BiRem => {
+                            Some("arithmetic operation")
+                        },
+                        hir::BiAnd | hir::BiOr => {
+                            Some("logical operation")
+                        },
+                        hir::BiBitXor | hir::BiBitAnd | hir::BiBitOr | hir::BiShl | hir::BiShr => {
+                            Some("bitwise operation")
+                        },
+                    }
+                },
+                hir::ExprUnary(..) => Some("unary operation"),
+                _ => None
+            };
+            if let Some(must_use_op) = must_use_op {
+                cx.span_lint(UNUSED_MUST_USE, expr.span,
+                    &format!("unused {} which must be used", must_use_op));
+                op_warned = true;
             }
         }
-
         if !(ty_warned || fn_warned || op_warned) {
             cx.span_lint(UNUSED_RESULTS, s.span, "unused result");
         }
index 4dd8d245d3beaff1474d47f0d4961202c40b5dbe..5c7061abbb6608b9104401710d0dd04c113d286c 100644 (file)
@@ -20,7 +20,7 @@
 use rustc::mir::{AssertMessage, BasicBlock, BorrowKind, Location, Place};
 use rustc::mir::{Mir, Mutability, Operand, Projection, ProjectionElem, Rvalue};
 use rustc::mir::{Field, Statement, StatementKind, Terminator, TerminatorKind};
-use rustc::mir::ClosureRegionRequirements;
+use rustc::mir::{ClosureRegionRequirements, Local};
 
 use rustc_data_structures::control_flow_graph::dominators::Dominators;
 use rustc_data_structures::fx::FxHashSet;
@@ -729,6 +729,17 @@ fn visit_terminator_drop(
         erased_drop_place_ty: ty::Ty<'gcx>,
         span: Span,
     ) {
+        let gcx = self.tcx.global_tcx();
+        let drop_field = |
+            mir: &mut MirBorrowckCtxt<'cx, 'gcx, 'tcx>,
+            (index, field): (usize, ty::Ty<'gcx>),
+        | {
+            let field_ty = gcx.normalize_erasing_regions(mir.param_env, field);
+            let place = drop_place.clone().field(Field::new(index), field_ty);
+
+            mir.visit_terminator_drop(loc, term, flow_state, &place, field_ty, span);
+        };
+
         match erased_drop_place_ty.sty {
             // When a struct is being dropped, we need to check
             // whether it has a destructor, if it does, then we can
@@ -737,14 +748,24 @@ fn visit_terminator_drop(
             // destructor but `bar` does not, we will only check for
             // borrows of `x.foo` and not `x.bar`. See #47703.
             ty::TyAdt(def, substs) if def.is_struct() && !def.has_dtor(self.tcx) => {
-                for (index, field) in def.all_fields().enumerate() {
-                    let gcx = self.tcx.global_tcx();
-                    let field_ty = field.ty(gcx, substs);
-                    let field_ty = gcx.normalize_erasing_regions(self.param_env, field_ty);
-                    let place = drop_place.clone().field(Field::new(index), field_ty);
-
-                    self.visit_terminator_drop(loc, term, flow_state, &place, field_ty, span);
-                }
+                def.all_fields()
+                    .map(|field| field.ty(gcx, substs))
+                    .enumerate()
+                    .for_each(|field| drop_field(self, field));
+            }
+            // Same as above, but for tuples.
+            ty::TyTuple(tys) => {
+                tys.iter().cloned().enumerate()
+                    .for_each(|field| drop_field(self, field));
+            }
+            // Closures and generators also have disjoint fields, but they are only
+            // directly accessed in the body of the closure/generator.
+            ty::TyClosure(def, substs)
+            | ty::TyGenerator(def, substs, ..)
+                if *drop_place == Place::Local(Local::new(1)) && !self.mir.upvar_decls.is_empty()
+            => {
+                substs.upvar_tys(def, self.tcx).enumerate()
+                    .for_each(|field| drop_field(self, field));
             }
             _ => {
                 // We have now refined the type of the value being
@@ -752,7 +773,6 @@ fn visit_terminator_drop(
                 // subfield; so check whether that field's type still
                 // "needs drop". If so, we assume that the destructor
                 // may access any data it likes (i.e., a Deep Write).
-                let gcx = self.tcx.global_tcx();
                 if erased_drop_place_ty.needs_drop(gcx, self.param_env) {
                     self.access_place(
                         ContextKind::Drop.new(loc),
index 399892522a3531ebe9c61ce9bce31eeb937e3692..75b7a10097df4e0b5ac9f544b33134f067227b90 100644 (file)
@@ -24,7 +24,7 @@
 #![feature(const_fn)]
 #![feature(core_intrinsics)]
 #![feature(decl_macro)]
-#![feature(dyn_trait)]
+#![cfg_attr(stage0, feature(dyn_trait))]
 #![feature(fs_read_write)]
 #![feature(macro_vis_matcher)]
 #![feature(exhaustive_patterns)]
index ffebb959ebfde494abdd58d680e008da35f76f18..871fe98ec01879612afa2b7830f558ffaa05c3a8 100644 (file)
@@ -11,6 +11,7 @@
 use std::ffi::CString;
 use std::ptr;
 
+use attributes;
 use libc::c_uint;
 use rustc::middle::allocator::AllocatorKind;
 use rustc::ty::TyCtxt;
@@ -67,6 +68,9 @@ pub(crate) unsafe fn trans(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind)
         if tcx.sess.target.target.options.default_hidden_visibility {
             llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
         }
+       if tcx.sess.target.target.options.requires_uwtable {
+           attributes::emit_uwtable(llfn, true);
+       }
 
         let callee = CString::new(kind.fn_name(method.name)).unwrap();
         let callee = llvm::LLVMRustGetOrInsertFunction(llmod,
index f9a8473464db7f6f3269bc05ef77fc2d234efd03..ea3f5b408604ee8f4afa1698589bc3f1b51bcac9 100644 (file)
@@ -959,7 +959,11 @@ fn no_position_independent_executable(&mut self) {
     }
 
     fn finalize(&mut self) -> Command {
-        self.cmd.arg("--threads");
+        // There have been reports in the wild (rustwasm/wasm-bindgen#119) of
+        // using threads causing weird hangs and bugs. Disable it entirely as
+        // this isn't yet the bottleneck of compilation at all anyway.
+        self.cmd.arg("--no-threads");
+
         self.cmd.arg("-z").arg("stack-size=1048576");
 
         // FIXME we probably shouldn't pass this but instead pass an explicit
index 23fe91ffdebb641984993f3b49e7adb431397fe5..958960d3a36fd3660850b5d24cdcb72199f844eb 100644 (file)
@@ -71,6 +71,8 @@
 
 #![allow(non_camel_case_types)]
 
+#![cfg_attr(stage0, feature(dyn_trait))]
+
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
@@ -81,7 +83,6 @@
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_patterns)]
 #![feature(slice_sort_by_cached_key)]
-#![feature(dyn_trait)]
 #![feature(never_type)]
 
 #[macro_use] extern crate log;
index fd54e9bd1e06c3ab340cd2ed118537cef3085e74..5e93b20ea17fdb978b06693c5c38b4fb51c69bac 100644 (file)
@@ -146,9 +146,9 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
         window.rootPath = \"{root_path}\";\
         window.currentCrate = \"{krate}\";\
     </script>\
+    <script src=\"{root_path}aliases.js\"></script>\
     <script src=\"{root_path}main{suffix}.js\"></script>\
     <script defer src=\"{root_path}search-index.js\"></script>\
-    <script defer src=\"{root_path}aliases.js\"></script>\
 </body>\
 </html>",
     css_extension = if css_file_extension {
index 614386a583a7772ae76c30af1779791da9e70439..8efb51bccd80529d909975bff4ef9a0e8fca6e2c 100644 (file)
@@ -13,6 +13,8 @@
        html_root_url = "https://doc.rust-lang.org/nightly/",
        html_playground_url = "https://play.rust-lang.org/")]
 
+#![cfg_attr(stage0, feature(dyn_trait))]
+
 #![feature(ascii_ctype)]
 #![feature(rustc_private)]
 #![feature(box_patterns)]
@@ -23,7 +25,6 @@
 #![feature(test)]
 #![feature(vec_remove_item)]
 #![feature(entry_and_modify)]
-#![feature(dyn_trait)]
 
 extern crate arena;
 extern crate getopts;
index 0331e90164f0c763e41acde31537f49de1985db1..a4a83712a083a730029d66aacb1542a13db6d45d 100644 (file)
@@ -375,9 +375,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     // Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008)
     (active, non_exhaustive, "1.22.0", Some(44109), None),
 
-    // Trait object syntax with `dyn` prefix
-    (active, dyn_trait, "1.22.0", Some(44662), Some(Edition::Edition2018)),
-
     // `crate` as visibility modifier, synonymous to `pub(crate)`
     (active, crate_visibility_modifier, "1.23.0", Some(45388), Some(Edition::Edition2018)),
 
@@ -592,6 +589,8 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     (accepted, cfg_target_feature, "1.27.0", Some(29717), None),
     // Allows #[target_feature(...)]
     (accepted, target_feature, "1.27.0", None, None),
+    // Trait object syntax with `dyn` prefix
+    (accepted, dyn_trait, "1.27.0", Some(44662), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
@@ -1657,10 +1656,6 @@ fn visit_ty(&mut self, ty: &'a ast::Ty) {
                 gate_feature_post!(&self, never_type, ty.span,
                                    "The `!` type is experimental");
             }
-            ast::TyKind::TraitObject(_, ast::TraitObjectSyntax::Dyn) => {
-                gate_feature_post!(&self, dyn_trait, ty.span,
-                                   "`dyn Trait` syntax is unstable");
-            }
             _ => {}
         }
         visit::walk_ty(self, ty)
index 5e96b5ce6733c8d60631458755b37ac4e6ddd32e..658408519b9c7ead442eb045feb90ac82e258f1a 100644 (file)
@@ -21,6 +21,7 @@
 
 use serialize::{Encodable, Decodable, Encoder, Decoder};
 use std::collections::HashMap;
+use rustc_data_structures::fx::FxHashSet;
 use std::fmt;
 
 /// A SyntaxContext represents a chain of macro expansions (represented by marks).
@@ -117,6 +118,32 @@ pub fn is_descendant_of(mut self, ancestor: Mark) -> bool {
             true
         })
     }
+
+    /// Computes a mark such that both input marks are descendants of (or equal to) the returned
+    /// mark. That is, the following holds:
+    ///
+    /// ```rust
+    /// let la = least_ancestor(a, b);
+    /// assert!(a.is_descendant_of(la))
+    /// assert!(b.is_descendant_of(la))
+    /// ```
+    pub fn least_ancestor(mut a: Mark, mut b: Mark) -> Mark {
+        HygieneData::with(|data| {
+            // Compute the path from a to the root
+            let mut a_path = FxHashSet::<Mark>();
+            while a != Mark::root() {
+                a_path.insert(a);
+                a = data.marks[a.0 as usize].parent;
+            }
+
+            // While the path from b to the root hasn't intersected, move up the tree
+            while !a_path.contains(&b) {
+                b = data.marks[b.0 as usize].parent;
+            }
+
+            b
+        })
+    }
 }
 
 pub struct HygieneData {
@@ -238,6 +265,22 @@ fn apply_mark_internal(self, mark: Mark) -> SyntaxContext {
         })
     }
 
+    /// Pulls a single mark off of the syntax context. This effectively moves the
+    /// context up one macro definition level. That is, if we have a nested macro
+    /// definition as follows:
+    ///
+    /// ```rust
+    /// macro_rules! f {
+    ///    macro_rules! g {
+    ///        ...
+    ///    }
+    /// }
+    /// ```
+    ///
+    /// and we have a SyntaxContext that is referring to something declared by an invocation
+    /// of g (call it g1), calling remove_mark will result in the SyntaxContext for the
+    /// invocation of f that created g1.
+    /// Returns the mark that was removed.
     pub fn remove_mark(&mut self) -> Mark {
         HygieneData::with(|data| {
             let outer_mark = data.syntax_contexts[self.0 as usize].outer_mark;
index 9a7d1fd8ee6cb9a508579a3029cfe09d449b6860..8d37b4aa3968f5c84deaa5cd3383eb13ba21e4d2 100644 (file)
@@ -291,6 +291,12 @@ pub fn source_callsite(self) -> Span {
         self.ctxt().outer().expn_info().map(|info| info.call_site.source_callsite()).unwrap_or(self)
     }
 
+    /// The `Span` for the tokens in the previous macro expansion from which `self` was generated,
+    /// if any
+    pub fn parent(self) -> Option<Span> {
+        self.ctxt().outer().expn_info().map(|i| i.call_site)
+    }
+
     /// Return the source callee.
     ///
     /// Returns None if the supplied span has no expansion trace,
index c6b9b016331aa61d0ed1b257b34161f247a0b504..250905dbdcd8ca91b9aaacfcb81588f60f43f27c 100644 (file)
@@ -13,7 +13,7 @@
 #[inline]
 fn f() {}
 
-#[inline] //~ ERROR: attribute should be applied to function
+#[inline] //~ ERROR: attribute should be applied to function or closure
 struct S;
 
 fn main() {}
index 038eacaf1103ef31aa322f8abdee4a5fc5ac2da1..2891cd59e3e1f1f82f5e3d5102f48ea618248dba 100644 (file)
@@ -10,7 +10,6 @@
 
 //! A simple test for testing many permutations of allowedness of
 //! impl Trait
-#![feature(dyn_trait)]
 use std::fmt::Debug;
 
 // Allowed
index 7f73d9076ec99eec8ec4665a1c16b7dc54843de0..2bd45deeab4df7e2d091c5941dafa0f977026143 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 fn main() {
-    #[inline] struct Foo;  //~ ERROR attribute should be applied to function
+    #[inline] struct Foo;  //~ ERROR attribute should be applied to function or closure
     #[repr(C)] fn foo() {} //~ ERROR attribute should be applied to struct, enum or union
 }
index ff1fdaef416c82ddb33fcfc2744d0a26fcf03758..0dfa9f6f0d3417f7c196d6590ed705ee9992a1ef 100644 (file)
@@ -14,12 +14,12 @@ fn main() {
 
     #[inline]
     let _a = 4;
-    //~^^ ERROR attribute should be applied to function
+    //~^^ ERROR attribute should be applied to function or closure
 
 
     #[inline(XYZ)]
     let _b = 4;
-    //~^^ ERROR attribute should be applied to function
+    //~^^ ERROR attribute should be applied to function or closure
 
     #[repr(nothing)]
     let _x = 0;
@@ -40,7 +40,7 @@ fn foo() {}
 
     #[inline(ABC)]
     foo();
-    //~^^ ERROR attribute should be applied to function
+    //~^^ ERROR attribute should be applied to function or closure
 
     let _z = #[repr] 1;
     //~^ ERROR attribute should not be applied to an expression
index e30bed610581503d7bcb0910eb5d539d0e596488..a2c840a70980b5937970ca3d18cf03a20233370f 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags: -Z borrowck=mir
 
 #![allow(dead_code)]
-#![feature(dyn_trait)]
 
 use std::fmt::Debug;
 
index 0dd1a4e7d73358401a55e57094b95f959414ec07..1b1a238a941e50dc876311c5df1795d6c49af387 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(dyn_trait)]
 #![allow(bare_trait_object)]
 
 struct Foo;
index 219eca6fd21e5820684b643fa9ba974f7fc48984..66a6e6afed34b12952feeadd1c6712b61046efdd 100644 (file)
@@ -11,8 +11,6 @@
 // compile-pass
 // failure-status: 1
 
-#![feature(dyn_trait)]
-
 use std::error::Error;
 use std::io;
 
index 399823ec92d0c419eb91f48bac48a0d9dd347a02..010667942424c6f3f4b10a53bfc37e8ba060f48f 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-pretty `dyn ::foo` parses differently in the current edition
 
-#![feature(dyn_trait)]
-
 use std::fmt::Display;
 
 static BYTE: u8 = 33;
diff --git a/src/test/run-pass/issue-47703-tuple.rs b/src/test/run-pass/issue-47703-tuple.rs
new file mode 100644 (file)
index 0000000..4fec3ef
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+    fn drop(&mut self) {}
+}
+
+fn consume(x: (&mut (), WithDrop)) -> &mut () { x.0 }
+
+fn main() {}
diff --git a/src/test/run-pass/issue-49632.rs b/src/test/run-pass/issue-49632.rs
new file mode 100644 (file)
index 0000000..8cbb7d2
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(stmt_expr_attributes)]
+
+pub fn main() {
+    let _x = #[inline(always)] || {};
+    let _y = #[inline(never)] || {};
+    let _z = #[inline] || {};
+}
diff --git a/src/test/run-pass/nll/issue-48623-closure.rs b/src/test/run-pass/nll/issue-48623-closure.rs
new file mode 100644 (file)
index 0000000..08ff54a
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+    fn drop(&mut self) {}
+}
+
+fn reborrow_from_closure(r: &mut ()) -> &mut () {
+    let d = WithDrop;
+    (move || { d; &mut *r })()
+}
+
+fn main() {}
diff --git a/src/test/run-pass/nll/issue-48623-generator.rs b/src/test/run-pass/nll/issue-48623-generator.rs
new file mode 100644 (file)
index 0000000..524837c
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(nll)]
+#![feature(generators, generator_trait)]
+
+struct WithDrop;
+
+impl Drop for WithDrop {
+    fn drop(&mut self) {}
+}
+
+fn reborrow_from_generator(r: &mut ()) {
+    let d = WithDrop;
+    move || { d; yield; &mut *r };
+}
+
+fn main() {}
index 24c30a5abc22a0207284da443e1ba7fac4fefc90..183bb55353052140888580034783ebf0f58d85c8 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(dyn_trait)]
-
 use std::error::Error;
 
 fn main() -> Result<(), Box<dyn Error>> {
index d8feec9914068c06e5da00b5cccb27902c3b22e8..27d5d3645fdfc358dd20c034940cb1853aa28ec3 100644 (file)
@@ -1,19 +1,19 @@
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/E0518.rs:11:1
    |
 LL | #[inline(always)] //~ ERROR: E0518
    | ^^^^^^^^^^^^^^^^^
 LL | struct Foo;
-   | ----------- not a function
+   | ----------- not a function or closure
 
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/E0518.rs:14:1
    |
 LL |   #[inline(never)] //~ ERROR: E0518
    |   ^^^^^^^^^^^^^^^^
 LL | / impl Foo {
 LL | | }
-   | |_- not a function
+   | |_- not a function or closure
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/feature-gate-dyn-trait.rs b/src/test/ui/feature-gate-dyn-trait.rs
deleted file mode 100644 (file)
index 4b3803d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Trait {}
-type A = Box<dyn Trait>; //~ ERROR `dyn Trait` syntax is unstable
-
-fn main() {}
diff --git a/src/test/ui/feature-gate-dyn-trait.stderr b/src/test/ui/feature-gate-dyn-trait.stderr
deleted file mode 100644 (file)
index 6e6bdf1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
-  --> $DIR/feature-gate-dyn-trait.rs:12:14
-   |
-LL | type A = Box<dyn Trait>; //~ ERROR `dyn Trait` syntax is unstable
-   |              ^^^^^^^^^
-   |
-   = help: add #![feature(dyn_trait)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
index 410f960e655fbaeb466c4d6a95a1212273b72f98..b03faad988ebc1c79093695feced71f553b8643b 100644 (file)
 #![inline                     = "2100"]
 
 #[inline = "2100"]
-//~^ ERROR attribute should be applied to function
+//~^ ERROR attribute should be applied to function or closure
 mod inline {
     mod inner { #![inline="2100"] }
-    //~^ ERROR attribute should be applied to function
+    //~^ ERROR attribute should be applied to function or closure
 
     #[inline = "2100"] fn f() { }
 
     #[inline = "2100"] struct S;
-    //~^ ERROR attribute should be applied to function
+    //~^ ERROR attribute should be applied to function or closure
 
     #[inline = "2100"] type T = S;
-    //~^ ERROR attribute should be applied to function
+    //~^ ERROR attribute should be applied to function or closure
 
     #[inline = "2100"] impl S { }
-    //~^ ERROR attribute should be applied to function
+    //~^ ERROR attribute should be applied to function or closure
 }
 
 fn main() {}
index d67d78e31a9d5cf7d4587e802df2fed713b17a9b..4d63c3f50125d4348489c8fd583aea6111e7ce4f 100644 (file)
@@ -1,41 +1,41 @@
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43106-gating-of-inline.rs:21:1
    |
 LL |   #[inline = "2100"]
    |   ^^^^^^^^^^^^^^^^^^
-LL |   //~^ ERROR attribute should be applied to function
+LL |   //~^ ERROR attribute should be applied to function or closure
 LL | / mod inline {
 LL | |     mod inner { #![inline="2100"] }
-LL | |     //~^ ERROR attribute should be applied to function
+LL | |     //~^ ERROR attribute should be applied to function or closure
 LL | |
 ...  |
-LL | |     //~^ ERROR attribute should be applied to function
+LL | |     //~^ ERROR attribute should be applied to function or closure
 LL | | }
-   | |_- not a function
+   | |_- not a function or closure
 
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43106-gating-of-inline.rs:24:17
    |
 LL |     mod inner { #![inline="2100"] }
-   |     ------------^^^^^^^^^^^^^^^^^-- not a function
+   |     ------------^^^^^^^^^^^^^^^^^-- not a function or closure
 
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43106-gating-of-inline.rs:29:5
    |
 LL |     #[inline = "2100"] struct S;
-   |     ^^^^^^^^^^^^^^^^^^ --------- not a function
+   |     ^^^^^^^^^^^^^^^^^^ --------- not a function or closure
 
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43106-gating-of-inline.rs:32:5
    |
 LL |     #[inline = "2100"] type T = S;
-   |     ^^^^^^^^^^^^^^^^^^ ----------- not a function
+   |     ^^^^^^^^^^^^^^^^^^ ----------- not a function or closure
 
-error[E0518]: attribute should be applied to function
+error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43106-gating-of-inline.rs:35:5
    |
 LL |     #[inline = "2100"] impl S { }
-   |     ^^^^^^^^^^^^^^^^^^ ---------- not a function
+   |     ^^^^^^^^^^^^^^^^^^ ---------- not a function or closure
 
 error: aborting due to 5 previous errors
 
index be4852aaf06e16e0ac6ac8beb654222b444e7b44..af79eb7ac054fb8b84862a58c04f3cd41f62f78d 100644 (file)
@@ -6,20 +6,6 @@ LL |         for p in &x { //~ ERROR
 LL |             yield();
    |             ------- possible yield occurs here
 
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/yield-while-iterating.rs:50:17
-   |
-LL |       let mut b = || {
-   |  _________________^
-LL | |         for p in &mut x {
-LL | |             yield p;
-LL | |         }
-LL | |     };
-   | |     ^
-   | |     |
-   | |_____temporary value only lives until here
-   |       temporary value does not live long enough
-
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
   --> $DIR/yield-while-iterating.rs:67:20
    |
@@ -35,21 +21,7 @@ LL |       println!("{}", x[0]); //~ ERROR
 LL |       b.resume();
    |       - borrow later used here
 
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/yield-while-iterating.rs:62:17
-   |
-LL |       let mut b = || {
-   |  _________________^
-LL | |         for p in &mut x {
-LL | |             yield p;
-LL | |         }
-LL | |     };
-   | |     ^
-   | |     |
-   | |_____temporary value only lives until here
-   |       temporary value does not live long enough
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
 
-Some errors occurred: E0502, E0597, E0626.
+Some errors occurred: E0502, E0626.
 For more information about an error, try `rustc --explain E0502`.
index 6a7279422710932d85d80ce1e0403f4f0cfb1d90..57a0040600a255d506e893c997c8b983494b9479 100644 (file)
@@ -7,8 +7,6 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
-#![feature(dyn_trait)]
-
 use std::fmt::Debug;
 use std::option;
 
index 9b38de614fc10511ef9504155e0c0895e847d3c0..f6d58984ecef747ae3994640d005c6380d7ae928 100644 (file)
@@ -1,29 +1,29 @@
 error[E0667]: `impl Trait` is not allowed in path parameters
-  --> $DIR/impl_trait_projections.rs:23:51
+  --> $DIR/impl_trait_projections.rs:21:51
    |
 LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
    |                                                   ^^^^^^^^^^^^^
 
 error[E0667]: `impl Trait` is not allowed in path parameters
-  --> $DIR/impl_trait_projections.rs:30:9
+  --> $DIR/impl_trait_projections.rs:28:9
    |
 LL |     -> <impl Iterator as Iterator>::Item
    |         ^^^^^^^^^^^^^
 
 error[E0667]: `impl Trait` is not allowed in path parameters
-  --> $DIR/impl_trait_projections.rs:37:27
+  --> $DIR/impl_trait_projections.rs:35:27
    |
 LL |     -> <::std::ops::Range<impl Debug> as Iterator>::Item
    |                           ^^^^^^^^^^
 
 error[E0667]: `impl Trait` is not allowed in path parameters
-  --> $DIR/impl_trait_projections.rs:44:29
+  --> $DIR/impl_trait_projections.rs:42:29
    |
 LL |     -> <dyn Iterator<Item = impl Debug> as Iterator>::Item
    |                             ^^^^^^^^^^
 
 error[E0223]: ambiguous associated type
-  --> $DIR/impl_trait_projections.rs:23:50
+  --> $DIR/impl_trait_projections.rs:21:50
    |
 LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
    |                                                  ^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type
index ec8c4ecf102469b032e0d44a36069474b4866de2..4cf7feddd46541376fbe52cd6b875e5cdf82d895 100644 (file)
@@ -1,11 +1,11 @@
 warning: not reporting region error due to nll
-  --> $DIR/dyn-trait.rs:33:16
+  --> $DIR/dyn-trait.rs:32:16
    |
 LL |     static_val(x); //~ ERROR cannot infer
    |                ^
 
 error: free region `'a` does not outlive free region `'static`
-  --> $DIR/dyn-trait.rs:33:5
+  --> $DIR/dyn-trait.rs:32:5
    |
 LL |     static_val(x); //~ ERROR cannot infer
    |     ^^^^^^^^^^^^^
index a504bae2e600719177044fe9db7b1465abf388dd..c27bbe77fbf19fba4c91d64a867de1384916169f 100644 (file)
@@ -13,7 +13,6 @@
 
 #![allow(warnings)]
 
-#![feature(dyn_trait)]
 #![feature(in_band_lifetimes)]
 
 use std::fmt::Debug;
index 9d6a318c075134b59682f7018355d0b5fb88a341..201470abe674cde98effb422f391cf95108a27a3 100644 (file)
@@ -1,11 +1,11 @@
 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
-  --> $DIR/dyn-trait.rs:33:16
+  --> $DIR/dyn-trait.rs:32:16
    |
 LL |     static_val(x); //~ ERROR cannot infer
    |                ^
    |
-note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 32:1...
-  --> $DIR/dyn-trait.rs:32:1
+note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:1...
+  --> $DIR/dyn-trait.rs:31:1
    |
 LL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/lint/must-use-ops.rs b/src/test/ui/lint/must-use-ops.rs
new file mode 100644 (file)
index 0000000..4ed82ab
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Issue #50124 - Test warning for unused operator expressions
+
+// compile-pass
+
+#![feature(fn_must_use)]
+#![warn(unused_must_use)]
+
+fn main() {
+    let val = 1;
+    let val_pointer = &val;
+
+// Comparison Operators
+    val == 1;
+    val < 1;
+    val <= 1;
+    val != 1;
+    val >= 1;
+    val > 1;
+
+// Arithmetic Operators
+    val + 2;
+    val - 2;
+    val / 2;
+    val * 2;
+    val % 2;
+
+// Logical Operators
+    true && true;
+    false || true;
+
+// Bitwise Operators
+    5 ^ val;
+    5 & val;
+    5 | val;
+    5 << val;
+    5 >> val;
+
+// Unary Operators
+    !val;
+    -val;
+    *val_pointer;
+}
diff --git a/src/test/ui/lint/must-use-ops.stderr b/src/test/ui/lint/must-use-ops.stderr
new file mode 100644 (file)
index 0000000..f444ef0
--- /dev/null
@@ -0,0 +1,132 @@
+warning: unused comparison which must be used
+  --> $DIR/must-use-ops.rs:23:5
+   |
+LL |     val == 1;
+   |     ^^^^^^^^
+   |
+note: lint level defined here
+  --> $DIR/must-use-ops.rs:16:9
+   |
+LL | #![warn(unused_must_use)]
+   |         ^^^^^^^^^^^^^^^
+
+warning: unused comparison which must be used
+  --> $DIR/must-use-ops.rs:24:5
+   |
+LL |     val < 1;
+   |     ^^^^^^^
+
+warning: unused comparison which must be used
+  --> $DIR/must-use-ops.rs:25:5
+   |
+LL |     val <= 1;
+   |     ^^^^^^^^
+
+warning: unused comparison which must be used
+  --> $DIR/must-use-ops.rs:26:5
+   |
+LL |     val != 1;
+   |     ^^^^^^^^
+
+warning: unused comparison which must be used
+  --> $DIR/must-use-ops.rs:27:5
+   |
+LL |     val >= 1;
+   |     ^^^^^^^^
+
+warning: unused comparison which must be used
+  --> $DIR/must-use-ops.rs:28:5
+   |
+LL |     val > 1;
+   |     ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+  --> $DIR/must-use-ops.rs:31:5
+   |
+LL |     val + 2;
+   |     ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+  --> $DIR/must-use-ops.rs:32:5
+   |
+LL |     val - 2;
+   |     ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+  --> $DIR/must-use-ops.rs:33:5
+   |
+LL |     val / 2;
+   |     ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+  --> $DIR/must-use-ops.rs:34:5
+   |
+LL |     val * 2;
+   |     ^^^^^^^
+
+warning: unused arithmetic operation which must be used
+  --> $DIR/must-use-ops.rs:35:5
+   |
+LL |     val % 2;
+   |     ^^^^^^^
+
+warning: unused logical operation which must be used
+  --> $DIR/must-use-ops.rs:38:5
+   |
+LL |     true && true;
+   |     ^^^^^^^^^^^^
+
+warning: unused logical operation which must be used
+  --> $DIR/must-use-ops.rs:39:5
+   |
+LL |     false || true;
+   |     ^^^^^^^^^^^^^
+
+warning: unused bitwise operation which must be used
+  --> $DIR/must-use-ops.rs:42:5
+   |
+LL |     5 ^ val;
+   |     ^^^^^^^
+
+warning: unused bitwise operation which must be used
+  --> $DIR/must-use-ops.rs:43:5
+   |
+LL |     5 & val;
+   |     ^^^^^^^
+
+warning: unused bitwise operation which must be used
+  --> $DIR/must-use-ops.rs:44:5
+   |
+LL |     5 | val;
+   |     ^^^^^^^
+
+warning: unused bitwise operation which must be used
+  --> $DIR/must-use-ops.rs:45:5
+   |
+LL |     5 << val;
+   |     ^^^^^^^^
+
+warning: unused bitwise operation which must be used
+  --> $DIR/must-use-ops.rs:46:5
+   |
+LL |     5 >> val;
+   |     ^^^^^^^^
+
+warning: unused unary operation which must be used
+  --> $DIR/must-use-ops.rs:49:5
+   |
+LL |     !val;
+   |     ^^^^
+
+warning: unused unary operation which must be used
+  --> $DIR/must-use-ops.rs:50:5
+   |
+LL |     -val;
+   |     ^^^^
+
+warning: unused unary operation which must be used
+  --> $DIR/must-use-ops.rs:51:5
+   |
+LL |     *val_pointer;
+   |     ^^^^^^^^^^^^
+
index 34232e81cbdeef0a5a5bff568fc08d9a383850c0..9eb11148a8bcef45200484c0163c2371927fe782 100644 (file)
@@ -39,7 +39,13 @@ fn main() {
 
     let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
     //~^ ERROR function is expected to take
+
+    call(Foo);
+    //~^ ERROR function is expected to take
 }
 
 fn foo() {}
 fn qux(x: usize, y: usize) {}
+
+fn call<F, R>(_: F) where F: FnOnce() -> R {}
+struct Foo(u8);
index 6451c0d06fa2094ca9c89e16cd5e047b1baf7fc8..6270e794498766f17fcba58f4b3e8e130e07b981 100644 (file)
@@ -116,6 +116,21 @@ error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
 LL |     let _it = vec![1, 2, 3].into_iter().map(usize::checked_add);
    |                                         ^^^ expected function that takes 1 argument
 
-error: aborting due to 12 previous errors
+error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
+  --> $DIR/closure-arg-count.rs:43:5
+   |
+LL |     call(Foo);
+   |     ^^^^ expected function that takes 0 arguments
+...
+LL | struct Foo(u8);
+   | --------------- takes 1 argument
+   |
+note: required by `call`
+  --> $DIR/closure-arg-count.rs:50:1
+   |
+LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 13 previous errors
 
 For more information about this error, try `rustc --explain E0593`.
index 7b3ed6a94fcbb642951a69d156517a304f03c3fd..4767b75d89c1aab8517287f772c082b6e074295c 100644 (file)
@@ -15,7 +15,6 @@
 // Iterator>::Item`, to be exact).
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 trait Anything { }
index 0efbbdff12a3f25627b881adbf3d6f67d8821da6..3689ca74adb8c304dc0b29796a0def435feba9ed 100644 (file)
@@ -1,17 +1,17 @@
 warning: not reporting region error due to nll
-  --> $DIR/projection-no-regions-closure.rs:36:31
+  --> $DIR/projection-no-regions-closure.rs:35:31
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                               ^^^^^^^^^^^^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-no-regions-closure.rs:54:31
+  --> $DIR/projection-no-regions-closure.rs:53:31
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                               ^^^^^^^^^^^^^^^^^^
 
 note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:36:23
+  --> $DIR/projection-no-regions-closure.rs:35:23
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
    = note: where <T as std::iter::Iterator>::Item: '_#2r
 
 error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
-  --> $DIR/projection-no-regions-closure.rs:36:23
+  --> $DIR/projection-no-regions-closure.rs:35:23
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -34,7 +34,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
    = help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
 
 note: No external requirements
-  --> $DIR/projection-no-regions-closure.rs:32:1
+  --> $DIR/projection-no-regions-closure.rs:31:1
    |
 LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
 LL | | where
@@ -51,7 +51,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:46:23
+  --> $DIR/projection-no-regions-closure.rs:45:23
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -66,7 +66,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
    = note: where <T as std::iter::Iterator>::Item: '_#2r
 
 note: No external requirements
-  --> $DIR/projection-no-regions-closure.rs:42:1
+  --> $DIR/projection-no-regions-closure.rs:41:1
    |
 LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
 LL | | where
@@ -82,7 +82,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:54:23
+  --> $DIR/projection-no-regions-closure.rs:53:23
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -98,7 +98,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
    = note: where <T as std::iter::Iterator>::Item: '_#3r
 
 error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
-  --> $DIR/projection-no-regions-closure.rs:54:23
+  --> $DIR/projection-no-regions-closure.rs:53:23
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,7 +106,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
    = help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
 
 note: No external requirements
-  --> $DIR/projection-no-regions-closure.rs:50:1
+  --> $DIR/projection-no-regions-closure.rs:49:1
    |
 LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
 LL | | where
@@ -124,7 +124,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-no-regions-closure.rs:65:23
+  --> $DIR/projection-no-regions-closure.rs:64:23
    |
 LL |     with_signature(x, |mut y| Box::new(y.next()))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -140,7 +140,7 @@ LL |     with_signature(x, |mut y| Box::new(y.next()))
    = note: where <T as std::iter::Iterator>::Item: '_#3r
 
 note: No external requirements
-  --> $DIR/projection-no-regions-closure.rs:60:1
+  --> $DIR/projection-no-regions-closure.rs:59:1
    |
 LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
 LL | | where
index 32b73a51e11a527c198893dd30b74ad114270e53..dea2daf7e8eeb9f40a9fea46854707c1e1ee9bc5 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 
 trait Anything { }
 
index b2c5f28268db893382fbc78a9741a9cfe5e8c15e..3199ec151335dbc08ea55ab622af0e1def56f3ad 100644 (file)
@@ -1,17 +1,17 @@
 warning: not reporting region error due to nll
-  --> $DIR/projection-no-regions-fn.rs:24:5
+  --> $DIR/projection-no-regions-fn.rs:23:5
    |
 LL |     Box::new(x.next())
    |     ^^^^^^^^^^^^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-no-regions-fn.rs:40:5
+  --> $DIR/projection-no-regions-fn.rs:39:5
    |
 LL |     Box::new(x.next())
    |     ^^^^^^^^^^^^^^^^^^
 
 error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
-  --> $DIR/projection-no-regions-fn.rs:24:5
+  --> $DIR/projection-no-regions-fn.rs:23:5
    |
 LL |     Box::new(x.next())
    |     ^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL |     Box::new(x.next())
    = help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
 
 error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
-  --> $DIR/projection-no-regions-fn.rs:40:5
+  --> $DIR/projection-no-regions-fn.rs:39:5
    |
 LL |     Box::new(x.next())
    |     ^^^^^^^^^^^^^^^^^^
index cfe2880bfed476795ff5c84470c3f70444de5362..77024c4119ff95a3b2d63ecd15884c9fdf8babdd 100644 (file)
@@ -25,7 +25,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::cell::Cell;
index 0d5a2dc7c559855b5138e8e9f2b3767bbe0fe48b..e1218830dbb64ee53dfedfb8545db3b0941f0a45 100644 (file)
@@ -1,23 +1,23 @@
 warning: not reporting region error due to nll
-  --> $DIR/projection-one-region-closure.rs:56:39
+  --> $DIR/projection-one-region-closure.rs:55:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-one-region-closure.rs:68:39
+  --> $DIR/projection-one-region-closure.rs:67:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-one-region-closure.rs:90:39
+  --> $DIR/projection-one-region-closure.rs:89:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 note: External requirements
-  --> $DIR/projection-one-region-closure.rs:56:29
+  --> $DIR/projection-one-region-closure.rs:55:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -33,7 +33,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#1r: '_#2r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/projection-one-region-closure.rs:56:29
+  --> $DIR/projection-one-region-closure.rs:55:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,13 +41,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`...
 
 error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
-  --> $DIR/projection-one-region-closure.rs:56:20
+  --> $DIR/projection-one-region-closure.rs:55:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-one-region-closure.rs:52:1
+  --> $DIR/projection-one-region-closure.rs:51:1
    |
 LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -64,7 +64,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-closure.rs:68:29
+  --> $DIR/projection-one-region-closure.rs:67:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -81,7 +81,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#2r: '_#3r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/projection-one-region-closure.rs:68:29
+  --> $DIR/projection-one-region-closure.rs:67:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -89,13 +89,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
 
 error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
-  --> $DIR/projection-one-region-closure.rs:68:20
+  --> $DIR/projection-one-region-closure.rs:67:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-one-region-closure.rs:63:1
+  --> $DIR/projection-one-region-closure.rs:62:1
    |
 LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -113,7 +113,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-closure.rs:90:29
+  --> $DIR/projection-one-region-closure.rs:89:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -130,7 +130,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#2r: '_#3r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/projection-one-region-closure.rs:90:29
+  --> $DIR/projection-one-region-closure.rs:89:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -138,13 +138,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
 
 error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
-  --> $DIR/projection-one-region-closure.rs:90:20
+  --> $DIR/projection-one-region-closure.rs:89:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-one-region-closure.rs:75:1
+  --> $DIR/projection-one-region-closure.rs:74:1
    |
 LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -162,7 +162,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-closure.rs:103:29
+  --> $DIR/projection-one-region-closure.rs:102:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -179,7 +179,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#2r: '_#3r
 
 note: No external requirements
-  --> $DIR/projection-one-region-closure.rs:97:1
+  --> $DIR/projection-one-region-closure.rs:96:1
    |
 LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
index 16e91f2708fe94495627d0422a670af279e32d78..fb1009c9cc8e852b980fa65102f3441ad2ece902 100644 (file)
@@ -17,7 +17,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::cell::Cell;
index d4aca8380b469f2812d143a79db70f17cf7a4932..76554e29f62eac41ba9e161e730610f7905a10f1 100644 (file)
@@ -1,23 +1,23 @@
 warning: not reporting region error due to nll
-  --> $DIR/projection-one-region-trait-bound-closure.rs:48:39
+  --> $DIR/projection-one-region-trait-bound-closure.rs:47:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-one-region-trait-bound-closure.rs:59:39
+  --> $DIR/projection-one-region-trait-bound-closure.rs:58:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-one-region-trait-bound-closure.rs:80:39
+  --> $DIR/projection-one-region-trait-bound-closure.rs:79:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:48:29
+  --> $DIR/projection-one-region-trait-bound-closure.rs:47:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,13 +32,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#1r: '_#2r
 
 error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:8 ~ projection_one_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:16), 'a))`
-  --> $DIR/projection-one-region-trait-bound-closure.rs:48:20
+  --> $DIR/projection-one-region-trait-bound-closure.rs:47:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:44:1
+  --> $DIR/projection-one-region-trait-bound-closure.rs:43:1
    |
 LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -55,7 +55,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:59:29
+  --> $DIR/projection-one-region-trait-bound-closure.rs:58:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,13 +71,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#2r: '_#3r
 
 error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
-  --> $DIR/projection-one-region-trait-bound-closure.rs:59:20
+  --> $DIR/projection-one-region-trait-bound-closure.rs:58:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:54:1
+  --> $DIR/projection-one-region-trait-bound-closure.rs:53:1
    |
 LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -95,7 +95,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:80:29
+  --> $DIR/projection-one-region-trait-bound-closure.rs:79:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -111,13 +111,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#2r: '_#3r
 
 error: free region `ReEarlyBound(1, 'b)` does not outlive free region `ReEarlyBound(0, 'a)`
-  --> $DIR/projection-one-region-trait-bound-closure.rs:80:20
+  --> $DIR/projection-one-region-trait-bound-closure.rs:79:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:65:1
+  --> $DIR/projection-one-region-trait-bound-closure.rs:64:1
    |
 LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -135,7 +135,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:91:29
+  --> $DIR/projection-one-region-trait-bound-closure.rs:90:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -151,7 +151,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#2r: '_#3r
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:86:1
+  --> $DIR/projection-one-region-trait-bound-closure.rs:85:1
    |
 LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -169,7 +169,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:103:29
+  --> $DIR/projection-one-region-trait-bound-closure.rs:102:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -184,7 +184,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where '_#1r: '_#2r
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-closure.rs:95:1
+  --> $DIR/projection-one-region-trait-bound-closure.rs:94:1
    |
 LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
index 0d42636c844a55acfbe54bc65a8394aa5b7cc3ce..1f2f40196f8ee033805864d8c32dfb2cefa001c0 100644 (file)
@@ -16,7 +16,6 @@
 // compile-pass
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::cell::Cell;
index 875907e6b39d5779770728654e20bf678d9d7953..136e143e80edfab1dcc4c092d339b12e846c0870 100644 (file)
@@ -1,5 +1,5 @@
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:47:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:46:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:43:1
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:42:1
    |
 LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -28,7 +28,7 @@ LL | | }
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:56:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:55:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:51:1
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:50:1
    |
 LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -60,7 +60,7 @@ LL | | }
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:75:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:74:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:60:1
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:59:1
    |
 LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -92,7 +92,7 @@ LL | | }
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:84:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:83:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,7 +106,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:79:1
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:78:1
    |
 LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -124,7 +124,7 @@ LL | | }
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:96:29
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:95:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -137,7 +137,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
            ]
 
 note: No external requirements
-  --> $DIR/projection-one-region-trait-bound-static-closure.rs:88:1
+  --> $DIR/projection-one-region-trait-bound-static-closure.rs:87:1
    |
 LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
index 7c8ef140a29074296ec8cb6f885e12a343fd8090..5307d0880d4dad27f673d5d0fb9b51b4d540a224 100644 (file)
@@ -18,7 +18,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::cell::Cell;
index 7e36e467e4eba32ac700b48afea06ddae3016521..c7f456929609e841db440ecdc19913ebe727ba51 100644 (file)
@@ -1,29 +1,29 @@
 warning: not reporting region error due to nll
-  --> $DIR/projection-two-region-trait-bound-closure.rs:49:39
+  --> $DIR/projection-two-region-trait-bound-closure.rs:48:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-two-region-trait-bound-closure.rs:60:39
+  --> $DIR/projection-two-region-trait-bound-closure.rs:59:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-two-region-trait-bound-closure.rs:81:39
+  --> $DIR/projection-two-region-trait-bound-closure.rs:80:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/projection-two-region-trait-bound-closure.rs:109:39
+  --> $DIR/projection-two-region-trait-bound-closure.rs:108:39
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                                       ^^^^^^^
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:49:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:48:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
 
 error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
-  --> $DIR/projection-two-region-trait-bound-closure.rs:49:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:48:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:45:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:44:1
    |
 LL | / fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -65,7 +65,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:59:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -82,7 +82,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
-  --> $DIR/projection-two-region-trait-bound-closure.rs:60:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:59:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:55:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:54:1
    |
 LL | / fn no_relationships_early<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -109,7 +109,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:80:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -126,7 +126,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
-  --> $DIR/projection-two-region-trait-bound-closure.rs:81:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:80:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -134,7 +134,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:66:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:65:1
    |
 LL | / fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -153,7 +153,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:92:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:91:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -170,7 +170,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:87:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:86:1
    |
 LL | / fn elements_outlive1<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -189,7 +189,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:101:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:100:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -206,7 +206,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:96:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:95:1
    |
 LL | / fn elements_outlive2<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -225,7 +225,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:109:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:108:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -240,13 +240,13 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
 
 error: free region `ReEarlyBound(0, 'b)` does not outlive free region `ReFree(DefId(0/0:13 ~ projection_two_region_trait_bound_closure[317d]::two_regions[0]), BrNamed(crate0:DefIndex(1:43), 'a))`
-  --> $DIR/projection-two-region-trait-bound-closure.rs:109:20
+  --> $DIR/projection-two-region-trait-bound-closure.rs:108:20
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                    ^^^^
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:105:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:104:1
    |
 LL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -263,7 +263,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:120:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:119:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,7 +279,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:115:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:114:1
    |
 LL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
@@ -297,7 +297,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:132:29
+  --> $DIR/projection-two-region-trait-bound-closure.rs:131:29
    |
 LL |     with_signature(cell, t, |cell, t| require(cell, t));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -312,7 +312,7 @@ LL |     with_signature(cell, t, |cell, t| require(cell, t));
    = note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
 
 note: No external requirements
-  --> $DIR/projection-two-region-trait-bound-closure.rs:124:1
+  --> $DIR/projection-two-region-trait-bound-closure.rs:123:1
    |
 LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
 LL | | where
index 80b42c29563f1b5fb579a174117817032412f924..7ff4b484af17bed565cc30144f14892dbf6a2b57 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::cell::Cell;
index c8feaddff9382ddf2d335c5e1954445256690ed4..b4f51401a90f6534515efca6f445c1f43f10c5e4 100644 (file)
@@ -1,23 +1,23 @@
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:35:31
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:34:31
    |
 LL |     twice(cell, value, |a, b| invoke(a, b));
    |                               ^^^^^^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:31
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:31
    |
 LL |     twice(cell, value, |a, b| invoke(a, b));
    |                               ^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:31
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:31
    |
 LL |     twice(cell, value, |a, b| invoke(a, b));
    |                               ^^^^^^^^^^^^
 
 note: External requirements
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:35:24
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:34:24
    |
 LL |     twice(cell, value, |a, b| invoke(a, b));
    |                        ^^^^^^^^^^^^^^^^^^^
@@ -31,7 +31,7 @@ LL |     twice(cell, value, |a, b| invoke(a, b));
    = note: where T: '_#1r
 
 note: No external requirements
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:33:1
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:32:1
    |
 LL | / fn generic<T>(value: T) {
 LL | |     let cell = Cell::new(&());
@@ -47,7 +47,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:24
    |
 LL |     twice(cell, value, |a, b| invoke(a, b));
    |                        ^^^^^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL |     twice(cell, value, |a, b| invoke(a, b));
    = note: where T: '_#1r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:43:24
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:24
    |
 LL |     twice(cell, value, |a, b| invoke(a, b));
    |                        ^^^^^^^^^^^^^^^^^^^
@@ -69,7 +69,7 @@ LL |     twice(cell, value, |a, b| invoke(a, b));
    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_approximate_lower_bound[317d]::generic_fail[0]), BrNamed(crate0:DefIndex(1:15), 'a))`...
 
 note: No external requirements
-  --> $DIR/ty-param-closure-approximate-lower-bound.rs:42:1
+  --> $DIR/ty-param-closure-approximate-lower-bound.rs:41:1
    |
 LL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
 LL | |     twice(cell, value, |a, b| invoke(a, b));
index 50763a1d5080808c6572da682d43073cbcf30cdf..b5cbd07b99c18fb67a34775cabdd3ea693259d99 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::fmt::Debug;
index 500595e0c5dcaf21e32d80fe80168cd661a86e94..59a8a39a7b0857359cbf8d220c3b6ee4ed7053cf 100644 (file)
@@ -1,17 +1,17 @@
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-outlives-from-return-type.rs:37:27
+  --> $DIR/ty-param-closure-outlives-from-return-type.rs:36:27
    |
 LL |     with_signature(x, |y| y)
    |                           ^
 
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-outlives-from-return-type.rs:53:5
+  --> $DIR/ty-param-closure-outlives-from-return-type.rs:52:5
    |
 LL |     x
    |     ^
 
 note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-return-type.rs:37:23
+  --> $DIR/ty-param-closure-outlives-from-return-type.rs:36:23
    |
 LL |     with_signature(x, |y| y)
    |                       ^^^^^
@@ -26,7 +26,7 @@ LL |     with_signature(x, |y| y)
    = note: where T: '_#2r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-closure-outlives-from-return-type.rs:37:23
+  --> $DIR/ty-param-closure-outlives-from-return-type.rs:36:23
    |
 LL |     with_signature(x, |y| y)
    |                       ^^^^^
@@ -34,7 +34,7 @@ LL |     with_signature(x, |y| y)
    = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
 
 note: No external requirements
-  --> $DIR/ty-param-closure-outlives-from-return-type.rs:26:1
+  --> $DIR/ty-param-closure-outlives-from-return-type.rs:25:1
    |
 LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
 LL | | where
@@ -51,7 +51,7 @@ LL | | }
            ]
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-closure-outlives-from-return-type.rs:53:5
+  --> $DIR/ty-param-closure-outlives-from-return-type.rs:52:5
    |
 LL |     x
    |     ^
index b70fc2b2ec4b40d6f0ee38e911a7e06afd4716b8..edaaeac080d4df999d6a34893a2fea66f27f3cc6 100644 (file)
@@ -15,7 +15,6 @@
 // compile-flags:-Zborrowck=mir -Zverbose
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 #![feature(rustc_attrs)]
 
 use std::cell::Cell;
index 4d8a66ba8e1c4cea182584b02fc2fda762a9383b..a53ce21b7e6d22d253754d85fefe7279f65f2c84 100644 (file)
@@ -1,17 +1,17 @@
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:45:9
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:44:9
    |
 LL |         require(&x, &y)
    |         ^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:79:9
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:78:9
    |
 LL |         require(&x, &y)
    |         ^^^^^^^
 
 note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:26
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:37:26
    |
 LL |       with_signature(a, b, |x, y| {
    |  __________________________^
@@ -32,7 +32,7 @@ LL | |     })
    = note: where T: '_#1r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:38:26
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:37:26
    |
 LL |       with_signature(a, b, |x, y| {
    |  __________________________^
@@ -47,7 +47,7 @@ LL | |     })
    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:6 ~ ty_param_closure_outlives_from_where_clause[317d]::no_region[0]), BrNamed(crate0:DefIndex(1:14), 'a))`...
 
 note: No external requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:37:1
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:36:1
    |
 LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
 LL | |     with_signature(a, b, |x, y| {
@@ -63,7 +63,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:55:26
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:54:26
    |
 LL |       with_signature(a, b, |x, y| {
    |  __________________________^
@@ -85,7 +85,7 @@ LL | |     })
    = note: where T: '_#2r
 
 note: No external requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:51:1
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:50:1
    |
 LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
 LL | | where
@@ -102,7 +102,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:75:26
    |
 LL |       with_signature(a, b, |x, y| {
    |  __________________________^
@@ -123,7 +123,7 @@ LL | |     })
    = note: where T: '_#2r
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:76:26
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:75:26
    |
 LL |       with_signature(a, b, |x, y| {
    |  __________________________^
@@ -137,7 +137,7 @@ LL | |     })
    = help: consider adding an explicit lifetime bound `T: ReFree(DefId(0/0:8 ~ ty_param_closure_outlives_from_where_clause[317d]::wrong_region[0]), BrNamed(crate0:DefIndex(1:20), 'a))`...
 
 note: No external requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:71:1
    |
 LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
 LL | | where
@@ -154,7 +154,7 @@ LL | | }
            ]
 
 note: External requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:90:26
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:89:26
    |
 LL |       with_signature(a, b, |x, y| {
    |  __________________________^
@@ -174,7 +174,7 @@ LL | |     })
    = note: where T: '_#3r
 
 note: No external requirements
-  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:85:1
+  --> $DIR/ty-param-closure-outlives-from-where-clause.rs:84:1
    |
 LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
 LL | | where
index babe608354fb92481df3f4465eb8b67dfca2cab3..c0c483b3957d42bbf6af4296c7adf7ba14324e82 100644 (file)
@@ -15,7 +15,6 @@
 #![feature(nll)]
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 
 use std::cell::Cell;
 
index 1510ca61e5c7510be7ab23297dc90152d0ce38aa..dec15f47a03012cb5f1431bd79f6c26a75ff26ca 100644 (file)
@@ -1,5 +1,5 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn-body-nll-feature.rs:31:5
+  --> $DIR/ty-param-fn-body-nll-feature.rs:30:5
    |
 LL |     outlives(cell, t)
    |     ^^^^^^^^^^^^^^^^^
index fb4ea63f8532cd9c24d9d63f52c3c0e40f03d6bd..6226108ef196f1e0a7fc809868d7275305020044 100644 (file)
@@ -14,7 +14,6 @@
 // function body.
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 
 use std::cell::Cell;
 
index 0596861e67b572b8bbf67e9b10a15d9d3c394bdf..537f12234708e2ccc174f398f388276adb553990 100644 (file)
@@ -1,11 +1,11 @@
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-fn-body.rs:30:5
+  --> $DIR/ty-param-fn-body.rs:29:5
    |
 LL |     outlives(cell, t)
    |     ^^^^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn-body.rs:30:5
+  --> $DIR/ty-param-fn-body.rs:29:5
    |
 LL |     outlives(cell, t)
    |     ^^^^^^^^^^^^^^^^^
index 42d662e14193ccbce257bdb8ea6da923b8bd9366..258d77eb2b078eef79f3deb837e090a86bdaaa78 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags:-Zborrowck=mir
 
 #![allow(warnings)]
-#![feature(dyn_trait)]
 
 use std::fmt::Debug;
 
index 0d09cac8c38513da8abfeffbcdd91ffbb5a16c6a..5ce50d8118578f0b6bcbd50fd5a5a02327dbae53 100644 (file)
@@ -1,17 +1,17 @@
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-fn.rs:22:5
+  --> $DIR/ty-param-fn.rs:21:5
    |
 LL |     x
    |     ^
 
 warning: not reporting region error due to nll
-  --> $DIR/ty-param-fn.rs:38:5
+  --> $DIR/ty-param-fn.rs:37:5
    |
 LL |     x
    |     ^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn.rs:22:5
+  --> $DIR/ty-param-fn.rs:21:5
    |
 LL |     x
    |     ^
@@ -19,7 +19,7 @@ LL |     x
    = help: consider adding an explicit lifetime bound `T: 'a`...
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/ty-param-fn.rs:38:5
+  --> $DIR/ty-param-fn.rs:37:5
    |
 LL |     x
    |     ^
index 9b28aa0b15116d9549b56ac0bf908f52b01a34bf..9bb6653d770803e7065064a2696ab99ee3e5bbe1 100644 (file)
@@ -10,7 +10,6 @@
 
 // compile-flags: -Z parse-only
 
-#![feature(dyn_trait)]
 #![feature(raw_identifiers)]
 
 fn test_if() {
index 3758568323cc0ac0a3e10a348bee33266e6a1d2d..022f80ae8a4ecb31ba854774a2e9a7b961dd8b8d 100644 (file)
@@ -1,17 +1,17 @@
 error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `true`
-  --> $DIR/raw-literal-keywords.rs:17:10
+  --> $DIR/raw-literal-keywords.rs:16:10
    |
 LL |     r#if true { } //~ ERROR found `true`
    |          ^^^^ expected one of 8 possible tokens here
 
 error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
-  --> $DIR/raw-literal-keywords.rs:21:14
+  --> $DIR/raw-literal-keywords.rs:20:14
    |
 LL |     r#struct Test; //~ ERROR found `Test`
    |              ^^^^ expected one of 8 possible tokens here
 
 error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `Test`
-  --> $DIR/raw-literal-keywords.rs:25:13
+  --> $DIR/raw-literal-keywords.rs:24:13
    |
 LL |     r#union Test; //~ ERROR found `Test`
    |             ^^^^ expected one of 8 possible tokens here
index e573ad8fc1f09f62e15963c2e492d1aeaac4f3d6..6c83205d0504c593667707aa57dcb6abeb147897 100644 (file)
@@ -13,8 +13,6 @@
 //
 // cc #48468
 
-#![feature(dyn_trait)]
-
 use std::fmt::Debug;
 
 struct Foo {
index 6d777841f0319c410bdc8df2ec1a9996517d983c..1017217828a7bbd98f097def50719d00113d75d4 100644 (file)
@@ -1,11 +1,11 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/dyn-trait-underscore-in-struct.rs:21:24
+  --> $DIR/dyn-trait-underscore-in-struct.rs:19:24
    |
 LL |     x: Box<dyn Debug + '_>, //~ ERROR missing lifetime specifier
    |                        ^^ expected lifetime parameter
 
 error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
-  --> $DIR/dyn-trait-underscore-in-struct.rs:21:12
+  --> $DIR/dyn-trait-underscore-in-struct.rs:19:12
    |
 LL |     x: Box<dyn Debug + '_>, //~ ERROR missing lifetime specifier
    |            ^^^^^^^^^^^^^^
index 10a03786d7b1fa2a3353b8bc6fc003ae95c11df9..cdc0c78e6941463cfa16390f5793deda1f671744 100644 (file)
@@ -1,29 +1,29 @@
 warning: not reporting region error due to nll
-  --> $DIR/dyn-trait-underscore.rs:20:14
+  --> $DIR/dyn-trait-underscore.rs:18:14
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |              ^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/dyn-trait-underscore.rs:20:20
+  --> $DIR/dyn-trait-underscore.rs:18:20
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |                    ^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/dyn-trait-underscore.rs:20:5
+  --> $DIR/dyn-trait-underscore.rs:18:5
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |     ^^^^^^^^
 
 warning: not reporting region error due to nll
-  --> $DIR/dyn-trait-underscore.rs:20:5
+  --> $DIR/dyn-trait-underscore.rs:18:5
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: free region `` does not outlive free region `'static`
-  --> $DIR/dyn-trait-underscore.rs:18:52
+  --> $DIR/dyn-trait-underscore.rs:16:52
    |
 LL |   fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
    |  ____________________________________________________^
index 9640d3465978f90a2ba9ff8d63bf08f48b632054..247492fb7b77b4125f79289f11a70484e1d9440b 100644 (file)
@@ -13,8 +13,6 @@
 //
 // cc #48468
 
-#![feature(dyn_trait)]
-
 fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
index f1e59aed54a36622c48a58a84913ce58ad64723a..98249d3f2b567cbfac23e87ff46a620e8dc97b8c 100644 (file)
@@ -1,11 +1,11 @@
 error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
-  --> $DIR/dyn-trait-underscore.rs:20:20
+  --> $DIR/dyn-trait-underscore.rs:18:20
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |                    ^^^^
    |
-note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 18:1...
-  --> $DIR/dyn-trait-underscore.rs:18:1
+note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 16:1...
+  --> $DIR/dyn-trait-underscore.rs:16:1
    |
 LL | / fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
 LL | |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
@@ -13,7 +13,7 @@ LL | |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
 LL | | }
    | |_^
 note: ...so that reference does not outlive borrowed content
-  --> $DIR/dyn-trait-underscore.rs:20:14
+  --> $DIR/dyn-trait-underscore.rs:18:14
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |              ^^^^^