Skip to content

Commit

Permalink
enable the feature by default
Browse files Browse the repository at this point in the history
  • Loading branch information
SparrowLii committed Nov 11, 2022
1 parent 3bea6bc commit 61fd9d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if let Some(base_expr) = base_expr {
// FIXME: We are currently creating two branches here in order to maintain
// consistency. But they should be merged as much as possible.
let fru_tys = if self.tcx.features().type_changing_struct_update {
let fru_tys = if self.tcx.features().type_changing_struct_update || true {
if adt.is_struct() {
// Make some fresh substitutions for our ADT type.
let fresh_substs = self.fresh_substs_for_item(base_expr.span, adt.did());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ fn update_to_state2() {
common_field2: 2,
};
let m2: Machine<State2> = Machine {
state: State2,
state: State1,
//~^ ERROR mismatched types [E0308]
..m1
//~^ ERROR type changing struct updating is experimental [E0658]
//~| ERROR mismatched types [E0308]
};
assert_eq!(State2, m2.state);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
error[E0658]: type changing struct updating is experimental
--> $DIR/feature-gate.rs:22:11
|
LL | ..m1
| ^^
|
= note: see issue #86555 <https://github.com/rust-lang/rust/issues/86555> for more information
= help: add `#![feature(type_changing_struct_update)]` to the crate attributes to enable

error[E0308]: mismatched types
--> $DIR/feature-gate.rs:22:11
|
LL | ..m1
| ^^ expected struct `State2`, found struct `State1`
--> $DIR/feature-gate.rs:21:16
|
= note: expected struct `Machine<State2>`
found struct `Machine<State1>`
LL | state: State1,
| ^^^^^^ expected struct `State2`, found struct `State1`

error: aborting due to 2 previous errors
error: aborting due to previous error

Some errors have detailed explanations: E0308, E0658.
For more information about an error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.

0 comments on commit 61fd9d5

Please sign in to comment.