]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/macros/macro-backtrace-invalid-internals.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Macros in statement vs expression position handle backtraces differently.
13 macro_rules
! fake_method_stmt
{
15 1.fake
() //~ ERROR no method
19 macro_rules
! fake_field_stmt
{
21 1.fake
//~ ERROR doesn't have fields
25 macro_rules
! fake_anon_field_stmt
{
27 (1).0 //~ ERROR doesn't have fields
31 macro_rules
! fake_method_expr
{
33 1.fake
() //~ ERROR no method
37 macro_rules
! fake_field_expr
{
39 1.fake
//~ ERROR doesn't have fields
43 macro_rules
! fake_anon_field_expr
{
45 (1).0 //~ ERROR doesn't have fields
49 macro_rules
! real_method_stmt
{
51 2.0.neg() //~ ERROR can't call method `neg` on ambiguous numeric type `{float}`
55 macro_rules
! real_method_expr
{
57 2.0.neg() //~ ERROR can't call method `neg` on ambiguous numeric type `{float}`
64 fake_anon_field_stmt
!();
67 let _
= fake_method_expr
!();
68 let _
= fake_field_expr
!();
69 let _
= fake_anon_field_expr
!();
70 let _
= real_method_expr
!();