Rust

Unknown Feature E0635 Fix

You name a feature in a #![feature] attribute and the compiler has never heard of it - a made-up name, or a real name with a typo - and it stops with E0635: unknown feature. On the stable compiler every crate-root #![feature] attribute also draws E0554, so the two codes arrive together. This guide shows each failing shape, which codes it actually draws, the neighboring shapes that draw different codes, and the repair on stable: remove the attribute, and fix or drop the name that is not a real feature.

Written December 2, 2026 · Tested with Rust 1.99.1 · 17 min read

By the end of this guide
  • The rule underneath: the name must be a feature this compiler knows
  • How to read the diagnostic
  • The first failure: the index example
  • A typo is an unknown feature

Written December 2, 2026

Tested with Rust 1.99.1

What this guide is

Error E0635 means a #![feature] attribute specified an unknown feature. The error codes index puts it in one sentence: "The #![feature] attribute specified an unknown feature."

In the shapes probed in this guide, on the stable compiler, a crate-root #![feature] attribute naming an unknown feature draws exactly one E0635 for that name, alongside one E0554 for the attribute itself. Two unknown names in one attribute draw two E0635 errors in the probed shape, one per name. A known unstable feature name draws E0554 alone, a stabilized feature name draws E0554 alone with a stable-features warning, a removed feature name draws E0557 alone, and using an unstable library feature draws E0658. This guide shows the E0635 shapes, the neighboring shapes, the programs that compile and run, and the repairs.

Build every program in this guide with rustc --edition 2021, except the one let-chains repair, which is built with rustc --edition 2024 and says so where it appears. In the compiler transcripts, the file names are the bare names shown on the command line.

The rule underneath: the name must be a feature this compiler knows

A #![feature] attribute enables named, not-yet-stable compiler and library features by name. The name has to match a feature this compiler knows exactly. A name that matches nothing - invented, misspelled, or from a different compiler version - is unknown, and E0635 names it in its header: "unknown feature", followed by the name in backticks.

On the stable release channel there is a second, independent problem with the same line: the E0554 page states that feature attributes are only allowed on the nightly release channel, and stable or beta compilers will not comply. That is why, in every crate-root shape probed in this guide, E0554 arrives alongside E0635. Fixing the unknown name does not remove E0554 on stable, and removing E0554 by deleting the attribute also removes the place where E0635 was reported. The two codes have two different causes on one line.

How to read the diagnostic

The E0635 header names the unknown feature, and its span underlines just that name inside the attribute - not the whole attribute. The E0554 header, by contrast, underlines the whole #![feature(...)] line. When both appear, read them separately: E0635 tells you which name is wrong, and E0554 tells you the attribute itself is not allowed on this channel at all.

When the unknown name is close to a real feature name, the diagnostic adds a help block suggesting the similar name. In the probed typo shape the suggestion was not the name the author meant - see the typo section below - so treat the suggestion as a candidate to check, not as the correction.

The first failure: the index example

The index's erroneous example, verbatim:

Rust
#![allow(unused)]
#![feature(nonexistent_rust_feature)]
fn main() {
}
Output
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> fail_index.rs:2:1
  |
2 | #![feature(nonexistent_rust_feature)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0635]: unknown feature `nonexistent_rust_feature`
 --> fail_index.rs:2:12
  |
2 | #![feature(nonexistent_rust_feature)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0554, E0635.
For more information about an error, try `rustc --explain E0554`.

The example draws exactly one E0635, for nonexistent_rust_feature, alongside exactly one E0554 for using a #![feature] attribute on the stable release channel. The repair below removes the attribute entirely, because the named feature does not exist and the program uses nothing that needs one.

The same shape with a different invented name fails identically:

Rust
#![feature(totally_made_up_feature)]
fn main() { println!("hi"); }
Output
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> fail_unknown_simple.rs:1:1
  |
1 | #![feature(totally_made_up_feature)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0635]: unknown feature `totally_made_up_feature`
 --> fail_unknown_simple.rs:1:12
  |
1 | #![feature(totally_made_up_feature)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0554, E0635.
For more information about an error, try `rustc --explain E0554`.

A typo is an unknown feature

A real feature name with one letter missing is just as unknown as an invented name. In the probed shape, let_chain - the real name let_chains without its final letter - drew E0635, and the help block suggested a different real feature, iter_chain:

Rust
#![feature(let_chain)]
fn main() { println!("hi"); }
Output
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> fail_typo.rs:1:1
  |
1 | #![feature(let_chain)]
  | ^^^^^^^^^^^^^^^^^^^^^^

