-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Ty::builtin_deref
just return a Ty
#124957
Conversation
rustbot has assigned @michaelwoerister. Use |
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@@ -1483,10 +1483,9 @@ fn suggest_ampmut<'tcx>( | |||
} else { | |||
// otherwise, suggest that the user annotates the binding; we provide the | |||
// type of the local. | |||
let ty_mut = decl_ty.builtin_deref(true).unwrap(); | |||
assert_eq!(ty_mut.mutbl, hir::Mutability::Not); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only usage of this mutability remaining in the compiler is this assertion that's in diagnostics. I don't think it's necessary.
This comment has been minimized.
This comment has been minimized.
b1674a7
to
d50c2b0
Compare
Nice cleanup, thanks @compiler-errors! @bors r+ rollup |
…ichaelwoerister Make `Ty::builtin_deref` just return a `Ty` Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#124615 (coverage: Further simplify extraction of mapping info from MIR) - rust-lang#124778 (Fix parse error message for meta items) - rust-lang#124807 (Migrate `run-make/rustdoc-io-error` to `rmake.rs`) - rust-lang#124957 (Make `Ty::builtin_deref` just return a `Ty`) Failed merges: - rust-lang#124888 (Migrate `run-make/rustdoc-output-path` to rmake) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#124615 (coverage: Further simplify extraction of mapping info from MIR) - rust-lang#124778 (Fix parse error message for meta items) - rust-lang#124797 (Refactor float `Primitive`s to a separate `Float` type) - rust-lang#124888 (Migrate `run-make/rustdoc-output-path` to rmake) - rust-lang#124957 (Make `Ty::builtin_deref` just return a `Ty`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124957 - compiler-errors:builtin-deref, r=michaelwoerister Make `Ty::builtin_deref` just return a `Ty` Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
…ichaelwoerister Make `Ty::builtin_deref` just return a `Ty` Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
…ichaelwoerister Make `Ty::builtin_deref` just return a `Ty` Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#124615 (coverage: Further simplify extraction of mapping info from MIR) - rust-lang#124778 (Fix parse error message for meta items) - rust-lang#124797 (Refactor float `Primitive`s to a separate `Float` type) - rust-lang#124888 (Migrate `run-make/rustdoc-output-path` to rmake) - rust-lang#124957 (Make `Ty::builtin_deref` just return a `Ty`) r? `@ghost` `@rustbot` modify labels: rollup
Nowhere in the compiler are we using the mutability part of the
TyAndMut
that we used to return.