Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7750357
Return early to avoid ICE
JohnTitor May 30, 2020
2d4b09a
[AVR] Add AVR platform support
shepmaster May 6, 2016
a42bf5a
[AVR] Fix debug printing of function pointers
dylanmckay Jun 8, 2019
208adf9
[AVR] Add required references for AVR to the parser test suites
dylanmckay Mar 3, 2020
94a94d7
[AVR] Raise and link to a tracking issue for the `avr-interrupt` call…
dylanmckay Mar 3, 2020
717268c
[AVR] Re-bless the UI tests
dylanmckay Mar 4, 2020
737c342
[AVR] Update the compiletest library to recognize AVR as a 16-bit target
dylanmckay Mar 5, 2020
94ece5e
[AVR] Re-bless the 'test/ui/symbol-names' tests
dylanmckay Mar 5, 2020
cd890ff
[AVR] Remove AVR-specific logic from libstd
dylanmckay Apr 1, 2020
6260bc4
[AVR] Rename the 'none_base' target spec module to 'freestanding_base'
dylanmckay Apr 1, 2020
491bf8c
[AVR] Update ABI type classification logic to match the the AVR-Clang…
dylanmckay May 17, 2020
f6dfbbb
On recursive ADT, provide indirection structured suggestion
estebank May 29, 2020
c209040
review comments: only suggest one substitution
estebank May 31, 2020
5707838
validate basic sanity for TerminatorKind
RalfJung May 31, 2020
e07e424
replace DUMMY_SP by proper span
RalfJung May 31, 2020
9a4bdbf
more checks for SwitchInt
RalfJung May 31, 2020
f793c0b
always print MIR Location when validator finds a problem
RalfJung May 31, 2020
717fd66
Make `SourceMap` available for early debug-printing of `Span`s
Aaron1011 May 26, 2020
aa5d29f
bump Miri, update for cargo-miri being a separate project
RalfJung May 31, 2020
f019526
Rollup merge of #69478 - avr-rust:avr-support-upstream, r=jonas-schie…
RalfJung Jun 1, 2020
54ca0f2
Rollup merge of #72618 - Aaron1011:feature/early-sourcemap, r=petroch…
RalfJung Jun 1, 2020
ceb26de
Rollup merge of #72740 - estebank:recursive-indirection, r=matthewjasper
RalfJung Jun 1, 2020
11c0fbb
Rollup merge of #72775 - JohnTitor:await-sugg, r=estebank
RalfJung Jun 1, 2020
412910e
Rollup merge of #72779 - RalfJung:miri, r=oli-obk
RalfJung Jun 1, 2020
6e916b7
Rollup merge of #72810 - RalfJung:mir-terminate-sanity, r=jonas-schie…
RalfJung Jun 1, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,12 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {

let self_ty = self.resolve_vars_if_possible(&trait_ref.self_ty());

// Do not check on infer_types to avoid panic in evaluate_obligation.
if self_ty.has_infer_types() {
return;
}
let self_ty = self.tcx.erase_regions(&self_ty);

let impls_future = self.tcx.type_implements_trait((
future_trait,
self_ty,
Expand Down
7 changes: 0 additions & 7 deletions src/librustc_trait_selection/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,13 +540,6 @@ fn type_implements_trait<'tcx>(
trait_def_id, ty, params, param_env
);

// Do not check on infer_types to avoid panic in evaluate_obligation.
if ty.has_infer_types() {
return false;
}

let ty = tcx.erase_regions(&ty);

let trait_ref = ty::TraitRef { def_id: trait_def_id, substs: tcx.mk_substs_trait(ty, params) };

let obligation = Obligation {
Expand Down
20 changes: 20 additions & 0 deletions src/test/ui/suggestions/issue-72766.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// edition:2018
// compile-flags: -Cincremental=tmp/issue-72766

pub struct SadGirl;

impl SadGirl {
pub async fn call(&self) -> Result<(), ()> {
Ok(())
}
}

async fn async_main() -> Result<(), ()> {
// should be `.call().await?`
SadGirl {}.call()?; //~ ERROR: the `?` operator can only be applied to values
Ok(())
}

fn main() {
let _ = async_main();
}
15 changes: 15 additions & 0 deletions src/test/ui/suggestions/issue-72766.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/issue-72766.rs:14:5
|
LL | SadGirl {}.call()?;
| ^^^^^^^^^^^^^^^^^^
| |
| the `?` operator cannot be applied to type `impl std::future::Future`
| help: consider using `.await` here: `SadGirl {}.call().await?`
|
= help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
= note: required by `std::ops::Try::into_result`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
5 changes: 5 additions & 0 deletions src/tools/clippy/clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ pub fn implements_trait<'a, 'tcx>(
trait_id: DefId,
ty_params: &[GenericArg<'tcx>],
) -> bool {
// Do not check on infer_types to avoid panic in evaluate_obligation.
if ty.has_infer_types() {
return false;
}
let ty = cx.tcx.erase_regions(&ty);
let ty_params = cx.tcx.mk_substs(ty_params.iter());
cx.tcx.type_implements_trait((trait_id, ty, ty_params, cx.param_env))
}
Expand Down