mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
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:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -998,8 +998,14 @@ fn assemble_candidates_for_fn_ptr_trait(
|
||||
| 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -1816,7 +1816,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// `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
Submodule src/doc/book updated: 21a2ed14f4...0510ca84c2
+1
-1
Submodule src/doc/rust-by-example updated: cfbfd648ce...ba84bf35d0
+1
-1
Submodule src/doc/rustc-dev-guide updated: d08baa166b...fca8af6c15
@@ -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) => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
+1
-1
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user