Skip to content

Rollup of 7 pull requests #100330

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 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
27b9b16
Error on broken pipe but do not ICE
ChrisDenton Aug 2, 2022
9cf5709
Suggest expressions' fields even if they're not ADTs
compiler-errors Aug 3, 2022
4df6cbe
Consider privacy more carefully when suggesting accessing fields
compiler-errors Aug 3, 2022
2a3fd50
Don't suggest field method if it's just missing some bounds
compiler-errors Aug 3, 2022
603ffeb
Skip over structs with no private fields that impl Deref
compiler-errors Aug 3, 2022
18a21e1
Remove duplicated temporaries creating during box derefs elaboration
tmiasko Aug 6, 2022
7d2131a
./x.py test --bless
tmiasko Aug 6, 2022
db7ddc5
Do not manually craft a span pointing inside a multibyte character.
cjgillot Aug 7, 2022
ac75863
Add more `// unit-test`s to MIR opt tests
JakobDegen Aug 3, 2022
bed8e93
remove Clean trait implementation for hir::ImplItem
GuillaumeGomez Aug 8, 2022
daa0e8f
remove Clean trait implementation for hir::Generics
GuillaumeGomez Aug 8, 2022
fb8636f
Set tainted errors bit before emitting coerce suggestions.
luqmana Aug 8, 2022
75cc9cd
Add test for #100246.
luqmana Aug 8, 2022
507b299
Rollup merge of #100040 - ChrisDenton:broken-pipe, r=davidtwco
Dylan-DPC Aug 9, 2022
5ca5f02
Rollup merge of #100086 - JakobDegen:better-tests, r=wesleywiser
Dylan-DPC Aug 9, 2022
2adcb4c
Rollup merge of #100098 - compiler-errors:field-suggestion-fixups, r=…
Dylan-DPC Aug 9, 2022
0888432
Rollup merge of #100192 - tmiasko:rm-duplicated-locals, r=nagisa
Dylan-DPC Aug 9, 2022
be071ec
Rollup merge of #100226 - cjgillot:noice-multibyte, r=davidtwco
Dylan-DPC Aug 9, 2022
e606861
Rollup merge of #100261 - luqmana:suggestions-overflow, r=lcnr
Dylan-DPC Aug 9, 2022
6109582
Rollup merge of #100319 - GuillaumeGomez:rm-clean-impls-2, r=Dylan-DPC
Dylan-DPC Aug 9, 2022
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
30 changes: 30 additions & 0 deletions src/test/ui/typeck/issue-100246.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#![recursion_limit = "5"] // To reduce noise

//expect incompatible type error when ambiguous traits are in scope
//and not an overflow error on the span in the main function.

struct Ratio<T>(T);

pub trait Pow {
fn pow(self) -> Self;
}

impl<'a, T> Pow for &'a Ratio<T>
where
&'a T: Pow,
{
fn pow(self) -> Self {
self
}
}

fn downcast<'a, W: ?Sized>() -> std::io::Result<&'a W> {
todo!()
}

struct Other;

fn main() -> std::io::Result<()> {
let other: Other = downcast()?;//~ERROR 28:24: 28:35: `?` operator has incompatible types
Ok(())
}
13 changes: 13 additions & 0 deletions src/test/ui/typeck/issue-100246.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error[E0308]: `?` operator has incompatible types
--> $DIR/issue-100246.rs:28:24
|
LL | let other: Other = downcast()?;
| ^^^^^^^^^^^ expected struct `Other`, found reference
|
= note: `?` operator cannot convert from `&_` to `Other`
= note: expected struct `Other`
found reference `&_`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.