diff --git a/.mailmap b/.mailmap index b8a9fc27eb7c7..92be31747501e 100644 --- a/.mailmap +++ b/.mailmap @@ -102,6 +102,7 @@ Carol Willing Chandler Deng Charles Lew CrLF0710 Chris C Cerami Chris C Cerami +Chris Denton Chris Denton Chris Gregory Chris Pardy Chris Pressey diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d732075fb2d07..dfaa70bb9db00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index 47a351590b1de..090312338e009 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -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; } } diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 3ed3dd2d20d84..b58e62536d604 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -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>, - // 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, } diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs index 63bce5d0ccd44..d728dc038176c 100644 --- a/library/core/src/cell.rs +++ b/library/core/src/cell.rs @@ -1816,7 +1816,7 @@ impl fmt::Display for RefMut<'_, T> { /// `UnsafeCell` opts-out of the immutability guarantee for `&T`: a shared reference /// `&UnsafeCell` may point to data that is being mutated. This is called "interior mutability". /// -/// All other types that allow internal mutability, such as `Cell` and `RefCell`, internally +/// All other types that allow internal mutability, such as [`Cell`] and [`RefCell`], internally /// use `UnsafeCell` to wrap their data. /// /// Note that only the immutability guarantee for shared references is affected by `UnsafeCell`. The diff --git a/src/doc/book b/src/doc/book index 21a2ed14f4480..0510ca84c2ce6 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit 21a2ed14f4480dab62438dcc1130291bebc65379 +Subproject commit 0510ca84c2ce6bf93c4ccf9248756e9e4fd00b12 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index cfbfd648ce339..ba84bf35d0f17 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit cfbfd648ce33926c3490f24de9a5b56cce404b88 +Subproject commit ba84bf35d0f17d404003349309201654d25f61af diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide index d08baa166b463..fca8af6c154c6 160000 --- a/src/doc/rustc-dev-guide +++ b/src/doc/rustc-dev-guide @@ -1 +1 @@ -Subproject commit d08baa166b463537229eeb737c4ccadabd83cf78 +Subproject commit fca8af6c154c6cde2512f1331cf2704f214a818e diff --git a/tests/ui/async-await/missed-capture-issue-107414.rs b/tests/ui/async-await/missed-capture-issue-107414.rs new file mode 100644 index 0000000000000..0ab4f5ade9815 --- /dev/null +++ b/tests/ui/async-await/missed-capture-issue-107414.rs @@ -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) => {} + _ => {} + } +} diff --git a/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs b/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs new file mode 100644 index 0000000000000..eec7da044c0d5 --- /dev/null +++ b/tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs @@ -0,0 +1,10 @@ +// check-pass +trait MyCmp { + fn cmp(&self) {} +} +impl MyCmp for f32 {} + +fn main() { + // Ensure that `impl Ord for F` is never considered for int and float infer vars. + 0.0.cmp(); +} diff --git a/triagebot.toml b/triagebot.toml index c86c1613fa9ce..20a8be283b990 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -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 = [