From ede7a777c08658ec54abea504da0e46cd0fb5e5b Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 28 Aug 2019 07:32:25 +0900 Subject: [PATCH] Remove `sized` spans --- src/librustc_typeck/check/cast.rs | 2 +- src/librustc_typeck/check/mod.rs | 2 +- src/test/ui/lang-item-missing.stderr | 4 ---- src/test/ui/privacy/privacy2.rs | 2 +- src/test/ui/privacy/privacy2.stderr | 4 ---- src/test/ui/privacy/privacy3.rs | 2 +- src/test/ui/privacy/privacy3.stderr | 4 ---- 7 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 6b88144d1fc..55e7a10f1aa 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -649,7 +649,7 @@ fn try_coercion_cast(&self, fcx: &FnCtxt<'a, 'tcx>) -> bool { impl<'a, 'tcx> FnCtxt<'a, 'tcx> { fn type_is_known_to_be_sized_modulo_regions(&self, ty: Ty<'tcx>, span: Span) -> bool { - let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, Some(span)); + let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, None); traits::type_known_to_meet_bound_modulo_regions(self, self.param_env, ty, lang_item, span) } } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 62e11fb421e..29fae13e6a8 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -2622,7 +2622,7 @@ pub fn require_type_is_sized(&self, span: Span, code: traits::ObligationCauseCode<'tcx>) { - let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, Some(span)); + let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, None); self.require_type_meets(ty, span, code, lang_item); } diff --git a/src/test/ui/lang-item-missing.stderr b/src/test/ui/lang-item-missing.stderr index 94d62023f35..f7516c7d377 100644 --- a/src/test/ui/lang-item-missing.stderr +++ b/src/test/ui/lang-item-missing.stderr @@ -1,8 +1,4 @@ error: requires `sized` lang_item - --> $DIR/lang-item-missing.rs:10:50 - | -LL | fn start(argc: isize, argv: *const *const u8) -> isize { - | ^^^^^ error: aborting due to previous error diff --git a/src/test/ui/privacy/privacy2.rs b/src/test/ui/privacy/privacy2.rs index 07634d9132e..c8fa436bd14 100644 --- a/src/test/ui/privacy/privacy2.rs +++ b/src/test/ui/privacy/privacy2.rs @@ -11,7 +11,7 @@ pub mod glob { } } -pub fn foo() {} //~ ERROR: requires `sized` lang_item +pub fn foo() {} fn test1() { use bar::foo; diff --git a/src/test/ui/privacy/privacy2.stderr b/src/test/ui/privacy/privacy2.stderr index eaa9f1ad652..9f2359657bd 100644 --- a/src/test/ui/privacy/privacy2.stderr +++ b/src/test/ui/privacy/privacy2.stderr @@ -11,10 +11,6 @@ LL | use bar::glob::foo; | ^^^ error: requires `sized` lang_item - --> $DIR/privacy2.rs:14:14 - | -LL | pub fn foo() {} - | ^ error: aborting due to 3 previous errors diff --git a/src/test/ui/privacy/privacy3.rs b/src/test/ui/privacy/privacy3.rs index 8853700180d..5a7cd76a98f 100644 --- a/src/test/ui/privacy/privacy3.rs +++ b/src/test/ui/privacy/privacy3.rs @@ -8,7 +8,7 @@ mod bar { pub use self::glob::*; mod glob { - fn gpriv() {} //~ ERROR: requires `sized` lang_item + fn gpriv() {} } } diff --git a/src/test/ui/privacy/privacy3.stderr b/src/test/ui/privacy/privacy3.stderr index 6826fbf9df2..22c1e48b07d 100644 --- a/src/test/ui/privacy/privacy3.stderr +++ b/src/test/ui/privacy/privacy3.stderr @@ -5,10 +5,6 @@ LL | use bar::gpriv; | ^^^^^^^^^^ no `gpriv` in `bar` error: requires `sized` lang_item - --> $DIR/privacy3.rs:11:20 - | -LL | fn gpriv() {} - | ^ error: aborting due to 2 previous errors