error[E0635]: unknown feature `let_chain`
 --> fail_typo.rs:1:12
  |
1 | #![feature(let_chain)]
  |            ^^^^^^^^^
  |
help: there is a feature with a similar name: `iter_chain`
  |
1 - #![feature(let_chain)]
1 + #![feature(iter_chain)]
  |

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0554, E0635.
For more information about an error, try `rustc --explain E0554`.

The suggested name is a real feature, but it is not the feature the typo was aiming at, and accepting the suggestion would enable the wrong feature. A plural in the wrong place fails the same way in the probed shape: async_closures, with a final letter the real name async_closure does not have, drew E0635, with the help block suggesting async_closure. Check the intended feature's exact name in its tracking issue or the reference for your compiler version; do not accept a similar-name suggestion on sight.

Correcting the typo does not make the program compile on stable. In the probed shape, the corrected name let_chains drew E0554 alone, with a help note stating that the feature let_chains has been stable since 1.88.0 and no longer requires an attribute to enable, plus a stable-features warning - no E0635. On stable, a feature that has already stabilized needs no attribute at all, which is why the repairs below remove the attribute and use the syntax directly.

An unknown name next to a known name

An unknown name does not stop the compiler from judging the other names in the same attribute, and a known name next to it does not rescue it. An unknown name alongside the known unstable feature generic_const_exprs drew exactly one E0635, for the unknown name only, alongside E0554 and an incomplete-features warning for the known name:

Rust
#![feature(nonexistent_rust_feature, generic_const_exprs)]
fn main() { println!("hi"); }
Output
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> fail_unknown_with_unstable.rs:1:1
  |
1 | #![feature(nonexistent_rust_feature, generic_const_exprs)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> fail_unknown_with_unstable.rs:1:38
  |
1 | #![feature(nonexistent_rust_feature, generic_const_exprs)]
  |                                      ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0635]: unknown feature `nonexistent_rust_feature`
 --> fail_unknown_with_unstable.rs:1:12
  |
1 | #![feature(nonexistent_rust_feature, generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors; 1 warning emitted

Some errors have detailed explanations: E0554, E0635.
For more information about an error, try `rustc --explain E0554`.

An unknown name alongside a stabilized feature name behaved the same way for the unknown name in the probed shape: nonexistent_rust_feature next to let_else drew exactly one E0635 for the unknown name, alongside E0554 - whose help note states that the feature let_else has been stable since 1.65.0 and no longer requires an attribute to enable - and a stable-features warning for let_else. Only the unknown name drew E0635; the stabilized name drew the warning, not an unknown-feature error.

Two unknown names in one attribute draw one E0635 each in the probed shape - two E0635 errors in total, alongside one E0554, for three errors in total:

Rust
#![feature(first_made_up_feature, second_made_up_feature)]
fn main() { println!("hi"); }
Output
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> fail_two_unknown.rs:1:1
  |
1 | #![feature(first_made_up_feature, second_made_up_feature)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0635]: unknown feature `first_made_up_feature`
 --> fail_two_unknown.rs:1:12
  |
1 | #![feature(first_made_up_feature, second_made_up_feature)]
  |            ^^^^^^^^^^^^^^^^^^^^

error[E0635]: unknown feature `second_made_up_feature`
 --> fail_two_unknown.rs:1:35
  |
1 | #![feature(first_made_up_feature, second_made_up_feature)]
  |                                   ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0554, E0635.
For more information about an error, try `rustc --explain E0554`.

The same unknown name written twice is a different shape again in the probed program: the second occurrence drew an error stating that the feature nonexistent_rust_feature has already been enabled, with a note that duplicate_features is denied by default, and that second occurrence also drew the shape's one E0635 - three errors in total, alongside E0554 on the whole attribute. An unknown name in a second, separate #![feature] attribute drew exactly one E0635 in the probed shape, on the second attribute's line, alongside the one E0554 drawn on the first attribute. And an unknown feature attribute in a file with no main function still drew exactly one E0635 in the probed shape, alongside E0554 and E0601 for the missing main function.

The shapes that are not this error

A known unstable feature name on stable draws E0554 alone - no E0635, because the compiler knows the name; the problem is the channel, not the name:

Rust
#![feature(generic_const_exprs)]
fn main() { println!("hi"); }
Output
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> neighbour_e0554.rs:1:1
  |
1 | #![feature(generic_const_exprs)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> neighbour_e0554.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0554`.

A stabilized feature name draws E0554 alone in the probed shape, with the help note and warning stating the version it has been stable since. The probed let_else attribute states that the feature let_else has been stable since 1.65.0 and no longer requires an attribute to enable. A stabilized name is known, so it never draws E0635 in these shapes - it draws the channel error, and the fix the help note offers is to remove the attribute.

A removed feature name draws a different code again. In the probed shape, box_syntax drew E0557 alone - no E0554 and no E0635:

Rust
#![feature(box_syntax)]
fn main() { println!("hi"); }
Output
error[E0557]: feature has been removed
 --> fail_box_syntax.rs:1:12
  |
1 | #![feature(box_syntax)]
  |            ^^^^^^^^^^ feature has been removed
  |
  = note: removed in 1.70.0; see <https://github.com/rust-lang/rust/pull/108471> for more information
  = note: replaced with `#[rustc_box]`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0557`.

The compiler remembers a removed feature in a way it does not remember an invented one: the name is known but gone, so the code is E0557, "feature has been removed", not E0635.

Using an unstable library feature is E0658, not E0635. The E0658 page states that an unstable feature was used, and gives use std::intrinsics; as its erroneous example. That use, inside main with no feature attribute anywhere, drew exactly one E0658 in the probed shape, alongside an unused-import warning:

Rust
fn main() {
    use std::intrinsics;
    println!("hi");
}
Output
warning: unused import: `std::intrinsics`
 --> neighbour_e0658.rs:2:9
  |
2 |     use std::intrinsics;
  |         ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0658]: use of unstable library feature `core_intrinsics`: intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
 --> neighbour_e0658.rs:2:9
  |
2 |     use std::intrinsics;
  |         ^^^^^^^^^^^^^^

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0658`.

The boundary is where the name appears: an unknown name inside a crate-root #![feature] attribute is E0635, a known feature attribute on the stable channel is E0554, a removed feature name is E0557, and actually using an unstable item in code is E0658.

The shapes that compile: the attribute in the wrong place, and no names at all

A #![feature] attribute written inside a function body is not treated as a crate-root attribute in the probed shape: it drew only a warning stating that the #![feature] attribute can only be used at the crate root, and the program compiled and printed hi. No E0635 was drawn for the unknown name inside it, because the attribute was not in the position where feature names are read.

Rust
fn main() {
    #![feature(nonexistent_rust_feature)]
    println!("hi");
}
Output
warning: the `#![feature]` attribute can only be used at the crate root
 --> fail_feature_inside_main.rs:2:5
  |
2 |     #![feature(nonexistent_rust_feature)]
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default

warning: 1 warning emitted

hi

Written as an outer attribute on a function - #[feature(nonexistent_rust_feature)] above main, without the exclamation mark - the probed shape likewise drew only a warning, stating that a crate-level attribute should be an inner attribute, and the program compiled and printed hi. No E0635 was drawn there either.

An empty feature list names no feature, so there is no unknown name to report: in the probed shape #![feature()] at the crate root drew only a warning stating that using feature with an empty list has no effect, and the program compiled and printed hi - no E0554 and no E0635.

Feature-attribute errors cluster together. For a known feature attribute used on the stable release channel, see Feature on Stable E0554 Fix. For actually using an unstable feature in code, see Unstable Feature E0658 Fix.

The repairs

On stable, remove the attribute. The index example with its #![feature] line removed - and the #![allow(unused)] line with it - is a program that uses no feature at all, and it compiles and runs in the same shape as the probed removal repair, which printed fixed:

Rust
fn main() { println!("fixed"); }
Output
fixed

If the attribute was there for a feature that has since stabilized, remove the attribute and use the syntax directly. A let-else statement with no feature attribute compiled and ran in the probed shape, printing got 3:

Rust
fn main() {
    let opt = Some(3);
    let Some(x) = opt else { println!("none"); return; };
    println!("got {}", x);
}
Output
got 3

A let chain - the syntax behind the probed let_chain typo - likewise needs no attribute in the probed shape, built with rustc --edition 2024: the program compiled and printed big 3.

Rust
fn main() {
    let opt = Some(3);
    if let Some(x) = opt && x > 1 { println!("big {}", x); }
}
Output
big 3

If the feature you need is genuinely still unstable and known to this compiler, there is no stable-channel repair in these shapes: the probed known-unstable attribute drew E0554 alone on stable. That work belongs on a nightly compiler, with the feature's exact name - not a similar name the help block happened to suggest.

Fixes in reach order

