Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
46809f7a
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
46809f7a
编写于
6月 22, 2012
作者:
L
Lindsey Kuper
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Nicer quoting in "attempted access of field" message. Issue #2358.
上级
47b1b7a2
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
7 addition
and
6 deletion
+7
-6
src/rustc/middle/typeck/check.rs
src/rustc/middle/typeck/check.rs
+3
-2
src/test/compile-fail/class-cast-to-iface.rs
src/test/compile-fail/class-cast-to-iface.rs
+1
-1
src/test/compile-fail/private-method-cross-crate.rs
src/test/compile-fail/private-method-cross-crate.rs
+1
-1
src/test/compile-fail/unsafe-fn-autoderef.rs
src/test/compile-fail/unsafe-fn-autoderef.rs
+1
-1
src/test/compile-fail/vec-field.rs
src/test/compile-fail/vec-field.rs
+1
-1
未找到文件。
src/rustc/middle/typeck/check.rs
浏览文件 @
46809f7a
...
...
@@ -1551,8 +1551,9 @@ fn get_node(f: spanned<field>) -> field { f.node }
}
none
{
let
t_err
=
fcx
.infcx
.resolve_type_vars_if_possible
(
expr_t
);
let
msg
=
#
fmt
[
"attempted access of field %s on type %s, but
\
no public field or method with that name was found"
,
let
msg
=
#
fmt
[
"attempted access of field `%s` on type `%s`,
\
but no public field or method with that name
\
was found"
,
*
field
,
fcx
.infcx
.ty_to_str
(
t_err
)];
tcx
.sess
.span_err
(
expr
.span
,
msg
);
// NB: Adding a bogus type to allow typechecking to continue
...
...
src/test/compile-fail/class-cast-to-iface.rs
浏览文件 @
46809f7a
// error-pattern: attempted access of field
eat on type noisy
// error-pattern: attempted access of field
`eat` on type `noisy`
iface
noisy
{
fn
speak
();
}
...
...
src/test/compile-fail/private-method-cross-crate.rs
浏览文件 @
46809f7a
// error-pattern:attempted access of field
nap
on type
// error-pattern:attempted access of field
`nap`
on type
// xfail-fast
// aux-build:cci_class_5.rs
use
cci_class_5
;
...
...
src/test/compile-fail/unsafe-fn-autoderef.rs
浏览文件 @
46809f7a
...
...
@@ -15,7 +15,7 @@ fn f(p: *rec) -> int {
// are prohibited by various checks, such as that the enum is
// instantiable and so forth).
ret
p
.f
;
//! ERROR attempted access of field
f on type *rec
ret
p
.f
;
//! ERROR attempted access of field
`f` on type `*rec`
}
fn
main
()
{
...
...
src/test/compile-fail/vec-field.rs
浏览文件 @
46809f7a
// error-pattern:attempted access of field
some_field_name on type [int]
// error-pattern:attempted access of field
`some_field_name` on type `[int]`
// issue #367
fn
f
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录