Skip to content

Commit

Permalink
Auto merge of #109911 - JohnTitor:rollup-7gjiqim, r=JohnTitor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Apr 3, 2023
2 parents 48829ea + b691507 commit cf7ada2
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 14 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Carol Willing <[email protected]>
Chandler Deng <[email protected]>
Charles Lew <[email protected]> CrLF0710 <[email protected]>
Chris C Cerami <[email protected]> Chris C Cerami <[email protected]>
Chris Denton <[email protected]> Chris Denton <[email protected]>
Chris Gregory <[email protected]>
Chris Pardy <[email protected]>
Chris Pressey <[email protected]>
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 1 files
+3 −290 COPYRIGHT
24 changes: 24 additions & 0 deletions tests/ui/async-await/missed-capture-issue-107414.rs
Original file line number Diff line number Diff line change
@@ -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) => {}
_ => {}
}
}
10 changes: 10 additions & 0 deletions tests/ui/fn/fn-ptr-trait-int-float-infer-var.rs
Original file line number Diff line number Diff line change
@@ -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();
}
2 changes: 1 addition & 1 deletion triagebot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit cf7ada2

Please sign in to comment.