Skip to content

Instantly share code, notes, and snippets.

@spastorino

spastorino/log Secret

Created June 21, 2018 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spastorino/6f29aa8772c5de988df8d73190233dee to your computer and use it in GitHub Desktop.
Save spastorino/6f29aa8772c5de988df8d73190233dee to your computer and use it in GitHub Desktop.
diff --git a/src/librustc_mir/borrow_check/error_reporting.rs b/src/librustc_mir/borrow_check/error_reporting.rs
index 349e4ff933..c0f02ae609 100644
--- a/src/librustc_mir/borrow_check/error_reporting.rs
+++ b/src/librustc_mir/borrow_check/error_reporting.rs
@@ -706,6 +706,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
}
ProjectionElem::Downcast(..) => {
self.append_place_to_string(&proj.base, buf, autoderef)?;
+ return Err(());
}
ProjectionElem::Field(field, _ty) => {
autoderef = true;
diff --git a/src/test/ui/borrowck/issue-41962.rs b/src/test/ui/borrowck/issue-41962.rs
index 29481dbe52..b44a70b18e 100644
--- a/src/test/ui/borrowck/issue-41962.rs
+++ b/src/test/ui/borrowck/issue-41962.rs
@@ -20,7 +20,7 @@ pub fn main(){
//~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382]
//~| ERROR use of moved value: `maybe` (Mir) [E0382]
//~| ERROR use of moved value: `maybe` (Mir) [E0382]
- //~| ERROR use of moved value: `maybe.0` (Mir) [E0382]
+ //~| ERROR use of moved value: `_` (Mir) [E0382]
//~| ERROR borrow of moved value: `maybe` (Mir) [E0382]
}
}
diff --git a/src/test/ui/borrowck/issue-41962.stderr b/src/test/ui/borrowck/issue-41962.stderr
index 75fe5bfd8c..912f3748c1 100644
--- a/src/test/ui/borrowck/issue-41962.stderr
+++ b/src/test/ui/borrowck/issue-41962.stderr
@@ -26,7 +26,7 @@ LL | if let Some(thing) = maybe {
LL | | }
| |_________^ value used here after move
|
- = note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
+ = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value: `maybe` (Mir)
--> $DIR/issue-41962.rs:17:9
@@ -38,7 +38,7 @@ LL | if let Some(thing) = maybe {
LL | | }
| |_________^ value borrowed here after move
|
- = note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
+ = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `maybe` (Mir)
--> $DIR/issue-41962.rs:17:16
@@ -49,15 +49,15 @@ LL | if let Some(thing) = maybe {
| | value moved here
| value used here after move
|
- = note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
+ = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
-error[E0382]: use of moved value: `maybe.0` (Mir)
+error[E0382]: use of moved value: `_` (Mir)
--> $DIR/issue-41962.rs:17:21
|
LL | if let Some(thing) = maybe {
| ^^^^^ value moved here in previous iteration of loop
|
- = note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
+ = note: move occurs because value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
error: aborting due to 6 previous errors
diff --git a/src/test/ui/error-codes/E0657.stderr b/src/test/ui/error-codes/E0657.stderr
index 737ae3a163..df0234a766 100644
--- a/src/test/ui/error-codes/E0657.stderr
+++ b/src/test/ui/error-codes/E0657.stderr
@@ -10,6 +10,8 @@ error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl le
LL | -> Box<for<'a> Id<impl Lt<'a>>>
| ^^
+#0 [typeck_tables_of] processing `free_fn_capture_hrtb_in_impl_trait`
+#1 [type_of] processing `free_fn_capture_hrtb_in_impl_trait::{{exist-impl-Trait}}`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0657`.
diff --git a/src/test/ui/impl_trait_projections.stderr b/src/test/ui/impl_trait_projections.stderr
index f6d58984ec..2802df1080 100644
--- a/src/test/ui/impl_trait_projections.stderr
+++ b/src/test/ui/impl_trait_projections.stderr
@@ -30,6 +30,7 @@ LL | fn projection_is_disallowed(x: impl Iterator) -> <impl Iterator>::Item {
|
= note: specify the type using the syntax `<impl std::iter::Iterator as Trait>::Item`
+#0 [type_of] processing `projection_is_disallowed::{{exist-impl-Trait}}`
error: aborting due to 5 previous errors
Some errors occurred: E0223, E0667.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment