Skip to content

Don’t suggest 'help: add #![feature(…)]' when it’s forbidden #23973

Closed
@SimonSapin

Description

@SimonSapin

Steps to reproduce:

mkdir foo
cd foo
multirust override beta  # Or obtain Rust beta in some other way
echo 'extern crate core; fn main(){}' > a.rs
echo '#![feature(core)] extern crate core; fn main(){}' > b.rs

The output of rustc a.rs is:

a.rs:1:1: 1:19 error: use of unstable library feature 'core'
a.rs:1 extern crate core; fn main(){}
       ^~~~~~~~~~~~~~~~~~
a.rs:1:19: 1:19 help: add #![feature(core)] to the crate attributes to enable

b.rs does as suggested by the help message, but that fails too (as expected):

b.rs:1:1: 1:18 error: unstable feature
b.rs:1 #![feature(core)] extern crate core; fn main(){}
       ^~~~~~~~~~~~~~~~~
note: this feature may not be used in the beta release channel
error: aborting due to previous error

Proposed fix: in the beta and stable channels (i.e. whenever #![feature(…)] is forbidden), the help message that suggests adding #![feature(…)] should not be shown.

(Clean up the test case with multirust remove-override; cd ..; rm -r foo.)

CC @brson

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions