Skip to content

Commit 8c8130e

Browse files
lcnrmark-i-m
authored andcommitted
braces
1 parent 8f2e466 commit 8c8130e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ty.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ In contrast, `ty::Ty` represents the semantics of a type, that is, the *meaning*
2929
wrote. For example, `rustc_hir::Ty` would record the fact that a user used the name `u32` twice
3030
in their program, but the `ty::Ty` would record the fact that both usages refer to the same type.
3131

32-
**Example: `fn foo(x: u32) → u32 { }`** In this function we see that `u32` appears twice. We know
32+
**Example: `fn foo(x: u32) → u32 { x }`** In this function we see that `u32` appears twice. We know
3333
that that is the same type, i.e. the function takes an argument and returns an argument of the same
3434
type, but from the point of view of the HIR there would be two distinct type instances because these
3535
are occurring in two different places in the program. That is, they have two
3636
different [`Span`s][span] (locations).
3737

3838
[span]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/struct.Span.html
3939

40-
**Example: `fn foo(x: &u32) -> &u32)`** In addition, HIR might have information left out. This type
40+
**Example: `fn foo(x: &u32) -> &u32`** In addition, HIR might have information left out. This type
4141
`&u32` is incomplete, since in the full rust type there is actually a lifetime, but we didn’t need
4242
to write those lifetimes. There are also some elision rules that insert information. The result may
43-
look like `fn foo<'a>(x: &'a u32) -> &'a u32)`.
43+
look like `fn foo<'a>(x: &'a u32) -> &'a u32`.
4444

4545
In the HIR level, these things are not spelled out and you can say the picture is rather incomplete.
4646
However, at the `ty::Ty` level, these details are added and it is complete. Moreover, we will have

0 commit comments

Comments
 (0)