编译时遇到无法编译proc-macro2的问题
gelmannt opened this issue · comments
rust 版本 1.28.0 nightly
error[E0433]: failed to resolve. Could not find Op
in proc_macro
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.3.8/src/unstable.rs:131:42
|
131 | let mut op = proc_macro::Op::new(tt.op(), spacing);
| ^^ Could not find Op
in proc_macro
error[E0433]: failed to resolve. Could not find Term
in proc_macro
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.3.8/src/unstable.rs:446:59
|
446 | Span::Nightly(s) => Term::Nightly(proc_macro::Term::new(string, s)),
| ^^^^ Could not find Term
in proc_macro
error[E0412]: cannot find type Term
in module proc_macro
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.3.8/src/unstable.rs:439:25
|
439 | Nightly(proc_macro::Term),
| ^^^^ not found in proc_macro
help: possible candidates are found in other modules, you can import them into scope
|
3 | use Term;
|
3 | use imp::Term;
|
3 | use stable::Term;
|
error[E0412]: cannot find type Term
in module proc_macro
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.3.8/src/unstable.rs:473:44
|
473 | fn unwrap_nightly(self) -> proc_macro::Term {
| ^^^^ not found in proc_macro
help: possible candidates are found in other modules, you can import them into scope
|
3 | use Term;
|
3 | use imp::Term;
|
3 | use stable::Term;
|
error[E0599]: no variant named Op
found for type proc_macro::TokenTree
in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.3.8/src/unstable.rs:228:13
|
228 | proc_macro::TokenTree::Op(tt) => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variant not found in proc_macro::TokenTree
error[E0599]: no variant named Term
found for type proc_macro::TokenTree
in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.3.8/src/unstable.rs:237:13
|
237 | proc_macro::TokenTree::Term(s) => ::Term::_new(Term::Nightly(s)).into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variant not found in proc_macro::TokenTree
error: aborting due to 6 previous errors
Some errors occurred: E0412, E0433, E0599.
For more information about an error, try rustc --explain E0412
.
error: Could not compile proc-macro2
.
上游在修,等两天吧
或者可以先运行 rustup override set nightly-2018-05-03
锁定编译器版本
试了一下 rustc nightly 1.27 的情况下也是相同的错误
不是大版本号,注意日期,nightly 是按天算版本的
运行 rustup override set nightly-2018-05-03 锁定编译器后,还是出现相同的编译错误提示
具体的错误信息
The type name used is not in scope.
Erroneous code examples:
impl Something {} // error: type name `Something` is not in scope
// or:
trait Foo {
fn bar(N); // error: type name `N` is not in scope
}
// or:
fn foo(x: T) {} // type name `T` is not in scope
To fix this error, please verify you didn't misspell the type name, you did
declare it or imported it into the scope. Examples: