@@ -33,6 +33,8 @@ pub enum Notification<'a> {
3333 UpgradeRemovesToolchains ,
3434 MissingFileDuringSelfUninstall ( PathBuf ) ,
3535 PlainVerboseMessage ( & ' a str ) ,
36+ UnmatchToolchain ( & ' a str ) ,
37+ SuggestTarget ( & ' a str ) ,
3638}
3739
3840impl < ' a > From < crate :: dist:: Notification < ' a > > for Notification < ' a > {
@@ -77,7 +79,10 @@ impl<'a> Notification<'a> {
7779 | UpgradingMetadata ( _, _)
7880 | MetadataUpgradeNotNeeded ( _) => NotificationLevel :: Info ,
7981 NonFatalError ( _) => NotificationLevel :: Error ,
80- UpgradeRemovesToolchains | MissingFileDuringSelfUninstall ( _) => NotificationLevel :: Warn ,
82+ UpgradeRemovesToolchains
83+ | MissingFileDuringSelfUninstall ( _)
84+ | UnmatchToolchain ( _)
85+ | SuggestTarget ( _) => NotificationLevel :: Warn ,
8186 }
8287 }
8388}
@@ -130,6 +135,8 @@ impl<'a> Display for Notification<'a> {
130135 p. display( )
131136 ) ,
132137 PlainVerboseMessage ( r) => write ! ( f, "{}" , r) ,
138+ UnmatchToolchain ( name) => write ! ( f, "toolchain '{}' may not be able to run on this system." , name) ,
139+ SuggestTarget ( t) =>write ! ( f, "If you meant to build software to target that platform, perhaps try `rustup target add {}` instead?" , t)
133140 }
134141 }
135142}
0 commit comments