Move "completed feature gate checking" pass to after "name resolution" pass so proc-macro-attribute feature gate check can use resolve
This commit is contained in:
parent
68439614ba
commit
04ecee158c
3 changed files with 16 additions and 11 deletions
|
|
@ -737,17 +737,6 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
|
|||
"checking for inline asm in case the target doesn't support it",
|
||||
|| no_asm::check_crate(sess, &krate));
|
||||
|
||||
// Needs to go *after* expansion to be able to check the results of macro expansion.
|
||||
time(time_passes, "complete gated feature checking", || {
|
||||
sess.track_errors(|| {
|
||||
syntax::feature_gate::check_crate(&krate,
|
||||
&sess.parse_sess,
|
||||
&sess.features.borrow(),
|
||||
&attributes,
|
||||
sess.opts.unstable_features);
|
||||
})
|
||||
})?;
|
||||
|
||||
time(sess.time_passes(),
|
||||
"early lint checks",
|
||||
|| lint::check_ast_crate(sess, &krate));
|
||||
|
|
@ -765,6 +754,17 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
|
|||
Ok(())
|
||||
})?;
|
||||
|
||||
// Needs to go *after* expansion to be able to check the results of macro expansion.
|
||||
time(time_passes, "complete gated feature checking", || {
|
||||
sess.track_errors(|| {
|
||||
syntax::feature_gate::check_crate(&krate,
|
||||
&sess.parse_sess,
|
||||
&sess.features.borrow(),
|
||||
&attributes,
|
||||
sess.opts.unstable_features);
|
||||
})
|
||||
})?;
|
||||
|
||||
// Lower ast -> hir.
|
||||
let hir_forest = time(sess.time_passes(), "lowering ast -> hir", || {
|
||||
let hir_crate = lower_crate(sess, &krate, &mut resolver);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ const fn foo() -> usize { 0 } //~ ERROR const fn is unstable
|
|||
|
||||
trait Foo {
|
||||
const fn foo() -> u32; //~ ERROR const fn is unstable
|
||||
//~| ERROR trait fns cannot be declared const
|
||||
const fn bar() -> u32 { 0 } //~ ERROR const fn is unstable
|
||||
//~| ERROR trait fns cannot be declared const
|
||||
}
|
||||
|
||||
impl Foo {
|
||||
|
|
@ -25,6 +27,7 @@ impl Foo {
|
|||
|
||||
impl Foo for u32 {
|
||||
const fn foo() -> u32 { 0 } //~ ERROR const fn is unstable
|
||||
//~| ERROR trait fns cannot be declared const
|
||||
}
|
||||
|
||||
static FOO: usize = foo();
|
||||
|
|
|
|||
|
|
@ -8,5 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![allow(deprecated)]
|
||||
|
||||
#[no_debug] //~ ERROR the `#[no_debug]` attribute is
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue