Remove with_legacy_ctxt
This commit is contained in:
parent
5ae3830d58
commit
8ab67c8f56
13 changed files with 44 additions and 34 deletions
31
src/test/ui/allocator/hygiene.rs
Normal file
31
src/test/ui/allocator/hygiene.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// run-pass
|
||||
// no-prefer-dynamic
|
||||
// aux-build:custom.rs
|
||||
// aux-build:helper.rs
|
||||
|
||||
#![allow(nonstandard_style)]
|
||||
|
||||
extern crate custom;
|
||||
extern crate helper;
|
||||
|
||||
use custom::A;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
#[allow(dead_code)]
|
||||
struct u8;
|
||||
#[allow(dead_code)]
|
||||
struct usize;
|
||||
#[allow(dead_code)]
|
||||
static arg0: () = ();
|
||||
|
||||
#[global_allocator]
|
||||
pub static GLOBAL: A = A(AtomicUsize::new(0));
|
||||
|
||||
fn main() {
|
||||
let n = GLOBAL.0.load(Ordering::SeqCst);
|
||||
let s = Box::new(0);
|
||||
helper::work_with(&s);
|
||||
assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 1);
|
||||
drop(s);
|
||||
assert_eq!(GLOBAL.0.load(Ordering::SeqCst), n + 2);
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
// run-pass
|
||||
|
||||
#![feature(concat_idents)]
|
||||
|
||||
pub fn main() {
|
||||
|
|
@ -5,10 +7,8 @@ pub fn main() {
|
|||
let _: concat_idents!(F, oo) = Foo; // Test that `concat_idents!` can be used in type positions
|
||||
|
||||
let asdf_fdsa = "<.<".to_string();
|
||||
// this now fails (correctly, I claim) because hygiene prevents
|
||||
// the assembled identifier from being a reference to the binding.
|
||||
// concat_idents should have call-site hygiene.
|
||||
assert!(concat_idents!(asd, f_f, dsa) == "<.<".to_string());
|
||||
//~^ ERROR cannot find value `asdf_fdsa` in this scope
|
||||
|
||||
assert_eq!(stringify!(use_mention_distinction), "use_mention_distinction");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
error[E0425]: cannot find value `asdf_fdsa` in this scope
|
||||
--> $DIR/syntax-extension-minor.rs:10:13
|
||||
|
|
||||
LL | assert!(concat_idents!(asd, f_f, dsa) == "<.<".to_string());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0425`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue