Auto merge of #109911 - JohnTitor:rollup-7gjiqim, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #109783 (Update contributing links for rustc-dev-guide changes)
 - #109883 (Add links to <cell.rs>)
 - #109889 (Update book, rustc-dev-guide, rust-by-example)
 - #109896 (Never consider int and float vars for `FnPtr` candidates)
 - #109902 (Add async-await test for #107414)
 - #109903 (Add Chris Denton to `.mailmap`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-04-03 22:29:54 +00:00
commit cf7ada217c
11 changed files with 54 additions and 14 deletions

View file

@ -102,6 +102,7 @@ Carol Willing <carolcode@willingconsulting.com>
Chandler Deng <chandde@microsoft.com>
Charles Lew <crlf0710@gmail.com> CrLF0710 <crlf0710@gmail.com>
Chris C Cerami <chrisccerami@users.noreply.github.com> Chris C Cerami <chrisccerami@gmail.com>
Chris Denton <chris@chrisdenton.dev> Chris Denton <ChrisDenton@users.noreply.github.com>
Chris Gregory <czipperz@gmail.com>
Chris Pardy <chrispardy36@gmail.com>
Chris Pressey <cpressey@gmail.com>

View file

@ -33,7 +33,6 @@ find a mentor! You can learn more about asking questions and getting help in the
Did a compiler error message tell you to come here? If you want to create an ICE report,
refer to [this section][contributing-bug-reports] and [open an issue][issue template].
[Contributing to Rust]: https://rustc-dev-guide.rust-lang.org/contributing.html#contributing-to-rust
[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/
[std-dev-guide]: https://std-dev-guide.rust-lang.org/
[contributing-bug-reports]: https://rustc-dev-guide.rust-lang.org/contributing.html#bug-reports

View file

@ -998,8 +998,14 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
| ty::Alias(..)
| ty::Param(..)
| ty::Bound(..)
| ty::Error(_) => {}
ty::Infer(_) => {
| ty::Error(_)
| ty::Infer(
ty::InferTy::IntVar(_)
| ty::InferTy::FloatVar(_)
| ty::InferTy::FreshIntTy(_)
| ty::InferTy::FreshFloatTy(_),
) => {}
ty::Infer(ty::InferTy::TyVar(_) | ty::InferTy::FreshTy(_)) => {
candidates.ambiguous = true;
}
}

View file

@ -177,14 +177,14 @@ struct TraitObligationStack<'prev, 'tcx> {
}
struct SelectionCandidateSet<'tcx> {
// A list of candidates that definitely apply to the current
// obligation (meaning: types unify).
/// A list of candidates that definitely apply to the current
/// obligation (meaning: types unify).
vec: Vec<SelectionCandidate<'tcx>>,
// If `true`, then there were candidates that might or might
// not have applied, but we couldn't tell. This occurs when some
// of the input types are type variables, in which case there are
// various "builtin" rules that might or might not trigger.
/// If `true`, then there were candidates that might or might
/// not have applied, but we couldn't tell. This occurs when some
/// of the input types are type variables, in which case there are
/// various "builtin" rules that might or might not trigger.
ambiguous: bool,
}

View file

@ -1816,7 +1816,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
/// `UnsafeCell<T>` opts-out of the immutability guarantee for `&T`: a shared reference
/// `&UnsafeCell<T>` may point to data that is being mutated. This is called "interior mutability".
///
/// All other types that allow internal mutability, such as `Cell<T>` and `RefCell<T>`, internally
/// All other types that allow internal mutability, such as [`Cell<T>`] and [`RefCell<T>`], internally
/// use `UnsafeCell` to wrap their data.
///
/// Note that only the immutability guarantee for shared references is affected by `UnsafeCell`. The

@ -1 +1 @@
Subproject commit 21a2ed14f4480dab62438dcc1130291bebc65379
Subproject commit 0510ca84c2ce6bf93c4ccf9248756e9e4fd00b12

@ -1 +1 @@
Subproject commit cfbfd648ce33926c3490f24de9a5b56cce404b88
Subproject commit ba84bf35d0f17d404003349309201654d25f61af

@ -1 +1 @@
Subproject commit d08baa166b463537229eeb737c4ccadabd83cf78
Subproject commit fca8af6c154c6cde2512f1331cf2704f214a818e

View file

@ -0,0 +1,24 @@
// check-pass
// edition:2018
fn main() {}
struct StructA {}
struct StructB {}
impl StructA {
fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
true
}
}
async fn get_struct_a_async() -> StructA {
StructA {}
}
async fn ice() {
match Some(StructB {}) {
Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
_ => {}
}
}

View file

@ -0,0 +1,10 @@
// check-pass
trait MyCmp {
fn cmp(&self) {}
}
impl MyCmp for f32 {}
fn main() {
// Ensure that `impl<F: FnPtr> Ord for F` is never considered for int and float infer vars.
0.0.cmp();
}

View file

@ -482,7 +482,7 @@ message = "This PR changes src/bootstrap/defaults/config.codegen.toml. If approp
[assign]
warn_non_default_branch = true
contributing_url = "https://rustc-dev-guide.rust-lang.org/contributing.html"
contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"
[assign.adhoc_groups]
compiler-team = [