First, read the name in the E0635 header. That name, exactly as written, is not a feature this compiler knows. In the probed shapes it arrived as an invented name (the index example and a made-up name), as a typo of a real feature name (let_chain for let_chains, and async_closures for async_closure), alongside a known unstable or a stabilized name, as one of two unknown names, as a repeated unknown name, in a second feature attribute, and in a file with no main function.

Second, check the name before touching the channel error. Compare it letter by letter with the feature's name for your compiler version, and do not accept the similar-name suggestion on sight: in the probed typo shape the suggestion was iter_chain, a real feature that was not the intended let_chains.

Third, separate E0635 from the codes that travel with or instead of it. In the probed shapes, a crate-root unknown name drew E0554 alongside E0635; a known unstable name and a stabilized name each drew E0554 alone; a removed name, box_syntax, drew E0557 alone; and using an unstable library feature drew E0658. A feature attribute inside a function, an outer #[feature] attribute on a function, and an empty feature list each drew only a warning and compiled in the probed shapes.

Fourth, apply the stable repair: remove the attribute, as in the probed repair printing fixed. Where the intended feature has stabilized, remove the attribute and use the syntax directly, as in the probed repairs printing got 3 for let-else on edition 2021 and big 3 for a let chain on edition 2024. Correcting a typo inside the attribute is not a stable repair by itself: in the probed shape the corrected name let_chains still drew E0554 alone on stable.

Last, leave the working shapes alone: a program with no feature attribute, and the stabilized-syntax programs above, compile in the probed shapes. Do not add a feature attribute back to them while fixing the unknown name next to them.

Decision summary

E0635 fired, exactly once per unknown name, for every crate-root unknown name probed - the index example (nonexistent_rust_feature, exactly one E0635 alongside exactly one E0554), a made-up name, a typo of a real feature name (let_chain, with a help suggestion of iter_chain), a second typo (async_closures, with a help suggestion of async_closure), an unknown name alongside a known unstable feature and alongside a stabilized feature name, an unknown name in a second feature attribute, and an unknown name in a file with no main function (which also drew E0601). It fired twice for two unknown names in one attribute in the probed shape, and once - on the second occurrence, which also drew a has-already-been-enabled error - for the same unknown name written twice. It did not fire for a known unstable feature name, which drew E0554 alone, for a stabilized feature name (let_else, and the corrected let_chains), which drew E0554 alone with a stable-features warning, for a removed feature name (box_syntax), which drew E0557 alone, or for using an unstable library feature (use std::intrinsics;), which drew E0658 alone. It did not fire for a feature attribute inside a function, an outer #[feature] attribute on a function, or an empty feature list, each of which drew only a warning and compiled and ran in the probed shapes. The shapes that compiled and ran were the removal repair (printing fixed), let-else with no attribute on edition 2021 (printing got 3), and a let chain with no attribute on edition 2024 (printing big 3).

Checklist

  • One unknown name, one E0635: in the probed shapes, a crate-root #![feature] attribute naming an unknown feature draws exactly one E0635 for that name, and two unknown names draw two E0635 errors.
  • On stable, E0554 travels with it: in every crate-root shape probed, the #![feature] attribute itself drew E0554 on the stable release channel, alongside any E0635.
  • A typo is an unknown feature: let_chain and async_closures draw E0635 in the probed shapes, and the similar-name suggestion is a candidate to check - in the let_chain shape it suggested iter_chain, not the intended let_chains.
  • Known, stabilized, and removed names keep their own codes: a known unstable name and a stabilized name draw E0554 alone in the probed shapes, a removed name (box_syntax) draws E0557 alone, and using an unstable library feature draws E0658.
  • Placement decides whether names are read at all: a feature attribute inside a function, an outer #[feature] attribute on a function, and an empty feature list draw only a warning and compile in the probed shapes.
  • The stable repair in the probed shapes: remove the attribute - and, where the intended feature has stabilized, use the syntax directly, as in the probed let-else and let-chain repairs.

Sources

  • Rust error codes index, E0635 - the #![feature] attribute specified an unknown feature; the erroneous example names nonexistent_rust_feature.
  • Rust error codes index, E0554 - feature attributes are only allowed on the nightly release channel; stable or beta compilers will not comply; the code drawn alongside E0635 by every crate-root feature attribute on stable in the probed shapes, and alone by a known unstable or a stabilized feature name.
  • Rust error codes index, E0658 - an unstable feature was used; the erroneous example is use std::intrinsics;, the code drawn by using an unstable library feature in the probed shape.
  • Rust error codes index, E0557 - a feature has been removed; the code drawn alone by the removed name box_syntax in the probed shape.

Keep Exploring