8000 Rollup of 6 pull requests by Centril · Pull Request #66601 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 6 pull requests #66601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b380d35
add ui test for issue-62097
csmoe Oct 23, 2019
dcc14c4
suggest to add a constraint except asyn-fn without explicit output
csmoe Oct 23, 2019
9124f7a
update suggestion ui test
csmoe Oct 23, 2019
405866a
re-add miri intrinsic ABI check
RalfJung Nov 16, 2019
44b6811
rename and move read_vector_ty
RalfJung Nov 16, 2019
09180d7
make simd_size return a u64
RalfJung Nov 16, 2019
8952c8a
ICE on invalid MIR
RalfJung Nov 16, 2019
5e115a2
avoid some casts
RalfJung Nov 16, 2019
5b0e702
Create a generic HashStable derive.
cjgillot Nov 9, 2019
c2e1658
Use proc_macro for HashStable derive in libsyntax.
cjgillot Nov 9, 2019
05f5f76
Move impl HashStable for SymbolStr in libsyntax_pos.
cjgillot Nov 9, 2019
1dd5133
Move impl HashStable for Symbol in libsyntax_pos.
cjgillot Nov 9, 2019
efcb695
Further HashStable_Generic derives.
cjgillot Nov 9, 2019
2a67986
HashStable literals in libsyntax.
cjgillot Nov 9, 2019
a265bc2
HashStable_Generic for libsyntax_pos.
8000 cjgillot Nov 9, 2019
2ba84c6
HashStable_Generic for librustc_target.
cjgillot Nov 9, 2019
333c114
Derive HashStable in librustc_target.
cjgillot Nov 9, 2019
375a761
HashStable in libsyntax.
cjgillot Nov 9, 2019
79bde05
Derive HashStable for PanicStrategy.
cjgillot Nov 9, 2019
e8e7ad6
Implement HashStable for RangeInclusive.
cjgillot Nov 16, 2019
5b4dad7
Derive HashStable_Generic for ABI types.
cjgillot Nov 16, 2019
3d97a91
Remove extern crate.
cjgillot Nov 16, 2019
44a595f
Simplify impl for SymbolStr.
cjgillot Nov 16, 2019
eda67ba
Disable gdb pretty printer global section on wasm targets
alexcrichton Nov 18, 2019
bca64ce
Point at type in `let` assignment on type errors
estebank Nov 19, 2019
44cebe5
reduce size of hir::ExprKind
Centril Nov 18, 2019
166b13b
Rollup merge of #65730 - csmoe:return-lifetime, r=nikomatsakis
Centril Nov 21, 2019
fe1f735
Rollup merge of #66460 - cjgillot:hashstable_generic, r=Zoxc
Centril Nov 21, 2019
9761a69
Rollup merge of #66468 - RalfJung:simd-cleanup, r=oli-obk
Centril Nov 21, 2019
90e7976
Rollup merge of #66515 - Centril:cheaper-inline-asm, r=oli-obk
Centril Nov 21, 2019
5585280
Rollup merge of #66520 - alexcrichton:disable-gdb-wasm, r=eddyb
Centril Nov 21, 2019
6815e4b
Rollup merge of #66539 - estebank:let-ty, r=Centril
Centril Nov 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
suggest to add a constraint except asyn-fn without explicit output
  • Loading branch information
csmoe committed Nov 11, 2019
commit dcc14c40eee3139e53bfacd3854af8a5a3d379e8
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
///
/// It will later be extended to trait objects.
pub(super) fn try_report_anon_anon_conflict(&self) -> Option<ErrorReported> {
let (span, sub, sup) = self.get_regions();
let (span, sub, sup) = self.regions();

// Determine whether the sub and sup consist of both anonymous (elided) regions.
let anon_reg_sup = self.tcx().is_suitable_region(sup)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<'cx, 'tcx> NiceRegionError<'cx, 'tcx> {
.or_else(|| self.try_report_impl_not_conforming_to_trait())
}

pub fn get_regions(&self) -> (Span, ty::Region<'tcx>, ty::Region<'tcx>) {
pub fn regions(&self) -> (Span, ty::Region<'tcx>, ty::Region<'tcx>) {
match (&self.error, self.regions) {
(Some(ConcreteFailure(origin, sub, sup)), None) => (origin.span(), sub, sup),
(Some(SubSupConflict(_, _, origin, sub, _, sup)), None) => (origin.span(), sub, sup),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// When given a `ConcreteFailure` for a function with parameters containing a named region and
/// an anonymous region, emit an descriptive diagnostic error.
pub(super) fn try_report_named_anon_conflict(&self) -> Option<DiagnosticBuilder<'a>> {
let (span, sub, sup) = self.get_regions();
let (span, sub, sup) = self.regions();

debug!(
"try_report_named_anon_conflict(sub={:?}, sup={:?}, error={:?})",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
) = error.clone()
{
let anon_reg_sup = self.tcx().is_suitable_region(sup_r)?;
let return_ty = self.tcx().return_type_impl_trait(anon_reg_sup.def_id);
if sub_r == &RegionKind::ReStatic &&
self.tcx().return_type_impl_trait(anon_reg_sup.def_id).is_some()
return_ty.is_some()
{
let sp = var_origin.span();
let return_sp = sub_origin.span();
Expand Down Expand Up @@ -53,16 +54,19 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
_ => "'_".to_owned(),
};
if let Ok(snippet) = self.tcx().sess.source_map().span_to_snippet(return_sp) {
err.span_suggestion(
return_sp,
&format!(
"you can add a constraint to the return type to make it last \
// only apply this suggestion onto non-async fnunctions
if !return_ty.unwrap().1 {
err.span_suggestion(
return_sp,
&format!(
"you can add a constraint to the return type to make it last \
less than `'static` and match {}",
lifetime,
),
format!("{} + {}", snippet, lifetime_name),
Applicability::Unspecified,
);
lifetime,
),
format!("{} + {}", snippet, lifetime_name),
Applicability::Unspecified,
);
}
}
err.emit();
return Some(ErrorReported);
Expand Down
8 changes: 5 additions & 3 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1552,14 +1552,14 @@ impl<'tcx> TyCtxt<'tcx> {
return Some(FreeRegionInfo {
def_id: suitable_region_binding_scope,
boundregion: bound_region,
is_impl_item: is_impl_item,
is_impl_item,
});
}

pub fn return_type_impl_trait(
&self,
scope_def_id: DefId,
) -> Option<Ty<'tcx>> {
) -> Option<(Ty<'tcx>, bool)> {
// HACK: `type_of_def_id()` will fail on these (#55796), so return `None`.
let hir_id = self.hir().as_local_hir_id(scope_def_id).unwrap();
match self.hir().get(hir_id) {
Expand All @@ -1579,8 +1579,10 @@ impl<'tcx> TyCtxt<'tcx> {
ty::FnDef(_, _) => {
let sig = ret_ty.fn_sig(*self);
let output = self.erase_late_bound_regions(&sig.output());
let is_async_fn =
hir::IsAsync::Async == self.asyncness(scope_def_id);
if output.is_impl_trait() {
Some(output)
Some((output, is_async_fn))
} else {
None
}
Expand Down
4 changes: 2 additions & 2 deletions < 6D47 span class="Truncate"> src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
if let (Some(f), Some(ty::RegionKind::ReStatic)) =
(self.to_error_region(fr), self.to_error_region(outlived_fr))
{
if let Some(ty::TyS {
if let Some((ty::TyS {
kind: ty::Opaque(did, substs),
..
}) = infcx
}, _)) = infcx
.tcx
.is_suitable_region(f)
.map(|r| r.def_id)
Expand Down
0