Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ownership, Reference and Memory allocation with Dangling Problem.
- Loading branch information
1 parent
2a08034
commit 7a9cbe0
Showing
25 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "class04" | ||
version = "0.1.0" | ||
authors = ["Admin <faheemuzzaman@hotmail.com>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// fn main() { | ||
// let x = 10; | ||
// let y = x; | ||
// println!("{} ,{}",x,y); | ||
|
||
// let s1 = String::from("Hello"); | ||
// let s2 = s1.clone(); | ||
// let s3 = &s1; | ||
|
||
// let s4 = &s1; | ||
// println!("{}, {}, {}, {}", s1, s2, s3, s4); | ||
// // } | ||
// fn main() { | ||
// let s = String::from("hello"); | ||
// takes_ownership(s.clone()); | ||
// println!("{}",s); | ||
// let x = 5; | ||
// makes_copy(x); | ||
// } | ||
// fn takes_ownership(some_string: String) { | ||
// println!("{}", some_string); | ||
// } | ||
// fn makes_copy(some_integer: i32) { | ||
// println!("{}", some_integer); | ||
// } | ||
|
||
fn main() { | ||
let s1 = gives_ownership(); | ||
let s2 = String::from("hello"); | ||
let s3 = takes_and_gives_back(s2); | ||
println!("{}",s1); | ||
println!("{}",s3); | ||
|
||
|
||
} | ||
fn gives_ownership() -> String { | ||
let some_string = String::from("hello"); | ||
some_string | ||
} | ||
fn takes_and_gives_back(a_string: String) -> String { | ||
a_string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rustc_fingerprint":9484594007537757877,"outputs":{"4476964694761187371":["___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Admin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n",""],"1164083562126845933":["rustc 1.37.0 (eae3437df 2019-08-13)\nbinary: rustc\ncommit-hash: eae3437dfe991621e8afdc82734f4a172d7ddf9b\ncommit-date: 2019-08-13\nhost: x86_64-pc-windows-msvc\nrelease: 1.37.0\nLLVM version: 8.0\n",""],"9311443727202421799":["___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Admin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n",""]},"successes":{}} |
Empty file.
Binary file added
BIN
+13 Bytes
.../target/debug/.fingerprint/class04-288ce7719697c293/dep-test-bin-class04-288ce7719697c293
Binary file not shown.
1 change: 1 addition & 0 deletions
1
class04/target/debug/.fingerprint/class04-288ce7719697c293/invoked.timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file has an mtime of when this was started. |
1 change: 1 addition & 0 deletions
1
class04/target/debug/.fingerprint/class04-288ce7719697c293/test-bin-class04-288ce7719697c293
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d24ad2a210b2794b |
1 change: 1 addition & 0 deletions
1
...target/debug/.fingerprint/class04-288ce7719697c293/test-bin-class04-288ce7719697c293.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rustc":16761476351873615079,"features":"[]","target":457681104562150112,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint\\class04-288ce7719697c293\\dep-test-bin-class04-288ce7719697c293"}}],"rustflags":[],"metadata":11626969923688510520} |
1 change: 1 addition & 0 deletions
1
class04/target/debug/.fingerprint/class04-e6cf225208f9f5ca/bin-class04-e6cf225208f9f5ca
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
42d6f14e3daced75 |
1 change: 1 addition & 0 deletions
1
class04/target/debug/.fingerprint/class04-e6cf225208f9f5ca/bin-class04-e6cf225208f9f5ca.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rustc":16761476351873615079,"features":"[]","target":457681104562150112,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint\\class04-e6cf225208f9f5ca\\dep-bin-class04-e6cf225208f9f5ca"}}],"rustflags":[],"metadata":11626969923688510520} |
Binary file added
BIN
+13 Bytes
class04/target/debug/.fingerprint/class04-e6cf225208f9f5ca/dep-bin-class04-e6cf225208f9f5ca
Binary file not shown.
1 change: 1 addition & 0 deletions
1
class04/target/debug/.fingerprint/class04-e6cf225208f9f5ca/invoked.timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file has an mtime of when this was started. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
c:\Users\Admin\Desktop\Rust\class04\target\debug\deps\class04-288ce7719697c293.rmeta: src\main.rs | ||
|
||
c:\Users\Admin\Desktop\Rust\class04\target\debug\deps\class04-288ce7719697c293.d: src\main.rs | ||
|
||
src\main.rs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
c:\Users\Admin\Desktop\Rust\class04\target\debug\deps\class04-e6cf225208f9f5ca.rmeta: src\main.rs | ||
|
||
c:\Users\Admin\Desktop\Rust\class04\target\debug\deps\class04-e6cf225208f9f5ca.d: src\main.rs | ||
|
||
src\main.rs: |
Empty file.
Empty file.
Binary file added
BIN
+131 KB
...t/debug/incremental/class04-1xpxqepvtujea/s-fgvaa0yyww-1jgee7-1c6aocmmgvrco/dep-graph.bin
Binary file not shown.
Binary file added
BIN
+51.5 KB
...debug/incremental/class04-1xpxqepvtujea/s-fgvaa0yyww-1jgee7-1c6aocmmgvrco/query-cache.bin
Binary file not shown.
Binary file added
BIN
+37 Bytes
...bug/incremental/class04-1xpxqepvtujea/s-fgvaa0yyww-1jgee7-1c6aocmmgvrco/work-products.bin
Binary file not shown.
Empty file.
Binary file added
BIN
+119 KB
...t/debug/incremental/class04-2l0p9rwpu2f2b/s-fgvaa0yrzj-zw8nkv-2ond8ea1lmcyj/dep-graph.bin
Binary file not shown.
Binary file added
BIN
+50.9 KB
...debug/incremental/class04-2l0p9rwpu2f2b/s-fgvaa0yrzj-zw8nkv-2ond8ea1lmcyj/query-cache.bin
Binary file not shown.
Binary file added
BIN
+37 Bytes
...bug/incremental/class04-2l0p9rwpu2f2b/s-fgvaa0yrzj-zw8nkv-2ond8ea1lmcyj/work-products.bin
Binary file not shown.
Empty file.