Skip to content

Commit cf7ada2

Browse files
committed
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
2 parents 48829ea + b691507 commit cf7ada2

File tree

11 files changed

+54
-14
lines changed

11 files changed

+54
-14
lines changed

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Carol Willing <carolcode@willingconsulting.com>
102102
Chandler Deng <chandde@microsoft.com>
103103
Charles Lew <crlf0710@gmail.com> CrLF0710 <crlf0710@gmail.com>
104104
Chris C Cerami <chrisccerami@users.noreply.github.com> Chris C Cerami <chrisccerami@gmail.com>
105+
Chris Denton <chris@chrisdenton.dev> Chris Denton <ChrisDenton@users.noreply.github.com>
105106
Chris Gregory <czipperz@gmail.com>
106107
Chris Pardy <chrispardy36@gmail.com>
107108
Chris Pressey <cpressey@gmail.com>

CONTRIBUTING.md

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ find a mentor! You can learn more about asking questions and getting help in the
3333
Did a compiler error message tell you to come here? If you want to create an ICE report,
3434
refer to [this section][contributing-bug-reports] and [open an issue][issue template].
3535

36-
[Contributing to Rust]: https://rustc-dev-guide.rust-lang.org/contributing.html#contributing-to-rust
3736
[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/
3837
[std-dev-guide]: https://std-dev-guide.rust-lang.org/
3938
[contributing-bug-reports]: https://rustc-dev-guide.rust-lang.org/contributing.html#bug-reports

compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,14 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
998998
| ty::Alias(..)
999999
| ty::Param(..)
10001000
| ty::Bound(..)
1001-
| ty::Error(_) => {}
1002-
ty::Infer(_) => {
1001+
| ty::Error(_)
1002+
| ty::Infer(
1003+
ty::InferTy::IntVar(_)
1004+
| ty::InferTy::FloatVar(_)
1005+
| ty::InferTy::FreshIntTy(_)
1006+
| ty::InferTy::FreshFloatTy(_),
1007+
) => {}
1008+
ty::Infer(ty::InferTy::TyVar(_) | ty::InferTy::FreshTy(_)) => {
10031009
candidates.ambiguous = true;
10041010
}
10051011
}

compiler/rustc_trait_selection/src/traits/select/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ struct TraitObligationStack<'prev, 'tcx> {
177177
}
178178

179179
struct SelectionCandidateSet<'tcx> {
180-
// A list of candidates that definitely apply to the current
181-
// obligation (meaning: types unify).
180+
/// A list of candidates that definitely apply to the current
181+
/// obligation (meaning: types unify).
182182
vec: Vec<SelectionCandidate<'tcx>>,
183183

184-
// If `true`, then there were candidates that might or might
185-
// not have applied, but we couldn't tell. This occurs when some
186-
// of the input types are type variables, in which case there are
187-
// various "builtin" rules that might or might not trigger.
184+
/// If `true`, then there were candidates that might or might
185+
/// not have applied, but we couldn't tell. This occurs when some
186+
/// of the input types are type variables, in which case there are
187+
/// various "builtin" rules that might or might not trigger.
188188
ambiguous: bool,
189189
}
190190

library/core/src/cell.rs

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

src/doc/book

Submodule book updated 1 file
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// check-pass
2+
// edition:2018
3+
4+
fn main() {}
5+
6+
struct StructA {}
7+
struct StructB {}
8+
9+
impl StructA {
10+
fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
11+
true
12+
}
13+
}
14+
15+
async fn get_struct_a_async() -> StructA {
16+
StructA {}
17+
}
18+
19+
async fn ice() {
20+
match Some(StructB {}) {
21+
Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
22+
_ => {}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// check-pass
2+
trait MyCmp {
3+
fn cmp(&self) {}
4+
}
5+
impl MyCmp for f32 {}
6+
7+
fn main() {
8+
// Ensure that `impl<F: FnPtr> Ord for F` is never considered for int and float infer vars.
9+
0.0.cmp();
10+
}

triagebot.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ message = "This PR changes src/bootstrap/defaults/config.codegen.toml. If approp
482482

483483
[assign]
484484
warn_non_default_branch = true
485-
contributing_url = "https://rustc-dev-guide.rust-lang.org/contributing.html"
485+
contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"
486486

487487
[assign.adhoc_groups]
488488
compiler-team = [

0 commit comments

Comments
 (0)