diff --git a/compiler/base/orchestrator/src/coordinator.rs b/compiler/base/orchestrator/src/coordinator.rs index 85645496..75352fcb 100644 --- a/compiler/base/orchestrator/src/coordinator.rs +++ b/compiler/base/orchestrator/src/coordinator.rs @@ -3074,11 +3074,7 @@ mod tests { r#"fn x() { u16::try_from(1u8); }"#, [false, false, true, true], ), - ( - r#"#![feature(gen_blocks)] - fn x() { gen { yield 1u8 }; }"#, - [false, false, false, true], - ), + (r#"fn x() { let gen = true; }"#, [true, true, true, false]), ]; let tests = params.into_iter().flat_map(|(code, works_in)| { @@ -3090,7 +3086,6 @@ mod tests { code: code.into(), edition, crate_type: CrateType::Library(LibraryType::Lib), - channel: Channel::Nightly, // To allow 2024 while it is unstable ..ARBITRARY_EXECUTE_REQUEST }; let response = coordinator.execute(request).await.unwrap(); @@ -3524,7 +3519,6 @@ mod tests { let req = CompileRequest { edition, code: SUBTRACT_CODE.into(), - channel: Channel::Nightly, // To allow 2024 while it is unstable ..ARBITRARY_HIR_REQUEST }; @@ -3855,7 +3849,6 @@ mod tests { let req = FormatRequest { edition, code: code.into(), - channel: Channel::Nightly, // To allow 2024 while it is unstable ..ARBITRARY_FORMAT_REQUEST }; @@ -4265,14 +4258,10 @@ mod tests { }); trait TimeoutExt: Future + Sized { - #[allow(clippy::type_complexity)] - fn with_timeout( - self, - ) -> futures::future::Map< - tokio::time::Timeout, - fn(Result) -> Self::Output, - > { - tokio::time::timeout(*TIMEOUT, self).map(|v| v.expect("The operation timed out")) + async fn with_timeout(self) -> Self::Output { + tokio::time::timeout(*TIMEOUT, self) + .await + .expect("The operation timed out") } } diff --git a/tests/spec/features/compilation_targets_spec.rb b/tests/spec/features/compilation_targets_spec.rb index 9198c3e9..4c4f588d 100644 --- a/tests/spec/features/compilation_targets_spec.rb +++ b/tests/spec/features/compilation_targets_spec.rb @@ -119,7 +119,7 @@ scenario "compiling a library to WebAssembly" do editor.set <<~EOF - #[no_mangle] + #[unsafe(no_mangle)] pub fn calculator(a: u8) -> u8 { a + 42 } EOF diff --git a/tests/spec/features/editions_spec.rb b/tests/spec/features/editions_spec.rb index f828c3db..b5219db7 100644 --- a/tests/spec/features/editions_spec.rb +++ b/tests/spec/features/editions_spec.rb @@ -39,13 +39,8 @@ scenario "using the 2024 edition" do editor.set <<-EOF - #![feature(gen_blocks)] - fn main() { - let mut x = gen { yield 1 }; - - eprintln!("{:?}", x.next()); - eprintln!("{:?}", x.next()); + let gen = 1; } EOF @@ -53,8 +48,7 @@ click_on("Run") within(:output, :stderr) do - expect(page).to have_content 'Some(1)' - expect(page).to have_content 'None' + expect(page).to have_content 'found reserved keyword `gen`' end end diff --git a/tests/spec/features/url_parameters_spec.rb b/tests/spec/features/url_parameters_spec.rb index 4f7d3021..b70c2ccb 100644 --- a/tests/spec/features/url_parameters_spec.rb +++ b/tests/spec/features/url_parameters_spec.rb @@ -104,7 +104,7 @@ scenario "loading without code or an edition" do visit '/' - expect(page).to have_edition('2021') + expect(page).to have_edition('2024') end def editor diff --git a/ui/frontend/AdvancedOptionsMenu.tsx b/ui/frontend/AdvancedOptionsMenu.tsx index a684ed0a..4e73ba6b 100644 --- a/ui/frontend/AdvancedOptionsMenu.tsx +++ b/ui/frontend/AdvancedOptionsMenu.tsx @@ -4,7 +4,7 @@ import * as config from './reducers/configuration'; import { Either as EitherConfig, Select as SelectConfig } from './ConfigElement'; import MenuGroup from './MenuGroup'; import * as selectors from './selectors'; -import { Backtrace, Channel, Edition } from './types'; +import { Backtrace, Edition } from './types'; import { useAppDispatch, useAppSelector } from './hooks'; const AdvancedOptionsMenu: React.FC = () => { @@ -18,9 +18,6 @@ const AdvancedOptionsMenu: React.FC = () => { const changeEdition = useCallback((e: Edition) => dispatch(config.changeEdition(e)), [dispatch]); const changeBacktrace = useCallback((b: Backtrace) => dispatch(config.changeBacktrace(b)), [dispatch]); - const channel = useAppSelector((state) => state.configuration.channel); - const switchText = (channel !== Channel.Nightly) ? ' (will select nightly Rust)' : ''; - return ( { - + { return (
- +
); }; -const RustSurvey2024Notification: React.FC = () => { - const showIt = useAppSelector(selectors.showRustSurvey2024Selector); +const Rust2024IsDefaultNotification: React.FC = () => { + const showIt = useAppSelector(selectors.showRust2024IsDefaultSelector); const dispatch = useAppDispatch(); - const seenIt = useCallback(() => dispatch(seenRustSurvey2024()), [dispatch]); + const seenIt = useCallback(() => dispatch(seenRust2024IsDefault()), [dispatch]); return showIt ? ( - Please help us take a look at who the Rust community is composed of, how the Rust project is - doing, and how we can improve the Rust programming experience by completing the{' '} - 2024 State of Rust Survey. Whether or not you use Rust today, we want - to know your opinions. + As of Rust 1.85, the default edition of Rust is now Rust 2024. Learn more about editions in + the Edition Guide. To specify which edition to use, use the advanced + compilation options menu. ) : null; }; diff --git a/ui/frontend/actions.ts b/ui/frontend/actions.ts index e23a312c..6be48827 100644 --- a/ui/frontend/actions.ts +++ b/ui/frontend/actions.ts @@ -5,7 +5,7 @@ import { addCrateType, editCode } from './reducers/code'; import { changeBacktrace, changeChannel, - changeEditionRaw, + changeEdition, changeMode, changePrimaryAction, } from './reducers/configuration'; @@ -153,7 +153,7 @@ export function indexPageLoad({ } } - const edition = maybeEdition || Edition.Rust2021; + const edition = maybeEdition || Edition.Rust2024; if (code) { dispatch(editCode(code)); @@ -163,7 +163,7 @@ export function indexPageLoad({ dispatch(changeChannel(channel)); dispatch(changeMode(mode)); - dispatch(changeEditionRaw(edition)); + dispatch(changeEdition(edition)); }; } diff --git a/ui/frontend/reducers/configuration.ts b/ui/frontend/reducers/configuration.ts index 38d02720..37752074 100644 --- a/ui/frontend/reducers/configuration.ts +++ b/ui/frontend/reducers/configuration.ts @@ -1,6 +1,5 @@ import { PayloadAction, createSlice } from '@reduxjs/toolkit'; -import { ThunkAction } from '../actions'; import { AssemblyFlavor, Backtrace, @@ -57,7 +56,7 @@ const initialState: State = { primaryAction: PrimaryActionAuto.Auto, channel: Channel.Stable, mode: Mode.Debug, - edition: Edition.Rust2021, + edition: Edition.Rust2024, backtrace: Backtrace.Disabled, }; @@ -85,7 +84,7 @@ const slice = createSlice({ state.demangleAssembly = action.payload; }, - changeEditionRaw: (state, action: PayloadAction) => { + changeEdition: (state, action: PayloadAction) => { state.edition = action.payload; }, @@ -149,7 +148,7 @@ export const { changeBacktrace, changeChannel, changeDemangleAssembly, - changeEditionRaw, + changeEdition, changeEditor, changeKeybinding, changeMode, @@ -162,14 +161,4 @@ export const { swapTheme, } = slice.actions; -export const changeEdition = - (edition: Edition): ThunkAction => - (dispatch) => { - if (edition === Edition.Rust2024) { - dispatch(changeChannel(Channel.Nightly)); - } - - dispatch(changeEditionRaw(edition)); - }; - export default slice.reducer; diff --git a/ui/frontend/reducers/notifications.ts b/ui/frontend/reducers/notifications.ts index 1f159386..40643f19 100644 --- a/ui/frontend/reducers/notifications.ts +++ b/ui/frontend/reducers/notifications.ts @@ -12,7 +12,8 @@ interface State { seenRustSurvey2022: boolean; // expired seenRustSurvey2023: boolean; // expired seenDarkMode: boolean; // expired - seenRustSurvey2024: boolean; + seenRustSurvey2024: boolean; // expired + seenRust2024IsDefault: boolean; } const initialState: State = { @@ -25,7 +26,8 @@ const initialState: State = { seenRustSurvey2022: true, seenRustSurvey2023: true, seenDarkMode: true, - seenRustSurvey2024: false, + seenRustSurvey2024: true, + seenRust2024IsDefault: false, }; const slice = createSlice({ @@ -34,8 +36,8 @@ const slice = createSlice({ reducers: { notificationSeen: (state, action: PayloadAction) => { switch (action.payload) { - case Notification.RustSurvey2024: { - state.seenRustSurvey2024 = true; + case Notification.Rust2024IsDefault: { + state.seenRust2024IsDefault = true; break; } } @@ -45,6 +47,6 @@ const slice = createSlice({ const { notificationSeen } = slice.actions; -export const seenRustSurvey2024 = () => notificationSeen(Notification.RustSurvey2024); +export const seenRust2024IsDefault = () => notificationSeen(Notification.Rust2024IsDefault); export default slice.reducer; diff --git a/ui/frontend/selectors/index.ts b/ui/frontend/selectors/index.ts index 78756147..09805f1a 100644 --- a/ui/frontend/selectors/index.ts +++ b/ui/frontend/selectors/index.ts @@ -172,7 +172,7 @@ export const getChannelLabel = createSelector(channelSelector, (channel) => `${c export const isEditionDefault = createSelector( editionSelector, - edition => edition == Edition.Rust2021, + edition => edition == Edition.Rust2024, ); export const getBacktraceSet = (state: State) => ( @@ -360,15 +360,15 @@ const notificationsSelector = (state: State) => state.notifications; const NOW = new Date(); -const RUST_SURVEY_2024_END = new Date('2024-12-23T00:00:00Z'); -const RUST_SURVEY_2024_OPEN = NOW <= RUST_SURVEY_2024_END; -export const showRustSurvey2024Selector = createSelector( +const RUST_2024_IS_DEFAULT_END = new Date('2025-04-03T00:00:00Z'); +const RUST_2024_IS_DEFAULT_OPEN = NOW <= RUST_2024_IS_DEFAULT_END; +export const showRust2024IsDefaultSelector = createSelector( notificationsSelector, - notifications => RUST_SURVEY_2024_OPEN && !notifications.seenRustSurvey2024, + notifications => RUST_2024_IS_DEFAULT_OPEN && !notifications.seenRust2024IsDefault, ); export const anyNotificationsToShowSelector = createSelector( - showRustSurvey2024Selector, + showRust2024IsDefaultSelector, excessiveExecutionSelector, (...allNotifications) => allNotifications.some(n => n), ); diff --git a/ui/frontend/types.ts b/ui/frontend/types.ts index cc954562..4b49511c 100644 --- a/ui/frontend/types.ts +++ b/ui/frontend/types.ts @@ -165,5 +165,5 @@ export enum Focus { } export enum Notification { - RustSurvey2024 = 'rust-survey-2024', + Rust2024IsDefault = 'rust-2024-is-default', }