Apply review comments

This commit is contained in:
Yuki Okushi 2019-08-28 07:10:47 +09:00
parent 82f2b37635
commit 8c921beebb
9 changed files with 21 additions and 6 deletions

View File

@ -1754,7 +1754,7 @@ impl<'tcx> MirPass<'tcx> for QualifyAndPromoteConstants<'tcx> {
ty,
tcx.require_lang_item(
lang_items::SyncTraitLangItem,
None
Some(body.span)
),
cause);
if let Err(err) = fulfillment_cx.select_all_or_error(&infcx) {

View File

@ -897,7 +897,10 @@ where
) -> BasicBlock {
let tcx = self.tcx();
let unit_temp = Place::from(self.new_temp(tcx.mk_unit()));
let free_func = tcx.require_lang_item(lang_items::BoxFreeFnLangItem, None);
let free_func = tcx.require_lang_item(
lang_items::BoxFreeFnLangItem,
Some(self.source_info.span)
);
let args = adt.variants[VariantIdx::new(0)].fields.iter().enumerate().map(|(i, f)| {
let field = Field::new(i);
let field_ty = f.ty(self.tcx(), substs);

View File

@ -649,7 +649,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
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, None);
let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, Some(span));
traits::type_known_to_meet_bound_modulo_regions(self, self.param_env, ty, lang_item, span)
}
}

View File

@ -2622,7 +2622,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
span: Span,
code: traits::ObligationCauseCode<'tcx>)
{
let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, None);
let lang_item = self.tcx.require_lang_item(lang_items::SizedTraitLangItem, Some(span));
self.require_type_meets(ty, span, code, lang_item);
}

View File

@ -1,4 +1,8 @@
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

View File

@ -11,7 +11,7 @@ mod bar {
}
}
pub fn foo() {}
pub fn foo() {} //~ ERROR: requires `sized` lang_item
fn test1() {
use bar::foo;

View File

@ -11,6 +11,10 @@ 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

View File

@ -8,7 +8,7 @@ mod bar {
pub use self::glob::*;
mod glob {
fn gpriv() {}
fn gpriv() {} //~ ERROR: requires `sized` lang_item
}
}

View File

@ -5,6 +5,10 @@ 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